/* CroreCalculator · Horizon (DESIGN.md Register 8, the tidvane.com look) — owner decision 27.09.2026.
   Bright sky, navy type, cobalt→turquoise gradient, white cards with soft blue shadows. Same markup and class names
   as before (the calculators' scripts are untouched); copy that names a colour stays true: milestone rows are green,
   EMI/tax "caution" stays ochre/amber. Fonts bundled, no CDNs, no tracking. */

/* ---------- fonts (bundled variable woff2, latin subsets; ₹ comes from the system font, as before) ---------- */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700; src: url('../fonts/Archivo-var.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; src: url('../fonts/InstrumentSans-var.woff2') format('woff2'); font-display: swap; }
/* metric-matched fallbacks keep the font swap from reflowing the calculators */
@font-face { font-family: 'Instrument Sans Fallback'; font-weight: 400 600; src: local('Arial'), local('ArialMT'); size-adjust: 103.25%; ascent-override: 93.95%; descent-override: 24.21%; line-gap-override: 0%; }
@font-face { font-family: 'Instrument Sans Fallback'; font-weight: 700; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 99.58%; ascent-override: 97.41%; descent-override: 25.11%; line-gap-override: 0%; }
@font-face { font-family: 'Archivo Fallback'; font-weight: 700; src: local('Arial Bold'), local('Arial-BoldMT'); size-adjust: 98.07%; ascent-override: 89.53%; descent-override: 21.41%; line-gap-override: 0%; }

/* ---------- tokens ---------- */
:root {
  --navy: #0F2552; --ink: #33466B; --muted: #66779A; --agate: #8A98B5;
  --line: #DCE7F4; --line-mid: #D2DEEE; --paper: #FFFFFF; --sky: #F5F9FE; --tint: #EAF3FC; --panel: #F3F8FE;
  --accent: #1F6FEB; --accent-deep: #1E4FC4; --accent-2: #2EE6D0; --accent-mid: #22C3E8;
  --grad: linear-gradient(90deg, #2EE6D0 0%, #22C3E8 45%, #1F6FEB 100%);
  --grad-diag: linear-gradient(135deg, #2EE6D0 0%, #22C3E8 40%, #1F6FEB 100%);
  --grad-button: linear-gradient(90deg, #1FB5E3, #1F6FEB);
  --grad-text: linear-gradient(90deg, #1E4FC4, #1F6FEB 55%, #22A9E8);
  --green: #13803F; --green-bg: #E6F7EC; --green-fill: #2AC466;
  --ochre: #B26A00; --ochre-bg: #FFF4DF; --ochre-fill: #E3A33A;
  --slate: #66779A;
  --shadow: 0 1px 2px rgba(15, 37, 82, .06), 0 10px 30px rgba(31, 79, 196, .10);
  --shadow-lift: 0 2px 4px rgba(15, 37, 82, .06), 0 18px 40px rgba(31, 79, 196, .16);
  --display: 'Archivo', 'Archivo Fallback', 'Helvetica Neue', Arial, sans-serif;
  --sans: 'Instrument Sans', 'Instrument Sans Fallback', 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4.5vw, 56px);
  --measure-max: 66ch;
  /* aliases for inline styles in the pages (var(--label-ink), var(--muted), var(--group-accent)) */
  --label-ink: var(--ink); --group-accent: var(--accent); --group-accent-ink: var(--accent-deep);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sky); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 400 17px/1.6 var(--sans);
  background: var(--sky) linear-gradient(180deg, #EAF3FC 0, #F5F9FE 360px, #FFFFFF 1000px, #F4F9FE 100%) no-repeat; background-size: 100% 100%; }
img, video, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 3px solid rgba(31, 111, 235, .45); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--navy); letter-spacing: -.015em; line-height: 1.1; margin: 0 0 16px; }
h1 { font-size: clamp(2.05rem, 4.8vw, 3.5rem); line-height: 1.04; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.05rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 16px; max-width: var(--measure-max); }
.shell { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.u-label { font: 500 .72rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.u-tnum { font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10; background: var(--paper); color: var(--navy); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */
.masthead { padding-top: 14px; }
.masthead-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.site-mark { width: 40px; height: 40px; flex: none; }
.site-name { font: 700 1.14rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); text-decoration: none; min-height: 44px; display: inline-flex; flex-direction: column; justify-content: center; }
.site-name small { display: block; margin-top: 5px; font: 500 .64rem/1.2 var(--sans); letter-spacing: .24em; color: var(--muted); }
.site-name:hover { color: var(--navy); }
.masthead-date { margin-left: auto; font-size: .88rem; color: var(--muted); }

/* ---------- calculator nav: a pill row (scrolls sideways on small screens) ---------- */
.tool-nav { padding: 10px 0 0; }
.tool-nav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tool-nav-inner::-webkit-scrollbar { display: none; }
.tool-nav .shell.tool-nav-inner { padding: 0; }
.tool-nav-inner { max-width: calc(1280px - 2 * var(--gutter)); width: calc(100% - 2 * var(--gutter)); margin: 0 auto; padding: 4px; background: var(--paper); border-radius: 999px; box-shadow: var(--shadow); }
.tool-nav a { display: inline-flex; align-items: center; flex: none; min-height: 40px; padding: 0 15px; border-radius: 999px; white-space: nowrap;
  font: 500 .9rem/1 var(--sans); color: var(--ink); text-decoration: none; transition: color .15s var(--ease), background .15s var(--ease); }
.tool-nav a:hover { color: var(--accent); background: var(--tint); }
.tool-nav a[aria-current="page"] { color: #fff; background: var(--grad-button); }

/* ---------- page head ---------- */
.page-head { padding: clamp(28px, 4vw, 52px) 0 clamp(20px, 3vw, 36px); }
.kicker { display: block; color: var(--ink); margin-bottom: 12px; }
.page-head .lede { font-size: clamp(1.02rem, 1.4vw, 1.14rem); color: var(--ink); max-width: 60ch; margin-bottom: 0; }
.dateline { color: var(--muted); font-size: .95rem; }

/* ---------- home hero: headline beside the round film disc ---------- */
.home-hero { --disc: clamp(160px, 17vw, 216px); --pad: clamp(28px, 4vw, 52px); position: relative; }
.home-hero.has-film { min-height: calc(var(--disc) + var(--pad) + 40px); padding-right: calc(var(--disc) + clamp(48px, 6vw, 96px)); }
.home-hero h1 { max-width: 18ch; }
.hero-film { position: absolute; right: 22px; top: calc(var(--pad) + 14px); width: var(--disc); aspect-ratio: 1; }
.hero-film::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; border: 2px dotted rgba(31, 111, 235, .32); }
.hero-film::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 6px rgba(91, 212, 253, .16), 0 0 60px 8px rgba(34, 195, 232, .36), inset 0 0 30px rgba(34, 195, 232, .28); }
.hero-film .disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #D9ECFA radial-gradient(circle at 50% 42%, #F2FAFE 0%, #DDEFFB 60%, #C6E3F7 100%); }
.hero-film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-film .glyph { position: absolute; right: -4px; bottom: 6%; width: 30%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow); display: grid; place-items: center; }
.hero-film .glyph svg { width: 60%; height: auto; }

/* ---------- cards: panels, converter ---------- */
.panel, .converter { background: var(--paper); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(18px, 2.2vw, 28px); position: relative; }
.panel::before, .converter::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--grad); }
.panel-title { color: var(--ink); padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: clamp(16px, 2.4vw, 32px); align-items: start; padding-bottom: 24px; }

/* inputs */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 8px; flex-wrap: wrap; }
.field-row label { color: var(--ink); }
.field-value { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; background: var(--panel); border: 1px solid var(--line-mid); border-radius: 12px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease); }
.field-value .unit { font: 500 .72rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.field-value input { font: 700 1.1rem/1.2 var(--display); font-variant-numeric: tabular-nums; color: var(--navy); border: 0; background: transparent; width: 7.5ch; text-align: right; padding: 0; min-height: 40px; }
.field-value input:focus { outline: none; }
.field-value:focus-within { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 4px rgba(31, 111, 235, .16); }
.field-value select { font: 500 1rem/1.2 var(--sans) !important; color: var(--navy); min-height: 40px; cursor: pointer; }
.field-hint { font-size: .84rem; color: var(--muted); margin: 8px 0 0; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #BDEFF0, #CFE0FB); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(31, 79, 196, .3); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, #BDEFF0, #CFE0FB); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(31, 79, 196, .3); }
input[type="range"]:focus-visible { outline: 3px solid rgba(31, 111, 235, .45); outline-offset: 4px; }
input[type="checkbox"] { accent-color: var(--accent); }

/* results */
.grade-block { display: flex; align-items: center; justify-content: center; background: var(--grad-diag); color: #fff; border-radius: 12px;
  font: 700 .82rem/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: .02em; box-shadow: 0 6px 14px rgba(34, 195, 232, .28); }
.grade-block.caution { background: linear-gradient(135deg, #F5B955, #D98A12); box-shadow: 0 6px 14px rgba(217, 138, 18, .25); }
.grade-block.neutral { background: linear-gradient(135deg, #8A98B5, #5B6B8F); box-shadow: 0 6px 14px rgba(51, 70, 107, .2); }
.result-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.result-hero .grade-block { width: 64px; height: 64px; font-size: 1rem; flex: none; border-radius: 16px; }
.result-hero-figures { min-width: 0; }
.result-label { color: var(--ink); display: block; margin-bottom: 4px; }
.result-value { font: 700 clamp(1.9rem, 3.8vw, 2.75rem)/1.05 var(--display); font-variant-numeric: tabular-nums; color: var(--navy); overflow-wrap: anywhere; letter-spacing: -.01em; }
.result-words { color: var(--muted); font-size: .88rem; margin-top: 6px; }
/* two lines reserved: the words arrive with the first calculation, so nothing below them moves (CLS 0) */
@media (min-width: 641px) { .result-words { min-height: 3.2em; } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat { padding: 12px 14px; background: var(--panel); border-radius: 14px; min-width: 0; }
.stat .u-label { color: var(--ink); display: block; margin-bottom: 4px; }
.stat b { display: block; font: 700 1.2rem/1.25 var(--display); font-variant-numeric: tabular-nums; color: var(--navy); overflow-wrap: anywhere; }
.stat i { font-style: normal; font-size: .8rem; color: var(--muted); }
.bench { margin-bottom: 20px; }
.bench-track { position: relative; height: 14px; background: var(--panel); border: 1px solid var(--line-mid); border-radius: 999px; overflow: hidden; }
.bench-fill { position: absolute; inset: 2px auto 2px 2px; background: var(--grad); border-radius: 999px; }
.bench-fill.caution { background: linear-gradient(90deg, #F5B955, #D98A12); }
.bench-marker { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--navy); }
.bench-legend { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-top: 10px; font-size: .84rem; color: var(--muted); }
.bench-legend span { display: inline-flex; align-items: center; gap: 7px; }
.bench-legend b { color: var(--navy); }
.bench-legend i { width: 10px; height: 10px; flex: none; border-radius: 3px; font-style: normal; }
.bench-legend .k-invested i { background: var(--panel); border: 1px solid var(--line-mid); }
.bench-legend .k-gain i { background: var(--grad); }
.bench-legend .k-caution i { background: #E3A33A; }
.note { margin: 20px 0; max-width: var(--measure-max); padding: 14px 16px 14px 18px; background: var(--ochre-bg); border-radius: 14px; border-left: 4px solid #E3A33A; font-size: .92rem; color: var(--ink); }
.note b { color: var(--navy); }
.note a, .ai-key-status a { display: inline-block; padding: 7px 0; margin: -7px 0; }

/* ledger */
.ledger-wrap { overflow-x: auto; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); padding: 6px 18px 10px; }
table.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger caption { text-align: left; padding: 10px 0; color: var(--ink); }
.ledger th { font: 500 .7rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 12px 10px; border-bottom: 1px solid var(--line-mid); }
.ledger th:first-child, .ledger td:first-child { text-align: left; padding-left: 0; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.ledger td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; font-size: .94rem; color: var(--navy); white-space: nowrap; }
.ledger tr:last-child td { border-bottom: 0; }
.ledger tr.milestone td { background: var(--green-bg); font-weight: 700; }
.ledger tr.milestone td:first-child { color: var(--green); box-shadow: inset 4px 0 0 var(--green-fill); padding-left: 10px; }

/* converter (home) */
.conv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.conv-cell { padding: 12px 16px; background: var(--panel); border: 1px solid var(--line-mid); border-radius: 16px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease); }
.conv-cell label { display: block; margin-bottom: 4px; color: var(--ink); }
.conv-cell input { width: 100%; min-height: 40px; padding: 0; border: 0; background: transparent; font: 700 1.5rem/1.2 var(--display); font-variant-numeric: tabular-nums; color: var(--navy); }
.conv-cell input:focus { outline: none; }
.conv-cell:focus-within { border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 4px rgba(31, 111, 235, .16); }
.conv-words { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.conv-words .result-label { color: var(--ink); }
.conv-words .in-notation { font: 700 clamp(1.3rem, 2.8vw, 1.85rem)/1.25 var(--display); font-variant-numeric: tabular-nums; color: var(--navy); overflow-wrap: anywhere; }
.conv-words .in-notation i { font-family: var(--sans); }
.conv-words .in-words { color: var(--muted); margin-top: 4px; }

/* home directory + motion cards */
.tool-index, .motion-index { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(12px, 1.6vw, 18px); }
.tool-index { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.motion-index { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tool-index li, .motion-index li { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.tool-index li:hover, .motion-index li:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.tool-index a { display: flex; gap: 14px; padding: 18px; color: var(--ink); text-decoration: none; height: 100%; border-radius: 20px; }
.tool-index .grade-block { width: 44px; height: 44px; font-size: .74rem; flex: none; }
.tool-index h3 { margin: 0 0 4px; font-size: 1.06rem; }
.tool-index p { margin: 0; font-size: .9rem; color: var(--ink); line-height: 1.45; }
.motion-index a { display: block; height: 100%; color: var(--ink); text-decoration: none; border-radius: 20px; overflow: hidden; }
.motion-frame { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #DDEFFB; }
.motion-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.motion-body { display: block; padding: 16px 18px 18px; }
.motion-body h3 { margin: 0 0 4px; font-size: 1.06rem; }
.motion-body p { margin: 0; font-size: .9rem; color: var(--ink); line-height: 1.45; }

/* sections, prose, FAQ */
.section { padding: clamp(40px, 5vw, 64px) 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-head h2 { margin: 0; }
.section-head .u-label { color: var(--muted); }
.prose { max-width: 920px; background: var(--paper); border-radius: 24px; box-shadow: var(--shadow); padding: clamp(22px, 4.6vw, 56px); margin-top: clamp(40px, 5vw, 64px); }
.page-head + .prose { margin-top: 0; }
.prose > * { max-width: var(--measure-max); }
.prose h2 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin: 1.6em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font: 700 1.05rem/1.3 var(--sans); color: var(--navy); margin: 1.3em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose .lede { font-size: 1.1rem; color: var(--ink); }
.prose p a, .prose li a { overflow-wrap: anywhere; }
.faq details { background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); margin-top: 10px; }
.faq h2 { padding-top: 0 !important; margin-bottom: 14px; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding: 12px 18px; cursor: pointer; list-style: none;
  font: 700 1rem/1.35 var(--sans); color: var(--navy); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--accent); font: 500 1.1rem/1 var(--sans); }
.faq details[open] summary::after { content: "−"; }
.faq .faq-a { padding: 0 18px 14px; color: var(--ink); max-width: 72ch; }
.faq .faq-a p { margin-bottom: 10px; }

/* ---------- Almanac AI (BYOK chat) ---------- */
.ai-setup { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: end; }
.ai-setup .field-value { width: 100%; }
.ai-setup .field-value input { width: 100%; text-align: left; font: 400 .95rem/1.2 var(--sans); letter-spacing: .02em; }
.ai-key-status { font-size: .88rem; color: var(--muted); margin: 10px 0 0; }
.ai-key-status b { color: var(--accent-deep); }
.btn { font: 500 .95rem/1 var(--sans); color: #fff; background: var(--grad-button); border: 0; border-radius: 999px; min-height: 44px; padding: 0 22px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 111, 235, .22); transition: box-shadow .2s var(--ease), transform .15s var(--ease); }
.btn:hover { box-shadow: 0 8px 22px rgba(31, 111, 235, .32); transform: translateY(-1px); }
.btn.ghost { color: var(--navy); background: var(--paper); border: 1px solid var(--line-mid); box-shadow: none; }
.btn.ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
select.ai-model { font: 500 .95rem/1.2 var(--sans); color: var(--navy); background: var(--panel); border: 1px solid var(--line-mid); border-radius: 12px; padding: 0 12px; min-height: 44px; max-width: 100%; }
.chat-log { display: flex; flex-direction: column; gap: 12px; padding: 20px 0; min-height: 120px; }
.chat-msg { max-width: 62ch; padding: 14px 18px; border-radius: 18px; line-height: 1.55; font-size: 1rem; overflow-wrap: anywhere; }
.chat-msg.user { align-self: flex-end; background: var(--tint); color: var(--navy); border-bottom-right-radius: 6px; }
.chat-msg.assistant { align-self: flex-start; background: var(--paper); box-shadow: var(--shadow); border-left: 4px solid var(--accent-mid); white-space: pre-wrap; border-bottom-left-radius: 6px; }
.chat-msg.error { align-self: flex-start; background: var(--ochre-bg); color: var(--ink); border-left: 4px solid #E3A33A; border-bottom-left-radius: 6px; }
.chat-msg .u-label { display: block; margin-bottom: 6px; color: var(--muted); }
.chat-form { display: flex; gap: 10px; align-items: stretch; padding: 12px; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); }
.chat-form textarea { flex: 1; min-width: 0; resize: none; min-height: 52px; padding: 12px 14px; font: 400 1rem/1.4 var(--sans); color: var(--navy); background: var(--panel); border: 1px solid var(--line-mid); border-radius: 14px; }
.chat-form textarea:focus { outline: none; border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 4px rgba(31, 111, 235, .16); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chips button { font: 500 .88rem/1.3 var(--sans); color: var(--navy); background: var(--paper); border: 1px solid var(--line-mid); border-radius: 999px; min-height: 40px; padding: 8px 14px; cursor: pointer; text-align: left; }
.chips button:hover { color: var(--accent); border-color: var(--accent); }
.ai-thinking { color: var(--muted); font-size: .9rem; }

/* ---------- footer ---------- */
.site-footer { margin-top: clamp(64px, 8vw, 104px); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .62); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px var(--gutter); padding: clamp(40px, 5vw, 60px) 0 24px; }
.footer-grid .u-label { display: block; margin-bottom: 8px; color: var(--muted); }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; min-height: 44px; margin-bottom: 4px; }
.footer-brand svg { width: 34px; height: 34px; }
.footer-brand b { font: 700 1rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li a { display: inline-block; padding: 6px 0; color: var(--ink); text-decoration: none; font-size: .95rem; }
.footer-grid li a:hover { color: var(--accent); }
.footer-about p { font-size: .95rem; color: var(--muted); max-width: 40ch; }
.footer-about p a { display: inline-block; padding: 6px 0; margin: -6px 0; }
.footer-about .mail { display: inline-block; padding: 8px 0; font-weight: 500; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px 24px; flex-wrap: wrap; padding: 18px 0 28px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.footer-bottom .fine { color: var(--muted); }
.attribution { display: inline-block; padding: 10px 0; margin: -10px 0; color: var(--muted); text-decoration: none; }
.attribution b { color: var(--navy); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent-mid); text-underline-offset: 3px; }
.attribution:hover b { color: var(--accent); }

/* ---------- motion (all behind prefers-reduced-motion) ---------- */
@keyframes cc-drift { from { transform: scale(1.04) translate3d(-1.2%, 0, 0); } to { transform: scale(1.1) translate3d(1.2%, -1%, 0); } }
@media (prefers-reduced-motion: no-preference) {
  .motion-frame img { animation: cc-drift 16s ease-in-out infinite alternate; }
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); transition-delay: var(--reveal-delay, 0ms); }
  .reveal.is-inview { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .calc-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 700px) { .ai-setup { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead { padding-top: 8px; }
  .masthead-inner { min-height: 52px; gap: 10px; }
  .site-mark { width: 34px; height: 34px; }
  .site-name { font-size: 1rem; letter-spacing: .07em; }
  .site-name small { font-size: .58rem; letter-spacing: .2em; }
  .masthead-date { display: none; }
  .tool-nav { padding-top: 6px; }
  .tool-nav a { padding: 0 13px; font-size: .88rem; }
  .page-head { padding: 20px 0 16px; }
  .home-hero, .home-hero.has-film { min-height: 0; padding-right: 0; }
  .home-hero::after { content: ""; display: block; clear: both; }
  .hero-film { position: relative; right: auto; top: auto; float: right; width: 92px; margin: 4px 4px 8px 14px; shape-outside: circle(50% at 50% 50%); shape-margin: 10px; }
  .hero-film::before { inset: -8px; }
  .hero-film::after { inset: -3px; box-shadow: 0 0 0 4px rgba(91, 212, 253, .16), 0 0 26px 4px rgba(34, 195, 232, .32); }
  .hero-film .glyph { display: none; }
  h1 { font-size: clamp(1.8rem, 8vw, 2.2rem); }
  .page-head .lede { font-size: 1rem; line-height: 1.55; }
  .panel, .converter { border-radius: 20px; padding: 16px; }
  .conv-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .conv-cell { padding: 10px 12px; }
  .conv-cell input { font-size: 1.25rem; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ledger-wrap { padding: 4px 12px 8px; border-radius: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px 16px; }
}
@media (max-width: 380px) {
  .site-name { font-size: .92rem; letter-spacing: .06em; }
  .conv-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media print {
  .masthead, .tool-nav, .site-footer, .hero-film, .motion-index { display: none; }
  .panel, .converter, .prose, .ledger-wrap { box-shadow: none; }
}
