/* Silent Student free tools: styles on top of site-base.css / pearl.css / site.css tokens (light and dark come from the tokens). */

/* ---------- page header ---------- */
.tl-hero { padding-bottom: clamp(18px, 2.6vw, 34px); }
.tl-hero .nu-h1 { font-size: clamp(36px, 4.6vw, 62px); max-width: 16em; }
.tl-hero .nu-lede { max-width: 42em; }
.tl-trust { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--text-2); }
.tl-trust span { display: inline-flex; align-items: center; gap: 8px; }
.tl-trust span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mint-ink); flex: none; }

/* ---------- tool card ---------- */
.tl-card { padding: clamp(16px, 2.4vw, 30px); border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(60, 50, 40, .05), 0 24px 44px -30px rgba(60, 40, 28, .35); }
/* Space reserved until the script has built the tool, sized to the measured first render (verify-grade-tools.mjs E9 records the measured heights per width) so nothing below it jumps. */
.tl-mount--canvas:not(.is-ready) { min-height: 1170px; }
.tl-mount--final:not(.is-ready) { min-height: 1070px; }
@media (max-width: 999px) { .tl-mount--canvas:not(.is-ready) { min-height: 1760px; } .tl-mount--final:not(.is-ready) { min-height: 1300px; } }
@media (max-width: 719px) { .tl-mount--canvas:not(.is-ready) { min-height: 2470px; } .tl-mount--final:not(.is-ready) { min-height: 1320px; } }
@media (max-width: 519px) { .tl-mount--canvas:not(.is-ready) { min-height: 2700px; } .tl-mount--final:not(.is-ready) { min-height: 1420px; } }
.tl-loading { color: var(--text-2); font-size: 15px; }
.tl-unsupported { padding: 16px 18px; border-radius: 16px; background: var(--amber-soft); border: 1px solid rgba(138, 90, 18, .22); color: var(--text); font-size: 15px; line-height: 1.6; }
.tl-unsupported[hidden], .tl-loading[hidden] { display: none; }
.tl-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tl-h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 2.4vw, 30px); line-height: 1.1; letter-spacing: -.015em; color: var(--text); }

/* ---------- controls ---------- */
.tl-label { display: block; font: 600 14px/1.3 var(--sans); color: var(--text); margin-bottom: 6px; }
.tl-help { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--text-3); }
.tl-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tl-fieldset > legend { padding: 0; }
.tl-field { min-width: 0; margin-top: 12px; }
.tl-in { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 500 16px/1.2 var(--sans); transition: border-color .15s, box-shadow .15s; }
.tl-in::placeholder { color: var(--text-3); opacity: 1; }
.tl-in:focus { outline: 0; border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 138, 96, .22); }
.tl-in:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tl-in[aria-invalid="true"] { border-color: var(--deep); }
.tl-in[readonly] { background: var(--fill); }
.tl-in--sm { min-height: 40px; padding: 0 10px; }
.tl-select { appearance: auto; padding-right: 8px; }
.tl-err { margin-top: 5px; font-size: 13px; line-height: 1.4; color: var(--accent-ink); }
.tl-err[hidden] { display: none; }
.tl-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tl-row--wrap { flex-wrap: wrap; }
.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--fill); color: var(--text); font: 700 15px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.tl-btn:hover { background: var(--fill-2); border-color: var(--text-3); }
.tl-btn:disabled { opacity: .5; cursor: not-allowed; }
.tl-btn .ic { width: 18px; height: 18px; flex: none; }
.tl-btn--primary { background: var(--coral); border-color: transparent; color: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.tl-btn--primary:hover { background: var(--coral-hover); border-color: transparent; }
.tl-btn--quiet { background: none; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--coral-2); padding: 0 8px; }
.tl-btn--quiet:hover { background: var(--fill); border-color: transparent; }
.tl-btn--icon { width: 44px; padding: 0; background: none; border-color: transparent; color: var(--text-2); flex: none; }
.tl-btn--icon:hover { background: var(--fill-2); border-color: transparent; color: var(--text); }
.tl-btn--danger:hover { color: var(--accent-ink); }
.tl-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; line-height: 1.35; color: var(--text); cursor: pointer; }
.tl-check input { width: 20px; height: 20px; flex: none; accent-color: var(--coral); margin: 0; }
.tl-check--small { font-size: 14px; min-height: 36px; }
.tl-feedback { min-height: 1.4em; margin-top: 10px; font-size: 14px; color: var(--text-2); }
.tl-confirm { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.tl-confirm[hidden] { display: none; }

/* ---------- banners and notices ---------- */
.tl-banner { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 10px 6px 10px 14px; border-radius: 14px; border: 1px solid var(--mint-line); background: var(--mint-soft); color: var(--text); font-size: 14.5px; line-height: 1.5; }
.tl-banner > span { flex: 1; padding-top: 2px; }
.tl-banner .ic { width: 22px; height: 22px; margin-top: 4px; color: var(--mint-ink); flex: none; }
.tl-banner--warn { background: var(--amber-soft); border-color: rgba(138, 90, 18, .26); }
.tl-banner--warn .ic { color: var(--amber-ink); }
.tl-banner[hidden] { display: none; }
.tl-notes { list-style: none; display: grid; gap: 8px; margin-top: 14px; padding: 0; }
.tl-note { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--fill); border: 1px solid var(--hair); font-size: 14px; line-height: 1.5; color: var(--text-2); }
.tl-note .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--accent-ink); }
.tl-note--warn { background: var(--amber-soft); border-color: rgba(138, 90, 18, .26); color: var(--text); }
.tl-note--warn .ic { color: var(--amber-ink); }
.tl-list { list-style: disc; padding-left: 1.2em; display: grid; gap: 6px; margin-top: 8px; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }

/* ---------- setup ---------- */
.tl-setup { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 28px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
@media (min-width: 1000px) { .tl-setup { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr); } }
.tl-setup-col { min-width: 0; }
.tl-scale { min-width: 0; }
.tl-scale .tl-field { margin-top: 0; }
.tl-scale-panel { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.tl-scale-panel[hidden] { display: none; }
.tl-scale-table { width: 100%; border-collapse: collapse; }
.tl-scale-table th { text-align: left; font: 700 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); padding: 0 6px 8px; }
.tl-scale-table td { padding: 3px 6px; }
.tl-scale-table td:last-child { width: 52px; }

/* ---------- editor ---------- */
.tl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
@media (min-width: 1000px) { .tl-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; } .tl-grid--final { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }
.tl-groups { display: grid; gap: 16px; }
.tl-group { padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.tl-gtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tl-gtitle { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.15; color: var(--text); overflow-wrap: anywhere; min-width: 0; }
.tl-gfields { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 719px) { .tl-gfields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tl-field--name { grid-column: span 2; } }
.tl-colhead, .tl-item { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto 44px; gap: 8px; align-items: start; }
.tl-groups.has-wi .tl-colhead, .tl-groups.has-wi .tl-item { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto 44px; }
.tl-colhead { margin-top: 14px; padding: 0 0 4px; font: 700 12px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.tl-rows { display: grid; gap: 8px; margin-top: 4px; }
.tl-item { padding: 6px 0; border-top: 1px solid var(--line); }
.tl-item:first-child { border-top: 0; }
.tl-cell { min-width: 0; }
.tl-cell--opts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; min-width: 150px; }
.tl-cell--rm { display: flex; justify-content: center; }
.tl-fl { display: none; font: 600 13px/1.2 var(--sans); color: var(--text-2); margin-bottom: 4px; }
.tl-tag { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--amber-soft); border: 1px solid rgba(138, 90, 18, .26); color: var(--amber-ink); font-size: 12.5px; font-weight: 700; }
.tl-tag[hidden] { display: none; }
.tl-item.is-dropped .tl-cell--score .tl-in, .tl-item.is-dropped .tl-cell--pos .tl-in, .tl-item.is-dropped .tl-cell--name .tl-in { text-decoration: line-through; color: var(--text-3); }
@media (max-width: 719px) {
  .tl-colhead { display: none; }
  .tl-item, .tl-groups.has-wi .tl-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px 0; }
  .tl-cell--name { grid-column: 1 / -1; }
  .tl-cell--opts { grid-column: 1 / 2; min-width: 0; }
  .tl-cell--rm { grid-column: 2 / 3; justify-content: flex-end; align-self: center; }
  .tl-fl { display: block; }
}

/* ---------- results ---------- */
@media (min-width: 1000px) and (min-height: 760px) { .tl-results { position: sticky; top: calc(var(--nav-h) + 16px); } }
.tl-results { padding: 18px; border-radius: 18px; background: var(--tint-bg); border: 1px solid var(--tint-line); min-width: 0; }
.tl-results-body { margin-top: 10px; min-height: 160px; }
.tl-headlabel { font: 700 12.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.tl-bignum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-family: var(--serif); font-size: clamp(40px, 5vw, 58px); line-height: 1; letter-spacing: -.02em; color: var(--text); }
.tl-bignum--sm { font-size: clamp(28px, 3vw, 36px); }
.tl-badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px; background: var(--chip-bg); color: var(--chip-ink); font: 700 15px/1.3 var(--sans); letter-spacing: 0; }
.tl-badge--lg { font-size: 20px; padding: 4px 14px; }
.tl-both { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tl-fig { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.tl-fig-label { display: block; font: 700 12px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.tl-fig-val { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; font: 600 20px/1.2 var(--sans); color: var(--text); }
.tl-fig-val .tl-badge { font-size: 13px; }
.tl-whatif { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.tl-whatif-h { font: 700 12.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.tl-wait { padding: 4px 0; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.tl-wait-h { font: 700 17px/1.3 var(--sans); color: var(--text); margin-bottom: 4px; }
.tl-math { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 4px; }
.tl-math summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font: 700 14.5px/1.3 var(--sans); color: var(--text); }
.tl-limits { margin-top: 12px; font-size: 13.5px; line-height: 1.55; color: var(--text-3); }
.tl-limits a { color: var(--text-2); }
.tl-answer { margin-top: 4px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--mint-ink); font-family: var(--serif); font-size: clamp(20px, 2vw, 25px); line-height: 1.3; color: var(--text); }
.tl-answer--bad { border-left-color: var(--deep); }
.tl-sub { margin-top: 10px; font-size: 15.5px; line-height: 1.5; color: var(--text-2); }
.tl-formula { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--fill); font: 500 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); overflow-wrap: anywhere; }
.tl-handoff { margin-top: 14px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.tl-handoff a { color: var(--text); text-decoration-color: var(--coral-2); text-underline-offset: 3px; }
.tl-tablewrap { margin-top: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.tl-cap { text-align: left; padding: 10px 12px 2px; font: 700 12.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); caption-side: top; }
.tl-table th, .tl-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--text-2); }
.tl-table thead th { font: 700 12px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); background: var(--surface-2); }
.tl-table tbody th { font-weight: 600; color: var(--text); }
.tl-table tr:last-child th, .tl-table tr:last-child td { border-bottom: 0; }
.tl-try-row th, .tl-try-row td { background: var(--peach); }
/* narrow containers (phones, and the results column beside the editor) read as stacked rows with their labels */
.tl-table--stack, .tl-table--stack tbody, .tl-table--stack tr, .tl-table--stack th, .tl-table--stack td { display: block; width: 100%; }
.tl-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tl-table--stack tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl-table--stack tr:last-child { border-bottom: 0; }
.tl-table--stack th, .tl-table--stack td { border: 0; padding: 3px 12px; }
.tl-table--stack td::before { content: attr(data-label) ': '; font-weight: 700; color: var(--text-2); }
@media (max-width: 719px) {
  .tl-table, .tl-table tbody, .tl-table tr, .tl-table th, .tl-table td { display: block; width: 100%; }
  .tl-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tl-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .tl-table tr:last-child { border-bottom: 0; }
  .tl-table th, .tl-table td { border: 0; padding: 3px 12px; }
  .tl-table td::before { content: attr(data-label) ': '; font-weight: 700; color: var(--text-2); }
}

/* ---------- target panel and actions ---------- */
.tl-target { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.tl-target-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
@media (min-width: 800px) { .tl-target-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.tl-target-out { margin-top: 14px; }
.tl-actions { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.tl-actions .tl-in { margin-top: 12px; }

/* ---------- final grade tool ---------- */
.tl-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.tl-tab { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--fill); color: var(--text-2); font: 700 15px/1 var(--sans); cursor: pointer; }
.tl-tab:hover { background: var(--fill-2); color: var(--text); }
.tl-tab[aria-selected="true"] { background: var(--peach); border-color: var(--coral-2); color: var(--text); }
.tl-tabpanel[hidden] { display: none; }
.tl-final-form > * + * { margin-top: 16px; }
.tl-final-form > .tl-tabpanel { margin-top: 8px; }
.tl-part { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: start; margin-top: 8px; }
.tl-part-n { font: 700 13px/44px var(--sans); color: var(--text-2); }
@media (max-width: 519px) { .tl-part { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; } .tl-part-n { grid-column: 1 / -1; line-height: 1.2; } .tl-fl { display: block; } }
@media (min-width: 520px) { .tl-part .tl-fl { display: none; } }
.tl-field--try { max-width: 240px; }

/* ---------- content below the tool ---------- */
.tl-layout { display: grid; grid-template-columns: minmax(0, 700px) 260px; justify-content: space-between; gap: clamp(32px, 5vw, 88px); align-items: start; }
.tl-layout > .tl-prose { grid-column: 1; grid-row: 1; min-width: 0; }
.tl-layout > .nu-toc { grid-column: 2; grid-row: 1; }
.tl-layout .nu-toc ol { counter-reset: tl; }
.tl-layout .nu-toc li { counter-increment: tl; }
.tl-layout .nu-toc a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px; align-items: baseline; }
.tl-layout .nu-toc a::before { content: counter(tl); font: 600 12px/1 var(--sans); color: var(--text-3); text-align: right; padding-right: 4px; }
@media (max-width: 960px) { .tl-layout { grid-template-columns: minmax(0, 1fr); } .tl-layout > .tl-prose, .tl-layout > .nu-toc { grid-column: auto; grid-row: auto; } .tl-layout > .nu-toc a { min-height: 44px; align-items: center; } }
.tl-prose h2 { margin-top: 1.6em; }
.tl-prose > h2:first-child { margin-top: 0; }
.tl-prose .tl-ex { margin-top: 1em; }
.tl-prose .tl-src { font-size: .9em; color: var(--text-3); }
.tl-prose .tl-src a { color: var(--text-2); }
.tl-prose table { font-size: .9em; }
.tl-prose .tl-eq { padding: 10px 14px; border-radius: 12px; background: var(--fill); font: 600 .9em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); overflow-wrap: anywhere; }
.tl-faq { display: grid; gap: 12px; margin-top: 18px; }
.tl-q { border-radius: 16px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.tl-q[open] { border-color: var(--coral-2); }
.tl-q summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 14px 20px; cursor: pointer; font: 600 17px/1.35 var(--sans); color: var(--text); list-style: none; }
.tl-q summary::-webkit-details-marker { display: none; }
.tl-q summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--accent-ink); flex: none; }
.tl-q[open] summary::after { content: '\2212'; }
.tl-q > div { padding: 0 20px 18px; font-size: 16px; line-height: 1.65; color: var(--text-2); max-width: 52em; }
.tl-q > div p + p { margin-top: 10px; }
.tl-q a { color: var(--text); text-decoration-color: var(--coral-2); text-underline-offset: 3px; }
.tl-legal { font-size: 14px; line-height: 1.6; }
.tl-cta { margin-top: 28px; font-size: 16px; line-height: 1.6; color: var(--text-2); max-width: 46em; }
.tl-cta a { color: var(--text); text-decoration-color: var(--coral-2); text-underline-offset: 3px; }
.tl-hubcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
@media (max-width: 760px) { .tl-hubcards { grid-template-columns: minmax(0, 1fr); } }
.tl-hubcards .nu-card { padding: clamp(20px, 2.6vw, 32px); }
.tl-hubcards .nu-card h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; }
.tl-hubcards .nu-card p { font-size: 16px; line-height: 1.6; }
.tl-hubcards .nu-chip { margin-bottom: 14px; }
.tl-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; font-weight: 700; color: var(--text); }
.tl-more svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) { .tl-in, .tl-btn { transition: none; } }

/* ---------- print: the result and the group table, not the controls ---------- */
@media print {
  .nav, .footer, .hv2-dock, .scroll-progress, .tl-setup, .tl-editor, .tl-actions, .tl-target-controls, .tl-banner, .tl-trust, .nu-toc, .tl-faq, .tl-cta, .skip, .tl-final-form { display: none !important; }
  .tl-card { border: 0; box-shadow: none; padding: 0; }
  .tl-results { position: static; border: 0; background: none; }
  .nu-hero { padding-top: 0; background: none; }
  body { background: #fff; color: #000; }
}
