/* ============================================================================
   TEGA TOOLS — COMPONENT STYLES
   Mobile-first (375px base). Desktop enhancements live in @media (min-width:*).
   Every value references a token from tokens.css — no hardcoded colours/spacing.
   ========================================================================== */

/* --- Layout primitives ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.site-main { display: block; }
.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-2);
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}

/* --- Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  min-height: 60px;
}
.site-header__logo { height: 30px; width: auto; display: block; }
.site-header__nav { display: flex; gap: var(--space-4); align-items: center; }
.site-header__nav a {
  font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--color-text);
}
.site-header__nav a:hover { color: var(--color-link-hover); }
@media (max-width: 400px) {
  .site-header__logo { height: 26px; }
  .site-header__nav { gap: var(--space-3); font-size: var(--text-xs); }
}

/* --- Hub ------------------------------------------------------------------- */
.hub-hero { padding: var(--space-7) 0 var(--space-6); }
.hub-hero h1 { font-size: var(--text-3xl); line-height: var(--lh-3xl); max-width: 16ch; }
.hub-hero__lead {
  font-size: var(--text-lg); color: var(--color-text-secondary);
  max-width: 54ch; margin: var(--space-4) 0 0;
}
.hub-grid-wrap { padding-bottom: var(--space-8); }
.hub-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
.tool-card {
  display: block; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: var(--space-5); box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.tool-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tool-card__title { font-size: var(--text-xl); margin: 0 0 var(--space-2); }
.tool-card__tag { color: var(--color-text-secondary); margin: 0 0 var(--space-4); }
.tool-card__go { font-weight: var(--fw-semibold); color: var(--color-link); }
.tool-card--soon { opacity: 0.7; border-style: dashed; box-shadow: none; }
.tool-card--soon:hover { transform: none; box-shadow: none; }
@media (min-width: 700px) { .hub-grid { grid-template-columns: 1fr 1fr; } }

/* --- Tool shell ------------------------------------------------------------ */
.tool-head { padding: var(--space-6) 0 var(--space-5); }
.tool-head h1 { margin-bottom: var(--space-2); }
.tool-head__subtitle {
  font-size: var(--text-lg); color: var(--color-text-secondary);
  max-width: 60ch; margin: 0 0 var(--space-5);
}
.tool-head__note {
  font-size: var(--text-xs); color: var(--color-text-muted);
  max-width: 60ch; margin: var(--space-3) 0 0;
}
.tool-grid { display: grid; grid-template-columns: 1fr; gap: var(--tool-gap); align-items: start; }
@media (min-width: 860px) {
  .tool-grid { grid-template-columns: var(--input-col) var(--result-col); }
  .tool-grid__result { position: sticky; top: 76px; }
}

/* Panels */
.panel {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-sm);
}
.panel__title { font-size: var(--text-lg); margin: 0 0 var(--space-4); }
.field-group { display: grid; gap: var(--space-4); }
.field-row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }

/* --- Fields ---------------------------------------------------------------- */
.field { display: block; }
.field__label {
  display: block; font-size: var(--text-sm); font-weight: var(--fw-medium);
  color: var(--color-text); margin-bottom: var(--space-2);
}
.field__control { position: relative; display: flex; align-items: stretch; }
.field__input {
  width: 100%; min-height: 46px; font-family: var(--font-body);
  font-size: var(--text-base); color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 0 var(--space-4);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.field__input:hover { border-color: var(--grey-400); }
.field__input:focus-visible { border-color: var(--color-accent); box-shadow: var(--focus-ring); outline: none; }
.field__control--unit .field__input { padding-right: 3.5rem; }
.field__unit {
  position: absolute; right: 1px; top: 1px; bottom: 1px; display: flex; align-items: center;
  padding: 0 var(--space-3); color: var(--color-text-secondary); font-size: var(--text-sm);
  background: var(--color-surface-alt); border-left: 1px solid var(--color-border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0; pointer-events: none;
}
.field__select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-4) center; padding-right: 2.5rem;
}
.field__help { font-size: var(--text-xs); color: var(--color-text-muted); margin: var(--space-2) 0 0; }
.field.has-error .field__input { border-color: var(--danger); background: var(--danger-bg); }
.field__error { font-size: var(--text-xs); color: var(--danger); margin: var(--space-2) 0 0; font-weight: var(--fw-medium); }

/* --- StandardsToggle (segmented) ------------------------------------------ */
.segmented {
  display: inline-flex; border: 1px solid var(--color-border); background: var(--color-surface);
  border-radius: var(--radius-pill); padding: 3px; gap: 2px; margin: 0; }
.segmented__opt {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--color-text);
  cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
/* Selected state is driven by the actual :checked radio so it updates live on
   click; the .is-selected class is the server-rendered / no-:has() fallback. */
.segmented__opt.is-selected,
.segmented__opt:has(input:checked) { background: var(--color-primary); color: var(--color-text-on-navy); }
/* When JS/:has is active, don't let the stale server class linger on the other option. */
.segmented:has(input:checked) .segmented__opt.is-selected:not(:has(input:checked)) {
  background: transparent; color: var(--color-text); }
.segmented__opt:has(input:focus-visible) { box-shadow: var(--focus-ring); }
/* On phones an inline pill row crams long labels (e.g. the transformer tool's
   four input modes) into ugly mid-word wraps. Lay the options out as a
   full-width grid instead: 2 options → one row, 4 → a tidy 2×2. */
@media (max-width: 600px) {
  .segmented {
    display: grid; grid-template-columns: 1fr 1fr;
    width: 100%; border-radius: var(--radius-lg); gap: 3px; }
  .segmented__opt {
    min-height: 44px; padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md); text-align: center;
    line-height: var(--lh-sm); }
}

/* --- Button ---------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-5); border: none; cursor: pointer;
  font-family: var(--font-body); font-size: var(--text-base); font-weight: var(--fw-semibold);
  border-radius: var(--radius-md); text-decoration: none;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.btn--gold { background: var(--color-accent); color: var(--color-text-on-gold); box-shadow: var(--shadow-gold); }
.btn--gold:hover { background: var(--color-accent-hover); color: var(--color-text-on-gold); }
.btn--gold:active { background: var(--color-accent-active); transform: translateY(1px); }
.btn--full { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn--ghost { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.btn-row .btn { flex: 1 1 auto; }

/* --- ResultCard ------------------------------------------------------------ */
.result {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-md); }
.result__eyebrow {
  font-size: var(--text-xs); letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--color-accent-active); font-weight: var(--fw-semibold); margin: 0 0 var(--space-3); }
.result__value { margin: 0 0 var(--space-3); display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.result__number { font-family: var(--font-mono); font-size: var(--text-4xl); line-height: var(--lh-4xl); color: var(--navy); font-weight: var(--fw-bold); }
.result__unit { font-family: var(--font-mono); font-size: var(--text-xl); color: var(--color-text-secondary); }
.result__reading { color: var(--color-text-secondary); margin: var(--space-3) 0 0; }
.result__rows { margin: var(--space-5) 0 0; border-top: 1px solid var(--color-divider); }
.result__row { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider); }
.result__row dt { color: var(--color-text-secondary); font-size: var(--text-sm); margin: 0; }
.result__row dd { margin: 0; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-text); font-weight: var(--fw-medium); text-align: right; }

/* State chips */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: var(--fw-semibold);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill); }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip--success { color: var(--success); background: var(--success-bg); }
.chip--warning { color: var(--warning); background: var(--warning-bg); }
.chip--danger  { color: var(--danger);  background: var(--danger-bg); }

/* Non-blocking caution notes inside a valid result */
.result__warnings { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.result__warn {
  font-size: var(--text-xs); color: var(--warning); background: var(--warning-bg);
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3);
  line-height: var(--lh-xs); }
.result__warn::before { content: "⚠ "; }

/* Result placeholder (before first calc) */
.result--empty { text-align: center; color: var(--color-text-muted); border-style: dashed; box-shadow: none; }
.result--empty .result__eyebrow { color: var(--color-text-muted); }

/* --- TeachingPanel --------------------------------------------------------- */
.teaching {
  background: var(--color-surface-alt); border: 1px solid var(--navy-100);
  border-radius: var(--radius-lg); padding: var(--space-5); margin-top: var(--tool-gap); }
.teaching__title { font-size: var(--text-lg); margin: 0 0 var(--space-3); }
.teaching__body { color: var(--grey-700); }
.teaching__body p { margin: 0 0 var(--space-3); }
.teaching__body p:last-child { margin-bottom: 0; }
.teaching__body strong { color: var(--color-heading); font-weight: var(--fw-semibold); }

/* --- CourseCTA ------------------------------------------------------------- */
.cta {
  margin-top: var(--space-7); background: var(--color-surface-invert); color: var(--color-text-on-navy);
  border-radius: var(--radius-xl); padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-gold);
  display: grid; grid-template-columns: 1fr; gap: var(--space-4); align-items: center; }
.cta__media { display: none; }
.cta__media img { width: 100%; height: auto; border-radius: var(--radius-md); display: block; }
.cta__badge {
  display: inline-block; font-size: var(--text-xs); font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--navy);
  background: var(--gold); padding: var(--space-1) var(--space-3); border-radius: var(--radius-pill);
  margin-bottom: var(--space-3); }
.cta__headline { font-family: var(--font-heading); font-size: var(--text-xl); color: var(--color-text-on-navy); margin: 0 0 var(--space-2); font-weight: var(--fw-semibold); }
.cta__text { color: var(--navy-100); margin: 0 0 var(--space-5); font-size: var(--text-sm); }
.cta .btn--gold { align-self: start; }
@media (min-width: 640px) {
  .cta { grid-template-columns: 180px 1fr; gap: var(--space-6); padding: var(--space-6); }
  .cta__media { display: block; }
}

/* --- Footer ---------------------------------------------------------------- */
.site-footer { background: var(--color-surface-invert); color: var(--color-text-on-navy); margin-top: var(--space-8); }
.site-footer__inner { padding: var(--space-7) var(--container-pad); display: grid; grid-template-columns: 1fr; gap: var(--space-5); }
.site-footer__brand img { height: 30px; width: auto; }
.site-footer__tag { color: var(--navy-100); font-size: var(--text-sm); margin: var(--space-3) 0 0; }
.site-footer__h { font-size: var(--text-sm); letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--gold-200); margin: 0 0 var(--space-3); }
.site-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.site-footer__col a { color: var(--navy-100); font-size: var(--text-sm); }
.site-footer__col a:hover { color: var(--color-text-on-navy); }
.site-footer__disclaimer { grid-column: 1 / -1; color: var(--navy-100); font-size: var(--text-xs); line-height: var(--lh-xs); border-top: 1px solid var(--navy-700); padding-top: var(--space-4); margin: var(--space-3) 0 0; max-width: 80ch; }
.site-footer__copy { grid-column: 1 / -1; color: var(--grey-400); font-size: var(--text-xs); margin: 0; }
@media (min-width: 700px) {
  .site-footer__inner { grid-template-columns: 2fr 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}

/* Auto-calc hint (replaces the old Calculate button) */
.form-hint { margin: var(--space-5) 0 0; font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; }

/* --- Sub-group (optional inputs) ------------------------------------------ */
.subgroup { border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: var(--space-4); margin: 0; }
.subgroup legend { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--color-text); padding: 0 var(--space-2); }
.subgroup__opt { color: var(--color-text-muted); font-weight: var(--fw-regular); }

/* Standard-specific field visibility toggled by JS */
.is-hidden { display: none !important; }

/* --- Electrical Unit Converter -------------------------------------------- */
.conv-grid { display: grid; grid-template-columns: 1fr; gap: var(--tool-gap); align-items: start; margin-top: var(--space-5); }
.conv-support { margin-top: var(--tool-gap); }
.conv-row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); align-items: end; }
@media (min-width: 640px) {
  .conv-row { grid-template-columns: 1fr auto 1fr; }
  .conv-row > .field:first-child { grid-column: 1 / -1; }  /* input value spans full width */
}
.swap-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 46px; flex: 0 0 auto; align-self: end;
  background: var(--color-surface-alt); color: var(--color-primary);
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  font-size: var(--text-lg); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.swap-button:hover { background: var(--color-primary); color: var(--color-text-on-navy); border-color: var(--color-primary); }
.auxiliary-field { margin-top: var(--space-4); }
.result .conv-result__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.conv-result__value { font-size: var(--text-3xl); word-break: break-word; margin: var(--space-2) 0; }
.conv-formula { display: block; margin: var(--space-3) 0 0; font-size: var(--text-sm); }
.conv-formula__label { color: var(--color-text-secondary); font-weight: var(--fw-semibold); margin-right: var(--space-2); }
.conv-formula__text { font-family: var(--font-mono); color: var(--color-text); }

.conv-details > summary { list-style: none; cursor: pointer; }
.conv-details > summary::-webkit-details-marker { display: none; }
.conv-support__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.conv-support__head .panel__title { margin-bottom: var(--space-1); }
.conv-support__arrow { color: var(--color-text-secondary); font-size: var(--text-xl); transition: transform var(--dur-base) var(--ease); }
.conv-details[open] .conv-support__arrow { transform: rotate(180deg); }
.conv-support__footer { margin-top: var(--space-4); }
.capability-groups { margin-top: var(--space-4); display: grid; gap: var(--space-4); }
.capability-group { border-top: 1px solid var(--color-divider); padding-top: var(--space-4); }
.capability-group h4 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); margin: 0 0 var(--space-3); }
.capability-count { font-size: var(--text-xs); color: var(--color-text-secondary); background: var(--color-surface-alt); padding: 2px var(--space-2); border-radius: var(--radius-pill); font-family: var(--font-mono); }
.capability-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.conversion-chip {
  font-size: var(--text-xs); color: var(--color-text); background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.conversion-chip:hover { border-color: var(--color-primary); }
.conversion-chip.is-active { background: var(--color-primary); color: var(--color-text-on-navy); border-color: var(--color-primary); }

/* --- Cookie consent banner ------------------------------------------------ */
.cookie-consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--color-surface-invert); color: var(--color-text-on-navy);
  box-shadow: 0 -6px 20px rgba(10, 31, 68, 0.18); }
.cookie-consent__inner {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding-top: var(--space-4); padding-bottom: var(--space-4); }
.cookie-consent__text { margin: 0; font-size: var(--text-sm); color: var(--navy-100); line-height: var(--lh-sm); }
.cookie-consent__text a { color: var(--gold-200); text-decoration: underline; }
.cookie-consent__actions { display: flex; gap: var(--space-3); }
.cookie-consent__actions .btn { flex: 1 1 auto; }
/* The banner is navy, so the ghost (Reject) button needs light text + border. */
.cookie-consent .btn--ghost { color: var(--color-text-on-navy); border-color: rgba(255, 255, 255, 0.45); }
.cookie-consent .btn--ghost:hover { color: var(--color-text-on-navy); border-color: var(--color-text-on-navy); background: rgba(255, 255, 255, 0.08); }
@media (min-width: 720px) {
  .cookie-consent__inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .cookie-consent__text { flex: 1; max-width: 70ch; }
  .cookie-consent__actions { flex: 0 0 auto; }
  .cookie-consent__actions .btn { flex: 0 0 auto; }
}
.site-footer__copy a { color: var(--navy-100); text-decoration: underline; }
.site-footer__copy a:hover { color: var(--color-text-on-navy); }

/* --- HTMX loading affordance ---------------------------------------------- */
.htmx-indicator { opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.btn { opacity: 0.8; pointer-events: none; }

/* --- Transformer sizing: quick load schedule ------------------------------ */
.sch { display: grid; gap: var(--space-3); }
.sch__head,
.sch__row {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.9fr 0.9fr 0.8fr 0.8fr auto;
  gap: var(--space-2); align-items: center;
}
.sch__head { font-size: var(--text-xs); color: var(--color-text-muted); padding: 0 2px; }
.sch__row .field__input { min-height: 40px; padding: 0 var(--space-2); font-size: var(--text-sm); }
/* The tight numeric columns can't spare room for the native spin buttons, which
   clip small values like "0.9" — hide them and centre the numbers. */
.sch__row input[type="number"] { -moz-appearance: textfield; appearance: textfield; text-align: center; }
.sch__row input[type="number"]::-webkit-outer-spin-button,
.sch__row input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Breathing room before the add-load button. */
#sch-add { margin-top: var(--space-4); }
.sch__del {
  border: 1px solid var(--color-border); background: var(--color-surface);
  color: var(--color-text-secondary); border-radius: var(--radius-sm);
  width: 32px; height: 32px; line-height: 1; font-size: 18px; cursor: pointer;
}
.sch__del:hover { border-color: var(--danger); color: var(--danger); }
/* On narrow screens the row header is hard to read; keep the compact grid but
   let it scroll rather than crush the fields. */
@media (max-width: 520px) {
  .sch__head { display: none; }
  .sch__row { grid-template-columns: 1fr 1fr; }
  .sch__row .sch__del { grid-column: 2; justify-self: end; }
}

/* --- Transformer sizing: single-line diagram + value callouts ------------- */
.tx-diagram { margin: var(--space-5) 0 0; }
.tx-diagram svg { width: 100%; height: auto; display: block; }
.tx-line { stroke: var(--color-text-secondary); stroke-width: 2; }
.tx-tick { stroke: var(--gold); stroke-width: 2; }
.tx-coil { fill: none; stroke: var(--navy); stroke-width: 2.5; }
.tx-badge { fill: var(--navy); }
.tx-badge-t { fill: var(--gold-200); font-size: 10px; letter-spacing: .12em; font-weight: 600; }
.tx-badge-v { fill: var(--white); font-size: 17px; font-weight: 700; }
.tx-load { fill: var(--color-text-secondary); font-size: 12px; font-weight: 600; }
.tx-cap { fill: var(--color-text-muted); font-size: 10px; letter-spacing: .1em; font-weight: 600; }
.tx-val { fill: var(--color-heading); font-size: 15px; font-weight: 700; }
.tx-sub { fill: var(--color-text-secondary); font-size: 12px; }
.tx-fault { fill: var(--danger); font-size: 12px; font-weight: 600; }
.tx-co { opacity: 0; animation: tx-pop var(--dur-base, .25s) var(--ease, ease) forwards; }
@keyframes tx-pop { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tx-co { animation: none; opacity: 1; }
}

/* --- FAQ (shared: zero-JS <details> accordion) ---------------------------- */
.faq { margin-top: var(--tool-gap); }
.faq__title { font-size: var(--text-lg); margin: 0 0 var(--space-4); }
.faq__list { display: grid; gap: var(--space-3); }
.faq__item {
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  background: var(--color-surface); padding: 0 var(--space-4);
}
.faq__q {
  list-style: none; cursor: pointer; padding: var(--space-4) 0;
  font-weight: var(--fw-semibold); color: var(--color-heading);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
}
.faq__q::-webkit-details-marker { display: none; }         /* hide default triangle */
.faq__q::after {
  content: "+"; font-weight: var(--fw-regular); font-size: 1.4em; line-height: 1;
  color: var(--color-text-secondary); transition: transform var(--dur-base) var(--ease);
}
.faq__item[open] .faq__q::after { content: "\2212"; }       /* minus when open */
.faq__a { color: var(--grey-700); padding: 0 0 var(--space-4); }
.faq__a p { margin: 0; }
.faq__item[open] .faq__q { color: var(--color-primary); }
/* Explicitly collapse the answer when closed — an author display:block on block
   elements otherwise overrides the browser's default details hiding. */
.faq__item:not([open]) .faq__a { display: none; }
