/* 0.47.0 layout for the landing page, PassLab and Firm Match (dev file v5: 1.0, 1.1, 3.1, 4.1, 4.2, 5.1-5.4).
   Loaded after style.css. Mobile (under 900px) keeps today's look except where a rule says otherwise. */

/* ── 1.1 Result cards under the demo (all widths): space is reserved, so nothing jumps ─────────────────────── */
.hook-grid, .hook-text, .hook-demo { display: contents; }
.tg-results { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 8px; }
.tg-results .tg-lock, .tg-results .tg-saved { position: static; margin: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  padding: 6px 14px; min-height: 54px; border-radius: 14px; visibility: hidden; opacity: 0; transition: opacity .3s ease; }
.tg-results .tg-lock.on, .tg-results .tg-saved.on { visibility: visible; opacity: 1; }
.tg-results .tg-lock { background: rgba(255, 61, 127, .1); border: 1px solid rgba(255, 61, 127, .45); }
.tg-results .tg-saved { background: rgba(198, 255, 61, .08); border: 1px solid var(--accent-line, rgba(198, 255, 61, .4)); color: var(--ink); }
.tg-results small { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tg-results .tg-lock span { font: 800 1.35rem/1.1 var(--mono); color: var(--pink); }
.tg-results .tg-saved b { font: 800 1.35rem/1.1 var(--mono); letter-spacing: -.03em; color: var(--accent); }
.tg-note { grid-column: 1 / -1; margin: 0; font-size: .6rem; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hook-demo .p-hint, .p-hook > .p-hint { margin-top: 6px; }
.works-on, .steps-band { display: none; }

/* ── 1.0 Landing page on desktop: a normal page, up to 1280px, no phone frame ─────────────────────────────── */
@media (min-width: 900px) {
  html.feed-page { scroll-padding-top: var(--header-h); }
  .feed-stage { display: block; padding: var(--header-h) 0 0; }
  .feed-phone { width: auto; height: auto; border: 0; outline: 0; border-radius: 0; overflow: visible; background: none; box-shadow: none; }
  .feed { height: auto; overflow: visible; scroll-snap-type: none; max-width: 1344px; margin: 0 auto; padding: 0 32px; }
  .feed-dots, .feed-phone .feed-cta { display: none; }
  .panel { min-height: 0; padding: 72px 0; scroll-snap-align: none; justify-content: flex-start; gap: 6px; overflow-wrap: normal; }
  .panel:nth-child(even) { background: none; }
  .panel h1 { font-size: clamp(2.8rem, 4.2vw, 3.9rem); line-height: 1.05; letter-spacing: -.03em; margin: 12px 0 18px; }
  .panel h2 { font-size: 2.1rem; margin: 6px 0 8px; }
  .p-lede { font-size: 1.1rem; max-width: 62ch; }
  .p-hint { display: none; }

  /* hero: text beside the demo */
  .p-hook { padding: 56px 0 32px; border-bottom: 0; }
  .hook-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 64px; align-items: center; }
  .hook-text, .hook-demo { display: block; }
  .hook-text .p-lede { font-size: 1.2rem; }
  .hook-text .launch-offer { max-width: 560px; }
  .hook-demo .tg-card { padding: 24px; border-radius: 22px; }
  .hook-demo .feed-demo .tg-score b { font-size: 3.6rem; }
  .hook-demo .feed-demo .tg-score span { font-size: 1.3rem; }
  .hook-demo .feed-demo .tg-meter { height: 12px; }
  .hook-demo .feed-demo .tg-feed { height: 8.4em; font-size: .86rem; margin-top: 14px; }
  .tg-results { margin-top: 16px; gap: 8px 14px; }
  .tg-note { font-size: .7rem; }
  .tg-results .tg-lock, .tg-results .tg-saved { min-height: 84px; padding: 14px 18px; border-radius: 16px; }
  .tg-results .tg-lock span, .tg-results .tg-saved b { font-size: 2rem; }

  /* Works on */
  .works-on { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin: 8px 0 0; padding: 16px 24px; border: 1px solid var(--navy-line);
    border-radius: 16px; background: rgba(255, 255, 255, .02); }
  .wo-l { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .wo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
  .wo-list li { font-weight: 800; color: var(--ink); font-size: 1.05rem; }
  .wo-r { margin-left: auto; color: var(--ink-2); font-size: .95rem; }
  .wo-r b { color: var(--accent); }

  /* Which trader: four across */
  .tt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .tt-btn { min-height: 148px; padding: 22px; }
  .tt-btn b { font-size: 1.1rem; }

  /* 10-second check: text and sliders side by side */
  .p-check { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); column-gap: 56px; grid-template-rows: auto auto 1fr; align-items: start; }
  .p-check .eyebrow, .p-check h2, .p-check .p-lede { grid-column: 1; }
  .p-check .feed-quiz { grid-column: 2; grid-row: 1 / span 3; padding: 28px; gap: 20px; align-self: center; }
  .feed-quiz output { min-width: 4.2ch; text-align: right; white-space: nowrap; }

  /* How Tilt Guard steps in */
  .steps-band { display: block; padding: 72px 0; border-bottom: 1px solid var(--navy-line); }
  .steps-band h2 { font-size: 2.1rem; margin: 0 0 8px; }
  .steps-3 { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .steps-3 li { padding: 20px 22px; border-radius: 16px; background: var(--navy-2); border: 1px solid var(--navy-line); border-top: 3px solid var(--st, var(--accent)); }
  .steps-3 small { display: block; margin-bottom: 8px; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--st, var(--accent)); }
  .steps-3 span { color: var(--ink); line-height: 1.5; }
  .st-warn { --st: #F5A623; } .st-pause { --st: #9B7BFF; } .st-lock { --st: #FF3D7F; }

  /* Rulebook: heading and numbers left, latest changes right */
  .p-rules { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 56px; align-content: center; }
  .p-rules > * { grid-column: 1; }
  .p-rules .rb-h, .p-rules .rb-changes { grid-column: 2; }
  .p-rules .rb-h { grid-row: 1; margin: 0 0 8px; }
  .p-rules .rb-changes { grid-row: 2 / span 5; align-self: start; }
  .p-rules .rb-changes li { font-size: .92rem; }
  .p-rules .rb-stats { max-width: 420px; }

  /* The kit: cards in rows */
  .kit-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .kit-list a { padding: 22px; min-height: 124px; border-radius: 16px; }
  .kit-list b { font-size: 1.1rem; }
  .p-kit .p-small { margin-top: 18px; }

  /* Join: centred */
  .p-join { max-width: 620px; margin: 0 auto; width: 100%; align-items: stretch; border-bottom: 0; }
}
@media (min-width: 900px) and (max-width: 1100px) {
  .hook-grid { gap: 36px; }
  .tt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-3, .kit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 3.1 Safari: values next to the sliders never wrap ───────────────────────────────────────────────────────── */
.feed-quiz output, .quiz output, output.c-calm, output.c-caution, output.c-stop { white-space: nowrap; min-width: 3.4ch; text-align: right; font-variant-numeric: tabular-nums; flex: none; }

/* ── 4.1 One minus / plus stepper; no native spinners anywhere ───────────────────────────────────────────────── */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.stepper { display: flex; align-items: stretch; width: 100%; min-height: 48px; border: 1.5px solid var(--line-2, rgba(255,255,255,.18)); border-radius: 12px;
  background: var(--surface, #0f1020); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.stepper:focus-within { border-color: var(--cyan, #2EE6FF); box-shadow: 0 0 0 4px rgba(46, 230, 255, .16); }
.pl .stepper input[type=number], .adv-form .stepper input[type=number], .stepper input[type=number] {
  flex: 1 1 auto; min-width: 0; width: auto; padding: 10px 4px; text-align: center; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--ink); }
.stepper input[type=number]:focus { box-shadow: none; outline: none; border: 0; }
.st-btn { flex: none; width: 48px; border: 0; padding: 0; background: rgba(198, 255, 61, .08); color: var(--accent, #C6FF3D); font: 700 1.35rem/1 var(--font, inherit);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background .12s; }
.st-btn:hover { background: rgba(198, 255, 61, .18); }
.st-btn:active { background: rgba(198, 255, 61, .3); }

/* ── 4.2 PassLab results on desktop: up to 1280px, three rows ───────────────────────────────────────────────── */
html.res-wide, html.fm-wide { --max: 1328px; }   /* 1280px of content plus the 24px gutters */
@media (min-width: 1000px) {
  .res-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin-top: 4px; }
  .res-grid > * { grid-column: 1 / -1; order: 5; margin: 0; min-width: 0; max-width: none; width: auto; }
  /* row 1: the big pass chance + the stat cards */
  .res-grid > .verdict { grid-column: span 5; order: 1; max-width: none; grid-template-columns: 1fr; gap: 14px; padding: 26px 28px; align-self: stretch; }
  .res-grid > .verdict .verdict-side { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
  .res-grid > .stats4 { grid-column: span 7; order: 1; max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .res-grid > .stats4 > div { padding: 22px; align-content: center; }
  /* row 2: the runs chart, full width (the history and two-phase cards sit just above it) */
  .res-grid > .hist-card, .res-grid > .res-funded { order: 2; }
  .res-grid > .res-runs { order: 3; }
  /* row 3: Tilt Guard card beside "How much room does your edge have?" */
  .res-grid > .guard-nudge, .res-grid > .fragility { grid-column: span 6; order: 4; }
  .res-grid:not(:has(.fragility)) > .guard-nudge { grid-column: 1 / -1; }
  .res-grid > .guard-nudge { display: flex; flex-direction: column; }
  .res-grid > .guard-nudge .gn-clip { max-width: 100%; height: auto; }
  .res-grid .table-wrap { overflow-x: auto; }
  /* the fan chart stretches to the card's width at a sensible height (the paths are plain lines, so nothing distorts) */
  .res-runs .paths-svg { height: 360px; }
  .res-runs .paths-svg * { vector-effect: non-scaling-stroke; }
}

/* ── 5.1 / 5.2 Firm Match form: equal boxes, 3 across on desktop, 2 on phones, one-line labels, notes in (i) tips ─ */
.adv-form .fields.fm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; align-items: stretch; }
.adv-form .fields.fm-grid > label { display: grid; grid-template-rows: 22px 48px; gap: 6px; align-content: start; min-width: 0; }
.adv-form .fields.fm-grid > label > select, .adv-form .fields.fm-grid > label > input { height: 48px; min-height: 48px; box-sizing: border-box; }
.adv-form .fields.fm-grid > label .stepper { height: 48px; min-height: 48px; }
.fm-grid .lbl { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: .9rem; }
@media (min-width: 720px) { .adv-form .fields.fm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; } }
.tip { position: relative; display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; font-size: .7rem; font-weight: 700;
  font-style: normal; color: var(--muted); border: 1px solid var(--line-2, rgba(255,255,255,.25)); cursor: help; }
.tip::before { content: "i"; }
.tip:hover, .tip:focus { color: var(--accent, #C6FF3D); border-color: var(--accent, #C6FF3D); outline: none; }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-30%); width: max-content; max-width: 240px;
  padding: 8px 10px; border-radius: 10px; background: var(--night, #0b0c18); color: #fff; border: 1px solid var(--line-2, rgba(255,255,255,.25));
  font: 500 .78rem/1.35 var(--font, inherit); white-space: normal; text-align: left; opacity: 0; visibility: hidden; pointer-events: none; z-index: 20; transition: opacity .12s; }
.tip:hover::after, .tip:focus::after { opacity: 1; visibility: visible; }
.adv-form .fields.fm-grid > .fm-check { grid-column: 1 / -1; display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 28px; font-weight: 600; }
.adv-form .fields.fm-grid > .fm-check input { width: 18px; height: 18px; flex: none; margin: 0; }

/* ── 5.3 Challenge prices ────────────────────────────────────────────────────────────────────────────────────── */
.cp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 6px; }
.cp-cur { display: inline-flex; border: 1.5px solid var(--line-2, rgba(255,255,255,.2)); border-radius: 999px; overflow: hidden; }
.cp-cur[hidden], .cp-rate[hidden] { display: none; }
.cp-cur button { border: 0; background: transparent; color: var(--ink-2, inherit); padding: 8px 16px; min-height: 40px; font: 700 .85rem var(--font, inherit); cursor: pointer; }
.cp-cur button[aria-pressed=true] { background: var(--accent, #C6FF3D); color: var(--night, #0b0c18); }
.cp-rate { font-size: .8rem; color: var(--muted); }
.cp-wrap { overflow-x: auto; margin-top: 8px; }
.cp-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cp-table th, .cp-table td { padding: 8px 7px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); font-size: .9rem; white-space: nowrap; }
.cp-table thead th { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.cp-table tbody th { font-weight: 650; }
.cp-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 8px; font-size: .68rem; font-weight: 750;
  background: rgba(255,255,255,.06); border: 1px solid var(--line-2, rgba(255,255,255,.2)); color: var(--ink); vertical-align: middle; }
.cp-table td.cp-listed, .cp-table td.cp-delta { text-align: right; }
.cp-table thead th:nth-child(4), .cp-table thead th:nth-child(6) { text-align: right; }
.cp-listed small, .cp-orig, .cp-orig-l { display: block; font-size: .72rem; color: var(--muted); }
.cp-orig:empty { display: none; }
/* 0.49.3 (item 6): the firm's own currency code beside the typed price */
.cp-own { font-size: .72rem; color: var(--muted); margin-left: .25rem; }
.cp-table tr[data-lime] .cp-listed, .cp-table tr.lime .cp-listed { color: var(--accent, #C6FF3D); font-weight: 700; }
.cp-your { position: relative; }
/* 0.49.4: long firm and challenge names wrap, so the table fits its 719 px box at desktop width without a sideways scroll */
.cp-table tbody th, .cp-table td.cp-prog { white-space: normal; min-width: 120px; }
/* 0.49.5: padding 7 px, stepper 124 px, buttons 32 px: the table was 730 px in 719 and clipped the delta column */
/* 0.49.4: a compact stepper so the firm currency code sits beside it and the column fits the table at desktop width */
.cp-your .stepper { display: inline-flex; width: 124px; min-height: 40px; vertical-align: middle; }
.cp-your .stepper input[type=number] { min-width: 0; width: 100%; padding-left: 4px; padding-right: 4px; }
.cp-your .st-btn { width: 32px; }
.cp-your .stepper input[type=number] { font-size: .95rem; }
.cp-your .stepper input[type=number]::placeholder { font-size: .78rem; font-weight: 500; }
.cp-dot { display: none; position: absolute; left: -2px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--accent, #C6FF3D); }
.cp-table tr.edited .cp-dot { display: block; }
.cp-delta.save { color: var(--accent, #C6FF3D); font-weight: 700; }
.cp-delta.up { color: var(--ink-2); }
.cp-box > summary .opt { margin-left: 8px; font-weight: 500; color: var(--muted); font-size: .85rem; }
@media (max-width: 719px) {
  .cp-table, .cp-table tbody, .cp-table tr, .cp-table th, .cp-table td { display: block; }
  .cp-table thead { display: none; }
  .cp-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .cp-table th, .cp-table td { border: 0; padding: 3px 0; white-space: normal; text-align: left !important; }
  .cp-table td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 96px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .cp-table td.cp-your { padding-left: 14px; }
  .cp-table td.cp-your::before { display: block; margin-bottom: 4px; }
  .cp-dot { left: 0; top: 34px; margin: 0; }
}

/* ── 5.4 Firm Match results: wide on desktop. One line per firm (rank, firm, cost and days, pass chance); the rest sits under Details (0.54.0) ── */
@media (min-width: 1000px) {
  .fm-wide .adv-results { max-width: none; }
  .fm-wide .adv-card { grid-template-columns: 44px minmax(0, 1fr) 230px; column-gap: 24px; align-items: start; }
  .fm-wide .adv-more .risk-find { max-width: 560px; }
}

/* the generic ".form button" (big lime CTA) must not restyle the stepper buttons inside forms */
.form .stepper .st-btn { display: block; width: 48px; margin: 0; padding: 0; border-radius: 0; gap: 0; background: rgba(198, 255, 61, .08); color: var(--accent, #C6FF3D);
  font: 700 1.35rem/1 var(--font, inherit); box-shadow: none; }
.form .stepper .st-btn:hover { background: rgba(198, 255, 61, .18); }
.form .cp-your .stepper .st-btn { width: 32px; }
.form .cp-cur button { display: block; width: auto; margin: 0; border-radius: 0; gap: 0; padding: 8px 16px; box-shadow: none; background: transparent; color: var(--ink-2, inherit); font: 700 .85rem var(--font, inherit); }
.form .cp-cur button[aria-pressed=true] { background: var(--accent, #C6FF3D); color: var(--night, #0b0c18); }
/* 0.49.4: each listed price carries its check date; a price older than 14 days reads "price being rechecked" */
.cp-listed .cp-lv { display: block; }
.cp-listed small.cp-chk { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.cp-table td.cp-recheck { color: var(--muted); white-space: normal; }
.cp-table td.cp-recheck .cp-lv { font-style: italic; }
