:root {
  color-scheme: light dark;
  --ink: light-dark(#202124, #e9edf2);
  --muted: light-dark(#465665, #b5c0cd);
  --quiet: var(--muted);
  --wash: light-dark(#f8fafd, #14181e);
  --surface: light-dark(#fff, #1d2229);
  --surface-soft: light-dark(#f3f6fa, #252c34);
  --surface-hover: light-dark(#e8eef5, #303a46);
  --search-surface: light-dark(#eaf0f8, #292f39);
  --line: light-dark(#dce2e9, #39434f);
  --control-line: light-dark(#9baab9, #73808e);
  --good: light-dark(#226144, #9bd8b1);
  --good-soft: light-dark(#e2efe7, #203b31);
  --attention: light-dark(#84521a, #f1c38c);
  --danger: light-dark(#95233b, #ffb2bc);
  --project-dot: light-dark(#75899e, #94a4b7);
  --blue: light-dark(#0b57c6, #a6c9ff);
  --sage: light-dark(#27634a, #98d6ac);
  --clay: light-dark(#92452e, #ffb49c);
  --iris: light-dark(#6547aa, #cdb9ff);
  --accent: var(--blue);
  --on-accent: light-dark(#fff, #121923);
  --accent-hover: color-mix(in srgb, var(--accent) 86%, var(--ink));
  --accent-ink: color-mix(in srgb, var(--accent) 78%, var(--ink));
  --accent-tint: color-mix(in srgb, var(--accent) 7%, var(--surface));
  --accent-fill: color-mix(in srgb, var(--accent) 18%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 46%, var(--surface));
  --accent-bar: color-mix(in srgb, var(--accent) 54%, var(--surface));
  --accent-mark: var(--accent);
  --focus: var(--accent);
  --contrast: var(--accent-ink);
  --console-ink: var(--ink);
  --console-muted: var(--muted);
  --console-line: var(--line);
  --console-accent: var(--accent);
  --white: var(--surface);
  --nav-text: var(--ink);
  font-family: Inter, Arial, sans-serif;
  accent-color: var(--accent);
}
:root[data-scheme="light"] { color-scheme: light; }
:root[data-scheme="dark"] { color-scheme: dark; }
:root[data-accent="sage"] { --accent: var(--sage); }
:root[data-accent="clay"] { --accent: var(--clay); }
:root[data-accent="iris"] { --accent: var(--iris); }

.theme-trigger { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:0 11px; flex:none; font:550 13px Inter,sans-serif; color:var(--muted); border:0; border-radius:24px; background:transparent; }
.theme-trigger:hover { background:var(--surface-hover); color:var(--ink); }
.theme-glyph { display:block; width:18px; height:18px; border:1.7px solid currentColor; border-radius:50%; background:linear-gradient(120deg, currentColor 49%, transparent 51%); }
.appearance-dialog { width:min(420px, calc(100% - 24px)); }
.appearance-dialog .workspace-dialog-header { align-items:center; border:0; padding:20px 22px 5px; background:var(--surface); }
.appearance-dialog .workspace-dialog-header h2 { font-size:23px; }
#appearance-form { padding:14px 22px 24px; }
#appearance-form fieldset { border:0; padding:0; margin:0; min-width:0; }
#appearance-form fieldset + fieldset { margin-top:20px; }
#appearance-form legend { padding:0; margin-bottom:8px; font-size:13px; font-weight:600; }
.mode-grid,.accent-grid { display:grid; gap:7px; }
.mode-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.accent-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
#appearance-form label { position:relative; display:flex; align-items:center; min-width:0; gap:8px; padding:8px; border:1px solid var(--control-line); border-radius:11px; color:var(--ink); font-size:12px; cursor:pointer; }
#appearance-form label:hover { background:var(--surface-soft); }
#appearance-form label:has(:checked) { border-color:var(--accent); background:var(--accent-tint); box-shadow:inset 0 0 0 1px var(--accent); font-weight:650; }
#appearance-form label:has(:focus-visible) { outline:2px solid var(--focus); outline-offset:3px; }
#appearance-form input { position:absolute; width:1px; height:1px; clip-path:inset(50%); margin:0; }
.mode-grid label { flex-direction:column; }
.mode-image { --mini-shell:#e5ebf2; --mini-page:#fff; --mini-line:#9aa9b9; position:relative; width:100%; height:51px; border-radius:5px; border:1px solid #a2afbc; background:var(--mini-shell); overflow:hidden; }
.mode-image::before,.mode-image::after { content:""; position:absolute; }
.mode-image::before { inset:9px 4px 4px 22%; border-radius:3px; background:var(--mini-page); }
.mode-image::after { top:17px; left:30%; width:44%; height:14px; background:linear-gradient(var(--mini-line),var(--mini-line)) left top/100% 2px no-repeat,linear-gradient(var(--mini-line),var(--mini-line)) left center/73% 2px no-repeat,linear-gradient(var(--mini-line),var(--mini-line)) left bottom/84% 2px no-repeat; }
.dark-image { --mini-shell:#313b47; --mini-page:#1d2229; --mini-line:#8497ac; }
.system-image { --mini-shell:linear-gradient(90deg,#e5ebf2 50%,#313b47 50%); --mini-page:linear-gradient(90deg,#fff 37%,#1d2229 37%); }
.accent-grid label { justify-content:center; min-height:41px; }
.accent-grid i { display:block; width:12px; height:12px; border-radius:50%; flex:none; }
.accent-grid [value="blue"] + i { background:var(--blue); }
.accent-grid [value="sage"] + i { background:var(--sage); }
.accent-grid [value="clay"] + i { background:var(--clay); }
.accent-grid [value="iris"] + i { background:var(--iris); }
@media(max-width:720px) {
  .theme-trigger { width:42px; height:42px; padding:0; }
  .theme-trigger-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
}
@media(max-width:375px) {
  #appearance-form { padding-inline:15px; }
  .accent-grid { gap:5px; }
  #appearance-form .accent-grid label { gap:5px; padding-inline:4px; }
}

/* Shared surfaces from the file explorer, Office intake and personal inbox. */
.work-dialog,.file-dialog,.file-table,.page-more,.status-panel,.folder-tile,
.hud-layout,.hud-form,.desk-search-form input,.search-form input,.workspace-field :is(input,select) {
  background:var(--surface); color:var(--ink); border-color:var(--line);
}
.workspace-dialog-header,.hud-mailbox,thead { background:var(--surface-soft); color:var(--ink); border-color:var(--line); }
.workspace-field :is(input,select),.desk-search-form input,.search-form input { border-color:var(--control-line); }
.workspace-field :is(input,select):disabled { background:var(--surface-soft); color:var(--muted); }
.hud-message,.hud-label,.file-table td,.file-table th,.hud-layout,.page-heading,.library-tabs { border-color:var(--line); }
.folder-tile:hover,tbody tr:hover,.icon-button:hover,.hud-message:hover,.recents-list .my-work-row:hover { background:var(--surface-hover); color:var(--ink); }
.hud-message[aria-pressed="true"] { background:var(--accent-fill); box-shadow:inset 3px 0 var(--accent); }
.hud-message.unread .hud-sender::before { background:var(--accent); }
.workspace-option:has(input:checked) { background:var(--accent-tint); border-color:var(--accent-line); }
.reader-follow .follow-row { background:var(--accent-tint); border-color:var(--accent-line); }
.reader-follow .follow-row > .btn { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.workspace-form-error,.status-error { color:var(--danger); }
.icon-button,.folder-tile > .icon,.queue-filter,.queue-count,.queue-position,.breadcrumbs .icon { color:var(--muted); }
.queue-segment,.queue-segment[aria-pressed="true"] { color:var(--ink); }
.queue-segment:hover,.queue-step,.queue-focus-toggle { background:var(--surface); color:var(--ink); border-color:var(--control-line); }
.queue-focus-toggle[aria-pressed="true"] { background:var(--accent-fill); color:var(--accent-ink); }
.queue-segment[aria-pressed="true"],.queue-stepper,.queue-list .follow-row + .follow-row { border-color:var(--line); }
.queue-keys,.queue-loading { background:var(--surface-soft); color:var(--muted); }
.queue-loading-mark { border-color:var(--line); border-top-color:var(--accent); }
.queue-empty:has(.workspace-link),.queue-feedback,.queue-segment.is-reviewed { background:var(--good-soft); color:var(--good); }
.follow-state,.queue-empty:has(.workspace-link)::before { color:var(--good); }
[data-state="unmatched"] .follow-state { color:var(--attention); }
.notice { background:var(--ink); color:var(--surface); }
.work-dialog::backdrop,.file-dialog::backdrop { background:light-dark(#141b2980,#080a10aa); }
@media (forced-colors: active) {
  #appearance-form label:has(:checked) { outline:2px solid Highlight; outline-offset:-2px; }
  .theme-glyph { background:CanvasText; }
}

.board-card.dragging-card { opacity:.55; }
.board-lane.drop-target { background:var(--accent-tint); outline:2px dashed var(--accent-line); outline-offset:-2px; }
.board-card.arriving-card { position:relative; z-index:1; }
@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation:dialog-in 165ms cubic-bezier(.2,.8,.2,1); }
  dialog[open]::backdrop { animation:veil-in 140ms ease-out; }
  .source-added,.notice:not(:empty) { animation:status-in 170ms cubic-bezier(.2,.8,.2,1); }
  .theme-trigger,.theme-glyph,#appearance-form label,.board-lane,.board-card { transition:background-color 120ms ease-out,border-color 120ms ease-out; }
  .theme-glyph { transition:transform 160ms ease-out; }
  .theme-trigger:hover .theme-glyph { transform:rotate(-16deg); }
  @keyframes dialog-in { from { opacity:0; transform:translateY(7px) scale(.99); } }
  @keyframes veil-in { from { opacity:0; } }
  @keyframes status-in { from { opacity:0; transform:translateY(4px); } }
}

body.codex-guide { margin:0; background:var(--wash); color:var(--ink); font:16px/1.55 Inter,Arial,sans-serif; }
.codex-guide main { max-width:690px; margin:clamp(16px,6vw,75px) auto; padding:clamp(20px,5vw,48px); background:var(--surface); border-radius:20px; }
.codex-guide h1 { margin:24px 0 8px; font-size:clamp(30px,5vw,42px); letter-spacing:-.045em; }
.codex-guide h2 { font-size:20px; margin:30px 0 4px; }
.codex-guide p { margin:6px 0 12px; }
.codex-guide a,.codex-guide summary { color:var(--accent-ink); }
.codex-guide summary { cursor:pointer; }
.codex-guide pre { white-space:pre-wrap; overflow-wrap:anywhere; padding:13px 16px; border-radius:10px; background:var(--surface-soft); }
.codex-guide a:focus-visible,.codex-guide summary:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
