/* Shared interface palette. Document canvas colors remain independent. */
:root {
  color-scheme: light;
  font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --bg:#f6f5f0; --surface:#ffffff; --well:#ecebe3; --ink:#1a221e;
  --muted:#5b655f; --line:#d8d6cc; --accent:#214d41; --accent-hover:#183b32;
  --on-accent:#ffffff; --focus:#467b65; --warn:#80500d; --warn-bg:#fff9ed; --warn-line:#b67a26;
  --danger:#9e2f2b; --radius-sm:4px; --radius-md:6px;
  --green:var(--accent); --border:var(--line);
  background:var(--bg); color:var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#161719; --surface:#202124; --well:#292b2f; --ink:#e8e8e6;
  --muted:#aeb1b7; --line:#414349; --accent:#e2e4e6; --accent-hover:#ffffff;
  --on-accent:#202124; --focus:#c3c8d1; --warn:#f0c17b; --warn-bg:#30291f; --warn-line:#ca9b55;
  --danger:#ffaaa3;
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body { margin:0; background:var(--bg); color:var(--ink); }
.brand { display:inline-flex; align-items:center; flex-shrink:0; gap:8px; color:var(--ink); text-decoration:none; font-size:25px; font-weight:750; letter-spacing:-1.3px; line-height:1; }
.brand img { display:block; flex:none; width:34px; height:34px; margin:0; }
.brand-wordmark { display:inline-block; white-space:nowrap; }
.brand-wordmark span { font-weight:400; color:inherit; }
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:36px; padding:7px 10px; border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface); color:var(--ink); font:inherit; font-size:13px; cursor:pointer; white-space:nowrap; }
.theme-toggle[aria-pressed="true"] { background:var(--well); border-color:var(--muted); }
.theme-toggle:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.theme-toggle svg { width:15px; height:15px; flex:none; }
/* Explicit light document surfaces, including when printed from dark UI. */
#paper,#pageFrame,.paper { color-scheme:light; }
@media print { :root,:root[data-theme="dark"] { color-scheme:light; background:white; color:black; } body { background:white; color:black; } .theme-toggle { display:none!important; } }
/* Placeholder text is readable in both themes, including native form fields. */
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
/* Release polish: motion is limited to interface controls, never the document canvas. */
:root{--radius-sm:6px;--radius-md:10px;--motion:180ms;--ease:cubic-bezier(.2,.65,.3,1)}
:where(button,a.cta,.theme-toggle,summary,input,select,textarea,.upload,.file-upload):focus-visible{outline:2px solid var(--focus);outline-offset:3px}
@media(prefers-reduced-motion:no-preference){:where(button,a.cta,.theme-toggle,.file-upload,.upload){transition:background-color var(--motion) var(--ease),border-color var(--motion) var(--ease),color var(--motion) var(--ease),box-shadow var(--motion) var(--ease)}:where(button:not(:disabled),a.cta,.file-upload):active{transform:translateY(1px)}@keyframes apa-enter{from{opacity:.35;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
