/* ============================================================================================
   CAPZILLA — platform pages (auth, pricing builder, tools, leaderboard, dashboard)

   Kept separate from app.css so the marketing pages and the signed-in app can be reasoned about
   independently — but it is the SAME system: hairlines and ground changes rather than floating
   cards, mono for every number, dark slabs where the lime is allowed to live.
   ============================================================================================ */

/* ----------------------------------------------------------------------------------- forms
   There were no form styles anywhere in the system — label, input and select were rendering as raw
   browser defaults on the login page, the plan builder and the profile. Native controls sit at
   about 13px Arial with a rounded blue-grey border, which is the single most recognisable "unstyled
   page" signal there is, and it was on the first screen a new customer sees.

   Everything here is square, hairline and mono, to match the rest: a form is data entry, and data
   is mono everywhere else on this site. */
label {
  display: block; margin-bottom: 7px;
  font: 500 12px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
}
label .muted { text-transform: none; letter-spacing: 0; }

/* A label that WRAPS its control is a different object from a label that captions one: it is a
   clickable row, not a field heading, so it must not inherit the uppercase mono treatment. */
label.check {
  display: flex; gap: 11px; align-items: flex-start; cursor: pointer; margin-bottom: 0;
  font: 400 14px/1.5 var(--disp); letter-spacing: 0; text-transform: none; color: var(--ink);
}
label.check .sub { display: block; margin-top: 2px; font: 400 12px/1.45 var(--mono); color: var(--ink-3); }

/* `input` with no type attribute defaults to text but is NOT matched by [type=text] — which is why
   every field written as a bare <input> (the display name, the whole solve tester) stayed native
   while the typed ones picked up the styling. Match by exclusion instead. */
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=search], input[type=tel], select, textarea {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 46px; padding: 0 14px; border-radius: 2px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 400 14.5px/1 var(--disp);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { height: auto; min-height: 110px; padding: 13px 14px; line-height: 1.55; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }

input:not([type=checkbox]):not([type=range]):hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--ink-3); }
input:not([type=checkbox]):not([type=range]):focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--green); background: #fff;
  box-shadow: 0 0 0 3px rgba(61,107,18,.14);
}
input:not([type=checkbox]):not([type=range]):disabled, select:disabled, textarea:disabled { background: var(--paper-2); color: var(--ink-3); cursor: not-allowed; }
input[type=number] { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Native select arrow is drawn by the OS and cannot be restyled, so it is suppressed and replaced
   with a chevron drawn as an inline SVG data URI (a remote image would be blocked by our CSP). */
select {
  padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='none' stroke='%236a6a60' stroke-width='1.6' d='M1 1l4.5 4.5L10 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select::-ms-expand { display: none; }

/* Checkboxes: the native control cannot be coloured, and a blue tick on a warm-paper page is the
   same "unstyled" tell as the sliders were. */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none;
  width: 17px; height: 17px; flex: none; border: 1px solid var(--ink-3); border-radius: 0;
  background: var(--card); cursor: pointer; position: relative;
  transition: background .14s ease, border-color .14s ease;
}
input[type=checkbox]:checked { background: var(--green); border-color: var(--green); }
input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(43deg);
}
input[type=checkbox]:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.hint { margin-top: 6px; font: 400 12px/1.45 var(--mono); color: var(--ink-3); }

/* Controls that sit ON a dark slab have to invert, or they are dark-on-dark and invisible. The
   keybox is the case that bit: its Reveal and Regenerate buttons rendered as unreadable smudges. */
.keybox .btn, .quote .btn:not(.fill), .auth-side .btn {
  border-color: var(--slab-ln); color: var(--on-slab); background: transparent;
}
.keybox .btn::before, .quote .btn:not(.fill)::before, .auth-side .btn::before { background: var(--lime); }
.keybox .btn:hover, .quote .btn:not(.fill):hover, .auth-side .btn:hover { color: var(--slab); }
.quote .btn.fill { background: var(--lime); color: var(--slab); border-color: var(--lime); }
.quote .btn.fill::before { background: #fff; }
.quote .btn.fill:hover { color: var(--slab); }

/* ---------------------------------------------------------------------------------- notes */
.note {
  padding: 13px 16px; border-left: 2px solid var(--green); background: var(--paper-2);
  font: 400 13.5px/1.55 var(--mono); color: var(--ink-2); margin-bottom: 20px;
}
.note.bad { border-left-color: var(--red); color: var(--red); background: #fbeceb; }

/* ------------------------------------------------------------------------------------ auth */
.auth { display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: start; }
.auth-side { background: var(--slab); color: var(--on-slab); padding: 34px 30px; }
.side-item { padding: 14px 0; border-top: 1px solid var(--slab-ln); }
.side-item:first-of-type { border-top: 0; padding-top: 0; }
.side-item b { display: block; font: 500 15px/1.3 var(--disp); color: #fff; }
.side-item span { display: block; margin-top: 3px; font: 400 13px/1.5 var(--mono); color: #7c8369; }
.side-code {
  margin: 26px 0 0; padding: 14px; background: #0a0c06; border: 1px solid var(--slab-ln);
  font: 11.5px/1.7 var(--mono); color: var(--lime); overflow-x: auto;
}

/* The Google button stays WHITE with the real multi-colour mark.
   Restyling a third-party identity button into the host brand reads as a phishing prompt, and
   Google's own branding guidelines require the unmodified mark — so this is the one control on the
   site that deliberately ignores the design system. */
.btn.google {
  width: 100%; background: #fff; border-color: var(--line); color: var(--ink);
  font-family: var(--disp); font-size: 14.5px; letter-spacing: 0; text-transform: none;
}
.btn.google::before { background: var(--paper-2); }
.btn.google:hover { color: var(--ink); }
.or { display: flex; align-items: center; gap: 14px; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or span { font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }

/* --------------------------------------------------------------------------- plan builder */
.builder { display: grid; grid-template-columns: 1fr 360px; gap: 44px; align-items: start; }
.builder-controls { display: grid; gap: 34px; }
.ctl-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.ctl-val { font: 600 30px/1 var(--disp); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ctl-val span { font: 400 12px/1 var(--mono); color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.ctl-scale { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--ink-3); }

/* Sticky, because the price is the thing you are watching while you drag a slider three screens up. */
.quote { background: var(--slab); color: var(--on-slab); padding: 28px 26px; position: sticky; top: 92px; }
.quote-hd { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #6f7560; margin-bottom: 20px; }
.quote-row { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--slab-ln); font: 400 13.5px/1.4 var(--mono); color: #949a83; }
.quote-row b { color: #fff; font-weight: 500; }
.quote-row.discount b { color: var(--lime); }
.quote-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--slab-ln); }
.quote-total span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #6f7560; }
.quote-total b { font: 600 36px/1 var(--disp); letter-spacing: -.035em; color: var(--lime); }

/* Range inputs.
   These were styled in the first design system and lost in the rewrite, so the plan builder — the
   page that takes money — rendered with default blue Chrome sliders on a warm-paper page. A native
   control in the middle of a custom design is the loudest possible "unfinished". */
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; cursor: pointer; display: block;
}
input[type=range]::-webkit-slider-runnable-track { height: 3px; background: var(--line); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; margin-top: -6.5px; border-radius: 0;
  background: var(--ink); border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--ink); transition: background .15s ease, transform .15s ease;
}
input[type=range]:hover::-webkit-slider-thumb { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type=range]:focus-visible::-webkit-slider-thumb { background: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 0 5px rgba(61,107,18,.2); }
input[type=range]::-moz-range-track { height: 3px; background: var(--line); }
input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 0;
  background: var(--ink); border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--ink);
}
input[type=range]:hover::-moz-range-thumb { background: var(--green); box-shadow: 0 0 0 1px var(--green); }

/* ------------------------------------------------------------------------- chips / filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.chip {
  height: 32px; padding: 0 14px; border: 1px solid var(--line); background: transparent;
  font: 500 12px/1 var(--mono); letter-spacing: .06em; color: var(--ink-2); cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ----------------------------------------------------------------------------------- tools */
/* The hairline grid is drawn with BORDERS ON THE CELLS, not with a 1px gap over a coloured
   container. The gap trick is shorter, but any count that does not fill the last row leaves the
   container colour showing through as dead grey blocks — four packages in a three-wide grid put two
   grey slabs on the dashboard. Borders on the cells mean an unfilled row is simply empty. */
.tool-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  /* Transparent, NOT --card: the container shows through wherever the last row is unfilled, and
     card-white against the warm paper ground reads as a mysterious empty box rather than as the
     absence of a cell. The cells paint their own background. */
  background: transparent; border: 1px solid var(--line); border-right: 0; border-bottom: 0;
}
.tool {
  background: var(--card); padding: 26px 24px; display: flex; flex-direction: column;
  position: relative; transition: background .18s ease;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.tool:hover { background: #fff; }
.tool.feat { background: #fdfdf8; }
.tool-flag { position: absolute; top: 0; right: 0; background: var(--green); color: #fff; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; padding: 4px 9px; }
.tool-top { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 15px; }
.tool-top img { width: 52px; height: 52px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.tool-ph { width: 52px; height: 52px; display: grid; place-items: center; background: var(--slab); color: var(--lime); font-size: 17px; flex: none; }
.tool h3 { font-size: 17px; margin-bottom: 4px; }
.tool-meta { font-size: 11.5px; color: var(--ink-3); margin: 0; }
.tool-desc { font-size: 14px; color: var(--ink-2); margin: 0 0 20px; flex: 1; }
.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11.5px; }

/* ------------------------------------------------------------------------------------ docs */
.doc { display: grid; grid-template-columns: 176px 1fr; gap: 56px; align-items: start; }

.toc { position: sticky; top: 96px; align-self: start; }
.toc-hd {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3);
  padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.toc a {
  display: block; padding: 7px 0 7px 13px; margin-left: -1px;
  border-left: 1px solid var(--line);
  font: 400 13px/1.35 var(--mono); color: var(--ink-3);
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--ink); }
/* The active section is marked by the RULE going dark, not by a highlight block — same logic as
   the section rules elsewhere: the page is built from lines, so the lines carry the state. */
.toc a.on { color: var(--ink); border-left-color: var(--ink); }

.doc-body { max-width: 760px; min-width: 0; }
.doc-body h2 {
  font-size: 27px; letter-spacing: -.02em; margin: 54px 0 14px;
  padding-top: 18px; border-top: 1px solid var(--line); scroll-margin-top: 96px;
}
.doc-body h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.doc-body h3 { font-size: 16px; margin: 30px 0 10px; }
.doc-body p { margin-bottom: 14px; font-size: 15px; }
.doc-body table { margin: 18px 0 22px; }
.doc-body td { font-size: 14px; vertical-align: top; }

/* Code blocks are the darkest thing on the page on purpose: in a reference, the code IS the
   content, and everything else is annotation around it. */
pre.code {
  position: relative; background: var(--slab); color: #d6dbc8;
  padding: 18px 20px; margin: 0 0 18px; overflow-x: auto;
  font: 400 13px/1.7 var(--mono); tab-size: 2;
}
pre.code code { background: none; padding: 0; color: inherit; font: inherit; }
pre.code .k { color: #9fd0ff; }  /* keys and keywords */
pre.code .s { color: var(--lime); } /* strings */
pre.code .o { color: #ffc46b; }  /* numbers, literals, commands */
pre.code .c { color: #6f7560; }  /* comments */
pre.code .v { color: #e0e5d2; }  /* interpolated values, variables */

.copy {
  position: absolute; top: 8px; right: 8px; opacity: 0;
  height: 25px; padding: 0 9px; border: 1px solid var(--slab-ln); border-radius: 2px;
  background: var(--slab); color: #949a83;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  transition: opacity .16s ease, color .16s ease, border-color .16s ease;
}
pre.code:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--lime); border-color: var(--lime); }

.tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 14px; }

.type-block { margin: 0 0 34px; }
.type-hd { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.type-hd h3 { margin: 0; font-size: 19px; }
.type-hd .price { margin-left: auto; font-size: 12.5px; color: var(--green); }

/* ------------------------------------------------------------------------------------- faq */
.faq details { border-top: 1px solid var(--slab-ln); }
.faq details:last-child { border-bottom: 1px solid var(--slab-ln); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 34px 20px 0; position: relative;
  font: 500 17px/1.35 var(--disp); letter-spacing: -.015em; color: #fff;
}
.faq summary::-webkit-details-marker { display: none; }
/* A plus that becomes a minus — drawn with two bars so it animates, rather than swapping glyphs. */
.faq summary::after,
.faq summary::before {
  content: ""; position: absolute; right: 4px; top: 50%; background: var(--lime);
  transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}
.faq summary::before { width: 13px; height: 1px; margin-top: -.5px; }
.faq summary::after { width: 1px; height: 13px; margin-top: -6.5px; right: 10px; }
.faq details[open] summary::after { transform: rotate(90deg); opacity: 0; }
.faq summary:hover { color: var(--lime); }
.faq details p { margin: 0 0 22px; padding-right: 40px; font-size: 15px; color: #949a83; }
.faq details p code { background: #0a0c06; color: var(--lime); }
@media (prefers-reduced-motion: reduce) { .faq summary::after, .faq summary::before { transition: none; } }

@media (max-width: 940px) {
  .doc { grid-template-columns: 1fr; gap: 28px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .toc-hd { display: none; }
  .toc a { border-left: 0; padding: 6px 10px 6px 0; }
  .toc a.on { border-left: 0; text-decoration: underline; }
  .copy { opacity: 1; }
}

/* ----------------------------------------------------------------------------- leaderboard */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; }
.pod { background: var(--card); border: 1px solid var(--line); padding: 26px 20px; text-align: center; display: grid; justify-items: center; gap: 9px; }
.pod.p1 { background: var(--slab); border-color: var(--slab); padding-block: 40px; }
.pod.p1 b, .pod.p1 .pod-n { color: #fff; }
.pod.p1 .pod-rank { color: var(--lime); border-color: var(--slab-ln); }
.pod-rank { font: 500 11px/1 var(--mono); color: var(--ink-3); border: 1px solid var(--line); padding: 4px 9px; }
.pod b { font: 500 16px/1.2 var(--disp); letter-spacing: -.015em; }
.pod-n { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lb-av { object-fit: cover; border: 1px solid var(--line); background: var(--paper-2); }
.pod.p1 .lb-av { border-color: var(--slab-ln); }

/* ------------------------------------------------------------------------------- dashboard */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--card); }
.stat-cell { padding: 24px 22px; border-left: 1px solid var(--line); }
.stat-cell:first-child { border-left: 0; }
.stat-cell b { display: block; font: 600 30px/1 var(--disp); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-cell span { display: block; margin-top: 7px; font: 400 11.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.keybox { display: flex; align-items: center; gap: 12px; background: var(--slab); padding: 16px 18px; }
.keybox code { flex: 1; background: none; color: var(--lime); font-size: 13.5px; overflow-x: auto; white-space: nowrap; padding: 0; }
.panel { border: 1px solid var(--line); background: var(--card); padding: 28px 26px; }
.panel h3 { margin-bottom: 18px; }
.avatar-lg { width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line); background: var(--paper-2); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

/* The 14-day bar chart. Fourteen integers do not justify a charting library, and a 200KB dependency
   to draw fourteen rectangles would be the slowest thing on the page. */
.chart {
  display: flex; align-items: flex-end; gap: 4px; height: 168px;
  background: var(--slab); padding: 20px 18px 8px; border: 1px solid var(--slab);
  position: relative;
}
/* A brand-new account has fourteen zero days, and 168px of unexplained black is not a chart — it
   is a rendering failure as far as the reader is concerned. Say so instead. */
.chart.empty::after {
  content: "No solves in the last 14 days"; position: absolute; inset: 0;
  display: grid; place-items: center; font: 400 12.5px/1 var(--mono); color: #6f7560;
  letter-spacing: .06em; pointer-events: none;
}
.chart .bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 7px; }
.chart .bar i {
  display: block; width: 100%; height: 0; background: var(--lime); min-height: 0;
  transition: height .6s cubic-bezier(.22,.9,.3,1);
}
/* A day with no solves still gets a visible sliver, in the dead colour — an empty gap reads as
   missing data, and "you solved nothing on Tuesday" is information. A brand-new account has
   fourteen of them, so this is what stops the chart being an unexplained black rectangle. */
.chart .bar.zero i { background: #363b2a; min-height: 4px; }
.chart .bar em {
  font: 400 9.5px/1 var(--mono); color: #6f7560; font-style: normal;
  text-align: center; white-space: nowrap; overflow: hidden;
}
/* Bars sit at zero until the .in class lands, so the growth reads as the data arriving. Without JS
   the class never lands — hence the no-js escape hatch below, which shows them at full height. */
.chart:not(.in) .bar i { height: 0 !important; }
html:not(.js) .chart .bar i { height: 40% !important; }
@media (prefers-reduced-motion: reduce) { .chart .bar i { transition: none; } }

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .chart .bar em { display: none; }
}

@media (max-width: 1040px) {
  .auth, .builder { grid-template-columns: 1fr; gap: 36px; }
  .quote { position: static; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat-cell:nth-child(3) { border-left: 0; }
}
@media (max-width: 620px) {
  .tool-grid { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .stat-cell { border-left: 0; border-top: 1px solid var(--line); }
  .stat-cell:first-child { border-top: 0; }
}

/* Verification nag on the dashboard. A ground change plus a rule, not a coloured alert box — it
   needs to be noticed without making a signed-in customer feel told off. */
.verify-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: var(--slab); color: var(--on-slab); padding: 18px 22px; margin-bottom: 26px;
  border-left: 3px solid var(--lime);
}
.verify-bar b { display: block; font: 500 15.5px/1.35 var(--disp); color: #fff; }
.verify-bar span { display: block; margin-top: 3px; font: 400 13px/1.5 var(--mono); color: #949a83; }
.verify-bar .btn { border-color: var(--slab-ln); color: var(--on-slab); flex: none; }
.verify-bar .btn::before { background: var(--lime); }
.verify-bar .btn:hover { color: var(--slab); }
.verify-bar .btn:disabled { opacity: .45; cursor: not-allowed; }
