/* Cynova-Tech : une feuille de prix et son instrument de lecture.
   Cyan = taux de marge (coût) ; violet = taux de marque (vente). */
@font-face { font-family: Inter; src: url('fonts/inter-var-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --night: #040B16; --night-2: #08182A; --paper: #F5FAFD;
  --cyan: #00C3FF; --violet: #9F5CFF; --muted-dark: #8EB1C9;
  --cyan-ink: #00657D; --violet-ink: #6530B4; --muted: #496174;
  --line: #D2DFE8; --control: #778C9F; --dark-line: #38546B;
  --error: #B5344C; --wrap: 1568px; --measure: 69ch;
  --space-1: .25rem; --space-2: .5rem; --space-3: 1rem; --space-4: 1.5rem;
  --space-5: 2rem; --space-6: 3rem; --space-7: 4rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, sans-serif; font-size: 1rem; line-height: 1.6; color: var(--night-2); background: var(--paper); font-feature-settings: 'cv11', 'ss01', 'calt'; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button { min-height: 44px; padding: .5rem 1rem; border: 1px solid var(--control); border-radius: 6px; background: #fff; color: var(--night-2); font-size: .875rem; font-weight: 600; transition: background-color .15s; }
button:hover { background: #E8F3F9; }
button.primary { background: var(--night-2); border-color: var(--night-2); color: #fff; }
button.primary:hover { background: #173750; }
button.quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--cyan-ink); outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline-offset: 2px; }
.wrap { width: min(calc(100% - 4rem), var(--wrap)); margin-inline: auto; }
.sr-only, .mobile-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.print-only { display: none; }
.skip { position: absolute; z-index: 5; left: 1rem; top: -6rem; padding: 1rem; background: #fff; color: var(--night); }
.skip:focus { top: 1rem; }
/* L'en-tête reste calme ; la lecture du prix est le moment fort. */
.band { background: var(--night); color: var(--paper); padding-bottom: 4rem; }
.top { min-height: 104px; display: flex; justify-content: space-between; align-items: center; gap: 2rem; border-bottom: 1px solid var(--dark-line); }
.brand { padding: 8px; margin-left: -8px; }
.brand img { width: 208px; }
.top nav ul { display: flex; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-size: .875rem; color: var(--muted-dark); }
.top nav a:hover { color: #fff; }
.top :focus-visible, .other-tools :focus-visible, .active-detail :focus-visible { outline-color: var(--cyan); }
.intro { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 4rem; align-items: end; padding-block: 3rem; }
h1 { max-width: 24ch; font-size: clamp(2rem, 3.3vw, 3rem); font-weight: 650; letter-spacing: -.045em; line-height: 1.1; margin: 0; text-wrap: balance; font-optical-sizing: auto; }
.intro p { color: var(--muted-dark); max-width: 47ch; margin: 0; font-size: 1rem; }
/* Feuille de prix : contrôles, données et totaux forment une seule surface. */
.workspace { background: #fff; color: var(--night-2); border-radius: 16px; overflow: clip; }
.workspace-heading { padding: 2rem 2rem 1.5rem; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
h2, h3, h4 { line-height: 1.25; }
.workspace-heading h2 { font-size: 1.5rem; letter-spacing: -.025em; margin: 0; font-weight: 650; }
.workspace-heading p { color: var(--muted); font-size: .875rem; margin: .5rem 0 0; }
.workspace-heading a { font-size: .875rem; color: var(--cyan-ink); }
.settings { background: var(--paper); padding: 1.5rem 2rem; border-block: 1px solid var(--line); }
.settings-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 1024px; }
.field { min-width: 0; }
.field > label, .field > div > label:not(.check) { display: block; font-weight: 550; font-size: .875rem; margin: 0 0 .5rem; }
.field label:not(:first-child) { margin-top: 1rem; }
.field input:not([type="checkbox"]), .field select { display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--control); border-radius: 6px; background: #fff; color: var(--night-2); padding: .5rem; font-size: 1rem; font-variant-numeric: tabular-nums; }
.field select { padding-right: 1.5rem; text-overflow: ellipsis; }
.field input:not([type="checkbox"]) { padding-inline: 1rem; }
.hint { color: var(--muted); font-size: .75rem; line-height: 1.5; margin: .5rem 0 0; max-width: 70ch; }
.settings-disclosure { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
#more-settings { background: transparent; border-color: transparent; padding-left: 0; text-align: left; }
#more-settings span { margin-left: .5rem; font-size: 1.25rem; }
.settings-summary { display: flex; gap: .5rem; flex-wrap: wrap; font-size: .75rem; color: var(--muted); }
.settings-summary span { padding: .25rem .5rem; border-radius: 4px; background: #E5EFF5; }
.advanced-grid { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr; gap: 2rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.check { display: flex !important; align-items: center; gap: .5rem; min-height: 44px; font-size: .875rem; cursor: pointer; }
.check input { accent-color: var(--cyan-ink); width: 20px; height: 20px; margin: 0; flex: none; }
.switch input { width: 24px; }
.field-error { color: var(--error); font-size: .875rem; margin: .5rem 0 0; }
[aria-invalid="true"] { border-color: var(--error) !important; box-shadow: inset 0 -2px var(--error); }
/* Les chiffres ont une chasse fixe, et restent alignés à droite. */
.table-viewport { max-width: 100%; overflow-x: auto; }
#price-table { width: 100%; min-width: 1260px; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .875rem; }
#price-table th { text-align: right; font-size: .75rem; line-height: 1.4; font-weight: 550; color: var(--muted); background: #fff; padding: 1rem .5rem; vertical-align: bottom; border-bottom: 1px solid var(--line); }
#price-table td { padding: 1rem .5rem; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
#price-table .col-name { width: 120px; text-align: left; padding-left: 1rem; }
#price-table .col-purchase { width: 104px; }
#price-table .col-rate { width: 92px; }
#price-table .col-fees { width: 92px; }
#price-table .col-qty { width: 60px; }
#price-table .col-ht { width: 108px; }
#price-table .col-coef { width: 76px; }
#price-table .delete-cell { width: 48px; padding: .25rem; }
#price-table td input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--control); border-radius: 4px; color: var(--night-2); background: #fff; padding: .5rem; text-align: right; font-size: .875rem; font-variant-numeric: tabular-nums; }
#price-table .col-name input { text-align: left; }
#price-table input::placeholder { color: var(--muted); opacity: 1; }
#price-table .result-cell { overflow-wrap: anywhere; }
#price-table .price-cell { background: #EBF6FB; color: var(--night-2); font-weight: 750; }
#price-table th.price-cell { color: var(--cyan-ink); }
#price-table tr.is-active > .col-name { box-shadow: inset 3px 0 var(--cyan-ink); }
#price-table tr.is-active .input-cell { background: #F2F8FC; }
#price-table .delete-cell button { min-width: 40px; min-height: 44px; border: 0; background: transparent; padding: .25rem; font-size: 1.5rem; color: var(--muted); }
#price-table .delete-cell button:hover { background: #E5EFF5; color: var(--night); }
#price-table .row-message { text-align: left; color: var(--muted); padding: 1rem; background: var(--paper); font-size: .875rem; }
#price-table .is-error .row-message { color: var(--error); }
#price-table tfoot td { padding: 1.5rem 2rem; background: var(--paper); text-align: left; border-bottom: 0; }
.totals-title { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; }
.totals-title span { font-size: .75rem; color: var(--muted); }
.excluded { color: var(--muted); font-size: .75rem; margin: .5rem 0 0; }
.totals-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0 0; align-items: end; }
.totals-grid dt { font-size: .75rem; line-height: 1.5; margin-bottom: .5rem; }
.totals-grid dd { margin: 0; font-weight: 650; font-size: 1rem; text-align: right; overflow-wrap: anywhere; }
.totals-grid dt { text-align: right; }
.total-main dd { font-size: 1.25rem; font-weight: 750; }
.c-cyan { color: var(--cyan-ink) !important; }
.c-violet { color: var(--violet-ink) !important; }
.table-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: 1.5rem 2rem 0; }
#action-status { color: var(--cyan-ink); margin: 0 0 0 .5rem; font-size: .875rem; }
.local-note { font-size: .75rem; color: var(--muted); margin: .5rem 2rem 1.5rem; }
.copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
/* Le panneau lie un prix réel aux deux bases de marge. */
.active-detail { margin: 1rem; background: var(--night-2); color: var(--paper); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); border-radius: 8px; }
.detail-price { padding: 2rem; border-right: 1px solid var(--dark-line); }
.active-detail h3 { font-size: .875rem; font-weight: 550; color: var(--muted-dark); margin: 0 0 1.5rem; overflow-wrap: anywhere; }
.out-label { font-size: .875rem; margin: 0; color: var(--muted-dark); }
.hero-figure { font-variant-numeric: tabular-nums; font-size: clamp(2.25rem, 4.5vw, 3rem); letter-spacing: -.045em; line-height: 1.15; font-weight: 650; margin: .5rem 0; overflow-wrap: anywhere; }
.hero-sub { color: var(--muted-dark); font-size: .875rem; margin: .5rem 0 0; font-variant-numeric: tabular-nums; }
.hero-sub strong { color: var(--paper); font-weight: 550; }
.detail-note { color: var(--muted-dark); font-size: .75rem; margin: 1rem 0 0; max-width: 60ch; }
.detail-explanation { padding: 2rem; min-width: 0; }
.comparison { font-size: 1rem; color: var(--paper); max-width: 65ch; margin: 1.5rem 0 0; border-left: 3px solid var(--violet); padding-left: 1rem; }
.comparison strong { font-weight: 650; }
.detail-empty { grid-column: 1 / -1; padding: 2rem; }
.detail-empty h3 { margin-bottom: .5rem; }
.detail-empty p { margin: 0; }
.pricebar .bar, .figure-bar .bar { display: flex; height: 40px; overflow: hidden; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.bar > div { display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; flex-shrink: 0; }
.seg-cost { background: #526C80; color: #fff; }
.seg-margin { background: repeating-linear-gradient(135deg, #F5FAFD 0 8px, #D2DFE8 8px 16px); color: var(--night); }
.seg-vat { background: repeating-linear-gradient(90deg, #8EB1C9 0 2px, #B6CBDA 2px 6px); color: var(--night); }
.brackets { position: relative; height: 6rem; margin-top: .5rem; font-size: .75rem; line-height: 1.4; }
.br { position: absolute; border-top: 2px solid; padding-top: .5rem; }
.br::before, .br::after { content: ''; position: absolute; width: 2px; height: 8px; background: currentColor; top: -8px; }
.br::before { left: 0; } .br::after { right: 0; }
.br-cost { color: var(--cyan); top: 0; }
.br-price { color: var(--violet); top: 3rem; }
.br span { display: block; width: max-content; max-width: min(30rem, calc(100vw - 6rem)); overflow-wrap: anywhere; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; list-style: none; padding: 0; margin: 0; color: var(--muted-dark); font-size: .75rem; font-variant-numeric: tabular-nums; }
.legend strong { color: var(--paper); font-weight: 550; margin-left: .25rem; }
/* Outils secondaires, hors de la feuille principale. */
.other-tools { margin-top: 3rem; }
.other-heading { display: flex; align-items: baseline; gap: 2rem; justify-content: space-between; }
.other-heading h2 { font-size: 1.25rem; margin: 0; font-weight: 600; }
.other-heading p { color: var(--muted-dark); font-size: .875rem; margin: 0; }
.tool-tabs { display: flex; gap: 1.5rem; border-bottom: 1px solid var(--dark-line); margin-top: 1.5rem; }
.tool-tabs button { color: var(--muted-dark); background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding-inline: 0; }
.tool-tabs button[aria-selected="true"] { color: var(--paper); border-bottom-color: var(--cyan); }
.secondary-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; padding-top: 2rem; max-width: 1100px; }
#secondary-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-content: start; }
#secondary-form .field { align-self: start; }
#secondary-form .hint { color: var(--muted-dark); }
#secondary-form input:not([type="checkbox"]), #secondary-form select { color: var(--paper); background: var(--night-2); border-color: #6B849B; }
#secondary-form input[type="checkbox"] { accent-color: var(--cyan); }
.input-pair { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: .5rem; }
.secondary-out { min-width: 0; }
.secondary-out .c-cyan { color: var(--cyan) !important; }
.secondary-out .c-violet { color: var(--violet) !important; }
.pair { margin-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rate-figure { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; margin: .5rem 0 1rem; }
.details { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 1.5rem 0; font-size: .875rem; }
.details dt, .details dd { padding: .5rem 0; margin: 0; border-bottom: 1px solid var(--dark-line); }
.details dt { color: var(--muted-dark); }
.details dd { text-align: right; padding-left: 1rem; font-variant-numeric: tabular-nums; }
.note { color: var(--muted-dark); font-size: .875rem; padding: 1rem 0; border-top: 1px solid var(--dark-line); }
.error, .warn { color: var(--paper); border-left: 3px solid var(--error); padding: .5rem 1rem; }
.error p { margin: .5rem 0; }
/* Guide : une mesure de lecture constante, des formules et un reçu chiffré. */
.guide { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 4rem; max-width: 1200px; padding-block: 4rem; }
.guide article { max-width: var(--measure); min-width: 0; }
.guide h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -.035em; font-weight: 650; margin: 0 0 1.5rem; max-width: 24ch; }
.guide h3 { font-size: 1.5rem; letter-spacing: -.025em; font-weight: 650; margin: 4rem 0 1rem; }
.guide h4 { font-size: 1rem; font-weight: 650; margin: 2rem 0 .5rem; }
.guide p { margin: 0 0 1rem; }
.guide .lead { font-size: 1.25rem; line-height: 1.6; color: var(--muted); }
.guide ul, .guide ol { padding-left: 1.5rem; margin: 0 0 1.5rem; }
.guide li { margin-bottom: .5rem; }
.steps { list-style: none; counter-reset: steps; padding: 0 !important; margin-block: 2rem !important; }
.steps li { counter-increment: steps; position: relative; padding: 0 0 1.5rem 4rem; margin: 0; }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 1rem; top: 2.5rem; bottom: .5rem; width: 1px; background: var(--line); }
.steps li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 8px; background: var(--night-2); color: var(--paper); display: grid; place-items: center; font-size: .875rem; font-variant-numeric: tabular-nums; }
.steps strong { display: block; margin-bottom: .25rem; }
.formula { padding: 1.5rem; margin: 1.5rem 0; border-left: 3px solid var(--night-2); border-radius: 0 8px 8px 0; background: #E8F0F6; font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; line-height: 1.6; }
.formula small { display: block; color: var(--muted); font-size: .875rem; font-weight: 400; margin-top: .5rem; }
.formula.cy { border-color: var(--cyan-ink); background: #E4F3F7; }
.formula.vi { border-color: var(--violet-ink); background: #EEE8F8; }
.def { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin: 2rem 0; }
.def > div { padding: 1rem 0; border-top: 3px solid; }
.def .cy { border-color: var(--cyan-ink); }
.def .vi { border-color: var(--violet-ink); }
.def h4 { margin: 0 0 .5rem; font-size: 1.25rem; }
.def .cy h4, .t-cy { color: var(--cyan-ink); }
.def .vi h4, .t-vi { color: var(--violet-ink); }
.t-cy, .t-vi { font-weight: 650; }
.callout { padding: 1.5rem; margin: 2rem 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.callout p:last-child { margin-bottom: 0; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.guide table { width: 100%; border-collapse: collapse; font-size: .875rem; font-variant-numeric: tabular-nums; margin: 1rem 0 1.5rem; }
.guide caption { text-align: left; font-size: 1rem; font-weight: 650; padding: .5rem 0 1rem; }
.guide th, .guide td { padding: 1rem .5rem; border-bottom: 1px solid var(--line); text-align: right; }
.guide thead th { color: var(--muted); font-weight: 550; font-size: .75rem; background: #E8F0F6; vertical-align: bottom; }
.guide tbody tr:nth-child(even) { background: #fff; }
.guide th[scope="rowgroup"] { background: #E8F0F6 !important; }
.calc-sheet { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 1.5rem 2rem; margin: 2rem 0; background: #fff; border-top: 4px solid var(--night-2); border-bottom: 4px double var(--control); border-radius: 0 0 8px 8px; font-variant-numeric: tabular-nums; }
.calc-sheet dt, .calc-sheet dd { margin: 0; padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.calc-sheet dt { color: var(--muted); padding-right: 1rem; }
.calc-sheet dd { text-align: right; font-weight: 650; }
.calc-sheet .total { color: var(--night-2); font-weight: 650; }
.calc-sheet > :nth-last-child(-n+2) { border-bottom: 0; }
.figure-bar { margin: 2rem 0; }
.figure-bar .f-cost { background: #526C80; color: #fff; }
.figure-bar .f-margin { background: repeating-linear-gradient(135deg, #E8F0F6 0 8px, #D2DFE8 8px 16px); color: var(--night); }
.figure-bar .br-cost { color: var(--cyan-ink); }
.figure-bar .br-price { color: var(--violet-ink); }
.figure-bar figcaption { color: var(--muted); font-size: .875rem; }
.guide details { border-bottom: 1px solid var(--line); }
.guide details:first-of-type { border-top: 1px solid var(--line); }
.guide summary { font-weight: 600; padding: 1rem 2rem 1rem 0; min-height: 48px; }
.guide details > div { padding: 0 0 1rem; }
.guide .sources { font-size: .875rem; color: var(--muted); }
.sources a { overflow-wrap: anywhere; }
.toc { position: sticky; top: 2rem; align-self: start; border-left: 1px solid var(--control); padding-left: 1.5rem; font-size: .875rem; }
.toc p { font-weight: 600; margin: 0 0 1rem; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: .5rem 0; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--cyan-ink); text-decoration: underline; }
.foot { background: var(--night); color: var(--muted-dark); padding: 3rem 0; font-size: .875rem; }
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 3rem; }
.foot img { width: 176px; margin: 8px; }
.foot p { max-width: 68ch; margin: 0; }
.foot a { color: var(--paper); }
.foot :focus-visible { outline-color: var(--cyan); }
@media (max-width: 1200px) {
  .wrap { width: calc(100% - 3rem); }
  .secondary-layout { gap: 2rem; }
  .guide { gap: 3rem; grid-template-columns: minmax(0, 1fr) 200px; }
}
@media (max-width: 980px) {
  .intro { grid-template-columns: 1fr; gap: 1.5rem; }
  .intro p { max-width: 65ch; }
  .advanced-grid { grid-template-columns: 1fr 1fr; }
  .active-detail { grid-template-columns: 1fr; }
  .detail-price { border: 0; padding-bottom: 0; }
  .detail-explanation { padding-top: 1.5rem; }
  .secondary-layout { grid-template-columns: 1fr; }
  .other-heading { display: block; }
  .other-heading p { margin-top: .5rem; }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .guide article { max-width: 100%; }
  .toc { position: static; margin-top: 3rem; }
  .toc ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
  /* Une ligne devient une fiche, sans défilement horizontal. */
  .table-viewport { overflow: visible; }
  #price-table { display: block; min-width: 0; table-layout: auto; }
  #price-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #price-table tbody, #price-table tfoot { display: block; }
  #price-table tbody { padding: 1rem; }
  #price-table tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem; }
  #price-table tbody tr:last-child { margin-bottom: 0; }
  #price-table tbody tr.is-active { border-color: var(--cyan-ink); }
  #price-table tbody td { display: block; width: auto; padding: 0; border: 0; }
  /* Les largeurs de colonnes du bureau (#price-table .col-*) ne s'appliquent pas en cartes. */
  #price-table tbody td[class] { width: auto; min-width: 0; }
  #price-table tbody .price-cell .cell-value { white-space: nowrap; }
  #price-table tbody .col-name { grid-column: 1 / -1; padding: 0 3rem 0 0; box-shadow: none; }
  #price-table tbody .input-cell { background: none; }
  .mobile-label { position: static; display: block; width: auto; height: auto; margin: 0 0 .5rem; overflow: visible; clip-path: none; white-space: normal; font-size: .75rem; font-weight: 450; color: var(--muted); text-align: left; }
  #price-table td input { font-size: 1rem; }
  #price-table tbody .result-cell { order: 2; padding-top: .5rem; text-align: right; }
  #price-table tbody .price-cell { order: 1; padding: 1rem; border-radius: 4px; grid-column: span 2; }
  #price-table .price-cell .cell-value { font-size: 1.5rem; }
  #price-table tbody .delete-cell { position: absolute; top: 1.5rem; right: 1rem; }
  #price-table tbody .row-message { order: 1; grid-column: 1 / -1; padding: 1rem; border-radius: 4px; }
  #price-table tfoot tr, #price-table tfoot td { display: block; }
  .totals-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
  .totals-grid dt, .totals-grid dd { text-align: left; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 2rem); }
  .top { min-height: 88px; flex-wrap: wrap; gap: 0; padding-block: 1rem; }
  .brand img { width: 176px; }
  .top nav { width: 100%; margin-top: .5rem; }
  .top nav ul { justify-content: space-between; gap: .5rem; }
  .top nav a { font-size: .75rem; }
  .intro { padding-block: 2rem; }
  h1 { font-size: 2rem; max-width: 20ch; }
  .workspace { border-radius: 12px; }
  .workspace-heading { display: block; padding: 1.5rem 1rem; }
  .workspace-heading a { display: inline-block; margin-top: .5rem; }
  .settings { padding: 1rem; }
  .settings-primary, .advanced-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .settings-disclosure { gap: .5rem; }
  #price-table tbody { padding: 1rem .5rem; }
  #price-table tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 1rem; }
  #price-table tbody .price-cell { grid-column: 1 / -1; }
  #price-table tbody .delete-cell { top: 1rem; right: .5rem; }
  #price-table tfoot td { padding: 1.5rem 1rem; }
  .totals-title { display: block; }
  .totals-title span { display: block; margin-top: .25rem; }
  .totals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .totals-grid dd { font-size: 1rem; }
  .table-actions { padding: 1.5rem 1rem 0; }
  .table-actions .primary, .table-actions button:not(.quiet) { width: 100%; }
  .table-actions .quiet { margin-inline: auto; }
  #action-status { margin: 0; width: 100%; }
  .local-note { margin: .5rem 1rem 1.5rem; }
  .active-detail { margin: .5rem; }
  .detail-price, .detail-explanation, .detail-empty { padding: 1.5rem 1rem; }
  .detail-price { padding-bottom: 0; }
  .hero-figure { font-size: 2.25rem; }
  .comparison { font-size: .875rem; }
  .legend { gap: .5rem 1rem; }
  .other-tools { margin-top: 2rem; }
  #secondary-form { grid-template-columns: 1fr; }
  .tool-tabs { gap: 1rem; }
  .guide { padding-block: 3rem; }
  .guide h3 { margin-top: 3rem; font-size: 1.25rem; }
  .guide .lead { font-size: 1rem; }
  .steps li { padding-left: 3rem; }
  .def { grid-template-columns: 1fr; gap: 1rem; }
  .formula { font-size: 1rem; padding: 1rem; }
  .callout { padding: 1rem; }
  .calc-sheet { padding: 1rem; }
  .calc-sheet dt { font-size: .75rem; }
  .calc-sheet dd { font-size: .875rem; white-space: nowrap; }
  .guide th, .guide td { padding: .5rem .25rem; font-size: .75rem; }
  .toc ul { grid-template-columns: 1fr; }
  .foot .wrap { display: block; }
  .foot img { margin: 0 0 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  @page { size: landscape; margin: 12mm; }
  html, body, .band, .paper, .foot, .workspace, .active-detail { background: #fff; color: #000; }
  .wrap { width: 100%; max-width: none; }
  .top { min-height: 0; border: 0; padding: 0; }
  .top::before { content: 'Cynova-Tech'; font-weight: 700; }
  .brand, .top nav, .foot img, .skip, .settings, .table-actions, .local-note, .other-tools, .workspace-heading a, .toc, button, .delete-cell { display: none !important; }
  .print-only { display: block; font-size: 9pt; }
  .intro { display: block; padding: 1rem 0; }
  h1 { font-size: 22pt; max-width: 40ch; }
  .intro p { color: #000; max-width: none; }
  .workspace { overflow: visible; border: 0; }
  .workspace-heading { padding: 1rem 0; }
  .table-viewport { overflow: visible; }
  #price-table { display: table; min-width: 0; width: 100%; font-size: 8pt; table-layout: fixed; }
  #price-table thead { display: table-header-group; position: static; width: auto; height: auto; clip-path: none; }
  #price-table tbody { display: table-row-group; padding: 0; }
  #price-table tfoot { display: table-row-group; }
  #price-table tbody tr, #price-table tfoot tr { display: table-row; }
  #price-table tbody td, #price-table tfoot td { display: table-cell; border-bottom: 1px solid #888; }
  #price-table th, #price-table td, #price-table tbody .col-name, #price-table tbody .price-cell { width: auto; padding: .25rem; font-size: 8pt; background: #fff !important; color: #000 !important; box-shadow: none; }
  #price-table td input { border: 0; border-radius: 0; min-height: 0; padding: 0; background: #fff; color: #000; font-size: 8pt; }
  #price-table .price-cell .cell-value { font-size: 8pt; }
  .mobile-label { display: none; }
  .totals-grid { grid-template-columns: repeat(4, 1fr); }
  .totals-grid dt, .totals-grid dd { font-size: 9pt; }
  .active-detail { display: block; margin: 1rem 0; border: 1px solid #888; break-inside: avoid; }
  .detail-price, .detail-explanation { padding: 1rem; border: 0; }
  .hero-figure { font-size: 24pt; }
  .active-detail h3, .out-label, .hero-sub, .hero-sub strong, .detail-note, .comparison, .legend, .legend strong, .br-cost, .br-price, .c-cyan, .c-violet { color: #000 !important; }
  .comparison { border-color: #000; }
  .bar { border: 1px solid #000; }
  .bar > div { color: #000 !important; background: #fff !important; border-right: 1px solid #000; }
  .guide { display: block; padding: 2rem 0; }
  .guide article { max-width: 100%; }
  .guide h3 { break-after: avoid; margin-top: 2rem; }
  .guide table, .formula, .calc-sheet, .figure-bar { break-inside: avoid; }
  .guide p, .guide li { orphans: 3; widows: 3; }
  .guide *, .foot * { color: #000 !important; }
  .formula, .callout, .calc-sheet, .guide th, .guide td { background: #fff !important; border-color: #888 !important; }
  .steps li::before { background: #fff; color: #000; border: 1px solid #000; }
  details::details-content { content-visibility: visible; height: auto; }
  details > div { display: block !important; }
  .foot { padding: 1rem 0; }
  .foot p { max-width: none; }
}
