/* A quiet C4P charcoal palette. Original light-theme rules remain intact. */
.theme-picker { position: relative; z-index: 80; flex: none; font: inherit; }
.theme-picker summary { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 38px; padding: .4rem .7rem; border: 1px solid #d8e4e8; border-radius: 999px; background: #fff; color: #34424d; cursor: pointer; list-style: none; font-size: .84rem; font-weight: 500; white-space: nowrap; }
.theme-picker summary::-webkit-details-marker { display: none; }
.theme-picker summary:hover, .theme-picker[open] summary { border-color: #2e758c; background: #f3f8f9; }
.theme-picker svg { width: 17px; height: 17px; flex: none; }
.theme-picker svg circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.theme-picker svg path { fill: currentColor; }
.theme-options { position: absolute; top: calc(100% + .6rem); right: 0; display: grid; gap: .15rem; width: 180px; padding: .4rem; border: 1px solid #d8e4e8; border-radius: 12px; background: #fff; color: #25313b; box-shadow: 0 12px 30px #172d4020; }
.theme-picker:not([open]) .theme-options { display: none; }
.theme-options button { position: relative; display: flex; align-items: center; width: 100%; min-height: 40px; padding: .5rem .7rem; border: 0; border-radius: 7px; background: transparent; color: inherit; font: inherit; font-size: .86rem; text-align: left; }
.theme-options button:hover { background: #edf4f6; }
.theme-options button[aria-pressed="true"] { background: #e6f1f4; color: #246779; font-weight: 600; }
.theme-options button[aria-pressed="true"]::after { content: "✓"; margin-left: auto; }
.platform-header .theme-picker { margin-left: auto; }
.platform-header .theme-picker summary { color: #eef4f6; background: #ffffff09; border-color: #71838d; }
.platform-header .theme-picker summary:hover, .platform-header .theme-picker[open] summary { background: #ffffff16; }
.theme-transition body, .theme-transition .side, .theme-transition .main, .theme-transition .composer, .theme-transition .card, .theme-transition .piece, .theme-transition .sp { transition: background-color .22s ease, color .22s ease, border-color .22s ease; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #202830; --mist: #252f38; --white: #2b3640;
  --ink: #edf2f5; --ink-muted: #b4c2cc; --ink-2: #b4c2cc;
  --night: #edf2f5; --charcoal: #333e48; --rule: #455460;
  --primary: #85cad8; --link: #91d5e1; --deep: #91d5e1;
  --mark: #9ec4df; --mark-light: #b9d8e7; --teal: #7bc4d0; --accent-light: #85cad8;
  --chart-bar: #85aebe; --chart-soft: #354d5c;
  --platform-blue: #85cad8; --c-bar: #85aebe; --c-hl: #85cad8;
  --c-soft: #476575; --c-line: #85cad8; --c-area: #85cad81a;
  --c-bad: #476575; --c-bad-text: #edb5b5;
}
html[data-theme="dark"] body { color: var(--ink); background: var(--page); }
html[data-theme="dark"] :focus-visible { outline-color: #91d5e1; }
html[data-theme="dark"] ::selection { background: #4a7188; color: #fff; }
html[data-theme="dark"] .theme-picker summary { color: #dce6ed; background: #2b3640; border-color: #536573; }
html[data-theme="dark"] .theme-picker summary:hover, html[data-theme="dark"] .theme-picker[open] summary { background: #35434f; border-color: #85cad8; }
html[data-theme="dark"] .theme-options { background: #2b3640; color: #edf2f5; border-color: #536573; box-shadow: 0 14px 40px #0005; }
html[data-theme="dark"] .theme-options button:hover { background: #35434f; }
html[data-theme="dark"] .theme-options button[aria-pressed="true"] { background: #354d5c; color: #b5e6ee; }

/* Prompt landing and its saved example answers. */
html[data-theme="dark"] .side { background: #252f38; }
html[data-theme="dark"] .side, html[data-theme="dark"] .stage { scrollbar-width: thin; scrollbar-color: #657682 transparent; }
html[data-theme="dark"] .ex-group button:hover { background: #35434f; }
html[data-theme="dark"] .ex-group button[aria-current="true"] { background: #35434f; }
html[data-theme="dark"] .btn { background: #85cad8; color: #192b35; }
html[data-theme="dark"] .btn:hover { background: #a4dde6; }
html[data-theme="dark"] .msg-user { background: #354d5c; color: #edf2f5; }
html[data-theme="dark"] .composer { border-color: #536573; box-shadow: 0 12px 40px -22px #0009; }
html[data-theme="dark"] .composer.typing { border-color: #85cad8; box-shadow: 0 12px 40px -22px #85cad85c; }
html[data-theme="dark"] .composer textarea::placeholder { color: #acbac5; }
html[data-theme="dark"] .send { background: #435966; color: #dce9ee; }
html[data-theme="dark"] .composer.ready .send { background: #85cad8; color: #192b35; }
html[data-theme="dark"] .step.done .dot { background-color: #36748a; }
html[data-theme="dark"] .tools i { box-shadow: inset 0 0 0 4px #35434f, inset 0 0 0 7px #85cad8; }
html[data-theme="dark"] .draft-box mark { color: #d5edf5; background: #354d5c; }
html[data-theme="dark"] .themes li::before { background: #526f82; color: #fff; }

/* Workflow, reports and the original C4P charts. */
html[data-theme="dark"] #analyse, html[data-theme="dark"] #draft { background: #202830; }
html[data-theme="dark"] #strategise { background: #252f38; border-color: var(--rule); }
html[data-theme="dark"] #draft { border-color: var(--rule); }
html[data-theme="dark"] .step-heading :is(h1,h2), html[data-theme="dark"] .dl-visible h3 { color: #edf2f5; }
html[data-theme="dark"] .step-heading p, html[data-theme="dark"] .dl-intro { color: #b4c2cc; }
html[data-theme="dark"] .step-n, html[data-theme="dark"] #strategise .step-n, html[data-theme="dark"] #draft .step-n { background: #365f73; color: #f1f7fa; }
html[data-theme="dark"] .sp-tint { background: #252f38; }
html[data-theme="dark"] .piece { border-color: #455460; }
html[data-theme="dark"] .piece-wide { background: #252f38; }
html[data-theme="dark"] .split-c4p { background: #365f73; color: #fff; }
html[data-theme="dark"] .split-you { background: #85aebe; color: #192b35; }
html[data-theme="dark"] .split-legend ul, html[data-theme="dark"] .counts b, html[data-theme="dark"] .ask { color: #edf2f5; }
html[data-theme="dark"] .df-out { box-shadow: 0 18px 40px -26px #0009; }
html[data-theme="dark"] .df-outline li::before { background: #526f82; color: #fff; }
html[data-theme="dark"] .chart .grid { stroke: #455460; }
html[data-theme="dark"] .chart .cat, html[data-theme="dark"] .chart .val { fill: #e2ebf0; }
html[data-theme="dark"] .chart .ax, html[data-theme="dark"] .chart .lbl { fill: #b4c2cc; }
html[data-theme="dark"] .chart .lead-lbl { fill: #a4dde6; }
html[data-theme="dark"] .chart .peer { stroke: #83939f; }
html[data-theme="dark"] .chart .area { fill: #85cad81a; }
html[data-theme="dark"] .chart .ceil { stroke: #b4c2cc; }
html[data-theme="dark"] .dl-visible .file { background: #2b3640; border-color: #455460; }
html[data-theme="dark"] .dl-visible .file a { color: #edf2f5; }
html[data-theme="dark"] .dl-visible .file a::before { color: #91d5e1; }
html[data-theme="dark"] .dl-visible .file-type { background: #365f73; color: #fff; }
html[data-theme="dark"] .catalogue-columns { background: #35434f; }
html[data-theme="dark"] .catalogue-search { border-color: #536573; }
html[data-theme="dark"] .catalogue-expand { border-color: #536573; }
html[data-theme="dark"] .catalogue-expand:hover, html[data-theme="dark"] .catalogue-expand[aria-expanded="true"] { background: #354d5c; }
html[data-theme="dark"] .catalogue-detail { background: #293945; }
html[data-theme="dark"] .connect dt { color: #edf2f5; }
html[data-theme="dark"] .connect .account-note { color: #b4c2cc; border-color: #455460; }
html[data-theme="dark"] .night, html[data-theme="dark"] #powers.sp-powers, html[data-theme="dark"] .footer { background: #29343e; color: #edf2f5; }
html[data-theme="dark"] .header-action { background: transparent; border-color: #85aebe; color: #edf2f5; }
html[data-theme="dark"] .header-action:hover { background: #ffffff12; }
html[data-theme="dark"] .combo, html[data-theme="dark"] mark { background: #354d5c; }

/* Privacy text stays identical; only its colours change. */
html[data-theme="dark"] .legal-page h1, html[data-theme="dark"] .legal-page h2, html[data-theme="dark"] .legal-page h3 { color: #edf2f5; }
html[data-theme="dark"] .legal-page p, html[data-theme="dark"] .legal-page li { color: #ccd8e1; }
html[data-theme="dark"] .legal-page .updated { color: #b4c2cc; }

@media (max-width: 860px) {
  .topbar .theme-label { display: none; }
  .topbar .theme-picker summary { width: 38px; padding: 0; }
  .topbar .theme-options { left: 0; right: auto; }
  .topbar { gap: .45rem; }
  .topbar .theme-picker { margin-left: auto; }
  .topbar .pause { margin-left: 0; }
}
@media (max-width: 410px) {
  .topbar { gap: .35rem; padding-inline: .7rem; }
  .topbar .top-more { padding-inline: .55rem; }
  .topbar .top-cta { padding-inline: .55rem; font-size: .76rem; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-transition body, .theme-transition .side, .theme-transition .main, .theme-transition .composer, .theme-transition .card, .theme-transition .piece, .theme-transition .sp { transition: none; }
}
@media print {
  .theme-picker { display: none; }
  html[data-theme="dark"] { color-scheme: light; --white: #fff; --mist: #f3f8f9; --rule: #d8e4e8; --ink: #25313b; --ink-muted: #51616d; --ink-2: #51616d; --night: #25313b; --deep: #246779; --mark: #315e75; }
  html[data-theme="dark"] body, html[data-theme="dark"] #analyse, html[data-theme="dark"] #strategise, html[data-theme="dark"] #draft, html[data-theme="dark"] .legal-page { background: #fff; color: #25313b; }
  html[data-theme="dark"] .legal-page :is(h1,h2,h3,p,li) { color: #25313b; }
  html[data-theme="dark"] body * { color: #25313b !important; background-color: transparent !important; box-shadow: none !important; text-shadow: none !important; border-color: #9eafb8 !important; }
  html[data-theme="dark"] .chart text { fill: #25313b !important; }
  html[data-theme="dark"] .chart .grid { stroke: #9eafb8; }
  html[data-theme="dark"] .logo, html[data-theme="dark"] .brand { background-color: #333e48 !important; }
}
