/* MBWS Bunker. Dark only (D34). */
:root {
  --bg: #0a0a0a;
  --surface: #151412;
  --surface-2: #1e1c19;
  --line: #2b2823;
  --text: #F2EBDD;
  --muted: #a39a89;
  --amber: #C8821C;
  --amber-press: #a96c14;
  --on-amber: #140d02;
  --danger: #e2735f;
  --radius: 14px;
  --tap: 52px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  /* iOS home screen apps with a translucent status bar lay the page out short by
     the top safe area, which leaves fixed bottom bars floating. This fills it. */
  min-height: calc(100% + env(safe-area-inset-top, 0px));
}
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.45;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.01em; text-wrap: balance; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 21px; }
p { margin: 0; }
a { color: var(--amber); }
strong { font-weight: 650; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Boot splash */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.wordmark { font-family: var(--serif); font-size: 34px; letter-spacing: 0.22em; color: var(--amber); opacity: 0.85; }

/* Signed-out screens */
.auth {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(var(--safe-t) + 28px) 22px calc(var(--safe-b) + 28px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand { text-align: center; padding: 10px 0 6px; }
.brand-logo { display: block; width: min(78%, 300px); height: auto; margin: 0 auto; }
.brand-mark { font-family: var(--serif); font-size: 46px; letter-spacing: 0.2em; margin-right: -0.2em; color: var(--text); line-height: 1; }
.brand-sub {
  display: inline-block; margin-top: 12px; padding: 5px 16px 4px;
  font-size: 14px; letter-spacing: 0.34em; margin-right: -0.34em; text-transform: uppercase;
  color: var(--amber); border-top: 1px solid var(--amber); border-bottom: 1px solid var(--amber);
}
.lede { color: var(--muted); font-size: 17px; }
.lede strong { color: var(--text); }
.fine { color: var(--muted); font-size: 14px; text-align: center; margin-top: auto; padding-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.back { align-self: flex-start; margin-left: -10px; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--amber); background: var(--amber); color: var(--on-amber);
  min-height: var(--tap); padding: 0 20px; border-radius: var(--radius);
  font-size: 17px; font-weight: 650; cursor: pointer; width: 100%;
  touch-action: manipulation; transition: background 0.12s, transform 0.06s;
}
.btn:active { background: var(--amber-press); transform: scale(0.985); }
.btn:disabled { opacity: 0.55; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:active { background: var(--surface-2); }
.btn-small { min-height: 40px; width: auto; font-size: 15px; padding: 0 16px; }
.btn-text {
  appearance: none; background: none; border: 0; color: var(--amber); cursor: pointer;
  min-height: 44px; padding: 0 10px; font-size: 16px; touch-action: manipulation;
}
.fine .btn-text { min-height: 0; padding: 0; font-size: inherit; text-decoration: underline; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.field-note { font-size: 14px; color: var(--muted); }
input[type="text"], input[type="email"] {
  appearance: none; width: 100%; min-height: var(--tap);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 16px; font: inherit; font-size: 17px; /* 16px+ stops iOS zooming in */
}
input::placeholder { color: #6e675b; }
input:focus { outline: none; border-color: var(--amber); }
.code-input {
  text-align: center; font-size: 32px !important; letter-spacing: 0.35em; padding-left: 0.35em !important;
  font-variant-numeric: tabular-nums; min-height: 68px !important;
}
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 26px; height: 26px; accent-color: var(--amber); flex: none; margin: 0; }
.error { color: var(--danger); font-size: 15px; }

/* Signed-in shell */
.shell { min-height: 100dvh; }
.shell-main { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 18px) 18px calc(var(--tabbar) + var(--safe-b) + 24px); }
.page { display: flex; flex-direction: column; gap: 16px; }
.page-head { padding: 6px 2px 2px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(14, 13, 12, 0.94); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.tab-icon { display: grid; place-items: center; height: 26px; }
.tab.is-active { color: var(--amber); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-title { font-family: var(--serif); font-size: 22px; }
.card-sub { color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.badge {
  display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--amber); border: 1px solid var(--amber);
}
.stats { display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
.stats div { display: flex; flex-direction: column; }
.stats strong { font-family: var(--serif); font-size: 28px; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { color: var(--text); }
.empty p { max-width: 30ch; }
.empty-icon { color: var(--amber); width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; margin-bottom: 6px; }

/* Add to home screen hint */
.hint { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--muted); }
.hint-title { color: var(--text); display: block; margin-bottom: 2px; }
.hint-icon { display: inline-grid; vertical-align: -6px; color: var(--amber); }
.hint-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar) + var(--safe-b) + 14px); z-index: 20;
  max-width: 420px; margin: 0 auto; padding: 13px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 15px; text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Phase 2: bottles ---------- */
.center { text-align: center; }
.page-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
select, textarea, input[type="search"], input[type="date"] {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: var(--tap);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 16px; font: inherit; font-size: 17px;
}
textarea { padding: 12px 16px; min-height: 96px; resize: vertical; }
select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
select:focus, textarea:focus, input[type="search"]:focus, input[type="date"]:focus { outline: none; border-color: var(--amber); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type="range"] { width: 100%; accent-color: var(--amber); min-height: 36px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.row-between { display: flex; flex-direction: row !important; align-items: center; justify-content: space-between; }
.money-wrap { position: relative; }
.money-wrap::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money-wrap input { padding-left: 28px; }

.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.group input[type="text"], .group select, .group textarea, .group input[type="date"] { background: var(--bg); }
.group-head { display: flex; flex-direction: column; gap: 2px; }
.sub { gap: 12px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; cursor: pointer; position: relative; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-label { font-weight: 600; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: none; width: 52px; height: 32px; border-radius: 999px; background: #3a362f; position: relative; transition: background 0.15s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--text); transition: transform 0.15s; }
.switch-input:checked ~ .switch-track { background: var(--amber); }
.switch-input:checked ~ .switch-track::after { transform: translateX(20px); }
.switch-input:focus-visible ~ .switch-track { outline: 2px solid var(--amber); outline-offset: 2px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
.segment { appearance: none; border: 0; background: transparent; color: var(--muted); min-height: 44px; border-radius: 10px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.segment.is-on { background: var(--amber); color: var(--on-amber); }

.qty { display: flex; align-items: center; gap: 14px; }
.qty-btn { appearance: none; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; touch-action: manipulation; }
.qty-btn:active { background: var(--surface-2); }
.qty-n { min-width: 2ch; text-align: center; font-family: var(--serif); font-size: 26px; font-variant-numeric: tabular-nums; }

/* Full-screen flows (add, edit) */
.flow { display: flex; flex-direction: column; gap: 16px; }
.flow-head { display: flex; flex-direction: column; gap: 2px; }
.flow-body { display: flex; flex-direction: column; gap: 14px; }
.no-tabs .shell-main { padding-bottom: calc(var(--safe-b) + 28px); }
.big-btn {
  appearance: none; display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  min-height: 88px; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer; touch-action: manipulation;
}
.big-btn strong { display: block; font-size: 19px; }
.big-btn small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.big-btn:active { background: var(--surface-2); }
.big-btn.is-primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); min-height: 104px; }
.big-btn.is-primary small { color: rgba(20, 13, 2, 0.75); }
.big-icon { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.18); }
.big-icon svg { width: 28px; height: 28px; }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-row {
  appearance: none; text-align: left; width: 100%; min-height: 64px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-start; touch-action: manipulation;
}
.pick-row:active { border-color: var(--amber); }
.pick-name { font-weight: 600; }
.pick-meta { color: var(--muted); font-size: 14px; }
.chosen { border-left: 3px solid var(--amber); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.is-amber { color: var(--amber); border-color: rgba(200, 130, 28, 0.55); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.working { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 16px; color: var(--muted); text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--amber); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sticky-save { position: sticky; bottom: calc(var(--safe-b) + 12px); display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.sticky-save .btn { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7); }
.sticky-save .error { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }

/* Scanner */
.scan { display: flex; flex-direction: column; gap: 12px; }
.scan-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 58dvh; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-guide { position: absolute; left: 6%; right: 6%; top: 28%; bottom: 28%; border: 2px solid var(--amber); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45); }
.scan-status { color: var(--muted); font-size: 15px; text-align: center; min-height: 2.9em; }
.scan-manual { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.scan-manual .btn { min-height: var(--tap); }

/* Bunker list */
.controls { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip { appearance: none; flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; touch-action: manipulation; }
.chip.is-on { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.bottle-list { display: flex; flex-direction: column; gap: 8px; }
.bottle-row { display: flex; gap: 14px; align-items: center; padding: 10px 12px; min-height: 92px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.bottle-row:active { border-color: var(--amber); }
.thumb { flex: none; width: 56px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.thumb.is-empty { display: grid; place-items: center; color: #5b554b; border: 1px solid var(--line); }
.bottle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bottle-name { font-weight: 600; line-height: 1.25; }
.bottle-pick { color: var(--amber); font-size: 14px; }
.bottle-meta { color: var(--muted); font-size: 14px; }
.bottle-title { font-size: 28px; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); z-index: 9;
  display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 0 22px 0 16px; border-radius: 999px;
  border: 0; background: var(--amber); color: var(--on-amber); font-size: 17px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.7); touch-action: manipulation;
}
.fab span { display: grid; place-items: center; }
.fab:active { background: var(--amber-press); }
.bottle-list:has(.bottle-row) { padding-bottom: 72px; }
.empty .btn { margin-top: 10px; max-width: 320px; }

/* Bottle detail */
.photos { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 0 18px; }
.photos::-webkit-scrollbar { display: none; }
.photo { position: relative; flex: none; width: 132px; height: 176px; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.is-add { appearance: none; color: var(--amber); font-weight: 600; font-size: 15px; cursor: pointer; border-style: dashed; }
.photo-x { appearance: none; position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.photo-tag { position: absolute; left: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.7); }
.photo-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.thumb-lg { width: 120px; height: 160px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; gap: 16px; font-size: 16px; }
.kv span { color: var(--muted); }
.kv strong { text-align: right; overflow-wrap: anywhere; }
.notes { white-space: pre-wrap; color: var(--muted); font-size: 15px; }
.btn-text.is-danger { color: var(--danger); align-self: center; }

/* ---------- Phase 3: club ---------- */
button.bottle-row { appearance: none; width: 100%; text-align: left; font: inherit; cursor: pointer; touch-action: manipulation; }
.member-row { min-height: 72px; }
.avatar { flex: none; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.avatar.is-initials { display: grid; place-items: center; font-family: var(--serif); color: var(--amber); letter-spacing: 0.04em; }
.count-badge { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(200, 130, 28, 0.55); color: var(--amber); font-family: var(--serif); font-size: 22px; font-variant-numeric: tabular-nums; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { font-size: 26px; }
.row-links { display: flex; gap: 8px; margin: -6px -10px; flex-wrap: wrap; }

/* ---------- Phase 4: trade board ---------- */
.bell { appearance: none; position: relative; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; }
.bell-dot { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--amber); color: var(--on-amber); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.tab { position: relative; }
.tab-dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.type-tag { flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 8px; border-radius: 7px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; }
.type-tag.is-ft { background: var(--amber); color: var(--on-amber); }
.type-tag.is-iso { border: 1px solid var(--amber); color: var(--amber); }
.post-card { appearance: none; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); touch-action: manipulation; }
.post-card:active { border-color: var(--amber); }
.post-card.is-unread { border-left: 3px solid var(--amber); }
.post-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-title { font-weight: 650; font-size: 18px; line-height: 1.25; }
.post-items { display: flex; flex-direction: column; gap: 8px; }
.post-wants { color: var(--muted); font-size: 15px; }
.post-wants strong { color: var(--text); }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.post-foot .tags { margin-top: 0; }
.mini { display: flex; align-items: center; gap: 12px; }
.mini-thumb { flex: none; width: 40px; height: 52px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.mini-thumb.is-empty { display: grid; place-items: center; color: #5b554b; border: 1px solid var(--line); }
.mini-name { font-weight: 600; line-height: 1.25; }
.check-row { appearance: none; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 68px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); touch-action: manipulation; }
.check-row.is-on { border-color: var(--amber); background: rgba(200, 130, 28, 0.1); }
.check-box { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid #5b554b; display: grid; place-items: center; font-weight: 800; color: var(--on-amber); }
.check-row.is-on .check-box { background: var(--amber); border-color: var(--amber); }
.offer { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.offer:first-of-type { border-top: 0; padding-top: 0; }
.offer:not(.is-live) { opacity: 0.7; gap: 4px; }
.offer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.offer-side { display: flex; flex-direction: column; gap: 8px; }
.offer-msg { color: var(--muted); font-style: italic; }
.thread-who { appearance: none; background: none; border: 0; padding: 0; text-align: left; font: inherit; font-weight: 650; color: var(--amber); cursor: pointer; min-height: 32px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.comment-who { font-weight: 600; font-size: 15px; }
.comment-hide { min-height: 0; padding: 4px 0; font-size: 14px; align-self: flex-start; }

/* ---------- Phase 5: confirming a trade ---------- */
.scan-frame.is-square { aspect-ratio: 1 / 1; }
.scan-frame.is-square .scan-guide { left: 10%; right: 10%; top: 10%; bottom: 10%; }
.qr-wrap { align-self: center; background: #fff; padding: 10px; border-radius: 16px; width: min(78vw, 320px); }
.qr { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.code-big { text-align: center; font-family: var(--serif); font-size: 44px; letter-spacing: 0.12em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.done { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 0 4px; }
.done-mark { width: 76px; height: 76px; border-radius: 50%; background: var(--amber); color: var(--on-amber); display: grid; place-items: center; font-size: 40px; font-weight: 800; margin-bottom: 8px; }
.center-links { justify-content: center; margin: 0; }
.history { gap: 6px; }
.history strong { color: var(--text); }

/* ---------- Photo cropper ---------- */
.crop { position: fixed; inset: 0; z-index: 50; background: rgba(5, 5, 5, 0.97); display: grid; place-items: center; padding: calc(var(--safe-t) + 16px) 24px calc(var(--safe-b) + 16px); overflow: auto; }
.crop-inner { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; max-width: 360px; }
.crop-inner .btn { width: 100%; }
.crop-stage { position: relative; border-radius: 16px; overflow: hidden; background: #000; }
.crop-canvas { display: block; touch-action: none; cursor: grab; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6); border: 2px solid var(--amber); pointer-events: none; }
.crop-zoom { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; color: var(--muted); font-size: 22px; }

/* ---------- Phase 6: vault ---------- */
.vault-stats { grid-template-columns: 1fr 1fr 1fr; }
.vault-stats strong { font-size: 22px; }
.lock-inline { display: inline-grid; vertical-align: -5px; color: var(--amber); }
.lock-inline svg { width: 18px; height: 18px; }
.nudge { appearance: none; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); border-left: 3px solid var(--amber); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; cursor: pointer; text-align: left; }
.nudge.is-on { background: rgba(200, 130, 28, 0.12); border-color: var(--amber); }
.nudge-go { color: var(--amber); font-weight: 600; white-space: nowrap; }
.vault-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.vault-top { appearance: none; background: none; border: 0; padding: 0; margin: 0; color: var(--text); font: inherit; text-align: left; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.vault-money { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; position: relative; }
.vault-field { display: flex; flex-direction: column; gap: 4px; }
.vault-field input { min-height: 46px; background: var(--bg); }
.save-note { position: absolute; right: 2px; top: -2px; font-size: 12px; color: var(--amber); }

/* ---------- Phase 7: admin, dialogs, about ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.72); display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(var(--safe-b) + 16px); }
.sheet-card { width: 100%; max-width: 440px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6); }
.sheet-title { font-family: var(--serif); font-size: 21px; line-height: 1.25; }
.sheet-card textarea { background: var(--bg); }
.btn.is-danger { background: var(--danger); border-color: var(--danger); color: #1a0703; }
@media (min-width: 600px) { .sheet { align-items: center; } }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 40; padding: calc(var(--safe-t) + 6px) 16px 6px; background: #5a3a0c; color: var(--text); font-size: 13px; text-align: center; }
.block { display: block; }
.nudge strong { display: block; }
.about-p { color: var(--muted); font-size: 16px; }
.about-p + .about-p { margin-top: -4px; }
.turnstile:empty { display: none; }
.turnstile { min-height: 65px; }

/* ---------- Logo placements ---------- */
.boot-logo { width: 150px; height: auto; opacity: 0.9; }
.brand-small { display: block; width: 92px; height: auto; margin: 0 auto 4px; }
.head-logo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head-mark { flex: none; width: 54px; height: auto; opacity: 0.92; }
.about-logo { width: min(60%, 220px); margin-bottom: 4px; }
