* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f4efec;
  --card: #ffffff;
  --ink: #251f21;
  --ink2: #585254;
  --ink4: #c0bebf;
  --hair: #eae9ea;
  --teal: #73a89a;
  --plum: #3d1f3e;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 90px;
}
.hidden { display: none !important; }

.top {
  padding: 28px 20px 12px;
  max-width: 640px;
  margin: 0 auto;
}
.top h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.route { color: var(--ink2); font-size: 13px; margin-top: 4px; }
.who { margin-top: 14px; font-size: 13px; color: var(--ink2); display: flex; align-items: center; gap: 8px; }
.who-btn {
  border: 1px solid var(--hair);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.who-btn.active { background: var(--plum); color: #f2e6c9; border-color: var(--plum); }

main { max-width: 640px; margin: 0 auto; padding: 8px 16px 24px; }

.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink2);
  margin: 22px 4px 6px;
}

.item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--hair);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.item:first-of-type { border-radius: 14px 14px 0 0; }
.item:last-of-type { border-radius: 0 0 14px 14px; border-bottom: none; }
.item:only-of-type { border-radius: 14px; }

.circle {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--teal);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
}
.item.done .circle { background: var(--teal); }
.item.done .circle::after { content: "✓"; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 16px; font-weight: 600; }
.item.done .item-title { color: var(--ink4); text-decoration: line-through; }
.item-detail { font-size: 13px; color: var(--ink2); margin-top: 2px; }
.item-aisle {
  font-size: 11px;
  font-weight: 600;
  color: var(--plum);
  background: #efe7ee;
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
}
.item-who { font-size: 11px; color: var(--ink4); margin-top: 2px; }
.item-delete {
  border: none; background: none; color: var(--ink4);
  font-size: 18px; padding: 4px 6px; cursor: pointer; flex-shrink: 0;
}

.empty {
  text-align: center;
  color: var(--ink2);
  margin-top: 60px;
  font-size: 15px;
  line-height: 1.6;
}
.empty .big { font-size: 40px; display: block; margin-bottom: 12px; }

.add-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--hair);
}
.add-bar input {
  flex: 1;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 16px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}
.add-bar button {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--teal);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.pin-gate {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.pin-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px;
  width: min(340px, 88vw);
  text-align: center;
  box-shadow: 0 8px 30px rgba(37,31,33,0.08);
}
.pin-title { font-family: Georgia, serif; font-size: 22px; margin-bottom: 6px; }
.pin-sub { color: var(--ink2); font-size: 13px; margin-bottom: 18px; }
.pin-card input {
  width: 100%;
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 12px;
  font-size: 18px;
  text-align: center;
  margin-bottom: 12px;
  outline: none;
}
.pin-card button {
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--plum);
  color: #f2e6c9;
  padding: 12px;
  font-size: 15px;
  cursor: pointer;
}
.pin-error { color: #ed313e; font-size: 13px; margin-top: 10px; }
