/* Semantic appearance tokens. Each theme includes surfaces, states and form controls. */
:root[data-theme]{
  color-scheme:dark;
  --bg:#101418;--surface:#171d23;--surface-alt:#202830;--field:#11171d;
  --row-a:#151d25;--row-b:#24313e;--row-hover:#2d3d4c;
  --text:#e8edf1;--muted:#a1b0bd;--subtle:#8d9eac;--line:#35424d;
  --accent:#89ddbc;--accent-bg:#193c30;--accent-border:#3c6b57;
  --button:#9ce4c4;--on-button:#102d22;--blue:#a9c6ff;--blue-bg:#243750;
  --save:#3265d5;--save-hover:#3e75eb;--warning:#f2c486;--warning-bg:#3d2d1c;
  --danger:#ffb0a1;--danger-bg:#432925;--green:var(--accent);--red:var(--danger);
  --network-muted:var(--muted);--hover:#2a353f;
  --hero-a:#172b29;--hero-b:#24483b;--hero-border:#3f6656;
  --hero-text:#effaf4;--hero-muted:#bed3c9;--hero-accent:#c9efad;
  --shadow:0 12px 36px #00000024;--surface-shadow:var(--shadow);--backdrop:#020609b3;
  background:var(--bg);color:var(--text);
}
:root[data-theme="ocean"]{
  --bg:#0b1423;--surface:#121f32;--surface-alt:#1a2a40;--field:#0d192b;
  --row-a:#142238;--row-b:#203650;--row-hover:#2a4562;--hover:#263e5a;
  --text:#e7f0ff;--muted:#a6b9d1;--subtle:#8ea5c1;--line:#354b66;
  --accent:#8fd6ff;--accent-bg:#173b52;--accent-border:#3c6886;
  --button:#a2dcff;--on-button:#0d2a40;
  --hero-a:#132d47;--hero-b:#20475d;--hero-border:#3c637e;
  --hero-muted:#b5d0e3;--hero-accent:#b5e5ff;
}
:root[data-theme="forest"]{
  --bg:#0c1714;--surface:#14241e;--surface-alt:#1b3027;--field:#0d1c16;
  --row-a:#13271e;--row-b:#254135;--row-hover:#305243;--hover:#294438;
  --text:#e5f2e9;--muted:#a5bfb0;--subtle:#8fae9c;--line:#3b5848;
  --accent:#b9df9a;--accent-bg:#2d4527;--accent-border:#5d7a45;
  --button:#c5e6a5;--on-button:#22371a;
  --hero-a:#1c3425;--hero-b:#355234;--hero-border:#54734c;
  --hero-muted:#c2d7bd;--hero-accent:#e2f4b7;
}
:root[data-theme="cloud"]{
  color-scheme:light;
  --bg:#eef2f0;--surface:#ffffff;--surface-alt:#f0f5f2;--field:#f8faf9;
  --row-a:#ffffff;--row-b:#e6eee9;--row-hover:#d7e7de;--hover:#e0ebe5;
  --text:#213c31;--muted:#536b5f;--subtle:#60786c;--line:#c9d7cf;
  --accent:#226342;--accent-bg:#e0efdf;--accent-border:#abc6ad;
  --button:#1e563e;--on-button:#ffffff;--blue:#2d5fa8;--blue-bg:#e8f0fd;
  --warning:#87531e;--warning-bg:#fff0da;--danger:#a13d2e;--danger-bg:#ffebe6;
  --hero-a:#103b30;--hero-b:#245442;--hero-border:#376650;
  --shadow:0 10px 32px #1c3e2a0a;--backdrop:#12271d80;
}
:root[data-theme] body{background:var(--bg);color:var(--text)}
:root[data-theme] ::selection{background:var(--accent);color:var(--bg)}
:root[data-theme] :is(button,a,input,select,summary):focus-visible{outline-color:var(--accent);outline-offset:3px}
:root[data-theme] input::placeholder{color:var(--subtle);opacity:1}
:root[data-theme] :is(input,select,textarea){accent-color:var(--accent)}
:root[data-theme] :is(.masthead,.feed,.controls,dialog,.success-notice,#sheet-actions,.notice-actions){background:var(--surface);color:var(--text);border-color:var(--line);box-shadow:var(--shadow)}
:root[data-theme] .masthead{box-shadow:none}
:root[data-theme] .brand-mark{background:var(--button)}
:root[data-theme] .brand-mark:after{border-color:var(--on-button)}
:root[data-theme] :is(.title-eyebrow,.title-period){color:var(--accent)}
.title-actions{display:flex;gap:12px;align-items:center;flex-shrink:0}
.theme-control{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 10px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--text);font-size:12px}
.theme-control>span{width:12px;height:12px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 3px var(--accent-bg);flex-shrink:0}
.theme-control select{appearance:auto;color:inherit;background:transparent;border:0;min-height:42px;font:inherit;cursor:pointer;max-width:100%;padding:0 4px}
.theme-control option{background:var(--surface);color:var(--text)}
:root[data-theme] :is(.readonly,.badge,.avatar,.credential-state.saved,.success-check,.success-inbox){color:var(--accent);background:var(--accent-bg);border-color:var(--accent-border)}
:root[data-theme] .readonly i{background:var(--accent)}
:root[data-theme] :is(.badge.neutral,.locked,.future-btn){background:var(--surface-alt);color:var(--muted);border-color:var(--line)}
:root[data-theme] :is(.badge.error,.alert,.sheet-error){background:var(--danger-bg);color:var(--danger);border-color:var(--danger)}
:root[data-theme] :is(.credential-state.pending,.credential-state.missing,.execution-pause-note){background:var(--warning-bg);color:var(--warning);border-color:var(--warning)}
:root[data-theme] :is(.link,.row-toggle,.rule-feedback,.log-live,.paid-monitor-state,.notice-evidence){color:var(--accent)}
:root[data-theme] :is(.outline,.rule-reset-btn,.utility-actions button,.credential-saved .outline,.order-copy-bar .copy-order){background:var(--surface-alt);color:var(--text);border-color:var(--line);box-shadow:none}
:root[data-theme] :is(.outline,.account-control,.close,.row-toggle,.notice-dismiss):hover:not(:disabled){background:var(--hover);border-color:var(--accent-border);color:var(--text);box-shadow:none}
:root[data-theme] .primary-btn{background:var(--button);color:var(--on-button);border-color:var(--button);box-shadow:none}
:root[data-theme] .primary-btn:hover:not(:disabled){background:var(--button);filter:brightness(1.08)}
:root[data-theme] :is(.claim-btn,.dock>.claim-btn){background:var(--warning-bg);color:var(--warning);border-color:var(--warning)}
:root[data-theme] :is(.claim-btn,.dock>.claim-btn):hover:not(:disabled){background:var(--warning-bg);color:var(--warning);filter:brightness(1.12)}
:root[data-theme] :is(.claim-btn.armed,.dock>.claim-btn.armed){background:#995718;color:#fff;border-color:#c48a47}
:root[data-theme] :is(.claim-btn.armed,.dock>.claim-btn.armed):hover:not(:disabled){background:#ae6726;color:#fff}
:root[data-theme] .rule-actions .save-rule-btn{background:var(--save);border-color:var(--save);color:#fff;box-shadow:none}
:root[data-theme] .rule-actions .save-rule-btn:hover:not(:disabled){background:var(--save-hover);border-color:var(--save-hover)}
:root[data-theme] :is(.rule-head .badge,.latest-btn){background:var(--blue-bg);color:var(--blue);border-color:var(--blue)}
:root[data-theme] :is(.account-control,.execution-status,.run-report,.paid-notice-settings,.saved-workspace,.credential-saved,.health-totals,.log-summary>div,.form-note,.pin-emblem,.platform-message,.data-provenance){background:var(--surface-alt);color:var(--text);border-color:var(--line)}
:root[data-theme] :is(.account-row.selected,.run-stat-button.success,.execution-success-count){background:var(--accent-bg);color:var(--accent);border-color:var(--accent-border)}
:root[data-theme] .run-stat-button:hover,:root[data-theme] .run-stat-button:focus-visible{background:var(--hover);border-color:var(--accent-border)}
:root[data-theme] :is(.rule-actions,.run-report-stats,.order-pagination,.network-node,.notice-field,.paid-mail-receipt,.execution-timeline li,.history-item,.order-bottom){border-color:var(--line)}
:root[data-theme] :is(.field input,.field select,.credential-editor input,.order-search input,.order-pagination input,.order-pagination select,.run-report-head select,.log-toolbar select,#smtp-config select){background:var(--field);color:var(--text);border-color:var(--line)}
:root[data-theme] :is(.field input,.credential-editor input,.order-search input):focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-bg)}
:root[data-theme] .field input:disabled{background:var(--surface-alt);color:var(--muted)}
:root[data-theme] :is(.inline-rule-form .field span,.control-note,.form-note,.platform-tag,.login-foot,.saved-workspace small,.collection-control>small,.log-summary small,.log-lines small,.log-note,.log-heading>span:last-child,.run-report-times,.run-rule,.run-report-stats span,.run-report-note,.run-pages,.run-events,.run-events time,.feed-context,#feed-count,.order-timing,.notice-context,.notice-footnote,.notice-field>span:first-child,.notice-dismiss,.smtp-help,.success-notice-head small,.paid-mail-receipt small,.paid-mail-receipt time,.copy-missing,.pin-footnote,.pin-status){color:var(--muted)}
:root[data-theme] :is(.execution-counts b,.execution-state-label,.run-report-times b,.run-rule strong,.run-report-stats b,.credential-mask,.order-row .col-price,.col-person,.col-card,.empty strong){color:var(--text)}
:root[data-theme] .order-account-scope{background:var(--surface-alt);color:var(--muted);border-color:var(--accent-border)}
:root[data-theme] .segments{background:var(--field);border-color:var(--line)}
:root[data-theme] .segments button{color:var(--muted)}
:root[data-theme] .segments button:hover{background:var(--hover);color:var(--text)}
:root[data-theme] .segments [aria-pressed="true"]{background:var(--surface-alt);color:var(--text);box-shadow:0 1px 5px #00000018}
:root[data-theme] .segments [data-view="success"]{color:var(--accent)}
:root[data-theme] .segments [data-view="success"][aria-pressed="true"]{background:var(--accent-bg);color:var(--accent)}
/* Stripe the order container, not its individual cells or expanded detail. */
:root[data-theme] .order-list{background:var(--surface);border-color:var(--line)}
:root[data-theme] .list-head{background:var(--surface-alt);color:var(--muted);border-bottom:1px solid var(--line);font-weight:600}
:root[data-theme] .order-list-item{background:var(--row-a);border-bottom:1px solid var(--line);border-top:0}
:root[data-theme] .order-list-item:nth-child(odd){background:var(--row-b)}
:root[data-theme] .order-list-item:last-child{border-bottom:0}
:root[data-theme] .order-list-item:hover,:root[data-theme] .order-list-item:focus-within{background:var(--row-hover)}
:root[data-theme] .order-list-item.expanded{box-shadow:inset 3px 0 var(--accent)}
:root[data-theme] .order-expanded{background:transparent;border-color:var(--line)}
:root[data-theme] :is(.col-time,.col-line,.row-mobile-meta,.order-row .row-mobile-meta,.order-identity>span,.order-copy-bar,.execution-egress,.execution-summary .order-reference,.execution-summary .order-timing,.order-execution){color:var(--muted)}
:root[data-theme] :is(.col-person:before,.col-card:before,.order-row .col-person:before,.order-row .col-card:before){color:var(--subtle)}
:root[data-theme] :is(.copy-value small,.order-row .copy-value small,.order-copy-bar .copy-value small){color:var(--accent);opacity:1}
:root[data-theme] :is(.copy-value:hover,.copy-value.copied,.notice-field .copy-value small){background:var(--accent-bg);color:var(--accent)}
:root[data-theme] .copy-value.copied small{color:var(--accent)}
:root[data-theme] .match-result{color:var(--warning)}
:root[data-theme] .match-result.matched{background:var(--accent-bg);color:var(--accent)}
:root[data-theme] :is(.order-execution.success,.success-inbox){color:var(--accent)}
:root[data-theme] :is(.order-execution.recorded,.log-warn){color:var(--warning)}
:root[data-theme] :is(.order-execution.warning,.rule-feedback.error,.notice-error){color:var(--danger)}
:root[data-theme] .network-error{color:var(--danger)!important}
:root[data-theme] :is(.order-execution .link,.order-meta-actions .link,.log-line-details summary){color:var(--blue)}
:root[data-theme] .order-execution-log{background:var(--field);color:var(--muted);border-color:var(--line)}
:root[data-theme] :is(.order-execution-log h3,.execution-timeline strong,.order-execution-log summary){color:var(--text)}
:root[data-theme] .execution-timeline small{color:var(--muted)}
:root[data-theme] .empty{background:var(--surface-alt);border-color:var(--line)}
:root[data-theme] .empty svg{color:var(--accent)}
:root[data-theme] .log-output{background:var(--field);color:var(--text);scrollbar-color:var(--line) var(--field)}
:root[data-theme] .log-row{border-color:var(--line)}
:root[data-theme] .log-row time{color:var(--muted)}
:root[data-theme] :is(.log-origin,.log-empty){color:var(--accent)}
:root[data-theme] .log-row.error{color:var(--danger)}
:root[data-theme] .log-row.warning{color:var(--warning)}
:root[data-theme] .success-inbox.has-unread{background:var(--button);color:var(--on-button);border-color:var(--button)}
:root[data-theme] :is(.overview,.success-notice-amount){background:linear-gradient(125deg,var(--hero-a),var(--hero-b));color:var(--hero-text);border-color:var(--hero-border)}
:root[data-theme] :is(.overview-top h2,.overview .metrics span,.overview .collection-stats,.overview .request-heading,.overview .request-outcomes span,.overview .request-heartbeat,.overview .count-note,.overview .scan-health,.overview .scan-health button,.overview .request-heading #request-live,.overview .signal,.success-notice-amount>small,.success-notice-amount>span){color:var(--hero-muted)}
:root[data-theme] .overview.is-compact :is(.metrics span,.request-outcomes span,.count-note){color:var(--hero-muted)}
:root[data-theme] :is(.overview .metrics strong,.overview .request-outcomes strong){color:var(--hero-text)}
:root[data-theme] :is(.overview .request-total,.overview .metrics>div+div strong){color:var(--hero-accent)}
:root[data-theme] .overview .request-outcomes>div:nth-child(2) strong{color:#f2cfaf}
:root[data-theme] .overview .request-outcomes>div:nth-child(3) strong{color:var(--hero-muted)}
:root[data-theme] .overview :is(.scan-health,.request-metrics,.signal,.metrics>div+div){border-color:var(--hero-border)}
:root[data-theme] .signal{background:#00000012}
:root[data-theme] dialog::backdrop{background:var(--backdrop)}
:root[data-theme] dialog.funds-pad{background:var(--surface);color:var(--text);border-color:var(--line)}
:root[data-theme] :is(.pin-slot,.pin-keys button,.pin-keys .pin-utility){background:var(--surface-alt);color:var(--text);border-color:var(--line);box-shadow:none}
:root[data-theme] :is(.pin-slot.current,.pin-slot.filled){background:var(--accent-bg);border-color:var(--accent)}
:root[data-theme] .pin-slot.filled:after{background:var(--accent)}
:root[data-theme] .pin-head>button{color:var(--muted)}
:root[data-theme] :is(.pin-head>button,.pin-keys button):hover:not(:disabled){background:var(--hover)}
:root[data-theme] .pin-confirm:disabled{background:var(--surface-alt);color:var(--muted);border-color:var(--line)}
:root[data-theme] .pin-handle{background:var(--line)}
:root[data-theme] #toast{background:var(--button);color:var(--on-button);border:1px solid var(--accent-border)}
:root[data-theme] .skip{background:var(--button);color:var(--on-button)}
@media(max-width:760px){
  .title-row{align-items:flex-start}.title-row>div:first-child{min-width:0}.title-actions{padding-top:18px;gap:0}
  .theme-control{gap:6px;padding-inline:8px;font-size:11px}.theme-control>span{width:9px;height:9px}
  :root[data-theme] :is(.collection-control,.inline-rules,.rule-summary>div){background:var(--surface);border-color:var(--line)}
  :root[data-theme] .dock{background:var(--surface);border-color:var(--line);color:var(--muted)}
  :root[data-theme] .dock>button:not(.claim-btn):hover{background:var(--hover)}
  :root[data-theme] .notice-actions{background:var(--surface)}
}
@media(max-width:359px){.title-row h1{font-size:26px}.theme-control{padding-inline:6px}}
@media(prefers-reduced-motion:reduce){.theme-control,.order-list-item{transition:none}}
