/* Public tools (/tools/). Evergreen material: a paper sheet on the page itself, one background, fields as
   soft fills with no hairline boxes, pills and soft radii, a wash instead of a solid
   fill for the selected option, and the result as the hero. One green, from
   packages/rt-design/green.css. */

.tool { --t-sheet: var(--paper); --t-field: var(--paper-deep); --t-wash: var(--green-100); --t-wash-ink: var(--green-800);
  --t-hero: var(--green-50); --t-ease: cubic-bezier(.2, .7, .2, 1); }

.tool-head { padding: 56px 0 8px; }
.tool-head h1 { font-size: 44px; line-height: 1.1; max-width: 18em; text-wrap: balance; }
.tool-head .lead { margin-top: 12px; max-width: 40em; font-size: 18px; }

.tool-stage { padding: 32px 0 88px; }
.tool-band { padding: 40px 0; margin-top: 32px; }
.tool-sheet { background: var(--t-sheet); border-radius: 18px; box-shadow: 0 24px 60px -30px rgba(26, 26, 26, .28), 0 2px 6px -2px rgba(26, 26, 26, .06); padding: 28px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 28px; align-items: stretch; }
.tool-in { display: flex; flex-direction: column; gap: 22px; padding: 8px 8px 8px 12px; min-width: 0; }
.tool-out { position: relative; display: flex; flex-direction: column; gap: 28px; padding: 36px 36px 32px; border-radius: 14px; background: var(--t-hero); min-width: 0; align-self: start; position: sticky; top: 88px; }

/* Fields: sentence-case label, soft fill, pill. */
.t-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.t-field > label, .t-label { font-size: 13px; color: var(--muted); letter-spacing: var(--track-13); line-height: 1.3; padding-left: 4px; }
.tool .input, .tool select.input { width: 100%; min-height: 46px; padding: 0 18px; font-size: 16.5px; font-variant-numeric: tabular-nums; color: var(--ink);
  background-color: var(--t-field); border: 1px solid transparent; border-radius: 999px; transition: background-color .2s, box-shadow .2s, border-color .2s; }
.tool select.input { padding-right: 42px; background-position: right 18px center; }
.tool .input:hover { background-color: color-mix(in srgb, var(--t-field) 70%, var(--green-100)); }
.tool .input:focus-visible { outline: none; background-color: var(--white); border-color: var(--green); box-shadow: 0 0 0 4px rgba(var(--green-rgb), .1); }
.tool input[type="search"] { -webkit-appearance: none; appearance: none; }
.t-field .t-hint, .t-hint { font-size: 13px; color: var(--faint); line-height: 1.45; padding-left: 4px; }
.t-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.t-sub { display: flex; flex-direction: column; gap: 14px; padding-top: 18px; margin-top: 2px; border-top: 1px solid var(--rule-light); }

/* Segmented control: a soft track, the chosen option a wash. */
.tool .seg { display: flex; gap: 2px; padding: 3px; background: var(--t-field); border: 0; border-radius: 999px; overflow: visible; }
.tool .seg label { flex: 1; }
.tool .seg span { text-transform: none; letter-spacing: var(--track-14); font-size: 14px; font-weight: 400; min-height: 40px; padding: 0 12px; border-radius: 999px; color: var(--muted); text-align: center; line-height: 1.2; transition: background .25s var(--t-ease), color .2s; }
.tool .seg label:hover span { color: var(--ink); }
.tool .seg input:checked + span { background: var(--t-wash); color: var(--t-wash-ink); font-weight: 500; }
.tool .seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(var(--green-rgb), .25); }
.tool .check { font-size: 15px; }
.tool .check .box, .tool .check input.box { border: 1.5px solid var(--quaternary, #a29e95); border-radius: 6px; background: var(--white); }
.tool .check input.box:checked { background: var(--green); border-color: var(--green); box-shadow: inset 0 0 0 3px var(--t-sheet); }

.t-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.t-chip { min-height: 40px; min-width: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--t-field); color: var(--text);
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; transition: background .25s var(--t-ease), color .2s; }
.t-chip:hover { background: var(--green-50); color: var(--ink); }
.t-chip[aria-pressed="true"] { background: var(--t-wash); color: var(--t-wash-ink); font-weight: 500; }
.t-chip:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.t-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.t-link:hover { color: var(--green-ink); }
.t-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
.tool .btn-outline { border: 0; background: var(--t-wash); color: var(--t-wash-ink); border-radius: 999px; padding: 0 22px; font-size: 11.5px; }
.tool .btn-outline:hover { background: var(--green-200); }
.t-private { font-size: 13px; color: var(--faint); padding-left: 4px; }

/* Rows of entries: a soft rule, the name on top, the rest side by side. */
.t-rows { display: flex; flex-direction: column; }
.t-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)); gap: 10px 12px; padding: 14px 0; border-top: 1px solid var(--rule-light); align-items: end; }
.t-row:first-child { border-top: 0; padding-top: 4px; }
.t-rowtop { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-end; }
.t-rowtop .t-field { flex: 1; }
.t-row .t-field > label { font-size: 12.5px; }
.t-rm { color: var(--faint); font-size: 13px; text-decoration: none; padding: 0 6px; }
.t-rm:hover { color: var(--ink); text-decoration: underline; }

/* The result: the hero. */
.t-big { font-family: var(--display); font-weight: 400; font-size: 92px; line-height: .95; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }
.t-big small { font-size: .42em; color: var(--muted); letter-spacing: 0; }
.t-big .t-letter { font-size: .42em; color: var(--green); margin-left: .35em; }
.t-big.is-word { font-size: 56px; }
.t-line { font-size: 17px; line-height: 1.55; color: var(--text); max-width: 34em; }
.t-line strong { font-weight: 600; }
.t-note { font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 40em; }
.t-note a { color: var(--green); }
.t-error { font-size: 15px; line-height: 1.5; color: #7d3f22; }
.res-hero { display: flex; flex-direction: column; gap: 14px; }
.res-more { display: flex; flex-direction: column; gap: 20px; }
.res-more[hidden], .res-hero[hidden] { display: none; }
.t-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px 28px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--green) 14%, transparent); margin: 0; }
.t-facts div { display: flex; flex-direction: column; gap: 2px; }
.t-facts dt { font-size: 13px; color: var(--muted); }
.t-facts dd { margin: 0; font-family: var(--display); font-size: 26px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }

/* The scale: one hairline, circles, labels that find their own room. Filled is the answer, a ring is a mark to compare against. */
.scale { position: relative; margin: 6px 8px 0; user-select: none; -webkit-user-select: none; }
.scale-up, .scale-down { position: relative; transition: height .3s var(--t-ease); }
.scale-track { position: relative; height: 40px; }
.scale-line { position: absolute; left: 0; right: 0; top: 20px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--green) 16%, transparent); }
.scale-fill { position: absolute; left: 0; top: 20px; height: 2px; border-radius: 2px; background: var(--green); transition: width .5s var(--t-ease); }
.scale-ticks { position: relative; height: 22px; }
.scale-tick { position: absolute; top: -14px; width: 1px; height: 6px; background: color-mix(in srgb, var(--green) 30%, transparent); }
.scale-tl { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.scale-dot { position: absolute; top: 20px; width: 18px; height: 18px; margin: -8px 0 0 -9px; border-radius: 50%; background: var(--green); transition: left .55s var(--t-ease); box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 14%, transparent); }
.scale-dot.ring { width: 12px; height: 12px; margin: -5px 0 0 -6px; background: var(--t-hero); border: 1.5px solid var(--green); box-shadow: none; }
.scale-dot.ink { background: var(--ink); box-shadow: 0 0 0 5px rgba(26, 26, 26, .08); }
.scale-label { position: absolute; white-space: nowrap; font-size: 13px; line-height: 16px; color: var(--ink); font-variant-numeric: tabular-nums; transition: left .55s var(--t-ease), top .3s var(--t-ease), opacity .3s; }
.scale-label.down { color: var(--muted); font-size: 12.5px; }
.scale-label b { font-weight: 500; }
/* the what-if handle */
.scale-handle { position: absolute; top: 20px; width: 28px; height: 28px; margin: -13px 0 0 -14px; border-radius: 50%; background: var(--white); border: 2px solid var(--green); cursor: grab; touch-action: none;
  box-shadow: 0 4px 12px -4px rgba(26, 26, 26, .35); display: grid; place-items: center; transition: box-shadow .2s; }
.scale-handle::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.scale-handle:active { cursor: grabbing; box-shadow: 0 0 0 7px color-mix(in srgb, var(--green) 16%, transparent), 0 4px 12px -4px rgba(26, 26, 26, .35); }
.scale-handle:focus-visible { outline: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--green) 30%, transparent); }
.scale-hit { position: absolute; left: -10px; right: -10px; top: 0; height: 40px; cursor: pointer; touch-action: none; }
.scale-whatif { margin-top: 6px; min-height: 3.2em; font-size: 15px; line-height: 1.5; color: var(--text); }
.scale-whatif .hint { color: var(--muted); font-size: 13px; }
.scale-whatif strong { font-weight: 600; }

.res-mini { display: none; }

/* Tables inside results */
.t-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.t-table th { text-align: left; font-weight: 400; font-size: 13px; color: var(--faint); padding: 0 12px 10px 0; border-bottom: 1px solid var(--rule); }
.t-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule-light); color: var(--text); vertical-align: middle; }
.t-table .r { text-align: right; padding-left: 12px; white-space: nowrap; }
.t-table td:last-child, .t-table th:last-child { padding-right: 0; }
.t-bar { position: relative; height: 14px; min-width: 70px; flex: 1; }
.t-bar::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 2px; border-radius: 2px; background: color-mix(in srgb, var(--green) 16%, transparent); }
.t-bar i { position: absolute; top: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--green); transition: left .5s var(--t-ease); }
.tool-out .t-table th { border-bottom-color: color-mix(in srgb, var(--green) 14%, transparent); }
.tool-out .t-table td { border-bottom-color: color-mix(in srgb, var(--green) 10%, transparent); }

/* HOPE verdicts */
.t-verdict { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--green) 14%, transparent); }
.t-verdict h3 { font-size: 22px; }
.t-checks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.t-check { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; font-size: 15px; line-height: 1.45; color: var(--text); }
.t-check .tick { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--green); transform: translateY(1px); }
.t-check .tick.no { background: transparent; border: 1.5px solid var(--green); }
.t-sub-line { color: var(--faint); }

/* Formula entry and chemistry results */
.tool .t-formula { font-size: 21px; min-height: 58px; }
.t-formula-show { font-family: var(--display); font-size: 32px; line-height: 1.2; color: var(--ink); }
.t-formula-show sub, .t-chip sub { font-size: .65em; line-height: 0; }
.t-chip sup { font-size: .6em; line-height: 0; }
.t-sci sup { font-size: .6em; line-height: 0; }
dl.t-trio { margin: 0; display: flex; flex-direction: column; }
.t-trio > div { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--green) 12%, transparent); }
.t-trio dt { font-size: 13px; color: var(--muted); }
.t-trio dd { margin: 0; font-family: var(--display); font-size: 36px; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.t-trio dd small { font-size: 15px; font-family: var(--body); color: var(--muted); margin-left: 6px; }
.t-trio .on dd { color: var(--green); }

/* Show the steps: a quiet disclosure under the result, with the working typeset. */
.t-steps { border-top: 1px solid color-mix(in srgb, var(--green) 14%, transparent); padding-top: 6px; }
.t-steps > summary { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; color: var(--green); cursor: pointer; list-style: none; -webkit-user-select: none; user-select: none; }
.t-steps > summary::-webkit-details-marker { display: none; }
.t-steps > summary::after { content: ''; width: 6px; height: 6px; margin-top: -3px; border-right: 1.25px solid currentColor; border-bottom: 1.25px solid currentColor; transform: rotate(45deg); transition: transform .25s var(--t-ease), margin .25s var(--t-ease); }
.t-steps[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.t-steps > summary:hover { color: var(--green-ink); }
.t-steps > summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.t-steps-list { list-style: none; counter-reset: st; margin: 8px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.t-steps-list > li { counter-increment: st; position: relative; padding-left: 28px; min-width: 0; }
.t-steps-list > li::before { content: counter(st); position: absolute; left: 0; top: -1px; font-family: var(--display); font-size: 18px; line-height: 1.3; color: var(--green); }
.t-step-h { margin: 0 0 4px; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.t-step-p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--text); }
.t-step-p sub, .t-step-h sub { font-size: .72em; line-height: 0; }
.t-step-p sup, .t-step-h sup { font-size: .68em; line-height: 0; }
.t-m math { font-size: 1.08em; }
.t-m-block { display: block; margin: 8px 0 2px; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.t-m-block math { font-size: 1.1em; math-style: normal; }
.t-steps .table-wrap { margin: 0; }
.t-m-system { margin: 6px 0 0; }
.t-m-system .t-m-block { margin: 0; padding: 3px 0; }
.t-steps .nw { white-space: nowrap; }
.t-step-table { font-size: 14px; margin-top: 8px; }
.t-step-table th { font-size: 12.5px; padding-bottom: 6px; }
.t-step-table td { padding-top: 7px; padding-bottom: 7px; }
.tool-out .t-step-table th { border-bottom-color: color-mix(in srgb, var(--green) 14%, transparent); }
.t-step-table sub { font-size: .72em; line-height: 0; }
.t-step-table sup { font-size: .68em; line-height: 0; }
@media (max-width: 560px) { .t-m-block math { font-size: 1em; } .t-step-table { font-size: 13px; } .t-step-table th { font-size: 12px; } .t-steps-list > li { padding-left: 24px; } }
@media (prefers-reduced-motion: reduce) { .t-steps > summary::after { transition: none; } }

/* The balanced equation */
.t-eqn { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.35; color: var(--ink); letter-spacing: -.005em; overflow-wrap: anywhere; }
.t-eqn sub { font-size: .6em; line-height: 0; vertical-align: -.28em; }
.t-eqn sup { font-size: .55em; line-height: 0; vertical-align: .62em; margin-left: .04em; }
.t-eqn .co { color: var(--green); padding-right: .14em; }
.t-eqn .ar { font-family: var(--body); font-weight: 300; padding: 0 .18em; }
.t-eqn .pl { font-family: var(--body); font-weight: 300; padding: 0 .12em; }
.t-eqn .sp { white-space: nowrap; }
.t-eq-plain { font-size: 15px; line-height: 1.5; color: var(--muted); }
@media (max-width: 560px) { .t-eqn { font-size: 27px; } }

/* Explainer */
.tool-explain { padding: 80px 0; }
.tool-explain .article h2 { font-size: 30px; margin-top: 48px; }
.tool-explain .article h2:first-child { margin-top: 0; }
.tool-explain .article h3 { font-size: 22px; margin: 28px 0 8px; }
.tool-explain .article ul, .tool-explain .article ol { margin-top: 12px; }
.tool-explain math { font-size: 1.12em; }
.math-block { display: block; margin: 20px 0; padding: 4px 0; overflow-x: auto; overflow-y: hidden; }
.math-block math { display: block math; font-size: 1.25em; }
.tool-faq { padding: 80px 0; }
.tool-more { padding: 40px 0 72px; }
.tool-more .arrows { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 900px) {
  .tool-head { padding: 28px 0 0; }
  .tool-head h1 { font-size: 32px; }
  .tool-head .lead { font-size: 17px; }
  .tool-stage { padding: 20px 0 56px; }
  .tool-band { padding: 16px 0; margin-top: 20px; }
  .tool-band > .wrap { padding: 0 12px; }
  .tool-sheet { padding: 12px; border-radius: 16px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .tool-in { padding: 8px 6px; }
  .tool-out { position: static; padding: 28px 20px 24px; }
  .out-first .tool-out { order: -1; }
  .t-big { font-size: 72px; }
  .tool-explain, .tool-faq { padding: 56px 0; }
  .t-table th, .t-table td { padding-right: 8px; }
  .has-mini .res-mini { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; position: sticky; bottom: 10px; z-index: 5; margin-top: 8px; padding: 12px 20px;
    border-radius: 999px; background: var(--green); color: var(--white); box-shadow: 0 10px 30px -10px rgba(var(--green-rgb), .6); border: 0; font: inherit; cursor: pointer; text-align: left; }
  .res-mini .m-num { font-family: var(--display); font-size: 26px; line-height: 1; }
  .res-mini .m-more { font-size: 13px; opacity: .85; }
}
@media (max-width: 560px) { .t-pair { gap: 10px; } .t-big { font-size: 64px; } }
@media (prefers-reduced-motion: reduce) { .tool * { transition: none !important; } }


/* ================= The periodic table =================
   Ported from the test app's periodic-table.css (assessment/components/run). Evergreen tokens
   are scoped to the panel, so dark mode follows the visitor's system setting on its own. Family
   tints are a little of one hue mixed into the paper. */
.pt-panel {
  --paper: #fbf9f4; --paper-deep: #f3efe6; --ink: #1a1a1a; --text: #2c2c2c; --muted: #56554f; --faint: #66645d; --quaternary: #a29e95;
  --accent: var(--green-800); --accent-fill: var(--green-800); --accent-hover: var(--green-700); --on-accent: #fff;
  --elev-sheet: 0 24px 60px -24px rgba(0, 0, 0, 0.5); --font-ui: 'SF Pro', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'PP Editorial Old', 'Didot', Georgia, serif; --dur: 160ms;
  position: relative; width: 100%; display: flex; flex-direction: column; gap: 18px; padding: 26px 30px 24px;
  background: var(--paper); color: var(--text); border-radius: 14px; box-shadow: var(--elev-sheet); font-family: var(--font-ui); overflow: hidden; letter-spacing: normal; line-height: 1.3; font-weight: 400;
}
@media (prefers-color-scheme: dark) {
  .pt-panel { --paper: #181b19; --paper-deep: #1f2320; --ink: #f2efe7; --text: #dfdcd4; --muted: #b0aca2; --faint: #9a968c; --quaternary: #5d5a54;
    --accent: var(--green-400); --accent-fill: var(--green-600); --accent-hover: var(--green-550); --elev-sheet: 0 24px 60px -24px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05); }
}
.pt-panel h2 { color: var(--ink); }
.pt-head { display: flex; align-items: center; gap: 16px; }
.pt-head h2 { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; color: var(--ink); }
.pt-find input { width: 168px; height: 32px; min-height: 0; padding: 0 12px; font: 300 14px/1 var(--font-ui); color: var(--ink); background: var(--paper-deep); border: 1px solid transparent; border-radius: 999px; -webkit-appearance: none; appearance: none; }
.pt-find input::placeholder { color: var(--faint); }
.pt-find input:focus { outline: none; border-color: var(--accent); }
.pt-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; border: 0; background: var(--paper-deep); color: var(--muted); cursor: pointer; }
.pt-close:hover { color: var(--ink); }
.pt-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pt-scroll { overflow: auto; -webkit-overflow-scrolling: touch; min-height: 0; }
.pt-grid {
  display: grid; --tile-h: clamp(46px, calc((100dvh - 330px) / 9.4), 64px);
  grid-template-columns: 14px repeat(18, minmax(44px, 1fr));
  grid-template-rows: 16px repeat(7, var(--tile-h)) 10px repeat(2, var(--tile-h));
  gap: 3px; min-width: 860px;
}
.pt-group, .pt-period { font-size: 10px; font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; line-height: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 3px; }
.pt-group { grid-row: 1; }
.pt-period { grid-column: 1; align-items: center; justify-content: flex-start; padding: 0; }
.pt-el {
  --hue: var(--quaternary); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 3px 2px;
  border: 0; border-radius: 5px; cursor: pointer; background: color-mix(in srgb, var(--hue) 24%, var(--paper)); color: var(--ink); font-family: var(--font-ui);
  transition: opacity var(--dur) ease, transform var(--dur) ease, box-shadow var(--dur) ease;
}
.pt-el .n { position: absolute; top: 3px; left: 5px; font-size: 9.5px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-el .s { font-size: 18px; font-weight: 500; line-height: 1; letter-spacing: -0.01em; margin-top: 6px; }
.pt-el .nm { font-size: 8.5px; font-weight: 300; line-height: 1.1; white-space: nowrap; color: var(--text); }
/* Every name in full, never clipped: a tile is a size container, and its name (--nw, the name's width in em)
   is set to fill at most 97% of the tile, between 5.75px and 8.5px. Every tile is the same width, so where even the
   longest name would drop under 5.75px, all the names hide together; the element card still shows it. */
.pt-el { container-type: inline-size; }
@supports (width: 1cqi) { .pt-el .nm { font-size: clamp(5.75px, calc(97cqi / var(--nw, 6.6)), 8.5px); line-height: 9.35px; } }
@supports not (width: 1cqi) { .pt-el .nm { display: none; } }
@container (max-width: 38.9px) { .pt-el .nm { display: none; } }
.pt-el .m { font-size: 8.5px; font-weight: 300; line-height: 1.1; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-el:hover { transform: scale(1.06); z-index: 1; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35); }
.pt-el:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 1; }
.pt-el.is-picked { box-shadow: inset 0 0 0 1.5px var(--accent); }
.pt-el.is-dim { opacity: 0.22; }
.f-alkali { --hue: #c4643f; } .f-alkaline { --hue: #c89a3c; } .f-transition { --hue: #6f8fae; } .f-post { --hue: #8a86b4; } .f-metalloid { --hue: #8c9a4e; }
.f-nonmetal { --hue: #3f8a5c; } .f-halogen { --hue: #3a8f95; } .f-noble { --hue: #a06b9a; } .f-lanthanide { --hue: #c27d95; } .f-actinide { --hue: #94785e; } .f-unknown { --hue: #9a968c; }

.pt-card-wide { grid-column: 4 / 14; grid-row: 2 / 5; padding: 0 12px 12px; min-width: 0; contain: size; }
.pt-card-narrow { display: none; }
.pt-card { display: flex; gap: 18px; align-items: stretch; height: 100%; min-height: 0; }
.pt-card.is-empty { align-items: center; justify-content: center; }
.pt-card.is-empty p { margin: 0; font-size: 13px; font-weight: 300; color: var(--faint); }
.pt-big { flex: none; aspect-ratio: 1 / 1.08; height: 100%; min-height: 112px; max-height: 150px; position: relative; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: color-mix(in srgb, var(--hue, var(--quaternary)) 24%, var(--paper)); }
.pt-big .n { position: absolute; top: 8px; left: 10px; font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-big .s { font-family: var(--font-display); font-weight: 400; font-size: 54px; line-height: 1; color: var(--ink); }
.pt-facts { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.pt-facts .nm { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.1; color: var(--ink); }
.pt-facts dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 4px 28px; }
.pt-facts dl div { display: contents; }
.pt-facts dt { font-size: 12px; font-weight: 300; color: var(--muted); white-space: nowrap; }
.pt-facts dd { margin: 0; font-size: 13px; font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.pt-facts dd sup { font-size: 0.7em; line-height: 0; }
.pt-facts .pred { color: var(--faint); font-weight: 300; }

.pt-key { list-style: none; margin: 0; padding: 0 0 0 10px; display: flex; flex-wrap: wrap; gap: 2px; }
.pt-key button { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 9px 0 8px; font: 300 12px/1 var(--font-ui); color: var(--text); background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.pt-key button i { width: 10px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--hue) 55%, var(--paper)); }
.pt-key button:hover, .pt-key button.is-on { background: var(--paper-deep); color: var(--ink); }
.pt-key button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (max-width: 760px) {
  .pt-panel { padding: 18px 16px 16px; gap: 14px; border-radius: 16px; }
  .pt-head h2 { font-size: 20px; white-space: nowrap; }
  .pt-find input { width: 120px; }
  .pt-card-wide { display: none; }
  .pt-card-narrow { display: block; flex: none; height: 132px; }
  .pt-card { gap: 14px; }
  .pt-big { min-height: 0; height: 132px; }
  .pt-big .s { font-size: 40px; }
  .pt-facts { gap: 6px; }
  .pt-facts .nm { font-size: 20px; }
  .pt-facts dl { grid-template-columns: auto 1fr; gap: 1px 14px; }
  .pt-facts dt { font-size: 11.5px; } .pt-facts dd { font-size: 12.5px; }
  .pt-grid { --tile-h: 46px; grid-template-columns: 12px repeat(18, 42px); min-width: 0; }
  .pt-el .nm { display: none; }
  .pt-el .n { top: 2px; left: 4px; font-size: 8px; }
  .pt-el .s { font-size: 16px; margin-top: 8px; }
  .pt-el:hover { transform: none; box-shadow: none; }
  .pt-key { flex: none; padding: 0; }
  .pt-key button { white-space: nowrap; height: 26px; font-size: 11.5px; }
}
@media (max-width: 900px) and (min-width: 761px) { .pt-panel { padding: 22px 20px; } }
@media (prefers-reduced-motion: reduce) { .pt-el { transition: none; } .pt-el:hover { transform: none; } }

/* the tour */
.pt-tour { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pt-spot { position: absolute; border-radius: 9px; box-shadow: 0 0 0 2px var(--accent), 0 0 0 9999px rgba(8, 18, 11, 0.42); transition: left 260ms ease, top 260ms ease, width 260ms ease, height 260ms ease; }
.pt-spot.is-none { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 9999px rgba(8, 18, 11, 0.42); }
.pt-note { position: absolute; pointer-events: auto; padding: 16px 18px 14px; background: var(--paper); color: var(--text); border-radius: 12px; box-shadow: var(--elev-sheet); transition: left 260ms ease, top 260ms ease; }
.pt-note .t { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1.15; color: var(--ink); }
.pt-note .b { margin: 0 0 14px; font-size: 14px; font-weight: 300; line-height: 1.45; }
.pt-note .row { display: flex; align-items: center; gap: 14px; }
.pt-note .count { flex: 1; font-size: 12px; font-weight: 300; color: var(--faint); font-variant-numeric: tabular-nums; }
.pt-note .skip { border: 0; background: none; padding: 0; font: 300 13px/1 var(--font-ui); color: var(--muted); cursor: pointer; }
.pt-note .skip:hover { color: var(--ink); }
.pt-note .next { height: 30px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer; background: var(--accent-fill); color: var(--on-accent); font: 400 13px/1 var(--font-ui); }
.pt-note .next:hover { background: var(--accent-hover); }
.pt-note button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .pt-spot, .pt-note { transition: none; } }

.pt-wide-wrap { max-width: 1340px !important; }
@media (min-width: 901px) { .pt-wide-wrap .t-note { padding-left: 4px; } }


/* ================= The calculators (graphing, scientific) =================
   The tools themselves are packages/rt-tools (the same ones as the portal, the Library and
   the test app), served as /rt-tools/rt-tools.js and .css. Here: the panel they sit in, with
   Evergreen's tokens scoped to it, so the panel follows the visitor's light or dark setting
   the way the periodic table does, and the room around it. */
.rtc {
  --paper: #fbf9f4; --sheet: #fbf9f4; --paper-deep: #f3efe6; --paper-deep-edge: #e7e1d4; --ink: #1a1a1a; --text: #2c2c2c;
  --muted: #56554f; --faint: #66645d; --quaternary: #a29e95; --rule: #e4dfd3;
  --accent: var(--green-800); --accent-fill: var(--green-800); --accent-hover: var(--green-700); --accent-wash: var(--green-50); --on-accent: #fff;
  --font-ui: 'SF Pro', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'PP Editorial Old', 'Didot', Georgia, serif; --dur: 160ms;
  position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--paper); color: var(--text);
  border-radius: 18px; box-shadow: 0 24px 60px -30px rgba(26, 26, 26, .28), 0 2px 6px -2px rgba(26, 26, 26, .06);
  letter-spacing: normal; line-height: 1.3; font-weight: 400;
}
@media (prefers-color-scheme: dark) {
  .rtc { --paper: #181b19; --sheet: #181b19; --paper-deep: #1f2320; --paper-deep-edge: #2b302c; --ink: #f2efe7; --text: #dfdcd4;
    --muted: #b0aca2; --faint: #9a968c; --quaternary: #5d5a54; --rule: #2c302d;
    --accent: var(--green-400); --accent-fill: var(--green-600); --accent-hover: var(--green-550); --accent-wash: #102313;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .05); }
}
.rtc > .rtt { flex: 1 1 auto; min-height: 0; }
.rtc-off { margin: auto; padding: 40px 24px; font-size: 15px; color: var(--muted); text-align: center; }
.calc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; margin-top: 10px; padding: 0 6px; }
.calc-bar .t-private { margin-left: auto; padding-left: 0; }

/* Graphing: the page's width, edge to edge but for a margin, and nearly the window's height. */
.calc-band { padding: 20px 0 28px; margin-top: 28px; }
.calc-wide { padding: 0 24px; max-width: 1800px; margin: 0 auto; }
.rtc-graph { height: calc(100vh - var(--nav-h, 72px) - 120px); height: calc(100dvh - var(--nav-h, 72px) - 120px); min-height: 520px; max-height: 1080px; padding: 18px 18px 18px 20px; }

/* Scientific: the calculator, and beside it lines to try. */
.calc-sci { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 40px; align-items: stretch; }
.rtc-sci { height: 640px; padding: 20px; }
.calc-try { display: flex; flex-direction: column; gap: 6px; padding: 8px 0 0; min-width: 0; }
.calc-try h2 { font-size: 24px; line-height: 1.15; margin: 0 0 6px; }
.calc-try ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.calc-try li + li { border-top: 1px solid var(--rule-light); }
.calc-try button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 16px; width: 100%; min-height: 48px; padding: 10px 4px; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.calc-try code { font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, system-ui, sans-serif); font-size: 16px; font-weight: 400; color: var(--ink); background: none; padding: 0; }
.calc-try code i { font-family: var(--display); font-size: 1.12em; font-style: italic; letter-spacing: .01em; padding-right: .04em; }
.calc-try code sup { font-size: .68em; line-height: 0; vertical-align: .38em; }
.calc-try code sub { font-size: .68em; line-height: 0; }
.calc-try button > span { font-size: 13.5px; color: var(--muted); text-align: right; }
.calc-try button:hover code { color: var(--green); }
.calc-try button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.calc-try .t-note { margin-top: 12px; }

@media (max-width: 900px) {
  .calc-band { padding: 12px 0 18px; margin-top: 18px; }
  .calc-wide { padding: 0 10px; }
  .rtc-graph { height: calc(100svh - var(--nav-h, 62px) - 96px); min-height: 560px; padding: 12px; border-radius: 16px; }
  .calc-sci { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .rtc-sci { height: min(640px, calc(100svh - var(--nav-h, 62px) - 40px)); min-height: 520px; padding: 14px; border-radius: 16px; }
  .calc-bar .t-private { margin-left: 0; width: 100%; }
}


/* ================= The page around the tools =================
   One ground, top to bottom: the paper-deep that sat behind the periodic table. The index is a page like the
   site's others on it. Every tool page is one screen, like an app (body.is-app, html.tool-root): no page
   scroll, no zoom, the site's nav, crumbs and footer kept in the page but out of sight, a small control in
   the top corner in their place, the title and one line above the tool, and everything else (the explainer,
   the worked example, the questions, the links on) in an About sheet that slides in from the side. A tool
   taller than the screen scrolls inside its own sheet, never the page. */

body.is-tool { background: var(--paper-deep); }
.is-tool .nav { background: var(--paper-deep); }
.is-tool .crumbs { background: transparent; border-bottom: 0; }
.tool h1 .it, .tool h2 .it { font-style: italic; font-weight: 400; padding-right: .04em; }

/* The figure each page carries: thin strokes in the green ramp, drawn in once (tools/assets/page.js). */
.tm-wrap { pointer-events: none; min-width: 0; }
.tm { display: block; width: 100%; height: auto; overflow: visible; }
.tm-chem .tm, .tm-math .tm { overflow: hidden; }
.tm text { font-family: var(--ui); font-weight: 400; letter-spacing: 0; text-rendering: geometricPrecision; }
.tm .tm-h { stroke: var(--green-200); stroke-width: 1; stroke-linecap: round; }
.tm .tm-s { stroke: var(--green-400); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.tm .tm-k { stroke: var(--green-300); stroke-width: 1; stroke-dasharray: 3 4; }
.tm .tm-g { stroke: var(--green-100); stroke-width: 1; }
.tm .tm-p { fill: var(--green-400); }
.tm .tm-r { fill: var(--paper-deep); stroke: var(--green-400); stroke-width: 1.25; }
.tm .tm-t { fill: var(--green-100); fill-opacity: .75; stroke: none; }
.tm .tm-l { fill: var(--green-500); fill-opacity: .75; }
.tm .tm-li { fill: var(--green-600); }
.tm .tm-it { font-family: var(--display); font-style: italic; }
.tm .tm-hz { stroke: url(#tmh); }
.tm .tm-stop0 { stop-color: var(--green-200); stop-opacity: 0; }
.tm .tm-stop1 { stop-color: var(--green-200); stop-opacity: 1; }
.tm-arm:not(.tm-go) [data-t] { opacity: 0; }

/* ---- The index ---- */
.tool-intro { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: center; }
.tool-endband { padding-top: 0; }
.tool-endband > .wrap + .wrap { padding-top: 72px; }
.is-tool .keepgoing { border-top-color: var(--rule-light); }
@media (max-width: 900px) { .tool-intro { grid-template-columns: minmax(0, 1fr); } .tool-intro .tm-wrap { display: none; } .tool-endband > .wrap + .wrap { padding-top: 48px; } }

/* ---- A tool page: one screen ---- */
html.tool-root, html.tool-root body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.tool-root { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.is-app > .skip, .is-app > .nav, .is-app > .crumbs, .is-app > .keepgoing, .is-app > .footer { display: none !important; }

.tool-app { --app-x: 24px; position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); padding: 0 var(--app-x) max(20px, env(safe-area-inset-bottom)); }
.is-app .tool-head { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: end; gap: 40px; width: 100%; max-width: 1080px; margin: 0 auto; padding: 80px 0 22px; }
.is-app .tool-head h1 { font-size: 34px !important; line-height: 1.1; max-width: none; text-wrap: balance; }
.is-app .tool-head .lead { margin-top: 8px; max-width: 46em; font-size: 15.5px; line-height: 1.5; }
.is-app .tool-head .lead sub { font-size: .72em; line-height: 0; }
.is-app .tool-head .tm-wrap { width: 300px; margin-bottom: 2px; }

/* The GPA family: centred, with its figure on a horizon over the title. */
.fam-gpa .tool-head { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: 10px; padding-top: 64px; }
.fam-gpa .tool-head .tm-wrap { order: -1; width: 260px; margin: 0; }
.fam-gpa .tool-head .lead { margin-left: auto; margin-right: auto; }
/* Chemistry and math: the figure leans out to the edge. */
.fam-chem .tool-head .tm-wrap, .fam-math .tool-head .tm-wrap { width: 340px; margin-right: -40px; }

.is-app .tool-band { margin: 0; padding: 0; min-height: 0; display: flex; flex-direction: column; }
.is-app .tool-band > .wrap { flex: 1 1 auto; min-height: 0; width: 100%; padding: 0; max-width: 1080px; display: flex; flex-direction: column; }
.is-app .tool-sheet { flex: 0 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.is-app .tool-out { top: 0; }

/* Graphing: nearly edge to edge. */
.tool-graphing-calculator .tool-app { --app-x: 14px; }
.tool-graphing-calculator .tool-head { max-width: none; padding-left: 4px; padding-right: 4px; }
.is-app .calc-band > .calc-wide { flex: 1 1 auto; min-height: 0; width: 100%; margin: 0; display: flex; flex-direction: column; padding: 0; max-width: none; }
.is-app .rtc-graph { flex: 1 1 auto; height: auto; min-height: 0; max-height: none; }
.is-app .calc-bar { flex: none; margin-top: 8px; }
/* Scientific: the calculator as tall as the room allows, the lines to try scrolling beside it. */
.is-app .calc-sci { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.is-app .calc-sci > div:first-child { display: flex; flex-direction: column; min-height: 0; }
.is-app .rtc-sci { flex: 0 1 auto; height: 640px; max-height: 100%; min-height: 0; }
.is-app .calc-try { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 4px; }
/* The periodic table: the panel fits the screen and its tiles size to it. */
.is-app .pt-wide-wrap { max-width: 1340px !important; }
.is-app .pt-panel { flex: 0 1 auto; min-height: 0; min-width: 0; }
.is-app .pt-scroll { flex: 1 1 auto; }
.is-app .pt-grid { --tile-h: clamp(38px, calc((100dvh - 390px) / 9.4), 64px); }
.tool-periodic-table .tool-head { max-width: 1340px; padding-left: 30px; }

/* ---- The corner control: the logo home, and the site's menu ---- */
.app-bar { position: fixed; z-index: 50; top: max(14px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right));
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.app-bar > * { pointer-events: auto; }
.app-pill, .app-about-btn { background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 0 0 .5px rgba(26, 26, 26, .06), 0 10px 26px -16px rgba(26, 26, 26, .4); border-radius: 999px; }
.app-pill { position: relative; display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 5px 0 16px; }
.app-home { display: block; padding: 4px 0; }
.app-home img { display: block; height: 27px; width: auto; }
.app-menu-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; transition: background .2s; }
.app-menu-btn:hover, .app-menu-btn[aria-expanded="true"] { background: var(--paper-deep); }
.app-menu-btn svg path { transition: d .25s var(--t-ease); }
.app-menu-btn[aria-expanded="true"] svg path { d: path("M4 4l8 8M12 4l-8 8"); }
.app-menu-btn:focus-visible, .app-about-btn:focus-visible, .ta-close:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.app-menu { position: absolute; top: calc(100% + 8px); left: 0; width: 248px; padding: 8px; display: flex; flex-direction: column; border-radius: 18px;
  background: var(--paper); box-shadow: 0 0 0 .5px rgba(26, 26, 26, .06), 0 24px 60px -24px rgba(26, 26, 26, .4); transform-origin: 24px 0; animation: am-in .26s var(--t-ease); }
.app-menu[hidden] { display: none; }
.app-menu a { display: block; padding: 10px 14px; border-radius: 12px; font-size: 15.5px; line-height: 1.3; color: var(--text); text-decoration: none; }
.app-menu a:hover, .app-menu a:focus-visible { background: var(--paper-deep); color: var(--ink); outline: none; }
.app-menu a.am-cta { margin-top: 6px; color: var(--green); }
.app-menu a.am-cta::before { content: ''; display: block; height: 1px; margin: -6px -6px 10px; background: var(--rule-light); }
@keyframes am-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.app-about-btn { display: inline-flex; align-items: center; height: 42px; padding: 0 20px; font-size: 14px; color: var(--text); text-decoration: none; transition: color .2s; }
.app-about-btn:hover { color: var(--green); }
.ab-short { display: none; }

/* ---- The About sheet ---- */
.tool-about { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(600px, 100%); display: flex; flex-direction: column; background: var(--paper);
  box-shadow: -30px 0 80px -40px rgba(26, 26, 26, .45); transform: translateX(calc(100% + 140px)); transition: transform .45s var(--t-ease); outline: none; }
.tool-about:target, .tool-about.is-open { transform: none; }
.app-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(16, 24, 18, .16); opacity: 0; pointer-events: none; transition: opacity .35s; }
.is-about-open .app-scrim { opacity: 1; pointer-events: auto; }
.ta-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: max(16px, env(safe-area-inset-top)) 18px 14px 36px; border-bottom: 1px solid var(--rule-light); }
.ta-title { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.2; color: var(--ink); }
.ta-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: var(--paper-deep); color: var(--ink); }
.ta-close:hover { background: var(--green-50); }
.ta-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 36px max(36px, env(safe-area-inset-bottom)); }
.tool-about .wrap { max-width: none; padding: 0; }
.tool-about .article { max-width: none; }
.ta-section { padding: 32px 0; }
.ta-section + .ta-section { border-top: 1px solid var(--rule-light); }
.ta-intro .lead { font-size: 18px; }
.tool-about .tool-explain { padding: 32px 0; }
.tool-about .tool-explain .article h2 { font-size: 26px !important; margin-top: 36px; }
.tool-about .tool-explain .article h2:first-child { margin-top: 0; }
.tool-about .tool-faq { padding: 32px 0; }
.tool-about .tool-faq .split { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.tool-about .tool-faq h2, .tool-about .tool-close h2 { font-size: 28px !important; }
.tool-about .tool-more { padding: 28px 0 8px; }
.tool-about .tool-more .arrows { gap: 10px 24px; }
.ta-legal { margin: 20px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--faint); }
.ta-legal a { color: var(--faint); }
.is-about-open .tool-app { }

/* ---- Narrower screens ---- */
@media (max-width: 1100px) {
  .is-app .tool-head { grid-template-columns: minmax(0, 1fr) 240px; }
  .is-app .tool-head .tm-wrap, .fam-chem .tool-head .tm-wrap, .fam-math .tool-head .tm-wrap { width: 240px; margin-right: 0; }
}
@media (max-width: 900px) {
  .is-app .calc-sci { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; display: block; overflow: auto; overscroll-behavior: contain; }
  .is-app .calc-sci > div:first-child { display: block; }
  .is-app .rtc-sci { height: calc(100dvh - 210px); max-height: 640px; min-height: 420px; }
  .is-app .calc-try { overflow: visible; padding: 24px 4px 8px; }
}
@media (max-width: 760px) {
  .tool-app { --app-x: 10px; }
  .is-app .tool-head, .fam-gpa .tool-head { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 66px 6px 12px; }
  .is-app .tool-head h1 { font-size: 26px !important; }
  .is-app .tool-head .lead { margin-top: 4px; font-size: 14.5px; line-height: 1.45; }
  .is-app .tool-head .tm-wrap { display: none; }
  .fam-gpa .tool-head { text-align: left; justify-items: start; padding-top: 66px; }
  .fam-gpa .tool-head .lead { margin-left: 0; }
  .app-bar { top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; }
  .app-pill { height: 40px; padding-left: 13px; }
  .app-home img { height: 24px; }
  .app-about-btn { height: 40px; padding: 0 16px; }
  .ab-long { display: none; } .ab-short { display: inline; }
  .is-app .tool-band > .wrap { padding: 0; }
  .is-app .pt-grid { --tile-h: 46px; }
  /* On a phone the whole panel scrolls, the element's card held at its top. */
  .is-app .pt-panel { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .is-app .pt-scroll { flex: none; overflow-y: hidden; }
  .is-app .pt-card-narrow { position: sticky; top: -18px; z-index: 2; margin-top: -18px; padding-top: 18px; background: var(--paper); }
  .ta-bar { padding-left: 22px; padding-right: 12px; }
  .ta-scroll { padding-left: 22px; padding-right: 22px; }
  .tool-about .tool-explain .article h2 { font-size: 24px !important; }
  .tool-about .tool-faq h2, .tool-about .tool-close h2 { font-size: 26px !important; }
}
@media (max-height: 700px) and (max-width: 760px) {
  .is-app .tool-head .lead { display: none; }
  .is-app .tool-head { padding-bottom: 10px; }
}
/* iOS zooms into a field under 16px on focus; these are the tools' few that are. */
@media (pointer: coarse) {
  .is-app .pt-find input, .is-app .rtt-g-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-about, .app-scrim, .app-menu, .app-menu-btn svg path { transition: none; animation: none; }
}
