:root {
  color-scheme:light;
  --ink:#1f1d19; --muted:#5c5850; --accent:#4c5c31; --accent-light:#edf1e6;
  --rule:#e3e0d8; --rule-strong:#c9c5ba; --ground:#f3f2ee; --paper:#ffffff; --raised:#ffffff; --field:#ffffff;
  --danger:#913f32; --focus:#667d3b; --on-accent:#ffffff;
  --hover:#eeede7; --selection:#dce6ca; --selection-ink:#242b1c;
  --warning-bg:#fff1d9; --warning-ink:#684a1d;
  --delete-bg:#f7e9e5; --delete-ink:#794136; --insert-bg:#edf2e5; --insert-ink:#314227;
  --scrim:rgba(30,32,25,.32); --shadow:0 1px 3px rgba(29,31,23,.1),0 10px 28px rgba(29,31,23,.14); --thumb:#939988;
  --header-height:52px; --reading-size:18px; --reading-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; --reading-leading:1.7;
  --ui-font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; --serif:Georgia,"Times New Roman",serif;
  --ease:cubic-bezier(.2,.8,.2,1);
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --ink:#eeece5; --muted:#b9b5aa; --accent:#c2d1a6; --accent-light:#343d2a;
  --rule:#3d3f36; --rule-strong:#55584b; --ground:#171814; --paper:#201f1b; --raised:#2c2d26; --field:#2c2d26;
  --danger:#f3aa99; --focus:#c2d1a6; --on-accent:#22271b;
  --hover:#34362d; --selection:#52613e; --selection-ink:#f5f6ef;
  --warning-bg:#3e3421; --warning-ink:#f1d195;
  --delete-bg:#432c29; --delete-ink:#f1b6a8; --insert-bg:#303d29; --insert-ink:#c6e1ae;
  --scrim:rgba(0,0,0,.5); --shadow:0 1px 3px rgba(0,0,0,.4),0 12px 32px rgba(0,0,0,.42); --thumb:#7f886f;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { color:var(--ink); background:var(--ground); font:400 16px/1.5 var(--ui-font); -webkit-font-smoothing:antialiased; scrollbar-color:var(--thumb) var(--ground); scrollbar-width:thin; accent-color:var(--accent); }
body { margin:0; }
::selection { background:var(--selection); color:var(--selection-ink); }
a { color:var(--accent); text-underline-offset:.2em; }
button,input,select,textarea { font:inherit; color:inherit; }
button { cursor:pointer; background:transparent; border:1px solid var(--rule-strong); border-radius:8px; padding:6px 12px; min-height:36px; line-height:1.3; transition:background-color .12s,border-color .12s; }
button:hover { background:var(--hover); }
button:active { background:var(--selection); }
button:disabled { opacity:.4; cursor:not-allowed; }
button.primary,button[aria-pressed=true] { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
button.primary:hover { background:var(--accent); filter:brightness(1.08); }
:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
input,textarea,select { width:100%; color:var(--ink); background:var(--field); border:1px solid var(--rule-strong); border-radius:8px; padding:8px 12px; min-height:36px; caret-color:var(--accent); }
select { appearance:none; padding-right:32px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; background-size:16px; }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
textarea { min-height:120px; resize:vertical; }
label { display:block; margin:14px 0 6px; font-size:.8rem; font-weight:600; color:var(--muted); }
button,summary,a,input,select,textarea { touch-action:manipulation; }
button svg { flex-shrink:0; width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.skip { position:absolute; left:20px; top:-80px; z-index:40; padding:12px; background:var(--paper); }
.skip:focus { top:10px; }
summary { cursor:pointer; list-style:none; display:flex; align-items:center; gap:8px; }
summary::-webkit-details-marker { display:none; }
summary::before { content:''; flex-shrink:0; width:6px; height:6px; border-right:1.6px solid currentColor; border-bottom:1.6px solid currentColor; transform:rotate(-45deg); transition:transform .15s var(--ease); }
details[open] > summary::before { transform:rotate(45deg); }

/* Shell: menu and brand left, views centred, tools right. One row from 980px. */
.topbar { position:sticky; top:0; z-index:10; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; column-gap:12px; min-height:52px; padding:6px 12px; background:var(--paper); border-bottom:1px solid var(--rule); }
.topbar-left { display:flex; align-items:center; gap:4px; min-width:0; }
.brand { padding:0 8px; color:var(--ink); text-decoration:none; font:400 1.35rem/1 var(--serif); letter-spacing:-.01em; }
.mode-pill { margin-left:4px; padding:2px 9px; border:1px solid var(--rule-strong); border-radius:999px; color:var(--muted); font-size:.72rem; white-space:nowrap; cursor:help; }
.view-tabs { display:flex; align-items:center; gap:2px; }
.view-tabs button { min-height:34px; padding:0 12px; border:0; color:var(--muted); font-size:.9rem; white-space:nowrap; }
.view-tabs button[aria-current=true] { color:var(--accent); background:var(--accent-light); font-weight:600; }
.top-actions { display:flex; align-items:center; justify-content:flex-end; gap:4px; }
.icon-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; width:36px; height:36px; min-height:36px; padding:0; border:0; border-radius:8px; color:var(--ink); }
.icon-button.with-label { width:auto; padding:0 10px; font-size:.88rem; }
.type-mark { font:400 1.1rem/1 var(--serif); }
.comment-button { position:relative; display:inline-flex; align-items:center; gap:6px; margin-left:4px; padding:0 12px; min-height:36px; border-color:var(--rule-strong); color:var(--accent); font-size:.88rem; font-weight:600; }
.comment-button svg { width:18px; height:18px; }
#draft-indicator { position:absolute; top:3px; right:3px; width:8px; height:8px; border-radius:50%; background:var(--danger); }
#connection:empty { display:none; }
.warning { padding:10px 16px; color:var(--warning-ink); background:var(--warning-bg); font-size:.85rem; }
.workspace { max-width:1000px; min-height:calc(100vh - var(--header-height)); margin:0 auto; background:var(--paper); border-inline:1px solid var(--rule); }
main { min-width:0; padding:36px clamp(20px,5vw,64px) 112px; }
main:focus,main h1:focus { outline:none; }
main h1:focus-visible { text-decoration:underline; text-decoration-color:var(--focus); text-underline-offset:8px; text-decoration-thickness:2px; }

/* Reading column: width follows the reading size so title, summary and text share one measure. */
.column { max-width:calc(var(--reading-size) * 37); margin-inline:auto; }
.column.wide { max-width:860px; }
h1 { margin:0 0 12px; font:400 2rem/1.2 var(--serif); letter-spacing:-.02em; text-wrap:balance; }
h2 { margin:32px 0 10px; font-size:1.15rem; line-height:1.35; text-wrap:balance; }
h3 { margin:22px 0 8px; font-size:1rem; line-height:1.4; }
p { margin:0 0 14px; }
.small,.muted { color:var(--muted); }
.small { font-size:.82rem; line-height:1.5; }
.intro { max-width:66ch; color:var(--muted); font-size:1.05rem; line-height:1.6; }
.scope-line { margin:0 0 28px; color:var(--muted); font-size:.85rem; }
.doc-head { margin-bottom:28px; padding-bottom:20px; border-bottom:1px solid var(--rule); }
.doc-meta { position:relative; display:flex; align-items:center; gap:6px; color:var(--muted); font-size:.82rem; font-variant-numeric:tabular-nums; }
.doc-meta .meta-info { width:28px; height:28px; min-height:28px; margin-left:2px; color:var(--muted); }
.doc-meta .meta-info:hover,.doc-meta .meta-info[aria-expanded=true] { color:var(--accent); background:var(--accent-light); }
.doc-meta .meta-info svg { width:17px; height:17px; }
.source-pop { position:absolute; z-index:5; top:calc(100% + 6px); left:0; width:min(340px,100%); padding:14px 16px 4px; border-radius:10px; background:var(--raised); box-shadow:var(--shadow); color:var(--ink); font-size:.84rem; line-height:1.5; }
.source-pop strong { font-weight:600; }
.source-pop .hash { color:var(--muted); font:400 .8rem ui-monospace,SFMono-Regular,Menlo,monospace; }
.lede { margin:14px 0 0; color:var(--muted); font-size:1rem; line-height:1.55; text-wrap:pretty; }

/* The article: weight, size and spacing carry the structure of the original text. */
.reader { position:relative; font-family:var(--reading-family); font-size:var(--reading-size); line-height:var(--reading-leading); letter-spacing:.003em; }
.reader p { margin:0 0 1em; }
.reader > :first-child { margin-top:0; }
.reader strong { font-weight:600; }
.reader .strong-block strong { font-weight:500; }
.reader .lead-line { margin:1.8em 0 .55em; font-size:1.1em; line-height:1.4; text-wrap:balance; }
.reader .lead-line strong { font-weight:600; }
.reader .source-heading { margin:1.8em 0 .6em; font-weight:600; line-height:1.35; text-wrap:balance; }
.reader .source-heading.level-1 { font-size:1.35em; }
.reader .source-heading.level-2 { font-size:1.2em; }
.reader .source-heading.level-3 { font-size:1.08em; }
.reader .source-heading strong { font-weight:600; }
.reader .bullet { position:relative; margin:0 0 .6em 1.3em; }
.reader .bullet:before { content:'•'; position:absolute; left:-1.1em; color:var(--muted); }
.reader .nested { margin-left:2.4em; }
.reader table { width:100%; border-collapse:collapse; font-size:.88em; line-height:1.5; }
.reader th,.reader td { padding:10px; border-bottom:1px solid var(--rule); text-align:left; vertical-align:top; }
.reader th { font-weight:600; }
.table-wrap { overflow:auto; margin-bottom:1em; }
.passage-anchor { height:0; margin:0; padding:0; border:0; scroll-margin-top:calc(var(--header-height) + 32px); }
.passage-trigger { position:absolute; margin-top:.15em; right:calc(100% + 10px); width:28px; min-height:28px; height:28px; display:flex; align-items:center; justify-content:center; padding:0; border:0; color:var(--muted); border-radius:6px; opacity:.5; }
.passage-trigger.generated { opacity:.32; }
.passage-trigger:hover,.passage-trigger:focus-visible,.passage-trigger[aria-expanded=true] { opacity:1; color:var(--accent); background:var(--accent-light); }
.passage-trigger svg { width:18px; height:18px; }
/* Rebalised text: real headings, nested lists, anchored sub-headings. */
.reader .src-h { margin:2em 0 .6em; font-weight:600; line-height:1.35; text-wrap:balance; scroll-margin-top:calc(var(--header-height) + 16px); }
.reader .src-h.d1 { font-size:1.35em; }
.reader .src-h.d2 { font-size:1.2em; }
.reader .src-h.d3 { font-size:1.08em; }
.reader .src-h.d4 { font-size:1em; }
.reader > :first-child.src-h { margin-top:0; }
.reader .src-list { margin:.15em 0 1em; padding-left:1.7em; list-style:disc; }
.reader .src-list .src-list { margin:.25em 0 .1em; list-style:circle; }
.reader .src-list .src-list .src-list { list-style:square; }
.reader .src-list li { margin:0 0 .3em; padding-left:.2em; line-height:1.55; }
.reader .src-list li::marker { color:var(--ink); font-size:.9em; }
.copy-md { margin-left:auto; min-height:28px; padding:0 10px; font-size:.8rem; color:var(--muted); }
.copy-md svg { width:15px; height:15px; }
.copy-md:hover { color:var(--accent); }
.compare-mode .workspace { max-width:1320px; }
.column.compare { max-width:none; }
.verdict { font-weight:600; }
.verdict.ok { color:var(--accent); }
.verdict.bad { color:var(--danger); }
.cmp-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin:0 0 16px; }
.cmp-bar .segmented { width:auto; }
.cmp-bar .segmented button { padding:0 14px; white-space:nowrap; }
.cmp-copy { display:flex; gap:6px; }
.cmp-controls { display:flex; flex-wrap:wrap; align-items:end; gap:12px 20px; margin:0 0 12px; }
.cmp-controls label { margin:0; min-width:0; }
.cmp-controls select { min-width:260px; margin-top:6px; }
.cmp-controls .check { display:flex; align-items:center; gap:8px; padding-bottom:8px; color:var(--ink); font-weight:400; }
.cmp-controls .check input { width:auto; min-height:0; }
.cmp-head,.cmp-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0 16px; }
.cmp-head { position:sticky; top:var(--header-height); z-index:3; padding:8px 0; background:var(--paper); border-bottom:1px solid var(--rule); color:var(--muted); font-size:.78rem; font-weight:600; }
.cmp-row { position:relative; padding:10px 0 12px; border-bottom:1px solid var(--rule); }
.cmp-cell { min-width:0; font-size:.82rem; line-height:1.55; }
.cmp-cell .ln { display:inline-block; min-width:2.6em; margin-right:6px; color:var(--muted); font-size:.72rem; font-variant-numeric:tabular-nums; vertical-align:top; }
.cmp-cell code { font:400 .8rem/1.55 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.cmp-cell code.gone { color:var(--danger); font-style:italic; }
.cmp-cell mark { background:var(--selection); color:var(--selection-ink); border-radius:3px; padding:0 2px; }
.cmp-tag { grid-column:1 / -1; justify-self:start; margin-top:6px; padding:1px 8px; border-radius:4px; background:var(--accent-light); color:var(--accent); font-size:.72rem; font-weight:600; }
.cmp-cols { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; }
.cmp-cols > section { min-width:0; padding:0 4px; }
.cmp-cols .reader { --reading-size:15px; font-size:15px; line-height:1.6; }
.cmp-title { position:sticky; top:var(--header-height); z-index:3; margin:0 0 12px; padding:8px 0; background:var(--paper); border-bottom:1px solid var(--rule); color:var(--muted); font-size:.78rem; font-weight:600; }
.plan { margin:0; padding:0; list-style:none; font-size:.86rem; line-height:1.45; }
.plan li { padding:4px 0; }
.plan-l3 { margin-left:14px; }
.plan-l4 { margin-left:28px; }
.plan-l5 { margin-left:42px; }
.plan li.weak { color:var(--muted); }
.plan .cmp-tag { display:inline-block; margin:0 6px 0 0; }
.cmp-summary { width:100%; margin-top:12px; border-collapse:collapse; font-size:.86rem; }
.cmp-summary td { padding:6px 8px; border-bottom:1px solid var(--rule); }
.cmp-summary td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
@media (max-width:900px) { .cmp-head,.cmp-row,.cmp-cols { grid-template-columns:1fr; } .cmp-head span:last-child { display:none; } .cmp-cell + .cmp-cell { margin-top:6px; } }
.status { display:inline-block; margin:0 6px 10px 0; padding:3px 8px; border-radius:4px; color:var(--accent); background:var(--accent-light); font-size:.75rem; }

/* Trays: floating, non-modal on desktop, constant geometry. */
.panel { position:fixed; top:calc(var(--header-height) + 8px); bottom:12px; z-index:30; width:min(320px,95vw); overflow:auto; overscroll-behavior:contain; padding:0 16px 16px; background:var(--raised); border-radius:12px; box-shadow:var(--shadow); }
.contents { left:12px; }
.context,.settings { right:12px; }
.settings { bottom:auto; max-height:calc(100vh - var(--header-height) - 20px); }
.panel-heading { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:52px; margin:0 -16px 8px; padding:0 8px 0 16px; background:var(--raised); border-bottom:1px solid var(--rule); }
.panel-heading h2 { margin:0; font-size:1rem; font-weight:600; }
.panel h3 { margin:18px 0 6px; color:var(--muted); font-size:.78rem; font-weight:600; }
.search-field { position:sticky; top:52px; z-index:1; margin:0; padding:10px 0 8px; background:var(--raised); }
.search-field svg { position:absolute; left:10px; top:calc(50% + 1px); width:17px; height:17px; transform:translateY(-50%); fill:none; stroke:var(--muted); stroke-width:1.8; stroke-linecap:round; pointer-events:none; }
.search-field input { padding-left:34px; }
#coverage { margin:0 4px 8px; }
#coverage:empty { display:none; }
#sections { display:flex; flex-direction:column; gap:1px; }
.section-link { display:block; width:100%; min-height:0; margin:0; padding:8px 10px; border:0; border-radius:6px; text-align:left; font-size:.9rem; line-height:1.35; }
.section-link.current { background:var(--accent-light); color:var(--accent); font-weight:600; }
.outline-item { display:block; width:100%; min-height:0; margin:0; padding:6px 10px; border:0; border-radius:6px; text-align:left; font-size:.88rem; line-height:1.35; }
.outline-item.depth-0 { margin-top:8px; font-weight:600; }
.outline-item.depth-1 { padding-left:22px; }
.outline-item.depth-2 { padding-left:34px; }
.outline-item.anchor { color:var(--muted); font-size:.84rem; }
.outline-item.label { display:flex; align-items:center; gap:6px; color:var(--muted); }
.outline-item.label .chev { flex-shrink:0; width:6px; height:6px; margin-left:-2px; border-right:1.6px solid currentColor; border-bottom:1.6px solid currentColor; transform:rotate(-45deg); transition:transform .15s var(--ease); }
.outline-item.label[aria-expanded=true] .chev { transform:rotate(45deg); }
.outline-item.depth-0.label { color:var(--ink); }
.outline-item:disabled { opacity:1; cursor:default; }
.outline-item.current { background:var(--accent-light); color:var(--accent); }
.context-target { margin:14px 0 4px; font-size:.92rem; line-height:1.4; }
.context-target strong { display:block; font-weight:600; }
.context-target span { display:block; margin-top:2px; color:var(--muted); font-size:.8rem; }
.context-item { display:block; width:100%; min-height:0; padding:8px 10px; border:0; border-radius:6px; text-align:left; font-size:.9rem; line-height:1.35; }
.panel details > summary { padding:8px 0; color:var(--accent); font-size:.88rem; font-weight:600; }
.panel details .snapshot { margin:4px 0 12px; font-size:.82rem; }
.feedback-disclosure { margin:18px 0 0; padding-top:6px; border-top:1px solid var(--rule); }
.feedback-disclosure form { margin-top:4px; }
.feedback-disclosure form button[type=submit] { width:100%; margin-top:14px; }
.feedback-disclosure form .text-button { margin-top:4px; font-size:.82rem; }
.error { color:var(--danger); font-size:.85rem; }
.error:empty { display:none; }
.panel-backdrop { display:none; }
.setting { padding:14px 0; border-bottom:1px solid var(--rule); }
.setting-label { display:flex; justify-content:space-between; margin-bottom:8px; color:var(--muted); font-size:.8rem; font-weight:600; }
.setting-value { font-weight:400; font-variant-numeric:tabular-nums; }
.segmented { display:flex; gap:2px; padding:2px; border-radius:9px; background:var(--ground); }
.segmented button { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:32px; padding:0 6px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-size:.85rem; font-variant-numeric:tabular-nums; }
.segmented button:hover { color:var(--ink); background:var(--hover); }
.segmented button[aria-pressed=true] { background:var(--raised); color:var(--ink); font-weight:600; box-shadow:0 0 0 1px var(--rule-strong),0 1px 2px rgba(0,0,0,.12); }
.sample { font-size:1.05rem; line-height:1; }
.sample-sans { font-family:var(--ui-font); font-weight:600; }
.sample-serif { font-family:var(--serif); }
.settings-footer { display:flex; align-items:center; justify-content:space-between; padding-top:14px; }
.account { margin-top:14px; padding-top:14px; border-top:1px solid var(--rule); }
.account-row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#account-name { font-weight:600; overflow-wrap:anywhere; }
.quiet-action { display:inline-flex; align-items:center; gap:6px; font-size:.88rem; }
.quiet-action svg { width:17px; height:17px; }

/* Reading dock: compact, out of the way while scrolling down. */
.reader-dock { position:fixed; bottom:calc(16px + env(safe-area-inset-bottom,0px)); left:50%; transform:translateX(-50%); z-index:15; display:flex; align-items:center; gap:2px; width:min(440px,calc(100vw - 24px)); height:46px; padding:5px; border-radius:12px; background:var(--raised); box-shadow:var(--shadow); }
.reader-dock .icon-button { flex-shrink:0; }
.dock-location { flex:1; min-width:0; display:flex; align-items:center; justify-content:center; gap:8px; height:36px; min-height:36px; padding:0 8px; border:0; font-size:.86rem; line-height:1; }
#dock-title { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; line-height:1.2; }
#dock-progress { flex-shrink:0; color:var(--muted); font-size:.76rem; line-height:1.2; font-variant-numeric:tabular-nums; }
.passage-menu { position:fixed; z-index:40; padding:4px; overflow:auto; background:var(--raised); border-radius:10px; box-shadow:var(--shadow); }
.passage-menu button { display:block; width:100%; min-height:0; border:0; text-align:left; border-radius:6px; font-size:.88rem; padding:9px 12px; }

/* Products, modifications and returns share the same type scale and rhythm. */
.text-button { padding:6px 0; min-height:0; border:0; border-radius:0; color:var(--accent); text-align:left; }
.text-button:hover { background:none; text-decoration:underline; }
.loading,.empty { padding:24px 0; color:var(--muted); }
.empty h2 { margin-top:0; color:var(--ink); }
.product-list { margin-top:8px; }
.product-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:40px; padding:28px 0; border-top:1px solid var(--rule); }
.product-row h2 { font:400 1.45rem/1.25 var(--serif); margin:0 0 12px; }
.product-promise { font-size:1.02rem; line-height:1.6; }
.product-row .primary { margin-top:8px; }
.qualification { margin-top:40px; padding-top:24px; border-top:1px solid var(--rule); }
.legacy-list { display:flex; flex-direction:column; gap:2px; margin-top:12px; }
.product-brief { margin:28px 0; }
.product-brief h2 { margin:22px 0 6px; font-size:1.05rem; }
.example { margin:28px 0; padding:20px 24px; border-radius:10px; background:var(--ground); }
.example h2 { margin:0 0 10px; font-size:1rem; }
.example p:last-child,.gap p:last-child { margin-bottom:0; }
.workflow { padding-left:24px; max-width:72ch; }
.workflow li { padding-left:8px; margin-bottom:14px; }
.workflow li::marker { color:var(--accent); font-weight:600; }
.reuse-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:24px; }
.reuse-list h3 { margin:0 0 6px; }
.reuse-list p { font-size:.92rem; }
.gap { margin:24px 0 28px; padding:18px 0; border-block:1px solid var(--rule); }
.gap h3 { margin:0 0 6px; }
.product-footer,.return-actions { display:flex; flex-wrap:wrap; gap:10px; margin:28px 0; }
.offer-group { margin-top:36px; }
.offer-kicker { margin:0; font-size:.8rem; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.offer-id { margin:0 0 6px; letter-spacing:.04em; }
.offer-ladder { margin:6px 0 14px; padding-left:22px; }
.offer-ladder li { margin-bottom:6px; line-height:1.45; }
.offer-ladder li::marker { color:var(--accent); font-weight:600; }
.offer-ladder li > span:last-child:not(.offer-entry) { display:block; color:var(--muted); font-size:.9rem; }
.offer-entry { margin-left:6px; padding:1px 7px; border-radius:999px; background:var(--accent-light); color:var(--accent); font-size:.75rem; font-weight:600; }
.offer-summary { margin:8px 0 28px; padding:18px 0; border-block:1px solid var(--rule); }
.offer-summary h2 { margin:0 0 8px; font-size:1rem; }
.offer-sheet hr { border:0; border-top:1px solid var(--rule); margin:2em 0; }
.offer-sheet .ordered { list-style:decimal; }
.offer-need { padding:10px 0; border-bottom:1px solid var(--rule); }
.offer-need p { margin:0 0 4px; }
.detail-disclosure { margin:24px 0; padding:14px 0; border-top:1px solid var(--rule); }
.detail-disclosure > summary { color:var(--accent); font-weight:600; }
.detail-disclosure > p:first-of-type { margin-top:16px; }
.links { margin:14px 0 22px; }
.links button { margin:4px 6px 4px 0; font-size:.85rem; }
.detail-list { max-width:70ch; padding-left:20px; font-size:.95rem; }
.detail-list li { margin-bottom:8px; }
.evidence { padding:14px 0; border-bottom:1px solid var(--rule); font-size:.87rem; }
.evidence h3 { margin:0 0 6px; }
.evidence p { margin:6px 0; }
.toolbar { display:flex; flex-wrap:wrap; align-items:end; gap:12px 16px; margin:0 0 24px; }
.toolbar label { margin:0; min-width:180px; }
.toolbar select { margin-top:6px; font-weight:400; color:var(--ink); }
.change-row { padding:28px 0; border-top:1px solid var(--rule); }
.change-heading { display:flex; align-items:baseline; justify-content:space-between; gap:16px; }
.change-heading h2 { margin:0 0 6px; font-size:1.15rem; }
.change-heading .status { flex-shrink:0; }
.change-row > details { margin:18px 0; }
.change-row summary,.request-row summary { color:var(--accent); font-size:.88rem; }
.comparison { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.comparison h3 { margin-top:0; color:var(--muted); font-size:.82rem; font-weight:600; }
.comparison p { white-space:pre-wrap; font-size:.94rem; line-height:1.65; }
.before del { color:var(--delete-ink); background:var(--delete-bg); }
.after ins { color:var(--insert-ink); background:var(--insert-bg); text-decoration:none; }
.reason { margin:14px 0; color:var(--muted); font-size:.9rem; }
.snapshot { padding:14px 16px; border-radius:8px; background:var(--ground); color:var(--ink); white-space:pre-wrap; overflow-wrap:anywhere; max-height:320px; overflow:auto; font:400 .84rem/1.6 var(--ui-font); margin:14px 0; }
.decision-disclosure { border-top:1px solid var(--rule); padding-top:14px; }
.proposal-form { max-width:560px; margin:18px 0; }
.proposal-form textarea { min-height:88px; }
.proposal-form button { margin-top:14px; }
.event { padding:14px 0; border-bottom:1px solid var(--rule); font-size:.85rem; }
.request-row { padding:22px 0; border-bottom:1px solid var(--rule); }
.request-row h2 { margin:0 0 10px; font-size:1rem; }
.request-row .body { white-space:pre-wrap; overflow-wrap:anywhere; font-size:1.02rem; }
.request-row details { margin-bottom:12px; }
.record-controls { display:flex; flex-wrap:wrap; align-items:end; gap:12px 16px; margin-bottom:16px; }
.record-controls label { margin:0; max-width:260px; }
.record-controls select { margin-top:6px; }
#notice { position:fixed; bottom:calc(76px + env(safe-area-inset-bottom,0px)); left:50%; z-index:50; display:none; width:max-content; max-width:calc(100vw - 32px); padding:10px 18px; transform:translateX(-50%); border-radius:8px; background:var(--ink); color:var(--paper); font-size:.88rem; }
#notice.visible { display:block; }
#print-content { display:none; }
@media (max-width:1100px) {
 .icon-button.with-label .label,.comment-button .label { display:none; }
 .icon-button.with-label { width:36px; padding:0; }
 .comment-button { width:36px; padding:0; justify-content:center; }
}
@media (max-width:1050px) {
 .panel-backdrop:not([hidden]) { position:fixed; inset:var(--header-height) 0 0; z-index:25; display:block; width:100%; min-height:0; padding:0; border:0; border-radius:0; background:var(--scrim); }
 .panel-open .reader-dock { visibility:hidden; }
}
@media (max-width:980px) {
 :root { --header-height:92px; }
 .topbar { grid-template-columns:minmax(0,1fr) auto; row-gap:2px; padding-bottom:4px; }
 .view-tabs { grid-column:1 / -1; grid-row:2; margin:0 -4px; overflow-x:auto; scrollbar-width:none; }
 .view-tabs button { flex:0 0 auto; }
 .workspace { border-inline:0; }
}
@media (max-width:760px) {
 main { padding:28px 20px 104px; }
 .column:not(.wide) { padding-left:22px; }
 .passage-trigger { right:calc(100% + 2px); width:32px; height:32px; }
 h1 { font-size:1.7rem; }
 .product-row { grid-template-columns:1fr; gap:8px; padding:24px 0; }
 .product-row h2 { font-size:1.3rem; }
 .change-heading { display:block; }
 .toolbar label { min-width:0; flex:1 1 150px; }
 .return-actions button { flex:1 1 180px; }
 .comparison { grid-template-columns:1fr; gap:12px; }
 .panel { width:min(360px,94vw); max-width:94vw; bottom:calc(12px + env(safe-area-inset-bottom,0px)); }
}
@media (max-width:480px) {
 .topbar { padding-inline:6px; }
 .panel { left:0; right:0; width:100vw; max-width:100vw; top:var(--header-height); bottom:0; padding-bottom:calc(20px + env(safe-area-inset-bottom,0px)); border-radius:0; }
}
@page { size:A4; margin:20mm 20mm 22mm; }
@media print {
 :root,:root[data-theme="dark"] { color-scheme:light; --ink:#292621; --muted:#625e56; --accent:#4c5c31; --paper:#ffffff; --ground:#ffffff; --rule:#dedbd3; }
 html { color:var(--ink); background:var(--paper); font-size:11.5pt; line-height:1.55; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
 .topbar,.workspace,#connection,#notice,.skip,.panel-backdrop,.reader-dock,.passage-menu { display:none !important; }
 #print-content { display:block; max-width:none; margin:0; }
 #print-content h1 { font-size:27pt; line-height:1.2; }
 #print-content h2,#print-content .source-heading { break-after:avoid; }
 #print-content p { orphans:3; widows:3; }
 #print-content .reader { max-width:none; margin:0; font:400 11.5pt/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
 #print-content table { font-size:9.5pt; }
 .table-wrap { overflow:visible; }
 .passage-anchor { display:none; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; transition:none !important; } }
/* Points de contact (phase 2) : propositions, jamais appliquées. */
.contact-section { margin-top:44px; padding-top:28px; border-top:2px solid var(--rule-strong); }
.contact-block { margin-top:28px; }
.contact-row,.contact-zone { padding:18px 0; border-top:1px solid var(--rule); }
.contact-row h4,.contact-part h4 { margin:0 0 6px; }
.contact-part { margin-top:18px; }
.contact-box { margin:12px 0; padding:14px 18px; border-left:3px solid var(--accent); border-radius:0 8px 8px 0; background:var(--ground); }
.contact-box p:last-child { margin-bottom:0; }
.contact-levels dt { margin-top:8px; font-weight:600; font-size:.88rem; }
.contact-levels dd { margin:2px 0 0; color:var(--muted); font-size:.88rem; }
