/* The Free AI Credits tab (/free-ai-credits, /js/credits-site.js). Loaded on every page of the site
   (index.html), like docs.css and events.css. The page frame (.sd, .sd-head, .sd-error) is the Docs tab's.
   Colors come from the tokens in app.css, so light and dark both work. Class names start with cr-
   (credits).

   Since Benji's request of 2026-10-28 (the offers sorted by who you are, ranked by the smartest AI) the page
   is one column at every width, at most 960px: "Who is this for?" (three choices stacked full width on a
   phone, one row of three from 640px), then the one list picked as one table of four columns that fits a
   phone at 320 with nothing scrolling sideways and no box that scrolls, then the Never share note and the
   two closed parts. No header stays up: each row says what its small lines are ("You get:", "Score"), so
   none is needed, and iOS Safari's sticky table headers never come into it. */

.cr { max-width: 960px; }
.cr-head { margin-bottom: 12px; }
.cr-head-text { max-width: 780px; }
.cr-checked { margin: 0 0 8px; }
.cr-checked-date { font-weight: 700; }
.cr-note { color: var(--muted); font-size: 13px; }
.cr-intro { margin: 0; }

/* ---------- who is this for? ---------- */

.cr-pick { margin: 0 0 24px; }
.cr-legend { margin: 0 0 10px; font-size: 18px; font-weight: 750; }
/* Three choices, each at least 56px tall: stacked and the full width on a phone, one row of three equal
   segments from 640px. Each radio is out of sight but still the real control (the arrow keys move and
   pick, a screen reader says "1 of 3"), and its label right after it is the button people see. */
.cr-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cr-option { position: relative; min-width: 0; }
.cr-radio { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.cr-choice {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  min-height: 56px; height: 100%; margin: 0; padding: 9px 14px 9px 44px;
  border: 1px solid var(--field-line); border-radius: 12px; background: var(--surface);
  cursor: pointer; font-weight: 400; line-height: 1.3;
}
.cr-choice:hover { border-color: var(--accent); }
/* The round mark at the left; on the one picked it fills and holds a check mark, its edge is 2px and its
   name bold, so the pick never shows by color alone. */
.cr-choice::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border: 2px solid var(--field-line); border-radius: 50%;
}
.cr-radio:checked + .cr-choice { padding: 8px 13px 8px 43px; border: 2px solid var(--accent); }
.cr-radio:checked + .cr-choice::before { left: 13px; border-color: var(--accent); background: var(--accent); }
.cr-radio:checked + .cr-choice::after {
  content: ""; position: absolute; left: 20px; top: 50%; width: 6px; height: 11px; margin-top: -7px;
  border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.cr-radio:focus-visible + .cr-choice { outline: 2px solid var(--accent); outline-offset: 2px; }
.cr-choice-name { font-size: 16px; font-weight: 600; }
.cr-radio:checked + .cr-choice .cr-choice-name { font-weight: 800; }
.cr-choice-line { color: var(--muted); font-size: 13px; }
@media (min-width: 640px) {
  .cr-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.cr-hint { margin: 10px 0 0; }
.cr-all-line { margin: 0; }
/* The link to every offer: a 44px tall target, on a line of its own. */
.cr-all { display: inline-flex; align-items: center; min-height: 44px; font-weight: 650; text-underline-offset: 3px; }
.cr-status { margin: 0; font-weight: 650; }

/* ---------- the list ---------- */

.cr-prompt {
  margin: 0; padding: 18px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  color: var(--muted); text-align: center;
}
.cr-list-title { margin: 0 0 4px; font-size: 20px; }
.cr-list-note { margin: 0 0 8px; }
.cr-rank-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.cr-board-link { font-weight: 650; }
.cr-empty { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.cr-under18 { margin: 14px 0 0; }
.cr-change-line { margin: 10px 0 0; }
.cr-change.btn.linkish { min-height: 44px; padding: 0; color: var(--accent); font-weight: 650; }

/* ---------- the table ---------- */

/* Four columns sharing the table's width (table-layout: fixed), the same at every width, so a phone at 320
   has nothing to scroll sideways: # 10%, Offer 50%, Best AI 26% and Card 14% of 288 to 343px (Offer 143 to
   170px, so a name of 40 letters wraps at most twice). From 640px # is 48px and Offer takes what the other
   two leave. A model's name breaks anywhere when it has to (Beacon-Coder-2.5-Long-Context-Preview). */
.cr-table {
  width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 14px; line-height: 1.4;
}
.cr-col-rank { width: 10%; }
.cr-col-offer { width: 50%; }
.cr-col-model { width: 26%; }
.cr-col-card { width: 14%; }
@media (min-width: 640px) {
  .cr-table col.cr-col-rank { width: 48px; }
  .cr-table col.cr-col-offer { width: auto; }
}
.cr-table th, .cr-table td {
  padding: 10px 6px; text-align: left; vertical-align: top; font-weight: 400;
  border-top: 1px solid var(--line); overflow-wrap: break-word;
}
.cr-table thead th {
  padding-top: 9px; padding-bottom: 9px; border-top: 0; border-bottom: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.2;
  white-space: nowrap;
}
.cr-table thead th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.cr-table thead th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.cr-table tbody:first-of-type > tr:first-child > * { border-top: 0; }
.cr-table .cr-h-rank, .cr-table .cr-c-rank { padding-left: 2px; padding-right: 2px; text-align: center; }
/* The Card column's words get all of its width: at 320 its 14% is 40px, and with 6px each side "Not clear"
   broke inside "clear", which needs 32px (measured 2026-10-28). */
.cr-table thead th:last-child, .cr-table .cr-c-card { padding-left: 2px; padding-right: 2px; }
.cr-c-rank { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cr-table th.cr-c-offer { padding: 0 6px 10px 4px; }
.cr-model { display: block; font-weight: 650; overflow-wrap: anywhere; }
.cr-score { display: block; color: var(--muted); font-size: 13px; }
.cr-c-card { font-weight: 650; }

/* What anyone can read without opening an offer: what you get, for how long, the list's own fact. */
.cr-fact { margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.cr-fact-label { color: var(--text); font-weight: 650; }

/* Not ranked yet: a heading of its own across the table, over the offers with no score. */
.cr-group-row th { padding: 14px 12px 8px; background: var(--bg); }
.cr-group-title { display: block; font-size: 15px; font-weight: 750; }
.cr-group-note { display: block; color: var(--muted); font-size: 13px; }

/* An offer's name: the button that opens its drop-down, the whole cell wide and at least 44px tall to tap,
   a chevron before it that points right when closed and down when open, and after the name the small word
   "Steps", so it reads as something that opens. */
.cr-toggle {
  display: flex; align-items: flex-start; gap: 7px; width: 100%; min-height: 44px; margin: 0;
  padding: 10px 2px 4px; border: 0; border-radius: 6px; background: none; color: var(--text);
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.3; text-align: left; cursor: pointer;
}
.cr-toggle::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 6px 1px 0 2px;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform 0.15s ease;
}
.cr-toggle[aria-expanded="true"]::before { transform: rotate(45deg); margin-top: 4px; }
.cr-toggle:hover .cr-name { text-decoration: underline; text-underline-offset: 3px; }
.cr-toggle:hover::before { border-color: var(--text); }
.cr-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cr-toggle-text { min-width: 0; overflow-wrap: break-word; }
.cr-toggle-word { color: var(--accent); font-size: 12px; font-weight: 650; white-space: nowrap; }

/* The row an address named (#claim-<offerId>): the accent's tint and an edge, so it never shows by color
   alone. */
.cr-row { scroll-margin-top: 12px; }
.cr-table .cr-row.is-target > * { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cr-table .cr-row.is-target > :first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* An open row's drop-down: one cell under it, no line between them. */
.cr-table .cr-details > td { padding: 2px 12px 16px; border-top: 0; }
.cr-row.is-target + .cr-details > td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- a drop-down's words (a row of the table, and an offer in More offers) ---------- */

.cr-details-in > *, .cr-more-details > * { max-width: 760px; }
.cr-d-what, .cr-d-model p, .cr-d-head, .cr-d-wvc { margin: 0 0 8px; }
.cr-d-label { font-weight: 700; }
.cr-tie, .cr-also { color: var(--muted); font-size: 13px; }
.cr-before { margin: 0 0 12px; padding-left: 20px; }
.cr-before li + li { margin-top: 3px; }
.cr-tick-hint { color: var(--muted); font-size: 13px; font-weight: 400; }
/* Each step with its tick box: the box and the step's words are one label, so a tap on either ticks it. */
.cr-steps { margin: 0 0 12px; padding-left: 24px; }
.cr-steps li + li { margin-top: 6px; }
.cr-tick { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-weight: 400; cursor: pointer; }
.cr-tick-box { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.cr-tick-text { min-width: 0; }
.cr-tick-box:checked + .cr-tick-text { color: var(--muted); }
.cr-d-link { margin: 0; }
/* The link as a button, the full width on a phone. A long one wraps like words, its arrow kept with the last
   of them (at 375 in More offers "Open organize.mlh.com/host/hack-days" took three lines with the arrow off
   on its own as a flex button, WebKit 2026-09-29). It wraps after a slash (credits-site.js puts a <wbr>
   there); a word breaks inside only when it cannot fit a line at all (break-word, not anywhere, which broke
   "studentambass" and "adors" at 375). */
.cr-open {
  display: inline-block; min-height: 44px; max-width: 100%; padding: 11px 16px;
  font-size: 14px; line-height: 1.5; text-align: left; overflow-wrap: break-word;
}
.btn.cr-open > .ext svg { margin-left: 0.4em; }
@media (max-width: 639px) {
  .cr-open { display: block; width: 100%; text-align: center; }
}
/* A day written in numbers ("2026-10-31") and a last day to claim stay on one line: at 375 Ended read "by
   2026-10-" and then "31." (WebKit, 2026-09-29). */
.cr-nobr { white-space: nowrap; }
/* An address in a step or in Ended wraps only after a slash (credits-site.js puts a <wbr> there), not
   inside a word or at a hyphen: at 375 "azure.microsoft.com/en-" and then "us". A short part between two
   slashes is held on one line (.cr-seg); its last letters, the arrow and the mark after it stay on one line
   (.ext-glue), the mark in the words' own color and not underlined (a reviewer, WebKit 2026-09-29). */
.cr-link { overflow-wrap: break-word; }
.cr-seg { white-space: nowrap; }
.cr-after { display: inline-block; color: var(--text); }

/* ---------- under the list ---------- */

.cr-never {
  max-width: 780px; margin: 24px 0 0; padding: 7px 12px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--warn); color: var(--muted); font-size: 13px;
}

/* ---------- the two closed parts at the bottom: More offers, and Ended: skip these ---------- */

.cr-fold { margin-top: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.cr-fold + .cr-fold { margin-top: 12px; }
.cr-fold[open] { border-color: var(--line-strong); }
/* A chevron at the right says it opens (display: flex drops the browser's own triangle). */
.cr-fold-summary {
  display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 8px 16px;
  cursor: pointer; list-style: none; border-radius: var(--radius);
}
.cr-fold-summary::-webkit-details-marker { display: none; }
.cr-fold-summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: -4px 4px 0 auto;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 0.15s ease;
}
.cr-fold-summary:hover::after { border-color: var(--text); }
.cr-fold[open] > .cr-fold-summary::after { transform: rotate(225deg); margin-top: 4px; }
.cr-fold-title { margin: 0; font-size: 15px; }
/* The count keeps clear of the chevron when the title fills the line: at 375 "More offers: clubs, events
   and waitlists" takes two lines and "8 offers" sat 3px from the chevron (WebKit, 2026-09-29). */
.cr-count { margin-left: 4px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.cr-fold-summary .cr-count { margin-right: 8px; }
.cr-fold-body { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); font-size: 14px; }

/* More offers: a small label over each group, then each offer closed like a row of the table. */
.cr-more-group + .cr-more-group { margin-top: 18px; }
.cr-more-label { margin: 0; font-size: 14px; }
.cr-more-note { margin: 2px 0 6px; color: var(--muted); font-size: 13px; }
.cr-more-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cr-more-item { border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.cr-more-item .cr-toggle { font-size: 14px; }
/* Who qualifies, under the name, its words lined up with the name's (the chevron and its gap are 17px). */
.cr-more-item > .cr-fact { margin: 0; padding: 0 0 10px 19px; }
.cr-more-details { padding: 0 0 14px 17px; }
.cr-more-item.is-target { box-shadow: inset 3px 0 0 var(--accent); }
.cr-more-item.is-target > .cr-toggle { padding-left: 12px; }
.cr-more-item.is-target > .cr-fact { padding-left: 29px; }
.cr-more-item.is-target > .cr-more-details { padding-left: 29px; }

/* Ended: skip these. */
.cr-ended-list { list-style: none; display: grid; gap: 12px; }
.cr-ended-list > * { max-width: 900px; }
.cr-ended-item { scroll-margin-top: 12px; overflow-wrap: anywhere; }
.cr-ended-item + .cr-ended-item { padding-top: 12px; border-top: 1px solid var(--line); }
.cr-ended-name { margin: 0 0 2px; font-weight: 700; }
.cr-ended-line { margin: 0; }
.cr-ended-label { color: var(--muted); font-weight: 650; }
/* The entry an address named: the accent's edge as well as its color, so it does not show by color alone
   (a table row has its edge too). */
.cr-ended-item.is-target { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
.cr-ended-item.is-target .cr-ended-name { color: var(--accent); }

/* The chevrons turn without moving when the device asks for less motion; nothing here scrolls smoothly. */
@media (prefers-reduced-motion: reduce) {
  .cr-toggle::before, .cr-fold-summary::after { transition: none; }
}
