:root { --logo-tile: #1F3A6B; --logo-a: #FFFFFF; --logo-pen: #DDB15A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-tile: #2C4C88; } }
:root[data-theme="dark"] { --logo-tile: #2C4C88; }
.appbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 60px; padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
  padding-inline: clamp(16px, 2.5vw, 32px); background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
/* The workshop's right-hand column sticks below the bar, not under it. */
.rail { top: calc(env(safe-area-inset-top, 0px) + 76px) !important; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo-tile { fill: var(--logo-tile); }
.logo-a { fill: none; stroke: var(--logo-a); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.logo-pen { fill: none; stroke: var(--logo-pen); stroke-width: 2.6; stroke-linecap: round; }
.logo-word { font-family: "Bricolage Grotesque", "Figtree", system-ui, sans-serif; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.logo-word span { color: var(--accent); }
.appbar-right { display: flex; align-items: center; gap: 14px; }
.appbar-link { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.appbar-link:hover { color: var(--ink); }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--surface); }
.theme-switch button { border: 0; background: none; color: var(--muted); font: 600 13px/1 "Figtree", system-ui, sans-serif; padding: 7px 11px; border-radius: 999px; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.theme-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* One icon button, shared with the public site: sun in dark mode (a click goes light), moon in light mode. Auto follows the device. */
.theme-toggle { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--ink); background: var(--sunk); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .ic-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ic-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ic-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .ic-sun { display: none; }
  :root:not([data-theme]) .theme-toggle .ic-moon { display: block; }
}
/* Voice typing (public/voice.js): a mic at the bottom-right corner of the writing box that has the cursor. */
.voice-mic { position: fixed; z-index: 60; width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.voice-mic[hidden], .voice-bubble[hidden] { display: none; }
.voice-mic::after { content: ""; position: absolute; inset: -5px; }
.voice-mic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.voice-mic:hover { color: var(--ink); }
.voice-mic:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.voice-mic.on { color: #fff; background: #C0392B; border-color: #C0392B; animation: voice-pulse 1.4s ease-in-out infinite; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,.45); } 50% { box-shadow: 0 0 0 7px rgba(192,57,43,0); } }
@media (prefers-reduced-motion: reduce) { .voice-mic.on { animation: none; } }
.voice-bubble { position: fixed; z-index: 60; max-width: min(420px, calc(100vw - 16px)); padding: 8px 12px; border-radius: 10px; background: var(--ink); color: var(--bg); font: 500 14px/1.35 "Figtree", system-ui, sans-serif; box-shadow: 0 4px 18px rgba(0,0,0,.25); pointer-events: none; }
