/* ==========================================================================
   Tool Tax Calculator — layout + components.
   No raw brand values here: every color/font comes from tokens.css.
   Component names (.btn, .card-ish, .mono, .display, .note, .facts) mirror
   shift-pwa/index.html so the two stay recognisably the same system.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 12px); }
body {
  background: var(--bg); color: var(--fg);
  font: 16px/1.55 var(--font-body);
  min-height: 100dvh; overflow-x: clip;
}
body.has-bar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ---------- shared atoms (same as PWA) ---------- */
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--cyan); }
.display { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: -.015em; line-height: 1; }
.gradtext { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.small { font-size: 13px; color: var(--dim); }
.note { background: var(--bg2); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; color: var(--muted); }
.disclaimer { font-size: 12px; color: var(--dim); line-height: 1.5; margin-top: 18px; }
.h-section { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: 0; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap.wide { max-width: 1120px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--grad); color: var(--btn-fg); text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 17px;
  padding: 16px 20px; border-radius: 14px; border: 0; cursor: pointer; box-shadow: var(--btn-glow);
}
.btn.secondary { background: var(--card); border: 1px solid var(--line); box-shadow: none; color: var(--fg); font-family: var(--font-body); font-size: 15px; padding: 12px 14px; font-weight: 600; }
.btn.secondary:hover { border-color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--muted); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- dummy-data ribbon ---------- */
.ribbon {
  position: sticky; top: 0; z-index: 40; text-align: center;
  background: var(--danger); color: #fff; font: 700 12px/1 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase; padding: 8px var(--gutter);
  height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.ribbon:not([hidden]) + .topbar { top: 28px; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: var(--topbar); }
.brand img { height: 24px; width: auto; }

/* ---------- intro ---------- */
.intro { padding: 40px 0 24px; position: relative; }
.intro::before {
  content: ""; position: absolute; inset: -60px -40% auto -40%; height: 280px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 60% at 30% 40%, color-mix(in srgb, var(--violet) 32%, transparent), transparent 70%),
    radial-gradient(50% 50% at 80% 20%, color-mix(in srgb, var(--cyan) 18%, transparent), transparent 70%);
}
.intro h1 { font-size: clamp(38px, 10.5vw, 72px); margin: 12px 0 14px; }
.lead { color: var(--muted); font-size: 17px; max-width: 46ch; }
.shared-note { margin-bottom: 16px; border-style: solid; border-color: color-mix(in srgb, var(--cyan) 40%, var(--line)); }

/* ---------- layout ---------- */
.layout { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; }
  .panel { position: sticky; top: calc(var(--topbar) + 20px); }
  .ribbon:not([hidden]) ~ main .panel { top: calc(var(--topbar) + 48px); }
}

/* ---------- checklist ---------- */
.checklist-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hint { margin-top: 2px; }
.tcards { list-style: none; display: grid; gap: 10px; align-items: start; }
@media (min-width: 640px) { .tcards { grid-template-columns: 1fr 1fr; } }

.tcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 14px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.tcard:hover { border-color: color-mix(in srgb, var(--muted) 60%, var(--line)); }
.tcard.is-on {
  border-color: color-mix(in srgb, var(--cyan) 55%, var(--line));
  background: color-mix(in srgb, var(--cyan) 5%, var(--card));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cyan) 25%, transparent);
}
.tcard-head {
  position: relative; display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tcard-head input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick {
  width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--dim);
  display: grid; place-items: center; margin-top: 1px; transition: background .15s, border-color .15s;
}
.tick svg { width: 14px; height: 14px; stroke: var(--btn-fg); stroke-width: 3; fill: none; opacity: 0; transition: opacity .12s; }
.tcard-head input:focus-visible ~ .tick { outline: 2px solid var(--cyan); outline-offset: 2px; }
.tcard.is-on .tick { background: var(--grad); border-color: transparent; }
.tcard.is-on .tick svg { opacity: 1; }

.tname { font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.3; }
.tprice { font-family: var(--font-display); font-weight: 700; font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tprice small { font-size: 12px; font-weight: 500; color: var(--muted); }
.tcomp { font-size: 13px; color: var(--muted); margin: 4px 0 0 38px; }

.tpick { margin: 12px 0 0 38px; display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--bg2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font: 500 13px/1.2 var(--font-body); cursor: pointer;
}
.chip:hover { color: var(--fg); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--fg); border-color: color-mix(in srgb, var(--cyan) 60%, var(--line)); background: color-mix(in srgb, var(--cyan) 10%, var(--bg2)); }
.chip[aria-pressed="true"]::before { content: "✓ "; color: var(--cyan); }
.plans { display: grid; gap: 6px; }
.planrow { display: grid; grid-template-columns: minmax(64px, max-content) minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; }
.planrow-name { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planrow select {
  width: 100%; min-width: 0; appearance: none; -webkit-appearance: none;
  background: var(--bg2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A9AAB' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 30px 8px 10px; font: 500 13px/1.2 var(--font-body); cursor: pointer;
}
.planrow select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }

.tshift { margin: 12px 0 0 38px; padding-top: 10px; border-top: 1px solid var(--line); }
.tshift .mono { font-size: 10px; letter-spacing: .2em; }
.tshift p { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.tshift .tusage { color: var(--dim); font-size: 12px; }
.tcard.is-on .tusage { color: var(--muted); }

/* ---------- result panel ---------- */
.panel {
  background: var(--bg2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  padding: 20px 18px; display: grid; gap: 16px;
}
.panel-empty p { color: var(--muted); font-size: 15px; }
.panel-live { display: grid; gap: 14px; }
.stat .label { display: block; font-size: 13px; color: var(--muted); }
.stat b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat.big b {
  font-size: 52px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat b small { font-size: 16px; font-weight: 600; letter-spacing: 0; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.stat .sub { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub strong { color: var(--fg); }

.meter-track { height: 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--grad); border-radius: 999px; transition: width .45s cubic-bezier(.2,.8,.2,1); }
.meter.is-over .meter-fill { background: linear-gradient(90deg, var(--grad-2), var(--magenta)); }
.meter-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-top: 6px; font-family: var(--font-mono); letter-spacing: .06em; }
.note.over { border-style: solid; border-color: color-mix(in srgb, var(--magenta) 50%, var(--line)); color: var(--fg); }

.reveal { font-size: 18px; line-height: 1.45; font-weight: 600; letter-spacing: -.01em; }
.reveal em { font-style: normal; color: var(--cyan); }

.share { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.share .btn { padding: 11px 8px; font-size: 14px; }
.status { min-height: 1.2em; margin-top: -8px; }

.cta { display: grid; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 16px; }
.cta .small:empty { display: none; }
.disclosure { font-size: 11px; color: var(--dim); line-height: 1.45; }

/* ---------- club levels ---------- */
.levels { padding: 36px 0 4px; }
.lvl-grid { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 760px) { .lvl-grid { grid-template-columns: repeat(3, 1fr); } }
.lvl { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.lvl .mono { font-size: 11px; }
.lvl-price { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.lvl-note { font-size: 13px; color: var(--muted); }
.lvl-fit { font-size: 14px; color: var(--fg); padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line); flex: 1; }
.lvl-link { font-size: 14px; color: var(--cyan); text-decoration: none; font-weight: 600; }
.lvl-link:hover { text-decoration: underline; }
.lvl-ent { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.lvl-ent b { font-family: var(--font-display); font-weight: 600; }
.lvl-ent .btn { width: auto; }
.note.earn { margin-top: 12px; font-size: 13px; line-height: 1.55; }
.note.earn a { color: var(--cyan); }

/* ---------- method ---------- */
.method { padding: 40px 0 8px; max-width: 720px; }
.facts { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.facts li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; color: var(--muted); }
.facts li b { color: var(--fg); }
.facts li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); flex: 0 0 8px; margin-top: 7px; box-shadow: 0 0 12px var(--cyan); }

footer { padding: 32px 0 24px; color: var(--dim); font-size: 13px; text-align: center; }
footer a { color: var(--muted); }

/* ---------- mobile sticky summary bar ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg2) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  transform: translateY(0); transition: transform .25s ease;
}
.bar.is-tucked { transform: translateY(110%); }
.bar-inner { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center; max-width: 560px; margin: 0 auto; }
.bar-col .label { display: block; font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.bar-col b { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bar-btn { width: auto; padding: 12px 16px; font-size: 15px; }
@media (min-width: 900px) { .bar { display: none; } body.has-bar { padding-bottom: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .meter-fill, .bar, .tcard { transition: none; }
}
