/* The layouts by the shell's size, then e-ink and the review fixes that must win over them, after shell.css. */
/* ==== layouts: phone first; the shell's width (and height) adds the rest ==== */

/* Phone (< 600): bottom bar; no sidebar; the header keeps ★ and moves the rest under ⋯. */
.app-frame #toggle-side, .inbox-btn { display: none; }
.header-more { display: inline-flex; }
.agent-switch .agent-name { display: none; }
.app:not([data-page="chat"]) :is(.agent-switch, #thread-wrap, .header-more) { display: none !important; }
.app[data-page="chat"] #page-title { display: none; }
#page-title :is(.crumb, .crumb-sep) { display: none; }
/* iOS without interactive-widget: the keyboard's height from visualViewport (main.js). */
.app-frame[data-kb="open"] { height: calc(100vh - var(--kb, 0px)); height: calc(100dvh - var(--kb, 0px)); --safe-bottom: 0px; }
/* A phone's keyboard up (data-kb, main.js; iOS and Android alike): the bottom bar goes, the field and what's typed keep
   the room; it's back as soon as the keyboard is down. */
.app-frame[data-kb="open"] nav.tabbar { display: none; }
/* The bottom bar steps aside in the code and on the notepad; while typing only with the keyboard up (data-kb above):
   a field still focused after the system's button put the keyboard away kept it hidden until a tap. */
.app:is([data-page="code"], [data-page="notepad"]) nav.tabbar { display: none; }
.app-frame[data-kb="open"] footer { padding-bottom: calc(8px + var(--safe-bottom)); }
footer { padding-bottom: 8px; }
.page-view { --page-pad-bottom: 32px; }
.item-form textarea.notes { min-height: calc(var(--row-h) * 2.5); }
.item-form .actions { position: sticky; bottom: calc(-1 * var(--page-pad-bottom)); background: var(--surface); border-top: 1px solid var(--line); margin: 4px calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)); padding: 10px var(--sp-4); border-radius: 0 0 var(--r-lg) var(--r-lg); z-index: 2; }
.settings .item-form .actions, .integration .item-form .actions { position: static; margin: 0; padding: 0; border: none; background: none; }
.card .row button:first-of-type { margin-left: auto; }
.card .row .name + button, .card .row .title + button { margin-left: auto; }
/* Code on a phone: one panel at a time, Files | Code | Agent; "Both" only in tall shells. */
.code-main { display: flex; flex-direction: column; }
.code-main > * { flex: 1 1 0; min-height: 0; }
.code-main .code-side { border-right: none; }
.code-main[data-layout="both"] .code-center { flex: none; height: var(--code-split, 55%); }
.code-main[data-layout="both"] .code-comments { border-top: 1px solid var(--line); border-left: none; }
.code-main:not([data-layout="files"]) .code-side { display: none; }
.code-main[data-layout="files"] .code-side { display: block; }
.code-pane-grip { left: 0; right: 0; top: -12px; bottom: auto; width: auto; height: 24px; cursor: row-resize; }
.code-pane-grip::after { left: 50%; top: 10px; bottom: auto; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-strong); }
.code-layout [data-layout="both"] { display: none; }
.code-bar { gap: 6px; padding: 6px max(8px, var(--safe-left)); }
.code-bar .code-layout { flex: 1; }
.code-bar .code-layout button { flex: 1; }
.code-more { display: inline-flex; }
.code-bar .grow { display: none; }
.code-bar.open .code-bar-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.code-bar:not(.open) .code-bar-extra, .code-bar:not(.open) .code-edit-tools { display: none; }
.project-head-ide span { display: none; }
@container shell (width < 600px) and (height >= 700px) {
  .code-layout [data-layout="both"] { display: inline-flex; }
}

/* Tablet (600–1023): rail 72 px, the sidebar as a drawer over it. */
@container shell (width >= 600px) {
  .app { --header-h: 56px; --gutter: 24px; --chat-max: 720px; --log-pad: 24px; }
  nav.tabbar { display: none; }
  nav.rail { display: flex; }
  #sidebar {
    display: flex; position: fixed; top: 0; bottom: 0; left: 0; z-index: var(--z-drawer); width: calc(min(300px, 85cqw) + var(--safe-left));
    padding-top: calc(12px + var(--safe-top)); box-shadow: var(--shadow-3);
    transform: translateX(-105%); visibility: hidden; transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
  }
  .app.drawer-open #sidebar { transform: none; visibility: visible; transition: transform var(--dur) var(--ease); }
  .inbox-btn { display: inline-flex; }
  .agent-switch .agent-name { display: inline; }
  footer { padding-bottom: calc(10px + var(--safe-bottom)); }
  .page-view { --page-pad-top: 24px; --page-pad-bottom: calc(48px + var(--safe-bottom)); }
  #code-project-head { --page-pad-top: 24px; }
  .page-top { flex-wrap: nowrap; }
  .page-top .intro { flex: 1 1 0; -webkit-line-clamp: 3; }
  .page-top > .intro + button { margin-left: 0; }
  .item-form .three { grid-template-columns: 1fr 1fr; }
  .item-form .two { grid-template-columns: 1fr 1fr; }
  .item-form .actions { position: static; margin: 0; padding: 0; border: none; background: none; }
  .card .row button:first-of-type { margin-left: 0; }
  .send { width: auto; padding: 0 16px 0 12px; }
  .send .send-label { display: inline; }
  .project-head-ide span { display: inline; }
  .notepad-tools { order: 0; flex-wrap: wrap; overflow: visible; }
  .notepad-sheet { order: 0; }
  /* Code: files in a drawer; landscape puts the agent beside the code, portrait under it. */
  .code-layout [data-layout="both"] { display: inline-flex; }
  .code-bar .code-layout { flex: none; }
  .code-bar .code-layout button { flex: none; }
  .code-bar { padding: 8px 14px; }
  .code-main .code-side, .code-main:not([data-layout="files"]) .code-side {
    display: none; position: absolute; inset: 0 auto 0 0; width: min(300px, 80cqw); z-index: 4; border-right: 1px solid var(--line); box-shadow: var(--shadow-2);
  }
  .code-main.files-open .code-side { display: block; }
}
@container shell (width >= 600px) and (width < 1024px) and (orientation: landscape) {
  .code-main { --agent-w: 340px; display: grid; grid-template-columns: minmax(0, 1fr) var(--agent-w); }
  .code-main[data-layout="code"], .code-main[data-layout="side"] { grid-template-columns: minmax(0, 1fr); }
  .code-main[data-layout="both"] .code-center { height: auto; }
  .code-main[data-layout="both"] .code-comments { border-top: none; border-left: 1px solid var(--line); }
  .code-pane-grip { left: -4px; right: auto; top: 0; bottom: 0; width: 12px; height: auto; cursor: col-resize; }
  .code-pane-grip::after { left: 4px; top: 0; bottom: 0; width: 4px; height: auto; margin: 0; border-radius: 0; background: none; }
}

/* Settings side by side from 900 px wide and 500 high (settings.js: settingsSplit()); narrower, list → detail. */
@container shell (width >= 900px) {
  .app-frame:not([data-low]) .settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
  .app-frame:not([data-low]) .settings-layout[data-mode] .settings-tabs, .app-frame:not([data-low]) .settings-layout[data-mode] .settings-detail { display: flex; }
  .app-frame:not([data-low]) .settings-tabs { position: sticky; top: 0; }
  .app-frame:not([data-low]) .settings-tabs .tab { min-height: 44px; display: flex; border-bottom: none; padding: 0 12px; border-radius: 0; }
  .app-frame:not([data-low]) .settings-tabs .tab .tab-desc, .app-frame:not([data-low]) .settings-tabs .tab::after { display: none; }
  .app-frame:not([data-low]) .settings-tabs .tab.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
  .app-frame:not([data-low]) .settings-group-label { background: none; border-bottom: none; }
}
/* Round 2: each row keeps its state on a second line (settings.md §3). */
@container shell (width >= 900px) {
  .app-frame:not([data-low]) .settings-tabs .tab { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 48px; padding: 4px 12px; }
  .app-frame:not([data-low]) .settings-tabs .tab .tab-desc { display: block; font-size: var(--text-2xs); line-height: 1.3; }
}

/* Desktop (≥ 1024): the sidebar in place (collapsible to a 64 px rail), the whole header. */
@container shell (width >= 1024px) {
  /* Pages take the whole width beside the sidebar (only the gutter at the sides), so collapsing it gives them room. */
  .app { --chat-max: 820px; --gutter: 32px; --inner-max: none; }
  nav.rail { display: none; }
  /* In place, not a drawer: no layer of its own (a flex item's z-index counts even unpositioned, over the update bar). */
  #sidebar { position: static; z-index: auto; transform: none; visibility: visible; box-shadow: none; padding-top: 12px; transition: width var(--dur) var(--ease); }
  .app.drawer-open .scrim { display: none; }
  .app #toggle-side { display: inline-flex; }
  .header-more { display: none; }
  .header-new .label { display: inline; }
  #page-title :is(.crumb, .crumb-sep) { display: inline; }
  .header-new { width: auto; padding: 0 14px 0 10px; gap: 6px; font-weight: 600; font-size: var(--text-sm); }
  .search-btn { width: 240px; justify-content: flex-start; gap: 8px; padding: 0 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: var(--text-sm); }
  .search-btn .search-text { display: inline; flex: 1; text-align: left; }
  .search-btn kbd { display: inline; }
  .page-view { --page-pad-top: 24px; --page-pad-bottom: calc(48px + var(--safe-bottom)); }
  #code-project-head { --page-pad-top: 24px; }
  .settings-layout { grid-template-columns: 240px minmax(0, 880px); }
  .notepad-hint { display: block; }
  .code-main { display: grid; }
  .code-main > * { min-height: 0; }
  .code-main .code-side, .code-main:not([data-layout="files"]) .code-side { display: block; position: static; width: auto; box-shadow: none; }
  .code-main.no-tree .code-side { display: none; }
  .code-main[data-layout="both"] .code-center { height: auto; }
  .code-main[data-layout="both"] .code-comments { border-top: none; border-left: 1px solid var(--line); }
  .code-pane-grip { left: -4px; right: auto; top: 0; bottom: 0; width: 12px; height: auto; cursor: col-resize; }
  .code-pane-grip::after { left: 4px; top: 0; bottom: 0; width: 4px; height: auto; margin: 0; border-radius: 0; background: none; }
}
/* The collapsed sidebar: a 64 px rail of icons, lists hidden. */
@container shell (width >= 1024px) {
  body.sidebar-hidden #sidebar { width: 64px; padding-inline: 8px; overflow-x: hidden; }
  body.sidebar-hidden #sidebar :is(.build-commit, .label, .side-text, #conv-nav, #project-nav, .conv-more, .side-user .meta, .side-user .who, .side-search kbd, .side-fold, #conv-new, #project-add) { display: none; }
  body.sidebar-hidden .side-label { justify-content: center; margin: 6px 0 0; }
  body.sidebar-hidden .side-label .side-head .nav-ico { display: inline-flex; }
  body.sidebar-hidden .side-label .side-head { margin: 0; justify-content: center; width: 100%; min-height: var(--row-h); }
  body.sidebar-hidden .nav-link, body.sidebar-hidden .side-new, body.sidebar-hidden .side-search { justify-content: center; padding: 0; gap: 0; }
  body.sidebar-hidden .nav-link .count { position: absolute; top: 1px; right: 1px; font-size: var(--text-2xs); padding: 0 5px; }
  body.sidebar-hidden nav.views.folded { display: flex; }
  body.sidebar-hidden .side-user { justify-content: center; padding: 8px 0; }
}
/* Notepad: tools in a column left of the page on desktop and landscape tablets. */
@container shell (width >= 1024px) or ((width >= 600px) and (orientation: landscape)) {
  .notepad { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .notepad-bar, .notepad-hint { grid-column: 1 / -1; }
  .notepad-tools { flex-direction: column; flex-wrap: nowrap; align-items: stretch; overflow-y: auto; overflow-x: hidden; }
  .notepad-tools .tool-group { flex-direction: column; }
  .notepad-tools .spacer { display: none; }
}
/* Wide (≥ 1440). */
@container shell (width >= 1440px) {
  .app { --side-w: 300px; --chat-max: 880px; --log-pad: 32px; }
  .page-view { --page-pad-top: 32px; --page-pad-bottom: 48px; }
  #code-project-head { --page-pad-top: 32px; }
  .code-main { --files-w: 300px; --agent-w: 420px; }
  :is(.item-list, .settings).grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; }
}
/* Phone on its side (600–1023 wide, < 500 high): a 56 px rail, no bottom bar, a lower header. Not narrower: that's a
   phone upright with its keyboard open (Android shrinks the page), which keeps its own layout. The height is the
   frame's without a keyboard (data-low, main.js): a keyboard opening never changes the menu (a reader, a tablet). */
@container shell (width >= 600px) and (width < 1024px) {
  .app-frame[data-low] .app { --header-h: 44px; --rail-w: 56px; }
  .app-frame[data-low] nav.tabbar { display: none; }
  .app-frame[data-low] nav.rail { display: flex; }
  .app-frame[data-low] .rail-item { min-height: 44px; font-size: 0; gap: 0; }
  .app-frame[data-low] .rail-item .ico-wrap { height: 32px; }
  .app-frame[data-low] #sidebar {
    display: flex; position: fixed; top: 0; bottom: 0; left: 0; z-index: var(--z-drawer); width: calc(min(300px, 85cqw) + var(--safe-left));
    transform: translateX(-105%); visibility: hidden; box-shadow: var(--shadow-3);
  }
  .app-frame[data-low] .app.drawer-open #sidebar { transform: none; visibility: visible; }
}
/* A low screen (a phone on its side, a small reader turned): the rail keeps the bottom bar's five, More opens the same sheet. */
.app-frame[data-short] .rail .rail-extra { display: none; }
/* Popovers become bottom sheets on phones. */
@container shell (width < 600px) {
  /* The header: Offline is the dot's state, no chevron or slash, ★ in the ⋯ menu; nothing pushes past the frame. */
  header { overflow: hidden; }
  .offline { font-size: 0; padding: 0; width: 10px; height: 10px; min-width: 10px; flex: none; border-radius: var(--r-full); background: var(--warn-fill); }
  .offline::before { display: none; }
  .update-chip .lbl { display: none; }
  .update-chip { padding: 4px; }
  .agent-switch .chev, #thread-btn::before { display: none; }
  .agent-switch { padding: 0 4px; }
  #thread-star { display: none; }
  #thread-btn { max-width: none; flex: 1 1 auto; }
  .thread-wrap { flex: 1 1 auto; min-width: 0; display: flex; }
  /* The open code bar: "Compare with" and its select share one line, the select shrinks. */
  .code-bar label.inline { flex: 1 1 100%; min-width: 0; }
  .code-bar label.inline select { flex: 1; min-width: 0; max-width: none; }
  .pop, .agent-pick { inset: auto 0 0 0 !important; max-width: none; min-width: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; border: none; box-shadow: var(--shadow-3); padding: 8px 8px calc(12px + var(--safe-bottom)); max-height: 70cqh; }
  .pop .pop-item { min-height: 48px; font-size: 15px; }
  .log-entry { grid-template-columns: max-content 1fr; }
  .update-bar { bottom: calc(var(--bottom-h) + 16px + var(--safe-bottom)); }
  .card { padding: 12px; }
  .settings section { padding: 14px; }
}
/* Browsers without container queries (old e-ink WebViews): the phone layout, plus the sidebar on wide screens. */
@supports not (container-type: size) {
  @media (min-width: 1024px) { nav.tabbar { display: none; } #sidebar { display: flex; } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==== e-ink (data-display="eink" | "eink-color"): a display mode over any layout (requirements/ui/eink.md) ==== */
:root[data-display^="eink"] {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --surface-sunken: #ffffff; --surface-hover: #ffffff; --surface-raised: #ffffff;
  /* Lines a dark grey: soft on a reader's 16 greys, still black at a 1-bit threshold (under 50 %); fields and marks stay black. */
  --line: #6b6b6b; --line-strong: #6b6b6b; --line-input: #000000;
  --ink: #000000; --ink-2: #000000; --muted: #000000;
  --accent: #000000; --accent-strong: #000000; --accent-ink: #ffffff; --accent-soft: #ffffff;
  --user-bg: #ffffff;
  --ok: #000000; --ok-soft: #ffffff; --warn: #000000; --warn-fill: #000000; --warn-soft: #ffffff;
  --err: #000000; --err-soft: #ffffff; --star: #000000; --violet: #000000; --teal: #000000; --pink: #000000; --brown: #000000;
  --sel-bg: #000000; --sel-ink: #ffffff; --primary-bg: #000000; --primary-ink: #ffffff; --primary-hover: #000000;
  --focus: #000000; --scrim: rgb(255 255 255 / 0); --shadow-color: rgb(0 0 0 / 0); --shadow-2: none; --shadow-3: none;
  --mark: #ffffff; --grid-dot: #000000; --qr-bg: #ffffff;
  --glow: none; --glow-strong: none;
  /* No grey fills (they vanish at a 1-bit threshold): + / −, the 4 px bar and bold + underline carry it. */
  --diff-add: #ffffff; --diff-add-part: #ffffff; --diff-del: #ffffff; --diff-del-part: #ffffff; --diff-plus: #000000; --diff-minus: #000000;
  /* No colour on e-paper: pens are black; a highlighter is a 45° hatch in black (notepad.js), never a grey. */
  --pad-red: #000; --pad-blue: #000; --pad-green: #000; --pad-orange: #000; --pad-purple: #000; --pad-grey: #555;
  --pad-hl-yellow: #000; --pad-hl-green: #000; --pad-hl-pink: #000; --pad-hl-blue: #000; --pad-hl-orange: #000;
  --pad-hl-alpha: .6;
  --font-sans: var(--font-eink);
  --r-md: 4px; --r-lg: 4px; --r-xl: 6px; --r-sm: 4px; --radius: 4px;
  --bw: 1px; --focus-w: 3px; --lh: 1.5; --fs-small: 15px;
  --text-2xs: 15px; --text-xs: 15px; --text-sm: 15px; --text-sm2: 15px; --text-md: 17px; --text-lg: 19px; --text-xl: 22px; --text-2xl: 26px;
}
/* Colour e-paper (Kaleido): a small saturated palette for areas and thick lines; text stays black. */
:root[data-display="eink-color"] {
  --accent: #0047c8; --accent-strong: #000000; --err: #d00000; --ok: #007a2a; --online: #007a2a; --warn: #e07000; --warn-fill: #e07000; --star: #e07000;
  --sel-bg: #0047c8; --sel-ink: #ffffff; --mark: #ffe600;
  /* Diffs: white rows; the bar and the +/− carry the colour, bold + underline the changed part. */
  --diff-add: #ffffff; --diff-add-part: #ffffff; --diff-del: #ffffff; --diff-del-part: #ffffff; --diff-plus: #007a2a; --diff-minus: #d00000;
  --pad-red: #e00000; --pad-blue: #0040ff; --pad-green: #008a00; --pad-orange: #ff7000; --pad-purple: #8a00d4; --pad-grey: #555555;
  --pad-hl-yellow: #ffe600; --pad-hl-green: #4dff4d; --pad-hl-pink: #ff4dc4; --pad-hl-blue: #4dc3ff; --pad-hl-orange: #ffa020;
}
:root[data-display^="eink"] .app-frame { --tap: 48px; --tap-sm: 48px; --tap-gap: 8px; --control-h: 48px; --control-h-sm: 48px; --row-h: 48px; --input-fs: 17px; --reveal: 1; --icon-stroke: 2.2; }
/* The rail and the bottom bar keep short labels (the one place under 15 px, eink.md §3): 13 px bold. */
:root[data-display^="eink"] .app-frame { --rail-w: 84px; --bottom-h: 60px; }
:root[data-display^="eink"] :is(.tab-item, .rail-item) { font-size: 13px; font-weight: 700; }
:root[data-display^="eink"] body, :root[data-display^="eink"] .app-frame { font-size: 17px; font-weight: 450; -webkit-font-smoothing: auto; }
/* Nothing moves, nothing glows, nothing is see-through: every repaint ghosts on e-paper. */
:root[data-display^="eink"] *, :root[data-display^="eink"] *::before, :root[data-display^="eink"] *::after {
  animation: none !important; transition: none !important;
  box-shadow: none !important; text-shadow: none !important; backdrop-filter: none !important;
  scroll-behavior: auto !important; letter-spacing: 0 !important; mask-image: none !important;
}
:root[data-display="eink"] :is(img, .agent-emoji, .pi, .avatar, .folder-ico, .tile .emoji) { filter: grayscale(1) contrast(1.3); }
:root[data-display^="eink"] :focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
:root[data-display^="eink"] ::placeholder { color: var(--ink); font-style: italic; }
:root[data-display^="eink"] :is(.side-label, .pop .pop-label, .palette-group, .sheet h2, .settings-group-label, .conv-section > h2, .agent-form .agent-part h4, .page-view .integration-group > h2, .log-entry .lvl, details.builtins summary, .p-card h4, .p-needs h3, .review-files-head, .q-chip, .dream-side, .work-col-head .who) { text-transform: none; font-weight: 700; }
/* Selected: a bar and bold on rows (big areas never invert), inversion on small things, a thick line under tabs. */
:root[data-display^="eink"] :is(.nav-link.active, .settings-tabs .tab.active) { background: var(--bg); box-shadow: inset 6px 0 0 var(--accent) !important; font-weight: 700; }
:root[data-display^="eink"] .tab.active { border-bottom-width: 4px; border-bottom-color: var(--accent); font-weight: 700; }
:root[data-display^="eink"] :is(.tab-item.active, .rail-item.active .ico-wrap, .tile.active, .page-top .filter button.on, .seg-control button.on, .seg-control button[aria-pressed="true"], .code-layout button.active) { background: var(--sel-bg); color: var(--sel-ink); }
:root[data-display^="eink"] .tab-item.active::before { display: none; }
:root[data-display^="eink"] .tab-item.active svg { color: var(--sel-ink); }
:root[data-display^="eink"] :is(.page-top .filter, .seg-control, .code-layout) { background: var(--bg); border: var(--bw) solid var(--line); }
/* Outlines in place of fills. */
:root[data-display^="eink"] .user .bubble { background: var(--bg); border: var(--bw) solid var(--line); }
:root[data-display^="eink"] .assistant .bubble { border-left: 1px dotted var(--line); padding-left: 12px; }
:root[data-display^="eink"] :is(.tool, .md :not(pre) > code, .card .body) { border: 1px dotted var(--line); padding: 1px 6px; }
:root[data-display^="eink"] .tools-list { border-left-style: dotted; }
:root[data-display^="eink"] .tool::before { color: var(--ink); }
:root[data-display^="eink"] :is(.bubble pre, .md .code-block) { border: var(--bw) dotted var(--line); }
/* Links: underlined only within text (a message, a paragraph, a hint), where nothing else says they're links; as the
   app's own controls (cards' titles, tabs, crumbs, lists, menus) they're plain, an underline there only clutters. */
:root[data-display^="eink"] a { color: var(--ink); text-decoration: none; }
:root[data-display^="eink"] :is(.md, p, .hint-text, .hint, .note, .empty, .err) a { text-decoration: underline; text-decoration-thickness: 2px; }
:root[data-display="eink-color"] :is(.md, p, .hint-text, .hint, .note, .empty, .err) a { text-decoration-color: var(--accent); }
:root[data-display^="eink"] :is(.nav-link, .tab, .tab-item, .rail-item, .tile, .side-link, .side-head, .side-user, .conv-more, .pop-item, .folder-open, .folder-branch, .folder-slot, .meeting-card, .project-head-name) { text-decoration: none; }
:root[data-display^="eink"] :is(.card, .conv-card, .integration, .settings section, .item-form, .folder-tile, .composer, .speaker-row, .rec-panel) { border: var(--bw) solid var(--line); }
:root[data-display^="eink"] .composer:focus-within { outline: none; border-color: var(--ink); }
/* Its field is always focus-visible while typed in: the 3 px focus ring there was a heavy second frame. */
:root[data-display^="eink"] .composer textarea:focus-visible { outline: none; }
/* The chat's lines all thin: a frame and an outline were a double line; the steps' and a quote's bars 1 px. */
:root[data-display^="eink"] .tools-list { border-left-width: 1px; }
:root[data-display^="eink"] .md blockquote { border-left-width: 1px; }
:root[data-display^="eink"] .attach-chip { border: var(--bw) solid var(--line); opacity: 1; }
:root[data-display^="eink"] .attach-chip.error { border-style: dashed; }
:root[data-display^="eink"] .attach-progress > span { background: var(--ink); transition: none; }
:root[data-display^="eink"] .msg-attach-img img { border: var(--bw) solid var(--line); }
:root[data-display^="eink"] .attach-btn svg { width: 24px; height: 24px; }
:root[data-display^="eink"] button:disabled { border-style: dashed; color: var(--ink); }
:root[data-display^="eink"] .primary, :root[data-display^="eink"] .send, :root[data-display^="eink"] .header-new { background: var(--ink); color: var(--bg); }
/* Kaleido: the blue of every other selected or main thing (--sel-bg); black stays for black and white. */
:root[data-display="eink-color"] :is(.primary, .send, .header-new):not(:disabled) { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--sel-bg); }
:root[data-display^="eink"] button { font-weight: 700; }
:root[data-display^="eink"] .icon-btn, :root[data-display^="eink"] .hbtn { font-weight: 400; }
:root[data-display^="eink"] :is(.badge, .nav-link .count, .tab .count, .offline, .update-chip, .activity-chip) { background: var(--bg); color: var(--ink); border: 1px solid var(--ink); font-weight: 700; }
:root[data-display^="eink"] :is(.badge.on, .badge.err-badge, .badge.off, .nav-link .count.unread, .hbtn .count, .tab-item .count, .rail-item .count) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
:root[data-display="eink-color"] :is(.badge.err-badge, .badge.off) { background: var(--err); border-color: var(--err); }
/* Errors can't be red: bold and a sign. */
:root[data-display^="eink"] :is(.err, .overdue) { font-weight: 700; }
:root[data-display="eink"] .err:not(:empty)::before { content: "⚠ "; }
:root[data-display^="eink"] :is(.starred, .tree-file, .tree-dir, .tree-submodule, .tree-file .st, .sev-high) { color: var(--ink) !important; }
:root[data-display^="eink"] :is(.banner.sev-high, .notif-item.sev-high, .notif-item.sev-critical) { border-left: 6px solid var(--ink); }
/* What moved stays still: a square for busy, a glyph for working, words for recording and running. */
:root[data-display^="eink"] .busy { border-radius: 0; width: 10px; height: 10px; background: var(--ink); }
:root[data-display^="eink"] .project-head .busy::after, :root[data-display^="eink"] .meeting-progress .busy::after { content: "working…"; margin-left: 16px; font-size: 15px; white-space: nowrap; }
:root[data-display^="eink"] :is(.conv-link.working .label, .conv-card.working .name)::after { content: " ●"; color: var(--ink); }
:root[data-display="eink-color"] :is(.conv-link.working .label, .conv-card.working .name)::after { color: var(--accent); }
:root[data-display^="eink"] .run.running { border-left-width: 3px; }
:root[data-display^="eink"] .run.running::before { content: "Running"; display: inline-block; background: var(--sel-bg); color: var(--sel-ink); padding: 0 6px; margin-bottom: 4px; font-weight: 700; }
:root[data-display^="eink"] .rec-dot { width: auto; height: auto; border-radius: 0; background: none; font-weight: 700; }
:root[data-display^="eink"] .rec-dot::after { content: "● REC"; }
:root[data-display="eink-color"] .rec-dot::after { color: var(--err); }
:root[data-display^="eink"] .mic[data-state]:not([data-state="off"]) { background: var(--ink); color: var(--bg); }
:root[data-display^="eink"] .mic[data-mode="hold"] { outline: 4px solid var(--ink); color: var(--ink); }
:root[data-display^="eink"] .dot { border-radius: 0; background: var(--ink); }
:root[data-display^="eink"] .dot.offline-dot { background: var(--bg); border: 2px solid var(--ink); }
:root[data-display^="eink"] .limit-row .meter { border: var(--bw) solid var(--ink); height: 12px; background: var(--bg); }
:root[data-display^="eink"] .limit-row .meter > span { background: var(--ink); }
:root[data-display="eink"] .limit-row.warning .meter > span { background: repeating-linear-gradient(45deg, var(--ink) 0 2px, var(--bg) 2px 5px); }
:root[data-display="eink-color"] .limit-row.warning .meter > span { background: var(--warn); }
:root[data-display="eink-color"] .limit-row.critical .meter > span { background: var(--err); }
:root[data-display^="eink"] .limit-row.critical .when::after { content: " · critical"; font-weight: 700; }
/* Drawers and sheets: a line, no scrim, there at once. */
:root[data-display^="eink"] #sidebar { border-right: var(--bw) solid var(--line); }
:root[data-display^="eink"] :is(.sheet, .pop, .agent-pick, .palette) { border: var(--bw) solid var(--ink); }
:root[data-display^="eink"] .update-bar { left: 0; right: 0; transform: none; max-width: none; border-radius: 0; border: none; border-top: var(--bw) solid var(--line); }
:root[data-display^="eink"] header { border-bottom: var(--bw) solid var(--line); }
:root[data-display^="eink"] :is(nav.tabbar) { border-top: var(--bw) solid var(--line); }
:root[data-display^="eink"] :is(nav.rail) { border-right: var(--bw) solid var(--line); }
:root[data-display^="eink"] .side-group { border-top-style: dotted; }
:root[data-display^="eink"] .tab-strip { border-bottom: var(--bw) solid var(--line); }
:root[data-display^="eink"] .tab-strip[data-overflow] .tab-arrow { display: inline-flex; align-items: center; justify-content: center; }
:root[data-display^="eink"] .tab-strip .tab-arrow:disabled { visibility: hidden; }
:root[data-display^="eink"] :is(.msg .who .who-info, .md .diff-table .ln, .log-entry.debug, .card.disabled > :not(.row), .code-comment.resolved, .auth-choice label.disabled, .tree-file.wt-D, .usage-chart .cache-out, .usage-legend .sw.cache-out) { opacity: 1; }
:root[data-display^="eink"] .seg-who.again { opacity: 1; font-weight: 400; font-style: italic; }
:root[data-display^="eink"] .cursor::after { color: var(--ink); }
:root[data-display^="eink"] .msg.pending .bubble { opacity: 1; outline: 1px dashed var(--ink); }
:root[data-display^="eink"] .msg.pending .who::after { content: "Sending…"; }
:root[data-display^="eink"] .notepad-sheet { background-color: var(--bg); }
:root[data-display^="eink"] .notepad-tools .tool-group { border: var(--bw) solid var(--line); }
:root[data-display="eink"] #notepad-colors button:not([data-c="ink"], [data-c="grey"]) { display: none; }
:root[data-display^="eink"] .pop .pop-item, :root[data-display^="eink"] .palette-item { min-height: 48px; }
:root[data-display^="eink"] .palette-item[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: inset 6px 0 0 var(--ink) !important; font-weight: 700; }
/* Paging: ▲ ▼ instead of smooth scrolling, "More below" in the chat. */
.app[data-paging="on"] .page-btns { display: flex; }
/* Room for them at the right edge (56 px, 16 px off it), so they never cover a card's actions or the end of a line. */
@container shell (width >= 600px) { .app[data-paging="on"] :is(main#log, .page-view) { padding-right: max(80px, var(--safe-right)); } }
/* The palette as a dialog from a tablet up; full screen only on a phone (navigation.md §3.2). */
@container shell (width >= 600px) {
  .palette-wrap { padding: 12cqh 16px 16px; }
  .palette { width: min(640px, 100cqw - 32px); height: auto; max-height: 76cqh; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding-top: 0; }
  .palette-foot { padding-bottom: 8px; }
}
/* A phone: bottom right, above the composer, not over the text (eink.md §8). */
@container shell (width < 600px) { .page-btns { top: auto; bottom: calc(var(--bottom-h) + 72px + var(--safe-bottom)); transform: none; } }
:root[data-display^="eink"] .more-below:not([hidden]) { display: flex; justify-content: center; position: sticky; bottom: 0; margin: 0 auto; width: 100%; background: var(--bg); border: var(--bw) solid var(--line); }
/* Notepad tools stay in a column on tablets, whatever the orientation. */
@container shell (width >= 600px) {
  :root[data-display^="eink"] .notepad { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  :root[data-display^="eink"] .notepad-bar, :root[data-display^="eink"] .notepad-hint { grid-column: 1 / -1; }
  :root[data-display^="eink"] .notepad-tools { flex-direction: column; flex-wrap: nowrap; align-items: stretch; overflow-y: auto; }
  :root[data-display^="eink"] .notepad-tools .tool-group { flex-direction: column; }
  :root[data-display^="eink"] .notepad-tools .spacer { display: none; }
}
/* Diffs: colour isn't enough, so + / − before each line, a thick bar at its edge, the changed part bold and underlined. */
:root[data-display^="eink"] .md :is(.diff-add, .diff-del) .diff-code::before { display: inline-block; width: 1.2em; margin-left: -.4em; font-weight: 700; }
:root[data-display^="eink"] .md .diff-add .diff-code::before { content: "+"; color: var(--diff-plus); }
:root[data-display^="eink"] .md .diff-del .diff-code::before { content: "−"; color: var(--diff-minus); }
:root[data-display^="eink"] .md .diff-add > td:first-child { border-left: 4px solid var(--diff-plus); }
:root[data-display^="eink"] .md .diff-del > td:first-child { border-left: 4px solid var(--diff-minus); }
:root[data-display^="eink"] .md .diff-word { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
:root[data-display^="eink"] .md .diff-table .ln { color: var(--ink); }
:root[data-display="eink"] .md .diff-del .diff-code { text-decoration: line-through; }
:root[data-display^="eink"] .md :is(.diff-hunk, .diff-note) > td { background: var(--bg); border-top: 1px dotted var(--line); border-bottom: 1px dotted var(--line); }

/* States that were only a soft fill or a colour (white and black on e-paper): a bar on rows, inversion on small things. */
:root[data-display^="eink"] :is(.tree-file.active, #scratch-days a.current) { background: var(--bg); color: var(--ink); box-shadow: inset 6px 0 0 var(--accent) !important; font-weight: 700; }
:root[data-display^="eink"] :is(.seg.playing, .code-commented) { background: var(--bg); border-left: 4px solid var(--accent); font-weight: 700; }
:root[data-display^="eink"] :is(.msg .who .read-aloud.on) { background: var(--sel-bg); color: var(--sel-ink); }
:root[data-display^="eink"] :is(.primary, .send, .header-new):disabled { background: var(--bg); color: var(--ink); border: var(--bw) dashed var(--ink); }
/* Kaleido: small text, counts and thin icons stay black; red only on bold error text of 15 px or more. */
:root[data-display="eink-color"] :is(.git-status, .git-graph, .code-comment .where, .settings .ok, .status-list .on, .link-btn, .avatar, #code-dirty, .nav-ico, .tile svg, .msg .who .who-actions, .rail-item svg, .tab-item svg) { color: var(--ink); }
:root[data-display="eink-color"] :is(.err, .integration .warn, .auth-card .err) { font-weight: 700; }
:root[data-display="eink-color"] :is(.folder-tile .folder-slot.needs, .conv-link.asking .label, .conv-card.asking .name, .p-needs h3, .work-row.running .work-ico, .work-row.conv .work-ico, .work-live, .work-queued, .work-state) { color: var(--ink); }
/* Usage chart: the series told apart by shape (black, outline, dashed, dotted), not colour. */
:root[data-display^="eink"] .usage-chart .in { fill: var(--ink); }
:root[data-display^="eink"] .usage-chart .out { fill: var(--bg); stroke: var(--ink); stroke-width: 2; }
:root[data-display^="eink"] .usage-chart .cache-in { fill: var(--bg); stroke: var(--ink); stroke-width: 2; stroke-dasharray: 4 2; }
:root[data-display^="eink"] .usage-chart .cache-out { fill: var(--bg); stroke: var(--ink); stroke-width: 2; stroke-dasharray: 1 2; }
:root[data-display^="eink"] .usage-chart text { fill: var(--ink); }
/* No hover nor tint on e-ink: the bar listed is outlined, a filtering row underlined. */
:root[data-display^="eink"] .usage-chart g.bar:hover .hit { fill: transparent; }
:root[data-display^="eink"] .usage-chart g.bar.sel .hit { fill: transparent; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; }
:root[data-display^="eink"] .usage-breakdown div.r.on .name { text-decoration: underline; }
:root[data-display^="eink"] .usage-legend .sw { width: 14px; height: 14px; border: var(--bw) solid var(--ink); border-radius: 0; }
:root[data-display^="eink"] .usage-legend .sw.in { background: var(--ink); }
:root[data-display^="eink"] .usage-legend .sw.out { background: var(--bg); }
:root[data-display^="eink"] .usage-legend .sw.cache-in { background: repeating-linear-gradient(45deg, var(--ink) 0 2px, var(--bg) 2px 5px); }
:root[data-display^="eink"] .usage-legend .sw.cache-out { background: var(--bg); border-style: dotted; }
:root[data-display="eink-color"] :is(.usage-chart .in) { fill: var(--accent); }
:root[data-display="eink-color"] .usage-legend .sw.in { background: var(--accent); }
/* Sizes: mic, Send and Stop are max(40px, --tap), so 48 here; checkboxes 24 px; icons 24 px with the thick stroke. */
:root[data-display^="eink"] :is(input[type=checkbox], input[type=radio]) { width: 24px; height: 24px; accent-color: var(--ink); }
:root[data-display^="eink"] :is(.mic, .send, .stop, .msg .who .read-aloud, .notepad-tools .tool-group button, .palette-item, .folder-tile .folder-settings) svg { width: 24px; height: 24px; stroke-width: var(--icon-stroke); }
/* A press shows at once (no hover fills on e-paper), and hover changes nothing. */
:root[data-display^="eink"] :is(button, a, [role=button], .card, .conv-link, .nav-link):active { outline: 3px solid var(--ink); outline-offset: 2px; }
:root[data-display^="eink"] .folder-tile .folder-ide:hover { transform: none; }
:root[data-display="eink-color"] :is(a, button, .side-link, .side-head, .project-head-name, .seg-time, .meeting-back, .app-get):hover { color: var(--ink); }
/* Nothing redrawn all the time: the level meter goes, "● REC" says it; a busy button says so in words. */
:root[data-display^="eink"] .rec-level { display: none; }
:root[data-display^="eink"] button[aria-busy="true"]::before { content: "…"; width: auto; height: auto; border: 0; border-radius: 0; margin-right: 4px; vertical-align: baseline; }
:root[data-display^="eink"] #scratch-text:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
/* The VS Code logo in one ink (its two blues break up at a 1-bit threshold, and they're off the Kaleido palette). */
:root[data-display="eink"] :is(.folder-ide, .project-head-ide) svg :is(path, rect, circle, polygon) { fill: var(--ink); }

/* ---- shared: round 2 on e-ink: still, outlined, signs not colours ---- */
:root[data-display^="eink"] .spin { animation: none; color: var(--ink); }
:root[data-display^="eink"] .live-step .spin::after { content: " working…"; }
:root[data-display^="eink"] :is(.chip, .tag, .be-tag, .chip-btn) { background: var(--bg); color: var(--ink); border: var(--bw) solid var(--line); }
:root[data-display^="eink"] .chip.bad { border-style: double; border-width: 4px; }
:root[data-display^="eink"] .chip.bad::before { content: "✕ "; }
:root[data-display^="eink"] .chip.warn::before { content: "! "; }
:root[data-display^="eink"] :is(.chip-btn[aria-pressed="true"], .chip-btn.on, .mention[aria-selected="true"]) { background: var(--sel-bg); color: var(--sel-ink); }
:root[data-display^="eink"] .p-needs { background: var(--bg); border: var(--bw) solid var(--line); border-left: 8px solid var(--ink); }
:root[data-display^="eink"] .p-needs h3::before { content: "! "; }
:root[data-display="eink-color"] .p-needs { border-left-color: var(--warn); }
:root[data-display^="eink"] :is(.p-card, .p-setup, .p-fs, .run-output, .p-radio, .code-review-bar, .s-confirm, .token-box, .note.origin, .note.notice, .toast, .mention-list, .p-branch-msg) { background: var(--bg); border: var(--bw) solid var(--line); }
:root[data-display^="eink"] .p-radio:has(input:checked) { box-shadow: inset 6px 0 0 var(--ink) !important; font-weight: 700; }
:root[data-display^="eink"] .work-row.running::before { content: "Running"; background: var(--sel-bg); color: var(--sel-ink); padding: 0 6px; font-weight: 700; font-size: 15px; }
:root[data-display^="eink"] .work-row.queued::before { content: "Queued"; border: var(--bw) solid var(--ink); padding: 0 6px; font-weight: 700; font-size: 15px; }
:root[data-display^="eink"] :is(.dot-ok, .dot-bad) { border-radius: 0; background: var(--ink); }
:root[data-display^="eink"] .dot-bad { background: var(--bg); border: 2px solid var(--ink); }
:root[data-display^="eink"] .rdiff-line.del { text-decoration: line-through; }
:root[data-display^="eink"] .rdiff-line.code-commented { font-weight: 700; }
:root[data-display^="eink"] .danger-block { border-left: 8px solid var(--ink) !important; }
:root[data-display^="eink"] button.danger:not(.pop-item) { background: var(--bg); color: var(--ink); border: 3px double var(--ink); }
:root[data-display="eink-color"] button.danger:not(.pop-item) { color: var(--err); border-color: var(--err); }
/* Toasts: a still frame under the header, closed with ✕ (nothing fades on e-paper). */
:root[data-display^="eink"] .toasts { top: calc(var(--header-h) + var(--safe-top) + 8px); bottom: auto; left: 16px; right: 16px; max-width: none; align-items: stretch; }
:root[data-display^="eink"] .toast { border-width: 2px; }
:root[data-display^="eink"] :is(.unread-mark, .unread-dot) { color: var(--ink); background: none; width: auto; height: auto; font-weight: 700; }
:root[data-display^="eink"] .unread-dot::after { content: "●"; }
:root[data-display^="eink"] .conv-card.current { box-shadow: inset 6px 0 0 var(--ink) !important; }
:root[data-display^="eink"] :is(.working-t, .conv-more .unread-n, .rb-label) { color: var(--ink); font-weight: 700; }
:root[data-display^="eink"] .msg-acts { opacity: 1; }
:root[data-display^="eink"] .msg-act { border: 1px solid var(--line); font-size: 15px; }
:root[data-display^="eink"] .new-reply { display: none; }
:root[data-display^="eink"] .msg.queued .bubble { opacity: 1; outline: 1px dashed var(--ink); }
:root[data-display^="eink"] .term-user.queued { opacity: 1; }
:root[data-display^="eink"] .settings-tabs .tab.warn .tab-desc::before { content: "! "; }
:root[data-display^="eink"] :is(.settings-tabs .tab.warn, .settings-tabs .tab.err) .tab-desc { color: var(--ink); }
:root[data-display^="eink"] .settings-tabs .tab:is(.warn, .err) .tab-name::after { border-radius: 0; background: var(--ink); }
:root[data-display^="eink"] .attn { background: var(--ink); color: var(--bg); border-radius: 0; }
:root[data-display^="eink"] .s-statusbar { border-left: 8px solid var(--ink) !important; }
:root[data-display^="eink"] .s-statusbar[data-level="err"] { background: var(--bg); border: 3px double var(--ink); }
:root[data-display^="eink"] .log-new-line { color: var(--ink); }
:root[data-display^="eink"] .log-new-line::before, :root[data-display^="eink"] .log-new-line::after { border-top-color: var(--ink); }
:root[data-display^="eink"] .log-entry.error { box-shadow: inset 6px 0 0 var(--ink) !important; }
:root[data-display^="eink"] .log-entry.warn { box-shadow: inset 3px 0 0 var(--ink) !important; }
:root[data-display^="eink"] .restart-overlay { border: 4px solid var(--ink); }
:root[data-display^="eink"] .p-radio, :root[data-display^="eink"] .s-sessions li { min-height: 48px; }
:root[data-display^="eink"] .be-tag { border-style: dashed; }
:root[data-display^="eink"] .conv-card .preview mark { background: var(--bg); font-weight: 700; text-decoration: underline; }
/* Black and white: --mark is white, so a match is bold and underlined and a selection black (eink.md §12: no state disappears). */
:root[data-display="eink"] mark { background: var(--bg); color: var(--ink); font-weight: 700; text-decoration: underline; }
:root[data-display="eink"] ::selection { background: var(--ink); color: var(--bg); }
/* Faded in colour, whole on e-paper (eink.md §4): what they were says a dashed line or the text. */
:root[data-display^="eink"] :is(.term-ask.sending, .dream-op.reverted .dream-fact, .wf-st-skipped > .wf-box, .wr-comment.sent, .wr-comment.resolved, .card-steps i.skipped, .work-card.done, .work-card.rejected, .work-card.split) { opacity: 1; }
:root[data-display^="eink"] :is(.work-card.done, .work-card.rejected, .work-card.split, .dream-op.reverted .dream-fact) { border-style: dashed; }

/* ---- shared: round 2, review fixes (late in the file: they must win over the layouts and e-ink rules above) ---- */
/* A project's Settings: its Save bar stays at the bottom while the long form scrolls, up to 1024 px (round 1's .item-form .actions would push it down or switch it off). */
.item-form.p-settings-form > .actions { position: sticky; bottom: calc(-1 * var(--page-pad-bottom)); margin: 0; padding: 10px 0 calc(10px + var(--safe-bottom)); background: var(--bg); border-radius: 0; border-top: 1px solid var(--line); }
@container shell (width >= 1024px) { .item-form.p-settings-form > .actions { position: static; border: none; padding: 10px 0; } }
/* Review's diff: as wide as its longest line, so a line's colour reaches as far as it scrolls. */
.rdiff { width: max-content; min-width: 100%; }
/* Touch: lines a little taller, and a tap anywhere on one comments on it (code.js); e-ink taller still. */
@media (pointer: coarse) { .rdiff-line { min-height: 32px; align-items: center; } }
/* Targets of round 2 that were under 44 px on touch (48 on e-ink): the tokens grow there, these follow them. */
:is(.rb-sub .link-btn, .tools-more) { min-height: var(--tap-sm); }
a.chip { height: auto; min-height: var(--control-h-sm); }
.split-btn .split-arrow { min-width: var(--tap-sm); }
details.p-card > summary { min-height: var(--tap); align-items: center; }
.p-link { display: inline-flex; align-items: center; min-height: var(--tap-sm); }
.conv-link .conv-dots { min-width: var(--tap-sm); min-height: var(--tap-sm); justify-content: center; align-items: center; }
.conv-link .conv-dots::after { inset: 0; }
/* "↓ New reply" sits on the composer, whatever its height (To:, @mentions, several lines). */
footer { position: relative; }
.new-reply { bottom: calc(100% + 8px); }
/* A Planner card opened from a project (/routines#<id>) shows which it is for a moment. */
.card.flash { outline: 2px solid var(--accent); outline-offset: 2px; }
@container shell (width < 600px) {
  /* Phones, chat: toasts under the header, not over the composer. */
  .app[data-page="chat"] .toasts { bottom: auto; top: calc(var(--header-h) + var(--safe-top) + 8px); }
  /* The group's editor is a full sheet like the others. */
  .pop.pop-wide { max-width: none; max-height: calc(100cqh - var(--header-h)); }
}
/* E-ink: no shadow survives (the universal rule), so the diff's bars are borders; one 8 px column keeps the lines aligned. */
:root[data-display^="eink"] .rdiff-line { border-left: 8px solid var(--bg); min-height: 36px; align-items: center; }
:root[data-display^="eink"] .rdiff-line.add { border-left: 4px solid var(--diff-plus); padding-left: 4px; }
:root[data-display^="eink"] .rdiff-line.del { border-left: 4px solid var(--diff-minus); padding-left: 4px; }
:root[data-display^="eink"] .rdiff-line.code-commented { border-left: 8px solid var(--ink); padding-left: 0; }
/* E-ink: nothing translucent; what was faded says so in words or a dashed frame. */
:root[data-display^="eink"] :is(.sched-row.paused, .msg.elsewhere .bubble, .conv-link .conv-dots) { opacity: 1; }
:root[data-display^="eink"] .msg.elsewhere .bubble { outline: 1px dashed var(--ink); font-style: italic; }
/* E-ink's 15 px text in small labels: their height follows it. */
:root[data-display^="eink"] :is(.tag, .be-tag, .attn) { height: auto; min-height: 24px; line-height: 1.2; padding: 2px 6px; }
:root[data-display^="eink"] .unread-mark { font-size: 15px; }
:root[data-display^="eink"] .card.flash { outline: 3px solid var(--ink); }
/* Colour e-paper: text stays black; colour only on borders and bars, red only on bold error text. */
:root[data-display="eink-color"] :is(.s-status.warn, .ok, .ok-t, .danger:not(button)) { color: var(--ink); }
:root[data-display="eink-color"] :is(.err-t, .s-bar-trouble) { font-weight: 700; }

