/* Appearance control (both palettes) */
.site-foot .foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.appearance { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.appearance-label { font: var(--type-label); color: var(--muted); }
.appearance-seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); }
.appearance-seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--ink); font: var(--type-control); cursor: pointer; }
.appearance-seg button[aria-pressed="true"] { background: var(--ink-solid); color: var(--paper); }
@media (hover: hover) { .appearance-seg button[aria-pressed="false"]:hover { background: #00000010; } }
@media (pointer: coarse) { .appearance-seg button { min-height: 40px; padding: 0 14px; } }
@media (max-width: 640px) { .appearance { width: 100%; } }
@media print { .appearance { display: none !important; } }

/* Dark palette. Screen only, so printing a paste stays dark text on white paper. */
@media screen {
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eaee; --ink-solid: #f5f6f8;
  --muted: #a3a8b2; --faint: #8b919c;
  --line: #2b2f37; --line-strong: #3d424c;
  --paper: #121316; --paper-warm: #1c1b19; --paper-deep: #242220;
  --panel: #1a1d23; --panel-line: #2d323b;
  --cobalt: #7ea4f0; --cobalt-ink: #a8c2f6; --cobalt-wash: #19233a;
  --sage: #7fb88f; --sage-wash: #14231a;
  --brick: #ef8e76; --brick-wash: #2b1814;
  --gold: #d7ad55;
  --surface: #181a1f; --surface-2: #1d2026;
  --shadow: 0 1px 2px #0006, 0 8px 24px -12px #000a;
  --shadow-pop: 0 18px 50px -14px #000c;
}
html[data-theme="dark"] ::selection { background: #2f4a80; color: #fff; }
html[data-theme="dark"] .lede, html[data-theme="dark"] .app-hero .lede, html[data-theme="dark"] .hero-free { color: #b4b9c3; }
html[data-theme="dark"] .site-head { background: #121316ee; }
html[data-theme="dark"] .brand img { filter: invert(1); }
html[data-theme="dark"] .site-nav a { color: #c5c9d2; }
@media (hover: hover) { html[data-theme="dark"] .site-nav a:hover { color: var(--ink-solid); background: #ffffff14; } }
html[data-theme="dark"] .btn { color: #0b0b0c; }
@media (hover: hover) {
  html[data-theme="dark"] .btn:hover { background: #dde0e6; color: #0b0b0c; }
  html[data-theme="dark"] .btn-line:hover { background: #ffffff0f; color: var(--ink-solid); border-color: #5a606c; }
  html[data-theme="dark"] .btn-quiet:hover { background: #ffffff14; color: var(--ink-solid); }
  html[data-theme="dark"] .appearance-seg button[aria-pressed="false"]:hover { background: #ffffff14; }
  html[data-theme="dark"] .dropdown-menu :where(a, button):hover { background: #ffffff14; }
}
html[data-theme="dark"] .btn-line, html[data-theme="dark"] .btn-quiet { color: var(--ink-solid); }
html[data-theme="dark"] .btn-line.btn-danger, html[data-theme="dark"] .btn-quiet.btn-danger { color: var(--brick); }
html[data-theme="dark"] .field > span:not(.field-error), html[data-theme="dark"] .label, html[data-theme="dark"] .option { color: #c9ccd4; }
html[data-theme="dark"] .field-error, html[data-theme="dark"] .field .field-error { color: var(--brick); }
html[data-theme="dark"] .input, html[data-theme="dark"] .select, html[data-theme="dark"] .textarea { background: var(--surface); }
@media (hover: hover) { html[data-theme="dark"] :is(.input, .select, .textarea):hover { border-color: #565c68; } }
html[data-theme="dark"] :is(.input, .select, .textarea):focus { box-shadow: 0 0 0 3px #7ea4f040; }
html[data-theme="dark"] :is(.input, .select, .textarea)[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px #ef8e7640; }
html[data-theme="dark"] :is(.input, .select, .textarea)::placeholder { color: #8b919c; }
html[data-theme="dark"] :is(.input, .select, .textarea):disabled { background: var(--surface-2); color: var(--muted); }
html[data-theme="dark"] .card, html[data-theme="dark"] .table-wrap, html[data-theme="dark"] .faq details,
html[data-theme="dark"] .mine-list, html[data-theme="dark"] .md, html[data-theme="dark"] .more-apps a { background: var(--surface); }
html[data-theme="dark"] .paper, html[data-theme="dark"] .edit-note { border-color: #35312a; }
html[data-theme="dark"] .chip { color: #c5c9d2; }
html[data-theme="dark"] .chip-free, html[data-theme="dark"] .notice-ok { border-color: #28422f; color: #9ed2ab; }
html[data-theme="dark"] .chip-cobalt { border-color: #2a3a5c; }
html[data-theme="dark"] .notice, html[data-theme="dark"] .editor-notes, html[data-theme="dark"] .edit-note { color: #c9ccd4; }
html[data-theme="dark"] .notice-error { border-color: #5a2f25; color: #f2a897; }
html[data-theme="dark"] .table td.yes { color: #8fd0a0; }
html[data-theme="dark"] .table td.no { color: #e59a86; }
html[data-theme="dark"] .prose { color: #d5d8de; }
html[data-theme="dark"] .prose blockquote { color: #b8bcc6; }
html[data-theme="dark"] .prose a { text-decoration-color: #7ea4f099; }
html[data-theme="dark"] .prose pre, html[data-theme="dark"] .code { border: 1px solid var(--line); }
html[data-theme="dark"] .faq details > div, html[data-theme="dark"] .steps p { color: #c0c4cc; }
html[data-theme="dark"] .site-foot a, html[data-theme="dark"] .oa-network-more a { color: #b4b9c3; }
html[data-theme="dark"] .site-foot a:hover { color: var(--ink-solid); }
html[data-theme="dark"] .spinner { border-color: #ffffff2e; border-top-color: currentColor; }
html[data-theme="dark"] .toast { color: #0b0b0c; box-shadow: 0 10px 30px #000a; }
html[data-theme="dark"] .toast-action { background: #0000001a; color: #0b0b0c; }
@media (hover: hover) { html[data-theme="dark"] .toast-action:hover { background: #00000030; } }
html[data-theme="dark"] .dialog-backdrop { background: #000000a6; }
html[data-theme="dark"] .dialog { background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: 0 30px 80px -20px #000; }
html[data-theme="dark"] .dropdown-menu { background: var(--surface-2); }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1e2128 40%, #2a2e36 50%, #1e2128 60%) 0 0 / 300% 100%; }
html[data-theme="dark"] .error-state { border-color: #5a2f25; }
html[data-theme="dark"] :where(.error-state) > :is(h2, h3) { color: #f2a897; }
html[data-theme="dark"] :where(.error-state) > p { color: #e59a86; }
html[data-theme="dark"] .action-bar { background: #121316f2; }
html[data-theme="dark"] .seg { background: var(--surface); }
html[data-theme="dark"] .seg button[aria-pressed="true"], html[data-theme="dark"] .steps li::before { color: #0b0b0c; }

/* Landing hero and editor */
html[data-theme="dark"] .app-hero { border-bottom-color: #26241f;
  background: radial-gradient(56% 60% at 88% 16%, #1b2a4d, #1b2a4d00 72%), radial-gradient(46% 55% at 2% 100%, #2c2713, #2c271300 70%), radial-gradient(40% 40% at 58% 0%, #251f3b, #251f3b00 70%), linear-gradient(180deg, #17161a, #121316); }
html[data-theme="dark"] .hero-copy .editor { box-shadow: 0 18px 40px -24px #000, 0 2px 6px #0008; }
html[data-theme="dark"] .hero-phones::before { background: radial-gradient(closest-side, #ffffff14, #fff0); }
html[data-theme="dark"] .editor-title::placeholder, html[data-theme="dark"] .editor-text::placeholder { color: #8b919c; }
html[data-theme="dark"] .editor-text { background: var(--surface); }
html[data-theme="dark"] .editor-text[aria-invalid="true"] { background: #231a18; }
html[data-theme="dark"] .editor-error { background: var(--surface); }
html[data-theme="dark"] .editor-foot { background: var(--surface); }
html[data-theme="dark"] .editor:not(.editor-compact) .editor-foot { box-shadow: 0 -8px 14px -12px #000; }
html[data-theme="dark"] .editor:focus-within { border-color: #565c68; }
html[data-theme="dark"] .editor.dragging { box-shadow: 0 0 0 3px #7ea4f040; }

/* Paste view and admin */
html[data-theme="dark"] .view-head, html[data-theme="dark"] .edit-head { background: #1a1917; }
html[data-theme="dark"] .message-art { mix-blend-mode: screen; filter: invert(1) hue-rotate(180deg); }
html[data-theme="dark"] .code-view { background: var(--surface); color: #e3e6eb; }
html[data-theme="dark"] .code-view .lnum { background: #15171b; color: #858b96; }
html[data-theme="dark"] .code-view .ln.marked { background: #3a3217; }
html[data-theme="dark"] .code-view .ln.marked .lnum { background: #4a3f1a; color: var(--ink-solid); }
html[data-theme="dark"] .hljs-comment, html[data-theme="dark"] .hljs-quote { color: #8b919c; }
html[data-theme="dark"] .hljs-keyword, html[data-theme="dark"] .hljs-selector-tag, html[data-theme="dark"] .hljs-literal, html[data-theme="dark"] .hljs-doctag, html[data-theme="dark"] .hljs-meta .hljs-keyword { color: #8fb0f5; }
html[data-theme="dark"] .hljs-string, html[data-theme="dark"] .hljs-regexp, html[data-theme="dark"] .hljs-template-tag, html[data-theme="dark"] .hljs-addition { color: #8fcf9f; }
html[data-theme="dark"] .hljs-number, html[data-theme="dark"] .hljs-symbol, html[data-theme="dark"] .hljs-bullet, html[data-theme="dark"] .hljs-variable.constant_, html[data-theme="dark"] .hljs-link { color: #f0a08a; }
html[data-theme="dark"] .hljs-title, html[data-theme="dark"] .hljs-title.function_, html[data-theme="dark"] .hljs-section, html[data-theme="dark"] .hljs-selector-id, html[data-theme="dark"] .hljs-selector-class { color: #e3b56e; }
html[data-theme="dark"] .hljs-built_in, html[data-theme="dark"] .hljs-type, html[data-theme="dark"] .hljs-title.class_, html[data-theme="dark"] .hljs-name { color: #c9a0e8; }
html[data-theme="dark"] .hljs-attr, html[data-theme="dark"] .hljs-attribute, html[data-theme="dark"] .hljs-property, html[data-theme="dark"] .hljs-selector-attr, html[data-theme="dark"] .hljs-selector-pseudo, html[data-theme="dark"] .hljs-template-variable, html[data-theme="dark"] .hljs-variable { color: #dcae66; }
html[data-theme="dark"] .hljs-meta { color: #a3a8b2; }
html[data-theme="dark"] .hljs-deletion { color: #f0a08a; background: #3a1f1a; }
html[data-theme="dark"] .hljs-addition { background: #14301f; }
@media (max-width: 760px) { html[data-theme="dark"] .compare :is(th, td):first-child { background: var(--surface); } }
}
