/* sway.dfive.us — phone-first, dark, a little loud.

   The look: near-black violet ground, one gradient (coral → violet → mint)
   used sparingly for the things that matter — the top pick, the primary
   button, the score bar — and glassy cards everywhere else. Big chips because
   thumbs; tabular numerals because scores line up in a list. */

:root {
  --bg: #0c0a12;
  --bg-2: #14111d;
  --card: rgba(255, 255, 255, 0.045);
  --card-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);
  --ink: #f4f1fb;
  --ink-2: #b6afc9;
  --ink-3: #7d7591;
  --coral: #ff6b6b;
  --violet: #a78bfa;
  --mint: #5eead4;
  --gold: #fbbf24;
  --bad: #ff6b6b;
  --grad: linear-gradient(105deg, #ff6b6b 0%, #a78bfa 55%, #5eead4 100%);
  --grad-soft: linear-gradient(135deg, rgba(255,107,107,.22), rgba(167,139,250,.22) 55%, rgba(94,234,212,.22));
  --radius: 18px;
  --radius-s: 12px;
  --tap: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 10% -10%, rgba(167,139,250,.18), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(255,107,107,.12), transparent 60%),
    radial-gradient(600px 400px at 50% 110%, rgba(94,234,212,.10), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.45 var(--font);
  overscroll-behavior-y: none;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
a { color: var(--mint); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.tiny { font-size: 12.5px; }
.small { font-size: 14px; }
.center { text-align: center; }

/* ── the sign-in card sits on the platform's bone paper ─────────────────── */
body.signing-in { background: #f5f2ec; background-image: none; }
body.signing-in #app { padding: 0; max-width: none; }

/* ── page chrome ─────────────────────────────────────────────────────────── */
#app { max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 14px) 16px calc(40px + var(--safe-b)); }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.brand-name span { color: var(--ink-3); font-weight: 600; }
.spacer { flex: 1; }
.who { color: var(--ink-3); font-size: 13px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── type ────────────────────────────────────────────────────────────────── */
.eyebrow { color: var(--ink-3); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.eyebrow.hot { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h-hero { font-size: 30px; line-height: 1.12; margin: 6px 0 4px; }
.h-big { font-size: 24px; line-height: 1.15; }
.h-mid { font-size: 18px; }
.lede { color: var(--ink-2); font-size: 16px; margin: 6px 0 0; }

/* ── cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.card.glow { position: relative; border-color: transparent; background: var(--bg-2); }
.card.glow::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.card-head h2 { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  min-height: var(--tap); padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--ink);
  font-weight: 650; font-size: 15.5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--grad); color: #17111f; border-color: transparent; font-weight: 800; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 11px; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: 12px; font-size: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--mint); font-weight: 600; cursor: pointer; }
.link-dim { color: var(--ink-3); font-weight: 500; }

/* ── inputs ──────────────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 12px; }
.label { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--ink);
  outline: none; font-size: 16px;   /* 16px stops iOS zooming into the field */
}
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(167,139,250,.18); }
textarea.input { min-height: 88px; resize: vertical; line-height: 1.4; }
.hint { color: var(--ink-3); font-size: 12.5px; margin-top: 6px; }
.seg { display: grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--ink-2); min-height: 40px; border-radius: 10px; font-weight: 650; }
.seg button.is-on { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 14px; padding: 3px; }
.stepper button { width: 40px; min-height: 40px; border: 0; background: var(--card-2); border-radius: 11px; font-size: 20px; }
.stepper output { min-width: 44px; text-align: center; font-weight: 800; font-size: 18px; }

/* ── chips ───────────────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--ink-2);
  font-weight: 650; font-size: 14.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.chip.is-on { background: rgba(167,139,250,.18); color: var(--ink); border-color: var(--violet); }
.chip.is-must { background: rgba(255,107,107,.16); border-color: var(--coral); color: var(--ink); }
.chip.is-must::after { content: "must"; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--coral); }
.chip-x { margin-left: 2px; opacity: .7; }
.chip.chip-add { border-style: dashed; }
.chip-note { margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--ink-2); }
.tag.ok { color: var(--mint); background: rgba(94,234,212,.12); }
.tag.no { color: var(--coral); background: rgba(255,107,107,.12); }
.tag.gold { color: var(--gold); background: rgba(251,191,36,.12); }

/* ── ranking ─────────────────────────────────────────────────────────────── */
.rank { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; cursor: pointer; }
.rank.is-top { background: var(--bg-2); border-color: transparent; position: relative; }
.rank.is-top::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.rank.is-dropped { opacity: .55; }
.rank.is-chosen { border-color: var(--mint); }
.tile {
  width: 56px; height: 56px; border-radius: 16px; flex: none; display: grid; place-items: center;
  font-weight: 900; font-size: 22px; color: #17111f; background: var(--grad-soft); color: var(--ink);
}
.rank.is-top .tile { background: var(--grad); color: #17111f; }
.rank-body { flex: 1; min-width: 0; }
.rank-name { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.rank-name .price { color: var(--ink-3); font-weight: 600; font-size: 14px; }
.rank-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,.08); margin-top: 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.score { font-weight: 900; font-size: 22px; letter-spacing: -0.03em; }
.score small { font-size: 11px; color: var(--ink-3); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-left: 2px; }

/* ── progress ring ───────────────────────────────────────────────────────── */
.progress { display: flex; align-items: center; gap: 14px; }
.ring { width: 64px; height: 64px; flex: none; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring .track { stroke: rgba(255,255,255,.08); }
.ring .fill { stroke: url(#ringGrad); transition: stroke-dashoffset .5s ease; }
.ring b { font-size: 15px; font-weight: 900; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--mint); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(94,234,212,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(94,234,212,.55); } 70% { box-shadow: 0 0 0 9px rgba(94,234,212,0); } 100% { box-shadow: 0 0 0 0 rgba(94,234,212,0); } }

/* ── lists ───────────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--card); border: 1px solid var(--line); text-align: left; width: 100%; cursor: pointer; }
.item:active { background: var(--card-2); }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 700; }
.item-sub { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .chev { color: var(--ink-3); font-size: 20px; }
.empty { text-align: center; color: var(--ink-3); padding: 28px 12px; }
.empty .big { display: block; font-size: 34px; margin-bottom: 6px; }
.results { margin-top: 8px; }

/* ── decision header ─────────────────────────────────────────────────────── */
.hero { padding: 18px 18px 16px; border-radius: 22px; background: var(--grad-soft); border: 1px solid var(--line); margin-bottom: 14px; }
.hero .h-hero { margin-top: 4px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.status-closed { color: var(--gold); }
.status-open { color: var(--mint); }

/* ── bottom sheet ────────────────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
.sheet-body {
  position: relative; width: 100%; max-width: 640px; margin: 0 auto; max-height: 88dvh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 24px 24px 0 0; padding: 12px 16px calc(24px + var(--safe-b));
  animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-grip { display: block; width: 44px; height: 5px; border-radius: 999px; border: 0; background: var(--line-2); margin: 2px auto 14px; padding: 0; }
.sheet-x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--card-2); color: var(--ink-2); font-size: 16px; }
.sheet h2 { margin-bottom: 10px; padding-right: 40px; }

/* ── toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%);
  z-index: 60; background: #1f1a2e; color: var(--ink); border: 1px solid var(--line-2);
  padding: 11px 16px; border-radius: 14px; font-weight: 650; font-size: 14.5px; max-width: 92vw;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.toast.is-bad { border-color: var(--coral); }

/* ── reviews ─────────────────────────────────────────────────────────────── */
.review { padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.review b { color: var(--gold); }
.hours { font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* ── misc ────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.attribution { color: var(--ink-3); font-size: 11.5px; text-align: center; margin-top: 14px; }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox .input { flex: 1; font-size: 13.5px; color: var(--ink-2); }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--mint); animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
