:root { --site-bg: #f3f5ec; --site-panel: #fffef9; --site-field: #fbfcf7; --site-ink: #1d3028; --site-muted: #53645a; --site-line: #cbd3c8; --site-accent: #9f3825; --site-highlight: #fce8e1; --site-highlight-ink: #762f20; --site-success: #256346; --site-bar: #f7f8f2; --site-grid: rgba(29,48,40,.045); --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
  :root[data-theme="dark"] { color-scheme: dark; --paper: #111916; --panel: #1c2923; --ink: #edf7ef; --muted: #b7c9bd; --line: #50665a; --accent: #f4866b; --accent-dark: #ffad99; --success: #a5e2b9; --error-bg: #492a25; --site-bg: #111916; --site-panel: #1c2923; --site-field: #111c17; --site-ink: #edf7ef; --site-muted: #b7c9bd; --site-line: #50665a; --site-accent: #ffad99; --site-highlight: #492a25; --site-highlight-ink: #ffe3d9; --site-success: #a5e2b9; --site-bar: #24352b; --site-grid: rgba(215,235,220,.05); }
  .site-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; min-height: 76px; padding: 16px 0; border-bottom: 1px solid #cbd3c8; }
  .site-brand { color: #1d3028; text-decoration: none; font-size: 14px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
  .site-brand span { color: #c64f35; }
  .site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .site-nav a { color: #617067; padding: 8px 10px; border-radius: 4px; text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: normal; }
  .site-nav a:hover, .site-nav a[aria-current="page"] { color: #9f3825; background: #fce8e1; }
  .site-nav a:focus-visible, .site-brand:focus-visible { outline: 3px solid rgba(198, 79, 53, .3); outline-offset: 2px; }
  .site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 18px 0 28px; border-top: 1px solid #cbd3c8; color: #617067; font-size: 12px; }
  .footer-nav { display: flex; flex-wrap: wrap; gap: 16px; }
  .footer-nav a, .reading-content a { color: #9f3825; }
  .footer-nav a:focus-visible, .reading-content a:focus-visible { outline: 3px solid rgba(198, 79, 53, .3); outline-offset: 2px; }
  .reading-content { max-width: 860px; margin-top: 36px; padding: clamp(22px, 4vw, 38px); border: 1px solid #cbd3c8; border-radius: 6px; background: #fffef9; color: #1d3028; line-height: 1.75; }
  .reading-content h1, .reading-content h2, .reading-content h3 { color: #1d3028; line-height: 1.2; }
  .reading-content h2 { margin: 0 0 18px; font: 400 32px/1.2 Georgia, "Times New Roman", serif; }
  .reading-content h3 { margin: 26px 0 8px; font-size: 17px; }
  .reading-content p { margin: 0 0 16px; }
  .reading-content p:last-child { margin-bottom: 0; }
  .reading-content code { overflow-wrap: anywhere; font-size: .9em; }
  .reading-content pre { overflow-x: auto; padding: 14px; border: 1px solid #cbd3c8; border-radius: 4px; background: #f7f8f2; line-height: 1.5; }
  body { color: var(--site-ink); background-color: var(--site-bg); background-image: linear-gradient(var(--site-grid) 1px, transparent 1px), linear-gradient(90deg, var(--site-grid) 1px, transparent 1px); }
  .site-header, .site-footer, .workspace, .editor + .editor, .reading-content, .tool-card { border-color: var(--site-line); }
  .site-brand, .reading-content, .reading-content h1, .reading-content h2, .reading-content h3, .tool-card { color: var(--site-ink); }
  .site-nav a, .site-footer, .tool-card p, .intro p, .help, .details, .hint, .state { color: var(--site-muted); }
  .site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--site-highlight-ink); background: var(--site-highlight); }
  .footer-nav a, .reading-content a, .eyebrow, main a:not(.tool-card) { color: var(--site-accent); }
  .workspace, .reading-content, .tool-card { background: var(--site-panel); }
  .reading-content pre, .actions, details pre { background: var(--site-bar); border-color: var(--site-line); }
  textarea, .workspace textarea, .workspace input:not([type=checkbox]), .workspace select { color: var(--site-ink); background: var(--site-field); border-color: var(--site-line); font-family: var(--mono); }
  textarea::placeholder, input::placeholder { color: var(--site-muted); opacity: .85; }
  button:not(.primary), .workspace button:not(.primary) { color: var(--site-ink); border-color: var(--site-line); background: transparent; }
  .workspace button:disabled { color: var(--site-muted); background: var(--site-bar); border-color: var(--site-line); }
  button.primary, .workspace button.primary { background: #a43824; border-color: #a43824; color: #fff; }
  .error, .notice, .message.error { color: var(--site-highlight-ink); background: var(--site-highlight); border-color: var(--site-accent); box-shadow: none; }
  .notice.success-notice { color: var(--site-success); background: var(--site-success-bg, #e5f5ec); border-color: var(--site-success); }
  :root[data-theme="dark"] { --site-success-bg: #1d3929; }
  .error-context { color: var(--site-ink); background: var(--site-field); border-color: var(--site-line); }
  .repair-summary, .message:not(.error) { color: var(--site-ink); background: var(--site-bar); border-color: var(--site-success); }
  .privacy-note { color: var(--site-success); }
  :root[data-theme="dark"] .error-pointer, :root[data-theme="dark"] .error-suggestion { color: #ffe3d9; }
  .result, .live { font-family: var(--mono); }
  .theme-toggle { margin: 0; padding: 7px 10px; min-height: 36px; border: 1px solid var(--site-line); border-radius: 4px; color: var(--site-ink); background: var(--site-panel); font: 700 12px/1.4 "Avenir Next", Avenir, "Segoe UI", sans-serif; letter-spacing: normal; cursor: pointer; }
  .theme-toggle:focus-visible { outline: 3px solid var(--site-accent); outline-offset: 2px; }
  .privacy-badge { display: inline-block; margin-top: 15px; padding: 4px 8px; border: 1px solid var(--site-line); border-radius: 999px; color: var(--site-muted); background: var(--site-bar); font-size: 11px; font-weight: 700; }
  .action-status { min-height: 1.5em; color: var(--site-muted); font-size: 12px; }
  @media (max-width: 700px) { .site-header { align-items: flex-start; flex-direction: column; } .site-nav { margin-left: -10px; } }