/* Persistent DEMO chrome removed — gate disclosure only */
.demo-bar, .hint-out { display: none !important; }

/* ArchiveTheme web shell — aligned with store-shots-v6 / UI-DESIGN-DETAILS */
:root {
  --paper: #F3EDE3;
  --ink: #1C1915;
  --spine: #2A4A43;
  --wax: #9C3B2F;
  --label: #E7DCC8;
  --rule: #CDBFA8;
  --gold: #C4A035;
  --muted: #5A5348;
  --phone-w: 360px;
  --phone-h: 720px;
  --radius-sm: 2px;
  --radius-btn: 4px;
  --font-serif: "Georgia", "Times New Roman", "Noto Serif", "Songti TC", serif;
  --font-sans: "Helvetica Neue", "Segoe UI", "Noto Sans", "PingFang TC", "Hiragino Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: #d8cbb8;
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
}

/* —— Demo chrome (outside phone) —— */
.demo-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--spine);
  color: var(--paper);
  font-size: 12px;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
}
.demo-bar strong { font-weight: 600; letter-spacing: 0.02em; }
.demo-bar .bar-note { opacity: 0.92; max-width: 72ch; }
.cta-full {
  display: inline-block;
  background: var(--gold);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-btn);
  white-space: nowrap;
}
.cta-full:hover { filter: brightness(1.05); }

.page-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 48px;
  gap: 14px;
}

.hint-out {
  font-size: 13px;
  color: #4a4338;
  text-align: center;
  max-width: 420px;
}

/* —— Phone frame —— */
.phone {
  width: min(100%, var(--phone-w));
  height: var(--phone-h);
  background: var(--paper);
  border: 2px solid #2a2620;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(28, 25, 21, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.phone-status {
  flex: 0 0 auto;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 11px;
  color: var(--ink);
  background: var(--paper);
}
.phone-rail {
  flex: 0 0 auto;
  height: 6px;
  background: color-mix(in srgb, var(--spine) 16%, transparent);
  border-bottom: 1px solid var(--rule);
}
.phone-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 20px 24px;
  position: relative;
  /* ruled paper on home only via .ruled */
}
.phone-body.ruled {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    color-mix(in srgb, var(--rule) 45%, transparent) 28px
  );
  background-attachment: local;
}
.phone-nav {
  flex: 0 0 auto;
  height: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--label) 70%, var(--paper));
}
.phone-nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
}
.phone-nav-btn:hover { opacity: 1; background: color-mix(in srgb, var(--spine) 10%, transparent); }
.phone-nav-btn:active { opacity: 0.7; }
.phone-nav-btn:focus-visible { outline: 2px solid var(--spine); outline-offset: -2px; }

/* —— Typography —— */
.h-display {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
}
.h-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 20px;
  margin: 0;
  color: var(--ink);
}
.h-service {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 18px;
  margin: 0;
  color: var(--ink);
}
.tagline, .muted, .meta {
  color: var(--muted);
  font-size: 14px;
}
.tagline { font-size: 15px; margin: 6px 0 18px; }
.disclaimer {
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
  line-height: 1.5;
}

/* —— Links / buttons —— */
.link {
  color: var(--spine);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
}
.link:hover { filter: brightness(1.15); }
.link.wax { color: var(--wax); }
.link.disabled { opacity: 0.45; pointer-events: none; }
.link-disabled { color: var(--muted); opacity: 0.65; font-weight: 400; }

.btn {
  display: block;
  width: 100%;
  border-radius: var(--radius-btn);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  border: 1.5px solid var(--spine);
  padding: 14px 16px;
  margin: 0 0 10px;
}
.btn-primary {
  background: var(--spine);
  color: var(--paper);
  min-height: 52px;
}
.btn-outline {
  background: transparent;
  color: var(--spine);
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn-row {
  display: flex;
  gap: 10px;
}
.btn-row .btn { flex: 1; margin: 0; min-height: 40px; padding: 10px; }

.icon-btn {
  background: none;
  border: none;
  color: var(--spine);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.switch { display: inline-flex; align-items: center; }
.switch input { accent-color: var(--spine); width: 18px; height: 18px; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
}
.check-row input { margin-top: 3px; accent-color: var(--spine); }

/* —— Cards / folds —— */
.card {
  background: var(--label);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
}
.card .silent-title {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 8px;
}
.card .stats {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 6px;
}
.card .stats-sub {
  font-family: var(--font-serif);
  font-size: 16px;
  margin: 0 0 10px;
}

.fold {
  background: var(--label);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  margin: 8px 0;
  overflow: hidden;
}
.fold-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.fold-head .caret { color: var(--muted); font-size: 12px; }
.fold-body { padding: 0 10px 10px; }
.fold.collapsed .fold-body { display: none; }

.ledger-row {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 8px 0;
}
.ledger-row .row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.ledger-row .row-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.ledger-row .excerpt {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badge-gold {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  margin-top: 4px;
}
.badge-wider {
  display: inline-block;
  color: var(--gold);
  font-size: 11px;
  margin-left: 6px;
}
.badge-gateway {
  display: inline-block;
  color: var(--spine);
  font-size: 11px;
  margin-left: 6px;
}

/* —— Hex-prism line dial (螺帽 tab) —— */
.dial {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 12px;
  min-height: 56px;
}
.dial-clip {
  flex: 1;
  min-width: 0;
  height: 56px;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  /* perspective set in JS ≈ face_w * 8 */
  perspective-origin: left center;
}
.dial-stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.dial-face {
  position: absolute;
  left: 0;
  top: 50%;
  height: 48px;
  margin-top: -24px;
  box-sizing: border-box;
  background: var(--spine);
  color: var(--paper);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1.2;
  cursor: grab;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform;
}
.dial-face .dial-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dial-face .sub {
  max-width: 100%;
  font-size: 11px;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Front face sits on top in 2D hit-test; disable so side faces receive taps */
.dial-face { pointer-events: none; }
.dial-face.is-side { pointer-events: auto; cursor: pointer; }
.dial-face.is-front { cursor: grab; }
.dial-index {
  flex: 0 0 auto;
  align-self: center;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  padding: 10px 4px;
  text-decoration: underline;
  color: var(--spine);
}
.dial-picker {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dial-picker-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dial-picker-row.on {
  background: var(--spine);
  color: var(--paper);
}

/* —— Message list —— */
.msg-card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 8px 0;
  background: var(--paper);
}
.msg-card .from { font-weight: 600; font-size: 14px; }
.msg-card .when { color: var(--muted); font-size: 12px; }
.msg-card .body { font-size: 13px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }


.search {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--label);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  margin: 8px 0 4px;
  color: var(--ink);
}
.search:focus { outline: 1px solid var(--spine); }

/* —— Settings sections —— */
.settings-block {
  background: var(--label);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  margin: 0 0 16px;
  overflow: hidden;
}
.settings-block .block-title {
  font-family: var(--font-serif);
  font-size: 18px;
  padding: 12px 14px 10px;
  margin: 0;
}
.settings-block .block-rule {
  height: 1px;
  background: var(--rule);
  margin: 0;
  border: 0;
}
.settings-block .block-body { padding: 12px 14px 14px; }
.lang-list { list-style: none; padding: 0; margin: 0; }
.lang-list li {
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.lang-list li:last-child { border-bottom: none; }
.lang-list li.active { font-weight: 600; color: var(--spine); }
.lang-list input { accent-color: var(--spine); }

.detail-grid {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px 10px;
  font-size: 14px;
  margin: 8px 0;
}
.detail-grid .k { color: var(--muted); }

.nav-top { margin-bottom: 8px; }
.nav-sub { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 10px; }
.backup-hint { margin: -4px 0 10px; font-size: 12px; }

/* —— First screen: demo disclosure (full page until Start) —— */
.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  overflow: auto;
}
.gate.hidden { display: none; }
.gate-card {
  background: var(--paper);
  border: none;
  border-radius: 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-sizing: border-box;
}
.gate-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--spine);
}
.gate-card h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  margin: 0 0 10px;
  line-height: 1.25;
}
.gate-card #gate-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}
.gate-list {
  margin: 0 0 20px;
  padding-left: 1.15em;
  color: var(--ink);
  font-size: 14px;
  flex: 1 1 auto;
}
.gate-list li { margin: 10px 0; line-height: 1.45; }
.gate-start {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}
.gate-play {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
}
.gate-soon {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(28, 25, 21, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-soon.hidden { display: none; }
.gate-soon-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 320px;
  padding: 20px 18px 16px;
}
.gate-soon-card p {
  font-family: var(--font-serif);
  font-size: 20px;
  margin: 0;
}
@media (min-width: 721px) {
  .gate {
    background: #d8cbb8;
    align-items: center;
    padding: 24px 16px;
  }
  .gate-card {
    border: 1px solid var(--rule);
    border-radius: 8px;
    min-height: 0;
    max-height: min(92vh, 760px);
    overflow: auto;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    padding: 28px 26px 22px;
  }
}

/* —— Modal —— */
.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(28, 25, 21, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  width: 100%;
  max-height: 85%;
  overflow: auto;
  padding: 16px;
}
.modal-card h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  margin: 0 0 10px;
}
.status-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 8px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--label);
  margin: 6px 0;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.status-opt.selected {
  border-color: var(--spine);
  background: color-mix(in srgb, var(--spine) 12%, var(--label));
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  margin-top: 14px;
  padding-top: 4px;
}

.toast {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 52px;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  display: none;
}
.toast.show { display: block; }

.screen { display: none; }
.screen.active { display: block; }

.last-backup { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }

/* Wide: framed phone. Narrow (real phone browser): no bezel, content fullscreen. */
@media (max-width: 720px) {
  html, body {
    height: 100%;
    min-height: 100dvh;
  }
  body {
    background: var(--paper);
    display: flex;
    flex-direction: column;
  }
  .demo-bar {
    flex: 0 0 auto;
  }
  .page-wrap {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    gap: 0;
    width: 100%;
    align-items: stretch;
  }
  .hint-out { display: none; }
  .phone {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  /* Real device already has status UI — drop the fake chrome */
  .phone-status,
  .phone-rail { display: none; }
  .phone-nav {
    height: calc(48px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--label) 85%, var(--paper));
  }
  .toast {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 721px) {
  /* Desktop / wide: keep framed “phone in a page” look (default rules). */
}


/* —— Simulator add-ons (PIN / label / export / chips) —— */
.pin-banner {
  background: color-mix(in srgb, var(--wax) 12%, var(--label));
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--wax);
  font-size: 12px;
  padding: 8px 10px;
  margin: 0 0 12px;
  line-height: 1.35;
}
.field-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 4px;
}
.pin-input { letter-spacing: 0.2em; }
.err { color: var(--wax); font-size: 13px; margin: 6px 0; }
.tip-card {
  background: var(--label);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 14px;
  cursor: pointer;
}
.tip-card .tip-head {
  font-family: var(--font-serif);
  font-size: 14px;
  margin-bottom: 4px;
}
.tip-card .tip-body { color: var(--muted); font-size: 13px; }
.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin: 8px 0;
  background: var(--paper);
  cursor: pointer;
}
.check-row input { accent-color: var(--spine); margin-top: 3px; flex: 0 0 auto; }
.check-row .from { font-weight: 600; font-size: 14px; }
.check-row .when { color: var(--muted); font-size: 12px; }
.check-row .body { font-size: 13px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.mark-wax { color: var(--wax); font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  border: 1px solid var(--rule);
  background: var(--label);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.chip.selected {
  border-color: var(--spine);
  background: color-mix(in srgb, var(--spine) 14%, var(--label));
  color: var(--spine);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.history-row .h-service { font-size: 17px; }

/* Demo PIN skip — secondary full-width control */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); }

/* —— ContiguousPick label UI + dismiss —— */
.badge-dismissed {
  display: inline-block;
  color: var(--wax);
  font-size: 11px;
  margin-left: 6px;
  font-weight: 600;
}
.btn-wax {
  background: var(--wax);
  color: var(--paper);
  border-color: var(--wax);
  min-height: 40px;
}
.btn-wax:hover { filter: brightness(1.05); }
.chip.is-on {
  border-color: var(--spine);
  background: var(--spine);
  color: var(--paper);
}
.ctp-meta {
  margin: 6px 0 4px;
  color: var(--muted);
  font-size: 13px;
}
.ctp-selected {
  margin: 8px 0 6px;
  font-size: 14px;
  color: var(--ink);
}
.ctp-size-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 10px;
}
.ctp-size-row input[type="range"] {
  flex: 1;
  accent-color: var(--spine);
}
.ctp-size-row .link {
  font-size: 18px;
  line-height: 1;
  min-width: 1.2em;
  text-align: center;
  user-select: none;
}
.ctp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 12px;
}
.ctp-cell {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  line-height: 1;
  user-select: none;
}
.ctp-cell.is-lit {
  background: var(--wax);
  border-color: var(--wax);
  color: var(--paper);
}
.ctp-cell:active { transform: translateY(1px); }
.ctp-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 8px;
  line-height: 1.4;
}
.label-from {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}


/* Line detail inline edit (#4/#6) */
.detail-edit { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.detail-edit .search { flex:1; min-width:120px; margin:0; }


/* —— Related-SMS review: sticky Confirm footer (App-like) —— */
.phone-body.has-sticky-footer {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
  min-height: 0;
}
.screen.active.screen-review {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.review-chrome {
  flex: 0 0 auto;
}
.review-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.review-footer {
  flex: 0 0 auto;
  padding: 10px 0 calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -4px 12px color-mix(in srgb, var(--ink) 6%, transparent);
}
.review-footer .btn {
  margin-bottom: 0;
}

/* —— Feedback survey: floating entry + overlay —— */
.fb-fab {
  position: fixed;
  /* Fallback only; survey.js places it at the phone screen's right edge, ~30% down. */
  right: 8px;
  top: 30vh;
  z-index: 230;
  display: flex;
  align-items: flex-start;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.fb-fab.hidden { display: none; }
.fb-fab-open {
  font: 700 15px var(--font-sans);
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 11px 18px;
  box-shadow: 0 4px 14px rgba(28,25,21,0.35);
  cursor: grab;
  touch-action: none;
  animation: fb-nudge 4s ease-in-out 1.5s infinite;
  transform-origin: 50% 100%;
}
.fb-fab.dragging .fb-fab-open { cursor: grabbing; animation: none; }
@keyframes fb-nudge {
  0%, 82%, 100% { transform: rotate(0) scale(1); }
  86% { transform: rotate(-7deg) scale(1.06); }
  90% { transform: rotate(6deg) scale(1.06); }
  94% { transform: rotate(-4deg) scale(1.03); }
  97% { transform: rotate(2deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fb-fab-open { animation: none; }
}
.fb-fab-x {
  margin-left: -8px;
  margin-top: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.fb-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  background: rgba(28, 25, 21, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.fb-overlay.hidden { display: none; }
.fb-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px 18px 14px;
}
.fb-card h2 { font-family: var(--font-serif); font-size: 20px; margin: 0 0 4px; }
.fb-stars { display: flex; gap: 4px; }
.fb-star {
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  color: var(--rule);
  cursor: pointer;
  padding: 2px;
}
.fb-star.on { color: var(--gold); }
.fb-text { resize: vertical; font: inherit; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-foot { margin-top: 10px; }
.fb-notice { font-size: 12px; margin: 0 0 4px; line-height: 1.4; }
.err.hidden { display: none; }
