/* Fact Fluency Lab tracker: the site's tokens (site.css), plus the working parts of a tool. Restrained on purpose. */
:root { --ok: #1f7a4d; --ok-soft: #e7f4ec; --bad: #b42318; --bad-soft: #fdecea; }
@media (prefers-color-scheme: dark) {
  :root { --ok: #6fd39b; --ok-soft: #173326; --bad: #ff8a80; --bad-soft: #3a1d1b; }
}
.tracker { padding-block: 28px 48px; }
.tracker h1 { margin-bottom: 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 .3rem; }
.small { font-size: .88rem; }
.stack { display: grid; gap: 14px; }
.stack > * { min-width: 0; }   /* a grid item grows to its widest child: without this the score table widened the page on phones */
.stack > .card { margin: 0; }
.card.stack { padding-block: 6px 18px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li.row { padding: 10px 0; border-top: 1px solid var(--line); }
.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cards3 .card { margin: 0; }

/* Forms */
.field { display: grid; gap: 4px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-weight: 600; font-size: .92rem; }
.field.inline { display: inline-flex; align-items: center; gap: 8px; }
input, select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 0 10px; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=number] { width: 7em; }
input[type=file] { border: 0; padding: 0; min-height: 0; }
.mini { display: inline-flex; align-items: center; gap: 6px; }
.mini input { width: 5em; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { min-height: 0; width: 20px; height: 20px; }
.button[disabled], .tab[disabled] { opacity: .45; cursor: not-allowed; }
.button.danger { color: var(--bad); }

/* Child bar and tabs */
.childbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; scrollbar-width: thin; }
.tab { font: inherit; font-weight: 600; font-size: .95rem; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 10px 12px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.tab[aria-current=page] { color: var(--fg); border-bottom-color: var(--accent); }

/* Notices */
.notice:empty { display: none; }
.notice { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-weight: 500; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--bad-soft); color: var(--bad); }

/* Today */
.next h2 { font-size: clamp(2rem, 6vw, 2.6rem); margin: .2rem 0 0; }
.next .big { font-size: 1.15rem; font-weight: 600; margin: .2rem 0 .6rem; }
.limit { display: inline-flex; align-items: baseline; gap: 10px; background: var(--soft); border-radius: 10px; padding: 8px 14px; margin: 0 0 .4rem; }
.limit strong { font-size: 1.35rem; }

/* The page grid: the same columns as the book page */
.pgrid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; }
.pcell { display: grid; justify-items: end; align-content: start; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; min-width: 0; }
.pgrid.h .pcell { grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
.stacked { display: grid; justify-items: end; font-size: 1.15rem; line-height: 1.2; }
.stacked span:last-child { border-bottom: 2px solid var(--fg); padding-left: 6px; }
.across { font-size: 1.05rem; white-space: nowrap; }
.ans { width: 100%; max-width: 5.5em; text-align: right; font-size: 1.05rem; }
.pcell.right { border-color: var(--ok); background: var(--ok-soft); }
.pcell.wrong { border-color: var(--bad); background: var(--bad-soft); }
.fix { color: var(--bad); font-weight: 700; font-size: .9rem; }
.keyans { color: var(--accent); font-size: 1.15rem; }
@media (max-width: 560px) {
  .pgrid.v { grid-template-columns: repeat(min(var(--cols), 4), minmax(0, 1fr)); }
  .pgrid.h { grid-template-columns: repeat(min(var(--cols), 2), minmax(0, 1fr)); }
}

/* Timer */
.clock { font-size: clamp(4rem, 22vw, 7.5rem); font-weight: 800; line-height: 1; margin: .1rem 0; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.clock.idle { color: var(--muted); }
.timer.running { text-align: center; justify-items: center; }
.button.go { min-height: 56px; min-width: 9rem; font-size: 1.15rem; }

/* Checking by taps: every answer starts right */
.pcell.tap, .pgrid.h .pcell.tap { padding: 0; display: grid; grid-template-columns: 1fr; gap: 0; justify-items: stretch; }
.tapbtn { font: inherit; color: inherit; background: none; border: 0; border-radius: 9px; padding: 8px; min-height: 44px; width: 100%; cursor: pointer; display: grid; justify-items: end; gap: 4px; text-align: inherit; touch-action: manipulation; }
.pgrid.h .tapbtn { grid-template-columns: 1fr auto; align-items: center; justify-items: start; }
.pcell.tap.right .keyans { color: var(--ok); }
.pcell.tap.wrong { border: 2px solid var(--bad); background: var(--bad-soft); }
.pcell.tap.wrong .keyans { color: var(--bad); }
.pcell.tap.skip { border: 1px dashed var(--muted); background: transparent; opacity: .6; }
.pcell.tap.skip .keyans { text-decoration: line-through; }
.wrote { margin: 0 6px 6px; width: auto; max-width: none; min-height: 36px; text-align: right; font-size: .95rem; }
.button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.summary { border-radius: 10px; padding: 10px 14px; background: var(--soft); }
.summary.met { background: var(--ok-soft); }
.summary p { margin: .15rem 0; }
.bigscore { font-size: 1.1rem; }
.bigscore strong { font-size: 2rem; font-variant-numeric: tabular-nums; }
.summary.met .verdict { color: var(--ok); font-weight: 700; }

/* Progress */
.chart { width: 100%; height: auto; display: block; margin: 8px 0 12px; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .goalline { stroke: var(--fg); stroke-width: 1.5; stroke-dasharray: 6 4; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--muted); }
.chart .bar.met { fill: var(--accent); }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* Practice */
.facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.facts li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-variant-numeric: tabular-nums; }

/* Printing an extra page: only the sheets print, one per paper page, black on white */
#print { display: none; }
@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; color: #000; background: #fff; }
  .sheet { page-break-after: always; break-after: page; font-family: "Inter", sans-serif; }
  .sheet h1 { font-size: 20pt; margin: 0 0 4pt; }
  .sheet .meta { font-size: 9pt; color: #333; margin: 0 0 6pt; }
  .sheet .pgrid { gap: 18pt 10pt; margin-top: 16pt; }
  .sheet .pcell { border: 0; padding: 0; }
  .sheet .stacked { font-size: 20pt; }
  .sheet .stacked span:last-child { border-bottom: 1.5pt solid #000; }
  .sheet .across { font-size: 16pt; }
  .sheet .line { display: inline-block; width: 46pt; border-bottom: 1pt solid #000; height: 16pt; }
  .sheet .keyans { color: #000; font-size: 14pt; }
  @page { size: letter; margin: 0.5in; }
}
