/*!
 * Compound Interest Calculator plugin styles.
 * Every rule is scoped to #cic-app / #cic-guide so the theme cannot change the calculator
 * and the calculator cannot change the theme.
 */

/* ---------- Design tokens ---------- */
.cic {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #0f1b2d;
  --ink-2: #3e4c5e;
  --ink-3: #5d6b7f;
  --line: #e1e6ed;
  --line-strong: #c7cfda;
  --field: #ffffff;
  --primary: #0b4f8a;
  --primary-hover: #093f6e;
  --primary-ink: #ffffff;
  --primary-soft: #e6effa;
  --focus: #1f6feb;
  --err: #b4281e;
  --err-soft: #fdecea;
  --pos: #0f7a5f;
  --s-est: #1f6feb;
  --s-above: #0f8b6d;
  --s-below: #bf6510;
  --s-contrib: #5d6b7f;
  --grid: #e8ecf1;
  --shadow: 0 1px 2px rgba(15,27,45,0.04), 0 6px 20px rgba(15,27,45,0.06);
  --shadow-lift: 0 2px 4px rgba(15,27,45,0.05), 0 16px 36px rgba(15,27,45,0.10);
  --primary-shadow: rgba(11,79,138,0.55);
  --display: "CIC Newsreader", Georgia, "Times New Roman", serif;
  --sans: "CIC Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
.cic.cic--dark-on {
  color-scheme: dark;
  --bg: #0c1016; --surface: #161b23; --surface-2: #1b212a;
  --ink: #e8edf4; --ink-2: #b6c0cd; --ink-3: #8b97a8;
  --line: #262d38; --line-strong: #394252; --field: #11151c;
  --primary: #4d90f0; --primary-hover: #6aa3f4; --primary-ink: #06101d; --primary-soft: #16263d;
  --focus: #7db0f6; --err: #ff8f85; --err-soft: #2e1714; --pos: #3fbf9a;
  --s-est: #4285e6; --s-above: #22a07f; --s-below: #cc7622; --s-contrib: #8b97a8;
  --grid: #232a34;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
  --shadow-lift: 0 2px 4px rgba(0,0,0,0.35), 0 18px 40px rgba(0,0,0,0.4);
  --primary-shadow: rgba(0,0,0,0.6);
}
@media (prefers-color-scheme: dark) {
  .cic.cic--dark-auto {
    color-scheme: dark;
    --bg: #0c1016; --surface: #161b23; --surface-2: #1b212a;
    --ink: #e8edf4; --ink-2: #b6c0cd; --ink-3: #8b97a8;
    --line: #262d38; --line-strong: #394252; --field: #11151c;
    --primary: #4d90f0; --primary-hover: #6aa3f4; --primary-ink: #06101d; --primary-soft: #16263d;
    --focus: #7db0f6; --err: #ff8f85; --err-soft: #2e1714; --pos: #3fbf9a;
    --s-est: #4285e6; --s-above: #22a07f; --s-below: #cc7622; --s-contrib: #8b97a8;
    --grid: #232a34;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
    --shadow-lift: 0 2px 4px rgba(0,0,0,0.35), 0 18px 40px rgba(0,0,0,0.4);
    --primary-shadow: rgba(0,0,0,0.6);
  }
}

/* ---------- Container + theme-proof resets ---------- */
:is(#cic-app, #cic-guide) {
  container-type: inline-size;
  display: block; width: 100%; max-width: 1200px; margin: 0 auto 32px; padding: 0;
  font-family: var(--sans); font-size: 16px; line-height: 1.55; font-weight: 400;
  color: var(--ink); text-align: left; letter-spacing: normal; word-spacing: normal; text-transform: none;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
:is(#cic-app, #cic-guide) :where(h1, h2, h3, p, ul, ol, dl, dd, dt, figure, table, fieldset, legend, caption, details, summary, form, label) {
  margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
  font-size: inherit; font-weight: inherit; line-height: inherit; letter-spacing: normal; text-transform: none;
  color: inherit; font-family: inherit; text-align: inherit;
}
:is(#cic-app, #cic-guide) :where(h2, h3) { line-height: 1.2; }
:is(#cic-app, #cic-guide) :where(ul, ol) { list-style: none; }
:is(#cic-app, #cic-guide) :where(li) { margin: 0; padding: 0; list-style: none; font-size: inherit; line-height: inherit; }
:is(#cic-app, #cic-guide) :where(li)::marker { content: none; }
:is(#cic-app, #cic-guide) :where(span, b, sup, dt, dd) { font-size: inherit; }
:is(#cic-app, #cic-guide) :where(sup) { font-size: 0.7em; line-height: 0; vertical-align: super; }
:is(#cic-app, #cic-guide) :where(table) { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; }
:is(#cic-app, #cic-guide) :where(th, td) { border: 0; margin: 0; vertical-align: middle; line-height: 1.4; font-family: inherit; }
:is(#cic-app, #cic-guide) :where(button, input, select) {
  margin: 0; font-family: inherit; font-size: inherit; line-height: 1.3; letter-spacing: normal; text-transform: none;
  text-shadow: none; box-shadow: none; outline: 0; height: auto; max-width: 100%; min-width: 0; float: none; text-decoration: none;
}
:is(#cic-app, #cic-guide) :where(button) { width: auto; }
:is(#cic-app, #cic-guide) :where(svg) { display: inline-block; max-width: none; overflow: visible; }
:is(#cic-app, #cic-guide) :where(svg.chart-svg) { max-width: 100%; }
:is(#cic-app, #cic-guide) :where(a) { color: var(--primary); }
:is(#cic-app, #cic-guide).cic--theme-fonts,
:is(#cic-app, #cic-guide).cic--theme-fonts * { font-family: inherit !important; }
:is(#cic-app, #cic-guide) .cic-noscript { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }

:is(#cic-app, #cic-guide), :is(#cic-app, #cic-guide) *, :is(#cic-app, #cic-guide) *::before, :is(#cic-app, #cic-guide) *::after { box-sizing: border-box; }
:is(#cic-app, #cic-guide) [hidden] { display: none !important; }

/* ---------- Calculator and guide ---------- */
:is(#cic-app, #cic-guide) .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:is(#cic-app, #cic-guide) .num { font-variant-numeric: lining-nums tabular-nums; }
:is(#cic-app, #cic-guide) .app { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@container (min-width: 980px) {
  :is(#cic-app, #cic-guide) .app { grid-template-columns: 420px minmax(0, 1fr); gap: 28px; }
}
:is(#cic-app, #cic-guide) .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
:is(#cic-app, #cic-guide) form.card { padding: clamp(18px, 3cqi, 28px); display: grid; gap: 24px; }
:is(#cic-app, #cic-guide) .form-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
:is(#cic-app, #cic-guide) .form-top h2 { margin: 0; font-size: 17.6px; font-weight: 700; }
:is(#cic-app, #cic-guide) .req { margin: 0; font-size: 12.5px; color: var(--ink-3); }
:is(#cic-app, #cic-guide) .req b { color: var(--err); font-weight: 600; }
:is(#cic-app, #cic-guide) .steps { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 640px) and (max-width: 979px) {
  :is(#cic-app, #cic-guide) .steps { display: block; columns: 2; column-gap: 40px; }
  :is(#cic-app, #cic-guide) .steps fieldset { break-inside: avoid; margin-bottom: 24px; }
  :is(#cic-app, #cic-guide) .steps fieldset:nth-child(3) { break-before: column; }
  :is(#cic-app, #cic-guide) .steps fieldset:last-child { margin-bottom: 0; }
}
:is(#cic-app, #cic-guide) fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 16px; align-content: start; }
:is(#cic-app, #cic-guide) legend { float: left; width: 100%; margin: 0; padding: 0 0 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1px solid var(--line); }
:is(#cic-app, #cic-guide) legend + * { clear: both; }
:is(#cic-app, #cic-guide) .badge { width: 24px; height: 24px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: 0; }
:is(#cic-app, #cic-guide) .field { display: grid; gap: 6px; }
:is(#cic-app, #cic-guide) .field label { font-weight: 600; font-size: 14.5px; }
:is(#cic-app, #cic-guide) .star { color: var(--err); margin-left: 2px; }
:is(#cic-app, #cic-guide) .help { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
:is(#cic-app, #cic-guide) .control { position: relative; display: flex; align-items: center; }
:is(#cic-app, #cic-guide) .control input, :is(#cic-app, #cic-guide) .control select { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--field);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 14px; min-height: 48px;
  font-variant-numeric: tabular-nums; }
:is(#cic-app, #cic-guide) .control select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; }
:is(#cic-app, #cic-guide) .control .chev { position: absolute; right: 14px; width: 12px; height: 12px; pointer-events: none; color: var(--ink-3); }
:is(#cic-app, #cic-guide) .control input::placeholder { color: var(--ink-3); opacity: 0.55; }
:is(#cic-app, #cic-guide) .control input:hover, :is(#cic-app, #cic-guide) .control select:hover { border-color: var(--ink-3); }
:is(#cic-app, #cic-guide) .control input:focus, :is(#cic-app, #cic-guide) .control select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
:is(#cic-app, #cic-guide) .pre, :is(#cic-app, #cic-guide) .suf { position: absolute; color: var(--ink-3); pointer-events: none; font-weight: 500; }
:is(#cic-app, #cic-guide) .pre { left: 14px; }
:is(#cic-app, #cic-guide) .suf { right: 14px; }
:is(#cic-app, #cic-guide) .has-pre input { padding-left: 28px; }
:is(#cic-app, #cic-guide) .has-suf input { padding-right: 32px; }
:is(#cic-app, #cic-guide) input[aria-invalid="true"] { border-color: var(--err) !important; background: var(--err-soft); }
:is(#cic-app, #cic-guide) .error { margin: 0; font-size: 13px; font-weight: 600; color: var(--err); }
:is(#cic-app, #cic-guide) button:focus-visible, :is(#cic-app, #cic-guide) .table-scroll:focus-visible, :is(#cic-app, #cic-guide) summary:focus-visible, :is(#cic-app, #cic-guide) a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
:is(#cic-app, #cic-guide) .actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
:is(#cic-app, #cic-guide) .btn { font: inherit; min-height: 50px; padding: 0 24px; border-radius: 10px; font-weight: 700; font-size: 15.5px; cursor: pointer; }
:is(#cic-app, #cic-guide) .btn-primary { background: var(--primary); color: var(--primary-ink); border: 1px solid var(--primary); }
:is(#cic-app, #cic-guide) .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
:is(#cic-app, #cic-guide) .btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
:is(#cic-app, #cic-guide) .btn-secondary:hover { background: var(--surface-2); border-color: var(--ink-3); }
@container (min-width: 640px) and (max-width: 979px) {
  :is(#cic-app, #cic-guide) .actions { grid-template-columns: 220px auto; justify-content: start; }
}
:is(#cic-app, #cic-guide) .empty { padding: 48px 32px; display: grid; place-items: center; text-align: center; gap: 10px; min-height: 420px; align-content: center; }
:is(#cic-app, #cic-guide) .empty svg { width: 200px; max-width: 70%; height: auto; margin-bottom: 8px; }
:is(#cic-app, #cic-guide) .empty h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 25.6px; }
:is(#cic-app, #cic-guide) .empty p { margin: 0; color: var(--ink-2); max-width: 32ch; }
@container (max-width: 979px) {
  :is(#cic-app, #cic-guide) .empty { display: none !important; }
}
:is(#cic-app, #cic-guide) #cic-results { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
:is(#cic-app, #cic-guide) #cic-results > * { min-width: 0; }
:is(#cic-app, #cic-guide) .res-top { padding: clamp(20px, 3.5cqi, 32px); display: grid; gap: 14px; border-bottom: 1px solid var(--line); }
:is(#cic-app, #cic-guide) .eyebrow { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pos); }
:is(#cic-app, #cic-guide) .headline { margin: 0; display: grid; gap: 4px; }
:is(#cic-app, #cic-guide) .hl-lead { font-size: clamp(16.8px, 15.2px + 0.5cqi, 20.8px); color: var(--ink-2); }
:is(#cic-app, #cic-guide) .hl-num { font-family: var(--display); font-weight: 600; font-size: clamp(40px, 22.4px + 5cqi, 70.4px);
  line-height: 1; letter-spacing: -0.025em; color: var(--ink); overflow-wrap: anywhere;
  font-variant-numeric: lining-nums tabular-nums; }
:is(#cic-app, #cic-guide) .blurb { margin: 0; color: var(--ink-2); font-size: 14.5px; max-width: 72ch; }
:is(#cic-app, #cic-guide) .stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
:is(#cic-app, #cic-guide) .stat { padding: 16px clamp(16px, 3cqi, 28px); display: grid; gap: 2px; align-content: start; min-width: 0; }
:is(#cic-app, #cic-guide) .stat + .stat { border-left: 1px solid var(--line); }
:is(#cic-app, #cic-guide) .stat dt { font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.02em; }
:is(#cic-app, #cic-guide) .stat dd { margin: 0; font-size: clamp(17.6px, 15.2px + 0.7cqi, 22.4px); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
:is(#cic-app, #cic-guide) .stat dd.pos { color: var(--pos); }
:is(#cic-app, #cic-guide) .stat dd.neg { color: var(--err); }
@container (max-width: 540px) {
  :is(#cic-app, #cic-guide) .stats { grid-template-columns: minmax(0, 1fr); }
  :is(#cic-app, #cic-guide) .stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-block: 12px; }
  :is(#cic-app, #cic-guide) .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
}
:is(#cic-app, #cic-guide) .res-chart { padding: clamp(18px, 3cqi, 28px); display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
:is(#cic-app, #cic-guide) .chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; }
:is(#cic-app, #cic-guide) .chart-head h2 { margin: 0; font-size: 17.6px; font-weight: 700; }
:is(#cic-app, #cic-guide) .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
:is(#cic-app, #cic-guide) .legend li { display: inline-flex; align-items: center; gap: 8px; }
:is(#cic-app, #cic-guide) .legend .sw { width: 20px; height: 0; border-top: 3px solid; }
:is(#cic-app, #cic-guide) .chart-wrap { position: relative; min-width: 0; }
:is(#cic-app, #cic-guide) .chart-svg { width: 100%; display: block; touch-action: pan-y; overflow: visible; }
:is(#cic-app, #cic-guide) .chart-svg text { font-family: var(--sans); font-size: 12px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
:is(#cic-app, #cic-guide) .tip { position: absolute; pointer-events: none; z-index: 3; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 13px;
  min-width: 220px; max-width: calc(100% - 8px); box-shadow: 0 10px 28px rgba(0,0,0,0.16); }
:is(#cic-app, #cic-guide) .tip .ty { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
:is(#cic-app, #cic-guide) .tip .row { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; font-variant-numeric: tabular-nums; }
:is(#cic-app, #cic-guide) .tip .row span:first-child { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
:is(#cic-app, #cic-guide) .tip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
:is(#cic-app, #cic-guide) .tip .row span:last-child { font-weight: 700; color: var(--ink); }
:is(#cic-app, #cic-guide) .res-table { padding: 0 clamp(18px, 3cqi, 28px) clamp(18px, 3cqi, 28px); display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
:is(#cic-app, #cic-guide) .btn-ghost { justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--primary); border: 1px solid var(--line-strong);
  border-radius: 999px; min-height: 40px; padding: 0 18px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
:is(#cic-app, #cic-guide) .btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
:is(#cic-app, #cic-guide) .btn-ghost svg { width: 12px; height: 12px; transition: transform 0.2s; }
:is(#cic-app, #cic-guide) .btn-ghost[aria-expanded="true"] svg { transform: rotate(180deg); }
:is(#cic-app, #cic-guide) .res-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
:is(#cic-app, #cic-guide) .btn-pdf { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--primary); color: var(--primary-ink); border: 1px solid var(--primary);
  font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
:is(#cic-app, #cic-guide) .btn-pdf:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
:is(#cic-app, #cic-guide) .btn-pdf:disabled { opacity: 0.7; cursor: progress; }
:is(#cic-app, #cic-guide) .btn-pdf svg { width: 15px; height: 15px; flex: none; }
:is(#cic-app, #cic-guide) .pdf-status { margin: 0; font-size: 13px; color: var(--pos); font-weight: 600; }
:is(#cic-app, #cic-guide) .pdf-status.is-err { color: var(--err); }
@container (max-width: 440px) {
  :is(#cic-app, #cic-guide) .res-actions > button { flex: 1 1 100%; justify-content: center; }
}
:is(#cic-app, #cic-guide) .table-scroll { overflow: auto; max-height: 480px; border: 1px solid var(--line); border-radius: 10px; }
:is(#cic-app, #cic-guide) table { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: lining-nums tabular-nums; }
:is(#cic-app, #cic-guide) .table-scroll table { min-width: 520px; }
:is(#cic-app, #cic-guide) caption { text-align: left; padding: 12px 16px; font-weight: 700; font-size: 14px; color: var(--ink); background: var(--surface); border-bottom: 1px solid var(--line); }
:is(#cic-app, #cic-guide) th, :is(#cic-app, #cic-guide) td { padding: 11px 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 14px; }
:is(#cic-app, #cic-guide) th:first-child, :is(#cic-app, #cic-guide) td:first-child { text-align: left; }
:is(#cic-app, #cic-guide) .table-scroll th:first-child, :is(#cic-app, #cic-guide) .table-scroll td:first-child { position: sticky; left: 0; z-index: 1; }
:is(#cic-app, #cic-guide) thead th { font-size: 12.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); }
:is(#cic-app, #cic-guide) .table-scroll thead th { position: sticky; top: 0; z-index: 2; }
:is(#cic-app, #cic-guide) .table-scroll thead th:first-child { z-index: 3; }
:is(#cic-app, #cic-guide) td:first-child, :is(#cic-app, #cic-guide) tbody th { font-weight: 600; color: var(--ink-2); font-size: 14px; }
:is(#cic-app, #cic-guide) tbody tr:last-child td { border-bottom: 0; }
:is(#cic-app, #cic-guide) tbody tr:nth-child(even) td, :is(#cic-app, #cic-guide) tbody tr:nth-child(even) th { background: var(--surface-2); }
:is(#cic-app, #cic-guide) tbody tr:hover td, :is(#cic-app, #cic-guide) tbody tr:hover th { background: var(--primary-soft); }
:is(#cic-app, #cic-guide) .guide { display: grid; gap: clamp(20px, 3cqi, 28px); grid-template-columns: minmax(0, 1fr); margin-top: 12px; }
@container (min-width: 980px) {
  :is(#cic-app, #cic-guide) .guide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  :is(#cic-app, #cic-guide) .guide .span { grid-column: 1 / -1; }
}
:is(#cic-app, #cic-guide) .guide section { padding: clamp(20px, 3.5cqi, 32px); display: grid; gap: 14px; align-content: start; }
:is(#cic-app, #cic-guide) .guide h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: clamp(23.2px, 19.2px + 0.9cqi, 30.4px); line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
:is(#cic-app, #cic-guide) .guide p, :is(#cic-app, #cic-guide) .guide li { margin: 0; color: var(--ink-2); max-width: 68ch; }
:is(#cic-app, #cic-guide) .guide ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
:is(#cic-app, #cic-guide) .guide ol li { counter-increment: s; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
:is(#cic-app, #cic-guide) .guide ol li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; }
:is(#cic-app, #cic-guide) .guide ol li b { color: var(--ink); }
:is(#cic-app, #cic-guide) .formula { margin: 0; padding: 16px 18px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line);
  font-family: var(--display); font-size: clamp(16.8px, 15.2px + 0.5cqi, 20px); color: var(--ink); overflow-x: auto; white-space: nowrap; }
:is(#cic-app, #cic-guide) .vars { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 14.5px; }
:is(#cic-app, #cic-guide) .vars dt { font-family: var(--display); font-weight: 600; color: var(--ink); }
:is(#cic-app, #cic-guide) .vars dd { margin: 0; color: var(--ink-2); }
:is(#cic-app, #cic-guide) .ex-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
:is(#cic-app, #cic-guide) .ex-scroll table { min-width: 460px; }
:is(#cic-app, #cic-guide) .ex-scroll tr.best td { font-weight: 700; color: var(--ink); }
:is(#cic-app, #cic-guide) .note { font-size: 14px; color: var(--ink-3); }
:is(#cic-app, #cic-guide) .faq { display: grid; }
:is(#cic-app, #cic-guide) .faq details { border-top: 1px solid var(--line); }
:is(#cic-app, #cic-guide) .faq details:last-child { border-bottom: 1px solid var(--line); }
:is(#cic-app, #cic-guide) .faq summary { list-style: none; cursor: pointer; padding: 16px 36px 16px 0; position: relative;
  font-weight: 700; font-size: 16.32px; color: var(--ink); }
:is(#cic-app, #cic-guide) .faq summary::-webkit-details-marker { display: none; }
:is(#cic-app, #cic-guide) .faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.2s; }
:is(#cic-app, #cic-guide) .faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
:is(#cic-app, #cic-guide) .faq details p { padding: 0 0 18px; }
@media (prefers-reduced-motion: reduce) {
  :is(#cic-app, #cic-guide) .btn-ghost svg, :is(#cic-app, #cic-guide) .faq summary::after { transition: none; }
}
@media (prefers-reduced-motion: no-preference) {
  :is(#cic-app, #cic-guide) .btn, :is(#cic-app, #cic-guide) .btn-ghost, :is(#cic-app, #cic-guide) .control input, :is(#cic-app, #cic-guide) .control select { transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s; }
  :is(#cic-app, #cic-guide) #cic-results:not([hidden]) { animation: cic-rise 0.35s ease-out both; }
  @keyframes cic-rise {from { opacity: 0.5; transform: translateY(6px); }}
}
:is(#cic-app, #cic-guide) ::selection { background: var(--primary-soft); color: var(--ink); }
:is(#cic-app, #cic-guide) .guide > section { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
:is(#cic-app, #cic-guide) .guide > section:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
:is(#cic-app, #cic-guide) .badge { position: relative; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }
:is(#cic-app, #cic-guide) .badge::after { content: ""; position: absolute; inset: 6px; opacity: 0; transform: scale(0.4);
  background: var(--surface);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.2 4.7-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.3l2.3 2.2 4.7-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
:is(#cic-app, #cic-guide) fieldset:where(:has(input[required]):not(:has(input[required]:placeholder-shown)):not(:has([aria-invalid="true"]))) .badge { background: var(--pos); color: transparent; }
:is(#cic-app, #cic-guide) fieldset:where(:has(input[required]):not(:has(input[required]:placeholder-shown)):not(:has([aria-invalid="true"]))) .badge::after { opacity: 1; transform: scale(1); }
:is(#cic-app, #cic-guide) fieldset:focus-within legend { color: var(--primary); border-bottom-color: var(--primary); }
:is(#cic-app, #cic-guide) fieldset:focus-within .badge { background: var(--primary); color: var(--primary-ink); box-shadow: 0 0 0 4px var(--primary-soft); }
:is(#cic-app, #cic-guide) fieldset:focus-within .badge::after { opacity: 0; transform: scale(0.4); }
:is(#cic-app, #cic-guide) legend { transition: color 0.2s, border-color 0.2s; }
:is(#cic-app, #cic-guide) .field:focus-within > label { color: var(--primary); }
:is(#cic-app, #cic-guide) .field > label { transition: color 0.15s; }
:is(#cic-app, #cic-guide) .btn-primary, :is(#cic-app, #cic-guide) .btn-pdf { position: relative; overflow: hidden;
  background-image: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 18px -8px var(--primary-shadow); }
:is(#cic-app, #cic-guide) .btn-primary::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%); }
:is(#cic-app, #cic-guide) .btn-primary:hover, :is(#cic-app, #cic-guide) .btn-pdf:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 12px 24px -10px var(--primary-shadow); }
:is(#cic-app, #cic-guide) .btn:active, :is(#cic-app, #cic-guide) .btn-pdf:active, :is(#cic-app, #cic-guide) .btn-ghost:active { transform: translateY(0) scale(0.98); }
:is(#cic-app, #cic-guide) .btn, :is(#cic-app, #cic-guide) .btn-pdf, :is(#cic-app, #cic-guide) .btn-ghost { transition: background-color 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.15s; }
:is(#cic-app, #cic-guide) #cic-results { position: relative; }
:is(#cic-app, #cic-guide) #cic-results::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; z-index: 1;
  background: linear-gradient(90deg, var(--s-above), var(--s-est) 60%, var(--primary)); }
:is(#cic-app, #cic-guide) .stat { position: relative; }
:is(#cic-app, #cic-guide) .stat dd { transition: color 0.2s; }
:is(#cic-app, #cic-guide) .tip { transform-origin: top left; }
:is(#cic-app, #cic-guide) .table-scroll { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
:is(#cic-app, #cic-guide) .table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
:is(#cic-app, #cic-guide) .table-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--surface); }
:is(#cic-app, #cic-guide) .ex-scroll tr.best td { background: var(--primary-soft); }
:is(#cic-app, #cic-guide) .ex-scroll tr.best td:first-child { box-shadow: inset 3px 0 0 var(--s-est); }
:is(#cic-app, #cic-guide) .faq summary { transition: color 0.15s; }
:is(#cic-app, #cic-guide) .faq summary:hover { color: var(--primary); }
:is(#cic-app, #cic-guide) .faq summary:hover::after { border-color: var(--primary); }
@media (prefers-reduced-motion: no-preference) {
  :is(#cic-app, #cic-guide) .app > form { animation: cic-rise 0.6s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  :is(#cic-app, #cic-guide) .app > .results-col { animation: cic-rise 0.6s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  :is(#cic-app, #cic-guide) .empty svg { animation: cic-float 6s ease-in-out infinite; }
  :is(#cic-app, #cic-guide) .btn-primary:hover::after { transform: translateX(120%); transition: transform 0.7s ease; }
  :is(#cic-app, #cic-guide) .guide > section:hover { transform: translateY(-3px); }
  :is(#cic-app, #cic-guide) #cic-results.enter { animation: none; }
  :is(#cic-app, #cic-guide) #cic-results.enter > * { animation: cic-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  :is(#cic-app, #cic-guide) #cic-results.enter > :nth-child(2) { animation-delay: 0.08s; }
  :is(#cic-app, #cic-guide) #cic-results.enter > :nth-child(3) { animation-delay: 0.16s; }
  :is(#cic-app, #cic-guide) #cic-results.enter > :nth-child(4) { animation-delay: 0.24s; }
  :is(#cic-app, #cic-guide) #cic-results.enter::before { animation: cic-bar 0.9s cubic-bezier(0.45, 0, 0.2, 1) both; transform-origin: left; }
  :is(#cic-app, #cic-guide) #cic-results.enter .hl-num { animation: cic-num-in 0.8s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  :is(#cic-app, #cic-guide) #cic-results.enter .stat { animation: cic-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  :is(#cic-app, #cic-guide) #cic-results.enter .stat:nth-child(1) { animation-delay: 0.14s; }
  :is(#cic-app, #cic-guide) #cic-results.enter .stat:nth-child(2) { animation-delay: 0.22s; }
  :is(#cic-app, #cic-guide) #cic-results.enter .stat:nth-child(3) { animation-delay: 0.30s; }
  :is(#cic-app, #cic-guide) .chart-svg.reveal { animation: cic-reveal 1.2s 0.25s cubic-bezier(0.45, 0, 0.2, 1) both; }
  :is(#cic-app, #cic-guide) .tip { animation: cic-tip-in 0.14s ease-out; }
  :is(#cic-app, #cic-guide) .pdf-status:not([hidden]) { animation: cic-rise 0.3s ease-out both; }
  :is(#cic-app, #cic-guide) .table-scroll { animation: cic-fade 0.3s ease-out both; }
  @supports (animation-timeline: view()) {
    :is(#cic-app, #cic-guide) .guide > section { animation: cic-lift linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  }
  @supports selector(::details-content) {
    :is(#cic-app, #cic-guide) .faq details { interpolate-size: allow-keywords; }
    :is(#cic-app, #cic-guide) .faq details::details-content { block-size: 0; overflow: hidden; transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete; }
    :is(#cic-app, #cic-guide) .faq details[open]::details-content { block-size: auto; }
  }
}
@keyframes cic-rise {from { opacity: 0; transform: translateY(12px); }}
@keyframes cic-fade {from { opacity: 0; }}
@keyframes cic-lift {from { transform: translateY(28px); }}
@keyframes cic-draw {to { stroke-dashoffset: 0; }}
@keyframes cic-pop {from { opacity: 0; transform: scale(0.2); }}
@keyframes cic-ring {0% { opacity: 0.55; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); }}
@keyframes cic-float {50% { transform: translateY(-5px); }}
@keyframes cic-bar {from { transform: scaleX(0); }}
@keyframes cic-num-in {from { opacity: 0; filter: blur(8px); letter-spacing: 0.02em; transform: translateY(10px); }}
@keyframes cic-reveal {from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); }}
@keyframes cic-tip-in {from { opacity: 0; transform: translateY(4px) scale(0.97); }}
:is(#cic-app, #cic-guide) .cic-foot { margin: 16px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); max-width: 90ch; }
