/* Wine Fridge — light & airy redesign. Bricolage Grotesque + Hanken Grotesk. */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg: #f4ede4;
  --card: #fffdfb;
  --ink: #2b2126;
  --dim: #8c7f85;
  --line: #ece2da;
  --soft: #faf4ee;
  --accent: #a12c43;
  --accent2: #c85a6e;
  --accent-deep: #7d1f34;
  --gold: #c68a2e;
  --gold-bg: #fbf3e2;
  --danger-bg: #fdeef0;
  --red: #a12c43;
  --white-wine: #d8a23a;
  --rose: #e08aa0;
  --spark: #d9b73c;
  --radius: 20px;
  --shadow: 0 8px 26px rgba(90,45,55,.10);
  --display: 'Bricolage Grotesque', Georgia, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: radial-gradient(120% 60% at 50% 0%, #f7efe6 0%, #ecdfd4 60%, #e6d7cb 100%) fixed;
  color: var(--ink);
  font: 16px/1.5 'Hanken Grotesk', -apple-system, "Segoe UI", sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); }

@keyframes floatUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: translateX(-50%) scale(.9); } 60% { transform: translateX(-50%) scale(1.04); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(160deg, #fbf5eeee 0%, #f6ece1ee 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: 480px; margin: 0 auto; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 14px rgba(161,44,67,.35);
}
.topbar h1 { font-family: var(--display); font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; line-height: 1; }
.bottle-count { color: var(--dim); font-size: .78rem; margin-top: 3px; font-weight: 500; }
.top-add {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(90,45,55,.06);
}
.top-add:hover { background: var(--danger-bg); border-color: var(--accent2); }

main { max-width: 480px; margin: 0 auto; padding: 16px; }

/* ---------- buttons ---------- */
.btn {
  border: 0; border-radius: 13px; padding: 12px 18px;
  font-size: .95rem; font-weight: 700; font-family: inherit;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: filter .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(150deg, var(--accent), var(--accent-deep)); color: #fff; box-shadow: 0 6px 16px rgba(161,44,67,.3); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--soft); color: var(--dim); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--ink); border-color: var(--dim); }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---------- add panel ---------- */
.add-section:not(:empty) { margin-bottom: 4px; }
.add-panel {
  margin-bottom: 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); animation: floatUp .3s ease both;
}
.scan-cta {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 2px dashed #e3b9c2; background: #fdf3f4;
  border-radius: 16px; padding: 13px 14px;
}
.scan-cta:hover { border-color: var(--accent2); }
.scan-icon {
  width: 44px; height: 44px; border-radius: 13px; flex: none;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 12px rgba(161,44,67,.3);
}
.scan-text b { font-family: var(--display); font-weight: 800; font-size: .95rem; display: block; }
.scan-text small { color: var(--dim); font-size: .78rem; display: block; margin-top: 2px; }
.or-divider {
  display: flex; align-items: center; gap: 10px; margin: 15px 0 12px;
  color: var(--dim); font-size: .7rem; font-weight: 700; letter-spacing: .08em;
}
.or-divider span { flex: 1; height: 1px; background: var(--line); }
.add-fields { display: flex; gap: 8px; }
.add-fields input:first-child { flex: 1; min-width: 0; }
.add-fields input:last-child { width: 84px; }
input, select, textarea {
  background: var(--soft); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; font-size: .95rem; width: 100%;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent2); border-color: transparent; }
.add-actions { display: flex; gap: 8px; margin-top: 10px; }
.add-actions .btn-primary { flex: 1; }
.search-status { margin-top: 12px; color: var(--dim); font-size: .9rem; }
.search-status.error { color: var(--accent); }
.search-status img.scan-thumb { width: 34px; height: 44px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 10px; }

.spin {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 8px;
  border: 2px solid #e8d7cb; border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ---------- search results ---------- */
.results { list-style: none; margin-top: 10px; }
.results li + li { margin-top: 8px; }
.result-card {
  display: flex; gap: 12px; align-items: center; width: 100%;
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 12px; cursor: pointer; text-align: left;
  color: var(--ink); font: inherit;
}
.result-card:hover { border-color: var(--accent2); background: #fdf3f4; }
.result-thumb { width: 34px; height: 68px; object-fit: contain; flex: none; }
.result-thumb.placeholder { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; opacity: .5; }
.result-main { flex: 1; min-width: 0; }
.result-name { font-weight: 700; font-size: .92rem; line-height: 1.3; }
.result-sub { color: var(--dim); font-size: .8rem; margin-top: 2px; }
.result-rating { flex: none; text-align: right; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--danger-bg); color: var(--accent);
  border-radius: 9px; padding: 3px 8px; font-weight: 800; font-size: .9rem;
  font-family: var(--display);
}
.badge.na { background: #f1e8df; color: #b3a6ab; font-weight: 500; font-size: .78rem; }
.rating-count { display: block; color: var(--dim); font-size: .72rem; margin-top: 3px; }

/* ---------- list controls ---------- */
.controls { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; box-shadow: var(--shadow);
}
.filter-wrap input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 0; border-radius: 0; }
.filter-wrap input:focus { outline: none; }
.controls select { width: auto; flex: none; background: var(--card); font-weight: 600; font-size: .85rem; box-shadow: var(--shadow); cursor: pointer; }

.buyer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.buyer-label { font-size: .72rem; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.buyer-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.buyer-chip {
  border: 1px solid var(--line); background: var(--card); color: var(--dim);
  border-radius: 999px; padding: 5px 13px; font-size: .78rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.buyer-chip.active { background: var(--danger-bg); color: var(--accent); border-color: #e5aeb9; }

/* ---------- wine cards ---------- */
.wine-list { list-style: none; }
.wine-list li + li { margin-top: 13px; }
.wine-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px; position: relative;
  box-shadow: var(--shadow); animation: floatUp .35s ease both;
}
.wine-card.gone { opacity: .55; }
.wine-top { display: flex; gap: 13px; }
.type-col { width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.type-chip {
  width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.type-chip img, img.type-photo { width: 46px; height: 46px; border-radius: 14px; object-fit: contain; }
.type-label { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.wine-main { flex: 1; min-width: 0; }
.wine-headrow { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.wine-name { font-family: var(--display); font-size: 1.04rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.wine-winery { color: var(--dim); font-size: .82rem; margin-top: 2px; }
.wine-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.chip {
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 9px; font-size: .72rem; color: var(--dim); font-weight: 600;
}
.chip.vintage { color: #a06f18; border-color: #eeddba; background: var(--gold-bg); font-weight: 700; }
.wine-rating-box { flex: none; text-align: right; }
.stars { color: var(--gold); font-size: .72rem; letter-spacing: 1px; display: block; margin-top: 3px; }
.rating-scope { display: block; color: var(--dim); font-size: .64rem; margin-top: 2px; }

.taste-row {
  display: flex; gap: 12px; align-items: center; margin-top: 12px;
  background: var(--soft); border: 1px solid #f0e6dc; border-radius: 14px; padding: 10px 12px;
}
.taste-row .radar { flex: none; }
.taste-main { flex: 1; min-width: 0; }
.taste-title { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
.flavor-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.flavor-tags span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; font-size: .73rem; }

.wine-profile {
  margin-top: 10px; color: var(--ink); font-size: .88rem; line-height: 1.45;
  background: var(--soft); border: 1px solid #f0e6dc;
  padding: 8px 11px; border-radius: 12px;
}
.wine-profile.clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  cursor: pointer;
}
.wine-notes { margin-top: 9px; color: var(--dim); font-size: .84rem; font-style: italic; display: flex; gap: 7px; }
.wine-prov { margin-top: 8px; color: var(--dim); font-size: .78rem; }
.keep-banner {
  display: flex; align-items: center; gap: 8px; margin-top: 11px; padding: 8px 11px;
  border-radius: 11px; background: var(--danger-bg); border: 1px solid #f3c6cd;
  color: var(--accent); font-weight: 700; font-size: .78rem;
}

.wine-bottom {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); gap: 8px;
}
.qty { display: flex; align-items: center; gap: 9px; }
.qty button {
  width: 34px; height: 34px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--soft); color: var(--ink);
  font-size: 1.15rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.qty button:hover { border-color: var(--accent2); color: var(--accent); }
.qty-mid { text-align: center; min-width: 44px; }
.qty-num { font-family: var(--display); font-weight: 800; font-size: 1.1rem; line-height: 1; display: block; }
.qty-label { color: var(--dim); font-size: .6rem; text-transform: uppercase; letter-spacing: .05em; display: block; margin-top: 2px; }
.card-actions { display: flex; gap: 2px; align-items: center; }
.card-actions .buyer-tag { color: var(--dim); font-size: .72rem; margin-right: 6px; }
.icon-btn {
  background: transparent; border: 0; color: var(--dim);
  font-size: 1rem; padding: 8px 9px; border-radius: 10px; cursor: pointer;
  text-decoration: none; line-height: 1; display: inline-flex;
}
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--accent); }

/* ---------- open a bottle ---------- */
.open-btn {
  margin-left: 6px; border: 1px solid #eeddba; background: var(--gold-bg); color: #a06f18;
  border-radius: 11px; padding: 8px 12px; font-size: .8rem; font-weight: 800;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.open-btn:hover { border-color: var(--gold); }
.open-btn[disabled] { opacity: .45; cursor: default; }

/* ---------- tonight tab ---------- */
.corkwall-title { margin-top: 26px; }
.corkwall-sub { margin: -8px 2px 12px; }
.empty-small { color: var(--dim); font-size: .88rem; padding: 6px 2px 20px; }

.tasting-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; box-shadow: var(--shadow); margin-bottom: 14px; animation: floatUp .3s ease both;
}
.tasting-head { display: flex; align-items: center; gap: 11px; }
.tasting-id { flex: 1; min-width: 0; }
.tasting-id b { font-family: var(--display); font-size: .98rem; line-height: 1.25; display: block; }
.tasting-id small { color: var(--dim); font-size: .78rem; }
.tasting-when { color: var(--dim); font-size: .76rem; margin: 8px 0 4px; }

.notes { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.note { background: var(--soft); border: 1px solid #f0e6dc; border-radius: 12px; padding: 8px 11px; }
.note-head { display: flex; align-items: baseline; gap: 8px; }
.note-head b { font-size: .84rem; }
.note-head small { color: var(--dim); font-size: .68rem; margin-left: auto; }
.note-stars { color: var(--gold); font-size: .8rem; letter-spacing: 1px; }
.note-text { font-size: .87rem; margin-top: 3px; line-height: 1.4; }
.no-notes { color: var(--dim); font-size: .84rem; margin: 10px 0 4px; font-style: italic; }

.note-composer { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.nc-author-input { margin-top: 8px; }
.nc-stars { display: flex; align-items: center; gap: 2px; margin-top: 10px; }
.nc-star {
  background: none; border: 0; cursor: pointer; font-size: 1.5rem; line-height: 1;
  color: var(--gold); padding: 2px 3px;
}
.nc-stars-hint { color: var(--dim); font-size: .72rem; margin-left: 8px; }
.nc-text { margin-top: 8px; }
.tasting-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.tasting-actions .btn { padding: 10px 14px; font-size: .85rem; }
.tasting-actions .btn-primary { flex: 1; }

.cork-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 10px;
}
.cork-row { cursor: pointer; }
.cork-meta { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.cork-house { color: var(--gold); font-weight: 800; font-size: .82rem; }
.cork-house.dim { color: var(--dim); font-weight: 600; }
.cork-meta small { color: var(--dim); font-size: .72rem; }
.cork-notes { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 4px; }
.cork-notes .linkish { margin-top: 10px; }

/* ---------- empty state ---------- */
.empty { text-align: center; color: var(--dim); padding: 48px 24px; }
.empty-glass { font-size: 3rem; margin-bottom: 12px; }
.empty p + p { margin-top: 8px; }

/* ---------- stats ---------- */
.stats-title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; margin: 2px 2px 14px; }
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 14px; }
.stat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px; box-shadow: var(--shadow);
}
.stat-tile.hero { background: linear-gradient(150deg, var(--accent), var(--accent-deep)); border-color: var(--accent-deep); }
.stat-tile.hero .stat-value { color: #fff; }
.stat-tile.hero .stat-label { color: #eab6c0; }
.stat-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.stat-value { font-family: var(--display); font-weight: 800; font-size: 1.7rem; line-height: 1; }
.stat-label { color: var(--dim); font-size: .76rem; margin-top: 4px; font-weight: 600; }

.chart-card, .rack-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 15px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.chart-card h3, .rack-card h3 { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.chart-sub { color: var(--dim); font-size: .76rem; margin: 2px 0 10px; }
.trend-pill { font-size: .72rem; color: var(--accent); font-weight: 700; background: var(--danger-bg); border-radius: 8px; padding: 3px 8px; }
#invChart { margin-top: 8px; }
#invChart svg, #worldMap svg { display: block; width: 100%; height: auto; }

.donut-row { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: .85rem; }
.legend-item .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend-item .lbl { font-weight: 600; flex: 1; }
.legend-item .val { color: var(--dim); font-weight: 700; }

.map-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.map-legend span {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; font-size: .78rem; font-weight: 600;
}
.map-legend b { color: var(--accent); font-weight: 800; }

.region-rows { display: flex; flex-direction: column; gap: 11px; margin-top: 12px; }
.region-row .r-head { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 5px; }
.region-row .r-head b { font-weight: 600; }
.region-row .r-head span { color: var(--dim); font-weight: 700; }
.region-row .r-track { height: 9px; background: #f1e8df; border-radius: 99px; overflow: hidden; }
.region-row .r-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; }

.rating-bars { display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; height: 120px; margin-top: 8px; }
.rating-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.rating-bar b { font-size: .8rem; font-weight: 800; font-family: var(--display); }
.rating-bar .bar { width: 100%; max-width: 44px; border-radius: 9px 9px 4px 4px; }
.rating-bar small { font-size: .72rem; color: var(--dim); font-weight: 600; }

.rack-card { background: linear-gradient(160deg, #3a2419, #2a1913); border-color: #543826; }
.rack-card h3 { color: #f6e9dd; }
.rack-card .chart-head { margin-bottom: 12px; }
.rack-card .chart-head span { font-size: .72rem; color: #c8a887; font-weight: 600; }
.rack-shelf {
  display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap;
  padding: 9px 6px 11px; border-bottom: 3px solid #5a3c28; min-height: 52px;
}
.rack-bottle {
  width: 13px; height: 38px; border-radius: 5px 5px 2px 2px;
  position: relative; box-shadow: 0 2px 3px rgba(0,0,0,.3);
}
.rack-bottle::before {
  content: ""; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 8px; background: inherit; border-radius: 2px; filter: brightness(.7);
}

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-around;
  max-width: 480px; margin: 0 auto;
  padding: 10px 20px calc(14px + env(safe-area-inset-bottom));
  background: rgba(251,245,238,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; background: transparent; cursor: pointer; color: #b3a6ab; font-family: inherit;
}
.nav-btn span { font-size: .68rem; font-weight: 700; }
.nav-btn.active { color: var(--accent); }
.nav-add {
  width: 56px; height: 56px; border-radius: 19px; border: 0; cursor: pointer;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(161,44,67,.4); margin-top: -26px;
}
.nav-add:hover { filter: brightness(1.08); }

/* ---------- footer ---------- */
.foot { max-width: 480px; margin: 8px auto 0; padding: 0 16px 12px; }
#phoneHint { color: var(--dim); font-size: .82rem; text-align: center; border-top: 1px dashed var(--line); padding-top: 14px; }
#phoneHint code { color: var(--gold); font-size: .95em; }

/* ---------- editor sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(43,33,38,.5); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  background: var(--card); width: 100%; max-width: 560px;
  border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 14px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 92dvh; overflow-y: auto; animation: floatUp .3s ease both;
}
.sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: var(--line); margin: 0 auto 14px; }
@media (min-width: 600px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line); }
}
.sheet h2 { font-family: var(--display); font-weight: 800; margin-bottom: 14px; }
.sheet label { display: block; margin-top: 12px; font-size: .78rem; font-weight: 700; color: var(--dim); }
.sheet label input, .sheet label textarea, .sheet label select { margin-top: 5px; color: var(--ink); font-weight: 400; }
.sheet .req { color: var(--accent); }
.sheet .hint { font-size: .74rem; opacity: .8; font-weight: 400; }
.row2 { display: flex; gap: 10px; }
.row2 label { flex: 1; }
.check-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  margin-top: 14px !important; color: var(--ink) !important; font-size: .9rem !important;
}
.check-row input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
input[type="date"] { min-height: 44px; }
.editor-head { display: flex; gap: 10px; align-items: center; }
.editor-head:empty { display: none; }
.editor-head img { width: 30px; height: 60px; object-fit: contain; }
.editor-head .eh-text { font-size: .82rem; color: var(--dim); }
.editor-head .eh-text b { color: var(--gold); }
.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
.sheet-actions .btn-primary { flex: 1.5; }

/* ---------- quick-select chips (editor) ---------- */
.quick-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.qchip {
  border: 1px solid var(--line); background: var(--soft); color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: .85rem; font-weight: 700;
  cursor: pointer; font-family: inherit; min-height: 38px;
}
.qchip:hover { border-color: var(--accent2); }
.qchip.active { background: var(--danger-bg); color: var(--accent); border-color: #e5aeb9; }
.qs-input { margin-top: 8px !important; }

/* ---------- pairing picks (stats) ---------- */
.pair-chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.pair-chips::-webkit-scrollbar { display: none; }
.pair-chips .qchip { flex: none; }
.pair-list { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.pair-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--soft); border: 1px solid #f0e6dc; border-radius: 13px; padding: 10px 12px;
}
.pair-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pair-main { flex: 1; min-width: 0; }
.pair-main b { font-size: .88rem; display: block; line-height: 1.25; }
.pair-main small { color: var(--dim); font-size: .74rem; }
.pair-qty { color: var(--dim); font-weight: 800; font-size: .8rem; flex: none; }
.pair-empty { color: var(--dim); font-size: .88rem; padding: 10px 2px; }

/* ---------- live barcode scanner ---------- */
.scan-overlay { align-items: center; }
.scanner-box {
  background: #14090c; border-radius: 22px; overflow: hidden;
  width: min(94vw, 460px); padding-bottom: 14px; text-align: center; position: relative;
}
#scanVideo { width: 100%; max-height: 55vh; object-fit: cover; display: block; background: #000; }
.scan-frame {
  position: absolute; left: 12%; right: 12%; top: 90px; height: 120px;
  border: 3px solid rgba(255,255,255,.85); border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 200vmax rgba(0,0,0,.25);
}
.scan-hint { color: #f2d9de; font-size: .85rem; margin: 12px 0 10px; }
.scanner-actions { display: flex; gap: 8px; justify-content: center; }
.scanner-actions .btn-ghost { background: rgba(255,255,255,.08); color: #f2d9de; border-color: #4a2f36; }

/* ---------- lock screen ---------- */
body.locked main, body.locked .topbar, body.locked .bottom-nav, body.locked .foot { display: none; }
.lock-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.lock-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: var(--shadow); padding: 30px 26px; max-width: 360px; width: 100%;
  text-align: center; animation: floatUp .35s ease both;
}
.lock-card .brand-mark { margin: 0 auto 14px; width: 50px; height: 50px; border-radius: 16px; }
.lock-card h2 { font-family: var(--display); font-weight: 800; font-size: 1.35rem; }
.lock-card p { color: var(--dim); font-size: .87rem; margin: 8px 0 18px; line-height: 1.5; }
.lock-card input { text-align: center; font-size: 1rem; }
.lock-card .btn { width: 100%; margin-top: 10px; }
.lock-err { color: var(--accent); font-size: .85rem; margin-top: 12px; font-weight: 700; }
.linkish { background: none; border: 0; color: var(--dim); cursor: pointer; font: inherit; font-size: .82rem; }
.linkish:hover { color: var(--accent); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #2b2126; color: #fbf5ee; border: 0;
  border-radius: 13px; padding: 11px 18px; font-size: .85rem; font-weight: 600; z-index: 80;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: 92vw; text-align: center;
  animation: pop .3s ease;
}
.toast.error { background: #7d1f34; }
