/* ===== Theme: light (default tokens live in app.css), dark, and system ===== */
:root{color-scheme:light}
/* Dark token set. Applied when the user picks Dark, or when System + OS prefers dark. */
:root[data-theme="dark"],
:root:not([data-theme="light"]):not([data-theme="dark"]).system-dark{
  color-scheme:dark;
  --bg:#0F1117;--surface:#161922;--surface-2:#1C2029;--ink:#EDEFF5;--ink-2:#B4B9C8;--muted:#7F8598;--line:#262B37;
  --accent:#FF5A14;--accent-soft:#3A2114;--tint-blue:#1E2433;
  --ok:#5BD08F;--ok-soft:#10301F;--warn:#E0B052;--warn-soft:#33270E;--bad:#F07474;--bad-soft:#3A1818;--info:#8FA4FF;--info-soft:#1B2242;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 12px 32px -16px rgba(0,0,0,.6);
}
@media(prefers-color-scheme:dark){
  :root:not([data-theme="light"]):not([data-theme="dark"]){
    color-scheme:dark;
    --bg:#0F1117;--surface:#161922;--surface-2:#1C2029;--ink:#EDEFF5;--ink-2:#B4B9C8;--muted:#7F8598;--line:#262B37;
    --accent:#FF5A14;--accent-soft:#3A2114;--tint-blue:#1E2433;
    --ok:#5BD08F;--ok-soft:#10301F;--warn:#E0B052;--warn-soft:#33270E;--bad:#F07474;--bad-soft:#3A1818;--info:#8FA4FF;--info-soft:#1B2242;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 12px 32px -16px rgba(0,0,0,.6);
  }
}
/* Surfaces that were hard-coded white get remapped whenever the dark tokens are active */
:root[data-theme="dark"] body,.system-dark body{background:radial-gradient(circle at top left,#141826 0,#0F1117 40%,#0D0F14 100%);color:var(--ink)}
:root[data-theme="dark"] .sidebar,.system-dark .sidebar,
:root[data-theme="dark"] .panel,.system-dark .panel,:root[data-theme="dark"] .card,.system-dark .card,
:root[data-theme="dark"] .hero,.system-dark .hero,:root[data-theme="dark"] .overview-hero,.system-dark .overview-hero,
:root[data-theme="dark"] .drawer,.system-dark .drawer,:root[data-theme="dark"] .popover,.system-dark .popover,:root[data-theme="dark"] .policy-popover,.system-dark .policy-popover,
:root[data-theme="dark"] .segmented,.system-dark .segmented,:root[data-theme="dark"] .menu-toggle,.system-dark .menu-toggle{background:var(--surface);border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] .button,.system-dark .button,:root[data-theme="dark"] .btn,.system-dark .btn,:root[data-theme="dark"] a.button,.system-dark a.button,
:root[data-theme="dark"] input,.system-dark input,:root[data-theme="dark"] select,.system-dark select,:root[data-theme="dark"] textarea,.system-dark textarea{background:var(--surface-2)!important;color:var(--ink)!important;border-color:var(--line)!important}
:root[data-theme="dark"] .btn-primary,.system-dark .btn-primary,:root[data-theme="dark"] .button.primary,.system-dark .button.primary,
:root[data-theme="dark"] form[action^="/studio/"] button,.system-dark form[action^="/studio/"] button{background:var(--accent)!important;color:#fff!important;border-color:var(--accent)!important}
:root[data-theme="dark"] .seg.active,.system-dark .seg.active,:root[data-theme="dark"] .segmented .active,.system-dark .segmented .active{background:var(--ink);color:var(--bg)}
:root[data-theme="dark"] th,.system-dark th,:root[data-theme="dark"] td,.system-dark td{border-color:var(--line)}
:root[data-theme="dark"] tr:hover td,.system-dark tr:hover td{background:var(--surface-2)}
:root[data-theme="dark"] .badge,.system-dark .badge{background:var(--tint-blue);color:var(--ink-2)}
:root[data-theme="dark"] .overview-hero:after,.system-dark .overview-hero:after,:root[data-theme="dark"] .hero:after,.system-dark .hero:after{opacity:.55;mask-image:linear-gradient(to right,transparent 0%,black 45%)}
:root[data-theme="dark"] .side-item.active,.system-dark .side-item.active{background:var(--accent-soft);color:var(--ink)}
:root[data-theme="dark"] .prose,.system-dark .prose{color:var(--ink)}
:root[data-theme="dark"] img.thumb,.system-dark img.thumb{filter:brightness(.95)}
/* theme switch control */
.theme-switch{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:999px;background:var(--surface);margin:12px 0}
.theme-switch button{flex:1;min-height:40px!important;padding:0 8px!important;border:0!important;border-radius:999px!important;background:transparent!important;color:var(--muted)!important;font-size:13px!important;box-shadow:none!important}
.theme-switch button.active{background:var(--ink)!important;color:var(--bg)!important}
@media(max-width:900px){.theme-switch button{min-height:44px!important}}

/* Studio additions: generous reading surfaces and progressive disclosure. */
.validate-intro textarea{min-height:190px;font-size:17px}.validate-job-card{max-width:760px}.job-card-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}.eyebrow{display:block;color:var(--muted);font-size:12px;letter-spacing:.08em;text-transform:uppercase;margin-bottom:8px}.validation-hero{display:flex;justify-content:space-between;align-items:center;gap:28px;padding:30px;margin-bottom:24px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.validation-hero h2{font-size:27px;line-height:1.2;margin-bottom:8px}.verdict{width:126px;height:126px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none}.verdict strong{font-size:40px;line-height:1}.verdict span{text-transform:capitalize;margin-top:6px;font-weight:600}.verdict-go{background:var(--ok-soft);color:var(--ok)}.verdict-go_with_angle{background:var(--info-soft);color:var(--info)}.verdict-wait{background:var(--warn-soft);color:var(--warn)}.verdict-avoid{background:var(--bad-soft);color:var(--bad)}.validation-triad{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:0}.best-angle .lead{max-width:850px}.callout.bad-soft{background:var(--bad-soft);color:var(--bad)}.chat-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;align-items:start}.chat-sessions{padding:14px}.chat-session-row{display:block;padding:12px;border-radius:12px}.chat-session-row:hover,.chat-session-row.active{background:var(--tint-blue)}.chat-session-row small{display:block;margin-top:4px}.chat-panel{min-height:560px;display:flex;flex-direction:column}.chat-messages{display:grid;gap:16px;flex:1}.chat-message{max-width:82%}.chat-message.user{justify-self:end}.chat-message.assistant{justify-self:start}.chat-bubble{padding:14px 17px;background:var(--surface);border:1px solid var(--line);border-radius:18px}.chat-message.user .chat-bubble{background:var(--ink);color:var(--surface)}.chat-meta{margin:6px 12px 0;color:var(--muted);font-size:12px}.chat-input{display:grid;grid-template-columns:minmax(0,1fr) 70px;gap:10px;align-items:end;border-top:1px solid var(--line);padding-top:18px;margin-top:24px}.chat-input textarea{min-height:58px;resize:none}.send-button{min-width:70px;min-height:44px!important}.chat-thinking{grid-column:1/-1;color:var(--muted);font-size:13px}.chat-empty{text-align:center;padding:42px 20px}.chat-orb{font-size:32px;color:var(--accent);margin-bottom:8px}.prompt-chips{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:20px}.chip{min-height:40px!important;background:var(--tint-blue);border:0}.ask-button{position:fixed;right:24px;bottom:24px;z-index:35;min-height:48px!important;padding:0 22px;border:0;background:var(--accent);color:#fff;box-shadow:0 10px 28px -10px rgba(13,15,20,.45)}.drawer-chat{padding:18px}.drawer-chat .chat-input{margin-top:18px}.drawer-chat .chat-empty{padding:20px 4px}.drawer-chat .prompt-chips{display:grid}.drawer-chat .chip{width:100%;white-space:normal;height:auto;padding:10px 14px}.drawer-chat .chat-message{max-width:100%}
@media(max-width:900px){.validation-hero{display:block}.verdict{margin-top:22px}.validation-triad,.chat-layout{grid-template-columns:1fr}.chat-sessions{order:2}.chat-panel{min-height:520px}.ask-button{right:16px;bottom:16px}}
