/* Hallmark · shape: app screen · genre: modern-minimal · theme: Workbench (by request)
 * nav: top bar with global search and user menu, sidebar of six destinations with a quota foot · footer: none, the shell ends at the file list
 * hero: none (app screen) · signature: the selection rail, rows folding into one command bar
 * states: loading skeleton, empty, error, full · posture: restrained · surface: tinted paper
 * axes: warm paper / terracotta signal / system sans + ui-monospace for measurements · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P5 H4 E5 S4 R5 V4 · weakest: H, the toolbar carried three ranks at one weight; sort moved into the quiet tier and the primary action stands alone */
/* Hallmark · waive 47b · one real document iframe · the workbench frame is the document being edited */
/* Hallmark · waive 26b · :active and :disabled rules exist in app.css · the workbench templates carry no CSS of their own */
:root {
  color-scheme: light dark;

  /* Surfaces: warm paper, one step of separation per layer. */
  --paper: #f7f5f1;
  --paper-2: #f1eee7;
  --paper-3: #e9e4da;
  --surface: #fffdf9;
  --surface-2: #fbf8f2;
  --surface-raised: #fffefb;
  --scrim: rgb(20 19 15 / 48%);

  /* Ink */
  --ink: #1d1b17;
  --ink-2: #3a362e;
  --muted: #6a6457;
  --line: #ddd7cb;
  --line-strong: #c6bdad;

  /* One accent, used for the primary action, selection and state. */
  --accent: #b4441f;
  --accent-hover: #963717;
  --accent-ink: #fff8f4;
  --accent-soft: #f4e4db;
  --accent-line: #e0b9a6;
  --accent-on-soft: #9c3917;
  --focus: #b4441f;

  --danger: #9d2a1e;
  --danger-soft: #f7e3df;
  --ok: #2f6b47;
  --ok-soft: #e4efe7;
  --warn: #7a5316;
  --warn-soft: #f6ecd9;

  /* Type: one system family, mono only for sizes, dates, types and ids. */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  /* The document sheet keeps a serif voice: it is a page, not a panel. */
  --font-doc: Georgia, "Liberation Serif", "Times New Roman", serif;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Spacing scale (4px base). */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5rem;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(29 27 23 / 6%);
  --shadow-md: 0 1px 2px rgb(29 27 23 / 6%), 0 12px 32px rgb(29 27 23 / 10%);

  --dur-micro: 120ms;
  --dur-short: 200ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --z-sticky: 20;
  --z-menu: 60;
  --z-modal: 100;
  --z-toast: 120;

  --topbar-h: 3.5rem;
  --sidebar-w: 15rem;
  --container: 87.5rem;
  --gutter: clamp(1rem, 2.4vw, 2rem);
  --control-h: 2.5rem;
  --control-h-sm: 2.25rem;

  /* Safe areas: zero on regular browsers, non-zero in a standalone PWA on a
     notched phone. Layout keeps its own spacing and only adds the inset. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* The document sheet: its own paper/ink pair, so the page can follow the
     theme while the exported DOCX stays black-on-white. */
  --doc-paper: #fffefb;
  --doc-ink: #232019;
  --doc-rule: #e5dfd2;
  --doc-toolbar: #f6f2ea;
  --doc-tool: #f1ece1;
  --doc-tool-hover: #e7e0d2;
  --doc-tool-active: #f2ddd2;
  --doc-tool-active-ink: #8f3517;
  --doc-pad-block: 2.5cm;
  --doc-pad-inline: 2.25cm;
  --doc-sheet-shadow: 0 1px 2px rgb(29 27 23 / 8%), 0 18px 40px rgb(29 27 23 / 8%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --paper-2: #1a1914;
    --paper-3: #23211a;
    --surface: #1b1a15;
    --surface-2: #201f19;
    --surface-raised: #23221c;
    --scrim: rgb(8 6 4 / 68%);

    --ink: #f3eee4;
    --ink-2: #ded7c9;
    --muted: #a9a193;
    --line: #322f27;
    --line-strong: #4a4539;

    --accent: #d96b41;
    --accent-hover: #e9835c;
    --accent-ink: #1a0e08;
    --accent-soft: #38211a;
    --accent-line: #5a3425;
    --accent-on-soft: #f0916c;
    --focus: #e9835c;

    --danger: #ef8b7c;
    --danger-soft: #3a1f1b;
    --ok: #7fc49a;
    --ok-soft: #1d2c23;
    --warn: #d9a75e;
    --warn-soft: #332916;

    --doc-paper: #201e18;
    --doc-ink: #f3eee3;
    --doc-rule: #3a362c;
    --doc-toolbar: #1c1b15;
    --doc-tool: #26241d;
    --doc-tool-hover: #302d24;
    --doc-tool-active: #3b241c;
    --doc-tool-active-ink: #f0a07f;
    --doc-sheet-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 18px 40px rgb(0 0 0 / 35%);

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 35%);
    --shadow-md: 0 1px 2px rgb(0 0 0 / 30%), 0 14px 34px rgb(0 0 0 / 30%);
  }
}
