/* labs.square8.studio
   Metrics measured off square8.studio, not invented:
     display  84/40px, line-height 1.04, tracking -0.055em / -0.035em
     body     16px, line-height 1.6, measure 57ch (458px)
     sections flat 64px top and bottom
     labels   jetbrains mono 10.5px at 0.3em
     rules    hairline #232326, radii 3px, no shadows, no colour

   The earlier build used line-height 0.88 and clamped headings to 132px,
   which clipped ascenders and made every section feel heavy. Both are
   corrected here. */

:root {
  --black:  #000000;
  --l1:     #050506;
  --l2:     #08080a;
  --l3:     #0d0d0f;
  --line:   #232326;
  --line-2: #333337;
  --paper:  #f6f4f2;
  --dim:    #8a8a90;   /* 6.1:1 on black */
  --muted:  #7a7a80;   /* 4.7:1 on the #08080a panels, not just on pure black */

  --sans: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --pad:  clamp(22px, 4.5vw, 64px);
  --maxw: 1120px;
  --sec:  clamp(52px, 7vw, 76px);   /* section rhythm, parent uses a flat 64 */
  --r: 3px;
  --measure: 57ch;                  /* 458px at 16px, as the parent sets it */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--black); overflow-x: hidden; }
body {
  margin: 0; background: var(--black); color: var(--paper);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
svg { display: block; }
::selection { background: var(--paper); color: var(--black); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 60px; z-index: 90; background: var(--paper);
  color: var(--black); padding: 12px 18px; border-radius: var(--r); min-height: 32px; }

/* a visible focus ring everywhere — keyboard users had nothing before */
:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; border-radius: 2px; }

/* ---- type ------------------------------------------------------------- */
/* line-height 1.04 throughout the display sizes. never below 1 — that is
   what cut the tops off the letters. */

.giant, .big, h2.sec {
  font-family: var(--sans); font-weight: 800; margin: 0;
  line-height: 1.04; text-wrap: balance;
}
.giant { font-size: clamp(34px, 6.6vw, 76px); letter-spacing: -0.055em; }
.big   { font-size: clamp(28px, 4.6vw, 54px); letter-spacing: -0.045em; }
h2.sec { font-size: clamp(24px, 3.2vw, 40px); letter-spacing: -0.035em;
         margin-bottom: 16px; }
h3 { font-family: var(--sans); font-weight: 700; font-size: 17px;
     line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 8px; }
h4 { font-family: var(--sans); font-weight: 700; font-size: 13px;
     line-height: 1.35; letter-spacing: -0.01em; margin: 0 0 7px; }

.lede { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5;
        letter-spacing: -0.01em; color: var(--dim); max-width: var(--measure); }
.lede b, .lede em { color: var(--paper); font-weight: 500; font-style: normal; }
.body { font-size: 15px; line-height: 1.6; color: var(--dim); max-width: var(--measure); }
.fine { font-size: 12.5px; line-height: 1.6; color: var(--muted); max-width: 62ch; }

.num, .label, .chip, .stat .k, .field > label, .seg button, .ghost, .btn {
  font-family: var(--mono); font-weight: 400;
  font-size: 10.5px; letter-spacing: 0.3em; text-transform: uppercase;
}
.num { color: var(--muted); display: block; margin-bottom: 18px; }
.label { color: var(--muted); }

/* ---- nav -------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--pad);
  background: rgba(0,0,0,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px;
         font-weight: 700; font-size: 13px; letter-spacing: -0.03em; }
.brand .ring { flex: none; }
.brand span.sub { font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted); margin-left: 3px; }
.navlinks { display: flex; gap: 2px; }
.navlinks a { font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); padding: 7px 12px;
  border-radius: 999px; border: 1px solid transparent; transition: color .2s; }
.navlinks a { display: inline-flex; align-items: center; min-height: 32px; }
.navlinks a:hover { color: var(--paper); }
.navlinks a[aria-current="page"] { color: var(--paper); border-color: var(--line-2); }
/* Below 620 the brand and four links cannot share one row: the bar measured
   446px inside a 390px viewport and made every page scroll sideways. The
   links drop to their own full-width row instead of being squeezed. */
@media (max-width: 620px) {
  .nav { flex-wrap: wrap; row-gap: 4px; padding: 10px var(--pad) 8px; }
  .brand span.sub { display: none; }
  .navlinks { width: 100%; justify-content: space-between; gap: 0; }
  .navlinks a { padding: 7px 8px; letter-spacing: .1em; }
}

/* ---- layout ----------------------------------------------------------- */

.hero { padding: clamp(56px, 9vh, 96px) var(--pad) var(--sec); }
.band { padding: var(--sec) var(--pad); border-top: 1px solid var(--line); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.wrap.wide { max-width: 1280px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.head { margin-bottom: 34px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* two even columns, generous gutter, never narrower than a readable measure */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 28px 40px; }
.cols3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
         gap: 1px; background: var(--line); border: 1px solid var(--line);
         border-radius: var(--r); overflow: hidden; }
.cols3 > div { background: var(--black); padding: 22px; }

/* the mark: present, but a signature rather than a backdrop. it sits above
   the section label, in the flow, so nothing can run underneath it. */
.hero-ring { width: 88px; height: 88px; margin: 0 0 30px; }
.hero-ring svg { width: 88px; height: 88px; }
.brand .ring { width: 22px; height: 22px; }
@media (max-width: 620px) {
  .hero-ring, .hero-ring svg { width: 64px; height: 64px; }
  .hero-ring { margin-bottom: 22px; }
}

/* ---- forms ------------------------------------------------------------ */

.field { margin-bottom: 20px; }
.field > label { display: block; color: var(--muted); margin-bottom: 8px; }
.field .help { font-size: 14px; line-height: 1.55; color: var(--dim);
               margin: 0 0 9px; max-width: var(--measure); }
/* Listing the types by name meant type=password was missed entirely when the
   sign-in form arrived — it rendered at 21px with none of the site's styling.
   Excluding the few that must not be restyled is the safer direction: a new
   input type inherits the look instead of escaping it. */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=submit]):not([type=button]),
textarea, select {
  width: 100%; font-family: var(--sans); font-size: 15px; line-height: 1.5;
  color: var(--paper); background: var(--l2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px;
  transition: border-color .2s, background .2s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--paper); background: var(--l3); }
select { appearance: none; }
::placeholder { color: #4e4e53; }

/* the one oversized input, still with room above the glyphs */
.hero-search textarea {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(19px, 2.4vw, 30px); line-height: 1.3; letter-spacing: -0.035em;
  min-height: 112px; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 2px 14px;
  max-width: 22ch;
}
.hero-search textarea:focus { background: transparent; border-bottom-color: var(--paper); }
@media (min-width: 700px) { .hero-search textarea { max-width: 28ch; } }

.btn, .ghost { cursor: pointer; border-radius: 999px;
  transition: background .2s, color .2s, border-color .2s; }
.btn { border: 1px solid var(--paper); background: var(--paper); color: var(--black);
       padding: 12px 24px; }
.btn:hover { background: transparent; color: var(--paper); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--dim);
         padding: 8px 15px; }
.ghost:hover { color: var(--black); background: var(--paper); border-color: var(--paper); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
       overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--muted); border: 0;
              padding: 9px 15px; cursor: pointer; line-height: 1.4; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--black); }

/* ---- cards, lists ----------------------------------------------------- */

.card { border: 1px solid var(--line); border-radius: var(--r);
        background: var(--l2); padding: 22px; }
.card + .card { margin-top: 12px; }

.listing { display: grid; gap: 1px; background: var(--line);
           border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { background: var(--black); padding: 22px;
        display: grid; grid-template-columns: 54px minmax(0,1fr) auto;
        gap: 22px; align-items: start; transition: background .2s; }
.item:hover { background: var(--l2); }
.item > div { min-width: 0; }                 /* let long titles wrap, not overflow */
.item h3 { overflow-wrap: anywhere; }
.item .votes { text-align: center; }
.item .votes .n { font-family: var(--sans); font-weight: 800; font-size: 21px;
  line-height: 1.1; letter-spacing: -0.04em; display: block; }
.item .votes button { margin-top: 6px; width: 100%; cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); padding: 4px 0; font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; line-height: 1.6; }
.item .votes button:hover { color: var(--black); background: var(--paper);
  border-color: var(--paper); }
.item h3 a { display: inline-block; min-height: 24px; }
.item h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px;
  align-items: center; font-family: var(--mono); font-size: 10px;
  letter-spacing: .08em; color: var(--muted); text-transform: uppercase; line-height: 1.7; }
.item .price { text-align: right; font-family: var(--mono); font-size: 12px;
  line-height: 1.6; white-space: nowrap; }
.item .price small { display: block; color: var(--muted); font-size: 10px;
  letter-spacing: .22em; text-transform: uppercase; margin-bottom: 4px; }
@media (max-width: 720px) {
  .item { grid-template-columns: 44px minmax(0,1fr); gap: 16px; }
  .item .price { grid-column: 2; text-align: left; margin-top: 10px; white-space: normal; }
}

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); font-size: 10px;
  letter-spacing: .12em; line-height: 1.7; }
.chip.on, .chip.urgent, .chip.gold { color: var(--paper); border-color: var(--paper); }
.chip.open, .chip.idea { color: var(--dim); border-color: var(--line-2); }

/* the inline comment thread under a community post */
.thread { margin-top: 14px; }
.thread .fine { margin-bottom: 4px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; }
.stat { background: var(--black); padding: 16px 18px; min-width: 0; }
.stat .k { display: block; color: var(--muted); margin-bottom: 6px; line-height: 1.6; }
.stat .v { font-family: var(--sans); font-weight: 800; font-size: 21px;
  line-height: 1.2; letter-spacing: -0.04em; overflow-wrap: anywhere; }

.bar { height: 1px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--paper); width: 0; }

.split-bar { display: flex; height: 34px; border: 1px solid var(--line);
             border-radius: var(--r); overflow: hidden; }
.split-bar span { display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  border-right: 1px solid var(--line); min-width: 0; }
.split-bar span:last-child { border-right: 0; }
.split-bar .b0 { background: var(--paper); color: var(--black); }
.split-bar .b1 { background: #959593; color: var(--black); }
.split-bar .b2 { background: #565657; color: var(--paper); }
.split-bar .b3 { background: var(--l3); color: var(--dim); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 11.5px; }
thead th { background: var(--l2); color: var(--muted); text-align: left;
  padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap;
  font-weight: 400; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
tbody td { padding: 10px 13px; border-bottom: 1px solid var(--line); line-height: 1.6; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--l2); }
/* .num is the block-level section label; table alignment is .ta-r.
   They used to share a class, which gave every <th class="num"> a
   display:block and an 18px margin and collapsed the table. */
th.ta-r, td.ta-r { text-align: right; }

.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 52px minmax(0,1fr);
  gap: 22px; padding: 20px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(s, decimal-leading-zero);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .3em;
  color: var(--muted); line-height: 1.9; }
.steps p { font-size: 14.5px; line-height: 1.6; color: var(--dim);
  margin: 0; max-width: var(--measure); }

.notice { border-left: 1px solid var(--line-2); padding: 2px 0 2px 18px; }
.msg { padding: 11px 15px; border-radius: var(--r); font-size: 12.5px;
  line-height: 1.6; border: 1px solid var(--line-2); font-family: var(--mono);
  letter-spacing: .03em; }
.msg.ok { border-color: var(--paper); color: var(--paper); }
.msg.err { border-color: #959593; color: #d9d9d6; }
.empty, .loading { padding: 28px; color: var(--muted); font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; text-align: center; }

footer { padding: var(--sec) var(--pad) 44px; border-top: 1px solid var(--line); }
.footmark { font-family: var(--sans); font-weight: 800;
  font-size: clamp(38px, 8vw, 92px); letter-spacing: -0.06em; line-height: 1.02;
  margin: 0 0 20px; }
footer p { font-size: 12.5px; line-height: 1.7; color: var(--dim); max-width: 62ch; }
footer .fine { color: var(--muted); }
footer a { display: inline-block; padding: 7px 0; min-height: 32px; }
footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- motion ----------------------------------------------------------- */
/* Nothing is hidden by CSS — the pre-animation state is set from JavaScript
   after anime.js loads, so a blocked script leaves a readable page. No
   overflow masking on text either: that is what clipped the ascenders. */
[data-anim] { will-change: transform, opacity; }
.split-bar span { transform-origin: left; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* the live indicator — a dot and a word, nothing that competes with the page */
.live { display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted); }
.live i { width: 6px; height: 6px; border-radius: 50%;
  background: var(--line-2); flex: none; transition: background .3s; }
.live.on i { background: var(--paper); }
.live.ping i { animation: livePing .7s ease-out; }
@keyframes livePing {
  0%   { transform: scale(1);   box-shadow: 0 0 0 0 rgba(246,244,242,.55); }
  100% { transform: scale(1);   box-shadow: 0 0 0 9px rgba(246,244,242,0); }
}
@media (prefers-reduced-motion: reduce) { .live.ping i { animation: none; } }

/* ---- the frontier (PRD §9) --------------------------------------------
   One screen, one question. It is allowed to be mostly empty; that is the
   point of it. */
.frontier { display: flex; flex-direction: column; min-height: 100vh; }
/* align-items:center clips the top of anything taller than the viewport,
   so the stage is top-aligned and the first screen is claimed by .ask-first
   instead. */
.ask { flex: 1; display: flex; align-items: flex-start;
  padding: clamp(40px,7vh,80px) var(--pad) 0; }
.ask > .stage { max-width: 760px; margin: 0 auto; width: 100%; }
.ask-first { display: flex; flex-direction: column; justify-content: center;
  min-height: min(74vh, 620px); }

/* ---- what makes this different (home) --------------------------------- */
.diff { margin-top: clamp(64px, 12vh, 120px); border-top: 1px solid var(--line);
  padding: var(--sec) 0; }
/* Four items in an auto-fit grid resolved to 3 + 1 orphan at 1440. Two
   columns keeps them balanced at every width the 760px column allows. */
.diff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 44px; }
@media (max-width: 560px) { .diff-grid { grid-template-columns: 1fr; gap: 28px; } }

/* The frontier column is 760px; the shared footer is 1120px, which left the
   footer starting 180px to the left of the question above it. Match them. */
.frontier footer .wrap { max-width: 760px; }
.diff-grid .num { margin-bottom: 12px; }
.diff-grid h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.025em;
  line-height: 1.25; margin: 0 0 8px; }
.diff-grid p { font-size: 14.5px; line-height: 1.6; color: var(--dim); margin: 0; }
.diff-close { margin: 40px 0 0; padding-top: 26px; border-top: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.65; color: var(--muted); max-width: 68ch; }
.diff-close a { color: var(--paper); border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px; white-space: nowrap; }
.diff-close a:hover { border-bottom-color: var(--paper); }
.ask-sub { margin: 22px 0 34px; }
.ask-actions { display: flex; flex-wrap: wrap; gap: 12px 16px;
  align-items: center; margin-top: 18px; }

#seed {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(20px,2.8vw,32px); line-height: 1.3; letter-spacing: -0.035em;
  min-height: 118px; background: transparent; border: 0;
  border-bottom: 1px solid var(--line); border-radius: 0; padding: 6px 2px 16px;
}
#seed:focus { background: transparent; border-bottom-color: var(--paper); }

/* ---- the intake conversation (PRD §10) ------------------------------- */
.talk { display: flex; flex-direction: column; gap: 14px;
  max-height: 56vh; overflow-y: auto; padding-right: 6px; margin-bottom: 22px; }
.bubble { max-width: 92%; }
.bubble.agent { align-self: flex-start; }
.bubble.you { align-self: flex-end; text-align: right;
  border-right: 1px solid var(--line-2); padding-right: 14px; }
.b-say { margin: 0; font-size: clamp(16px,1.7vw,20px); line-height: 1.45;
  letter-spacing: -0.012em; }
.bubble.agent .b-say { color: var(--paper); }
.bubble.you .b-say { color: var(--dim); }
.b-help { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted);
  max-width: 56ch; }
.b-choices { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.b-choices .ghost { font-size: 10px; }
#reply { font-size: 17px; }
#talk-progress { font-family: var(--mono); font-size: 10px;
  letter-spacing: .2em; color: var(--muted); margin-left: auto; }

/* ---- the brief -------------------------------------------------------- */
.brief-row { padding: 14px 0; border-top: 1px solid var(--line); }
.brief-row:first-of-type { border-top: 0; }
.brief-row .label { display: block; color: var(--muted); margin-bottom: 6px; }
.brief-row .body { margin: 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin-top: 12px; }
.compare > div { background: var(--black); padding: 18px 20px; }
.compare .label { display: block; color: var(--muted); margin-bottom: 8px; }
.compare .body { margin: 0; color: var(--paper); font-size: 15px; line-height: 1.5; }
.compare > div:last-child .body { font-weight: 700; letter-spacing: -0.02em; }

/* ---- cycles, shown everywhere a price is shown ------------------------ */
.cycles { font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--paper); }
.cycles b { font-weight: 500; }

/* ---- dialogs ----------------------------------------------------------
   Replaces window.prompt, which rendered in the browser's chrome as
   "labs.square8.studio says" and looked like something to dismiss. */

.modal { border: 0; padding: 0; background: transparent;
  max-width: min(520px, calc(100vw - 32px)); width: 100%; color: var(--paper); }
.modal::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(2px); }
.modal-panel { border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--l2); padding: clamp(20px, 4vw, 30px);
  /* a four-option dialog measured 664px tall — taller than an iPhone SE,
     so the panel scrolls inside itself rather than off the screen */
  max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal-panel h2 { font-family: var(--sans); font-weight: 800; font-size: 23px;
  line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 10px; }
.modal-note { font-size: 14px; line-height: 1.6; color: var(--dim);
  margin: 0 0 20px; max-width: 46ch; }
.modal-note.err { color: #d9d9d6; }
.modal .field:last-of-type { margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap; }

/* a radio group that looks like the rest of the site rather than like a form */
.choice { display: flex; flex-direction: column; gap: 7px; }
.choice button { text-align: left; cursor: pointer; font: inherit;
  font-size: 14px; padding: 11px 15px; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: transparent; color: var(--dim); }
.choice button:hover { border-color: var(--line-2); color: var(--paper); }
.choice button[aria-checked="true"] { background: var(--paper);
  border-color: var(--paper); color: var(--black); }

/* ---- touch --------------------------------------------------------------
   Measured on a 375px viewport: nav links came out 32px tall, footer links
   34px, filter pills 33px. All clear the 24px WCAG 2.5.8 minimum and all of
   them are still uncomfortable on a phone. On coarse pointers everything
   tappable gets 44px, which is the only number that matters here. */

@media (pointer: coarse), (max-width: 900px) {
  .navlinks a { min-height: 44px; padding-top: 0; padding-bottom: 0; }
  .brand { min-height: 44px; }
  footer a { min-height: 44px; padding: 11px 0; }
  .seg button { min-height: 44px; padding-top: 0; padding-bottom: 0; }
  .votes button, .price button, .ghost, .btn { min-height: 44px; }
  /* .diff-close and other inline prose links are deliberately left alone:
     WCAG 2.5.8 exempts links inside a sentence, and padding them out
     breaks the line rhythm of the paragraph they sit in. */
  .choice button { min-height: 48px; }
}

/* A table that scrolls sideways with no sign that it does is a table with
   hidden columns. Fade the right edge while there is more to reach. */
.tablewrap { position: relative; }
.tablewrap.can-scroll::after {
  content: ''; position: absolute; top: 1px; right: 1px; bottom: 1px; width: 48px;
  pointer-events: none; border-radius: 0 var(--r) var(--r) 0;
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.92));
}
.tablewrap.can-scroll { scrollbar-width: thin; }
.scroll-hint { font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin: 8px 0 0; }

/* ---- reputation (PRD §34) ----------------------------------------------
   Six dimensions rather than one score. The bars are deliberately quiet:
   this is evidence, not a scoreboard. */
.dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 6px 22px; margin: 0 0 12px; max-width: 520px; }
.dim { display: grid; grid-template-columns: 72px 1fr 26px; align-items: center; gap: 8px; }
.dim-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); }
.dim-bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.dim-bar i { display: block; height: 100%; background: var(--dim); }
.dim-v { font-family: var(--mono); font-size: 10px; color: var(--dim); text-align: right; }
.builder .meta { margin-top: 2px; }
@media (max-width: 620px) {
  .dims { grid-template-columns: 1fr; gap: 5px; }
  .dim { grid-template-columns: 76px 1fr 26px; }
}
/* links inside table cells were 28x15 — too small to hit on a phone */
td a { display: inline-block; padding: 12px 10px; margin: -12px -10px;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-2); }
td a:hover { text-decoration-color: var(--paper); }

/* ---- demo marker --------------------------------------------------------
   Seeded example content. It sits top-left of the card it belongs to and is
   deliberately quiet — enough that nobody mistakes a seeded build for a real
   payout, not so loud it fights the content. */
.item, .card { position: relative; }
.demo-tag {
  position: absolute; top: -1px; left: -1px; z-index: 2;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .18em;
  text-transform: uppercase; line-height: 1;
  padding: 4px 7px; color: var(--black); background: var(--dim);
  border-radius: var(--r) 0 var(--r) 0;
}
.demo-note { font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; display: inline-block; }

/* ---- policy link in the footer ---------------------------------------- */
.policy-link { display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 9px 16px; margin-top: 6px; min-height: 44px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim); }
.policy-link:hover { color: var(--black); background: var(--paper);
  border-color: var(--paper); }
.policy-link:hover svg [stroke] { stroke: currentColor; }
.policy-link svg { width: 13px; height: 13px; flex: none; }
footer .foot-line + .policy-link { margin-bottom: 14px; }

/* "forgotten your password?" is an action, not a sentence, so it gets a
   tappable box even though it sits in fine print. */
.field + .fine a, .card .fine a { display: inline-block; padding: 12px 2px;
  min-height: 44px; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-2); }
.card .fine a:hover { text-decoration-color: var(--paper); }

/* ---- not open yet ------------------------------------------------------ */
.uc-icon { width: 44px; height: 44px; color: var(--dim); }
.modal-panel .uc-icon { width: 34px; height: 34px; margin-bottom: 14px; }
