/* Shared Bright Glass / Navy Studio treatment across all server-rendered pages. */
:root, :root[data-site-theme="bright"] {
  color-scheme: light;
  --site-ink: #112647; --site-muted: #586a83; --site-red: #cf1630;
  --site-panel: rgba(255,255,255,.78); --site-line: rgba(20,45,81,.13);
  --site-field: rgba(255,255,255,.82); --site-soft: #e8eef8;
  --site-shadow: 0 18px 55px rgba(17,38,71,.08), inset 0 1px rgba(255,255,255,.85);
}
:root[data-site-theme="cinematic"] {
  color-scheme: dark;
  --site-ink: #f6f8ff; --site-muted: #bdcbe0; --site-red: #eb3852;
  --site-panel: rgba(21,43,76,.78); --site-line: rgba(221,232,255,.18);
  --site-field: rgba(13,32,59,.84); --site-soft: #223954;
  --site-shadow: 0 18px 60px rgba(3,11,23,.35), inset 0 1px rgba(255,255,255,.1);
}
.site-theme-switch { display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--site-line); border-radius: 999px; background: var(--site-panel); flex-shrink: 0; }
.site-theme-switch button, .workbench .site-theme-switch button, .app-shell .site-theme-switch button { border: 0; border-radius: 999px; background: transparent; box-shadow: none; color: var(--site-muted); font: 650 11px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; padding: 8px 11px; width: auto; white-space: nowrap; cursor: pointer; }
.site-theme-switch button[aria-pressed="true"], .workbench .site-theme-switch button[aria-pressed="true"], .app-shell .site-theme-switch button[aria-pressed="true"] { background: var(--site-field); color: var(--site-ink); box-shadow: 0 2px 10px rgba(17,38,71,.1); }
.site-theme-switch button:focus-visible { outline: 2px solid var(--site-red); outline-offset: 2px; }
body.sponsor-entry .site-theme-switch { display: none; }

/* Workspace pages: the same materials as the discovery screen. */
body.sponsor-studio {
  --ws-bg: #f4f7fc; --ws-surface: var(--site-panel); --ws-ink: var(--site-ink);
  --ws-muted: var(--site-muted); --ws-navy: #17345e; --ws-navy-deep: #112647;
  --ws-navy-soft: var(--site-soft); --ws-red: var(--site-red);
  --ws-line: var(--site-line); --ws-shadow: var(--site-shadow);
}
:root[data-site-theme="cinematic"] body.sponsor-studio {
  --ws-bg: #132744; --ws-surface: var(--site-panel); --ws-ink: var(--site-ink);
  --ws-muted: var(--site-muted); --ws-navy: #3c608e; --ws-navy-deep: #f6f8ff;
  --ws-navy-soft: var(--site-soft); --ws-red: var(--site-red);
  --ws-line: var(--site-line); --ws-shadow: var(--site-shadow);
  background: radial-gradient(ellipse at 80% 15%,#233e65,transparent 50%),radial-gradient(ellipse at 20% 90%,#331c37,transparent 45%),#0c1c33;
}
:root[data-site-theme="cinematic"] body.sponsor-studio .ws-topbar,
:root[data-site-theme="cinematic"] body.sponsor-studio .ws-sidebar { background: rgba(12,28,51,.76); }
body.sponsor-studio:not(.sponsor-entry) .ws-main { max-width: none; padding: 30px clamp(24px,3.5vw,54px) 55px; }
body.sponsor-studio:not(.sponsor-entry) .ws-main > h1,
body.sponsor-studio:not(.sponsor-entry) .ws-demo-guide h1 { font-size: clamp(31px,3vw,44px); line-height: 1.1; letter-spacing: -.055em; margin: 7px 0 12px; }
body.sponsor-studio .ws-card, body.sponsor-studio .ws-scout-card,
body.sponsor-studio .ws-demo-brand, body.sponsor-studio .ws-demo-path-grid > div,
body.sponsor-studio .ws-demo-pdf, body.sponsor-studio .ws-message,
body.sponsor-studio .ws-demo-stage-nav button, body.sponsor-studio .ws-approval-card {
  background: var(--site-panel); color: var(--site-ink); border: 1px solid var(--site-line);
  border-radius: 20px; box-shadow: var(--site-shadow); backdrop-filter: blur(20px);
}
body.sponsor-studio .ws-card { padding: clamp(22px,2.5vw,32px); }
body.sponsor-studio .ws-card h2, body.sponsor-studio .ws-section-title,
body.sponsor-studio .ws-stat .value, body.sponsor-studio .ws-scout-card h3 { color: var(--site-ink); }
body.sponsor-studio .ws-scout-metrics div, body.sponsor-studio .ws-demo-account,
body.sponsor-studio .ws-demo-email, body.sponsor-studio .ws-message-user,
body.sponsor-studio .ws-chat .ws-conversation-tabs [aria-selected="true"] { background: var(--site-soft); color: var(--site-ink); }
body.sponsor-studio .ws-scout-card.selected { border-color: var(--site-red); box-shadow: inset 0 3px var(--site-red),var(--site-shadow); }
body.sponsor-studio .ws-scout-state, body.sponsor-studio .ws-scout-total,
body.sponsor-studio .ws-demo-path-number { color: var(--site-ink); }
body.sponsor-studio .ws-form-grid input, body.sponsor-studio .ws-form-grid textarea,
body.sponsor-studio .ws-form-grid select, body.sponsor-studio .ws-ask-form textarea,
body.sponsor-studio .ws-demo-guide textarea, body.sponsor-studio .ws-demo-path-grid input,
body.sponsor-studio .ws-chat .ws-field select { background: var(--site-field); color: var(--site-ink); border: 1px solid var(--site-line); border-radius: 12px; }
body.sponsor-studio a.ws-button, body.sponsor-studio button.ws-button,
body.sponsor-studio .ws-chat .ws-ask-form button[type="submit"] { background: var(--site-red); border-color: var(--site-red); color: #fff; border-radius: 11px; }
body.sponsor-studio a.ws-button.secondary, body.sponsor-studio button.ws-button.secondary { background: var(--site-field); color: var(--site-ink); border-color: var(--site-line); }
body.sponsor-studio .ws-demo-stage-nav button[aria-selected="true"] { background: var(--site-red); color: #fff; }
body.sponsor-studio .ws-demo-brand-head span, body.sponsor-studio .ws-demo-path-grid p,
body.sponsor-studio .ws-note { color: var(--site-muted); }
body.sponsor-studio .ws-demo-guide blockquote { background: var(--site-soft); border-radius: 0 14px 14px 0; }
body.sponsor-studio .ws-demo-drafts > details { padding: 13px 16px; background: var(--site-panel); border: 1px solid var(--site-line); border-radius: 13px; }
body.sponsor-studio .ws-demo-drafts > details summary { font-size: 14px; }
/* Guided desktop journey: each tool and decision has one clear next action. */
body.sponsor-studio .ws-guide-hero { position: relative; overflow: hidden; padding: clamp(32px,4vw,62px); border: 1px solid var(--site-line); border-radius: 26px; background: linear-gradient(115deg,var(--site-panel),var(--site-field)); box-shadow: var(--site-shadow); backdrop-filter: blur(24px); }
body.sponsor-studio .ws-guide-hero::after { content: "85"; position: absolute; right: 2%; bottom: -42%; font-size: clamp(170px,22vw,350px); font-weight: 900; letter-spacing: -.13em; line-height: 1; color: var(--site-ink); opacity: .055; pointer-events: none; }
body.sponsor-studio .ws-guide-hero > * { position: relative; z-index: 1; }
body.sponsor-studio .ws-guide-hero h1 { max-width: 800px; font-size: clamp(43px,5.2vw,78px); line-height: 1.02; letter-spacing: -.065em; margin: 15px 0 19px; }
body.sponsor-studio .ws-guide-hero p:not(.ws-guide-eyebrow) { max-width: 680px; color: var(--site-muted); font-size: 17px; line-height: 1.65; }
body.sponsor-studio .ws-guide-hero .ws-actions { margin-top: 27px; }
body.sponsor-studio .ws-guide-eyebrow { color: var(--site-red); font-size: 11px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
body.sponsor-studio .ws-guide-map { margin: 33px 0; }
body.sponsor-studio .ws-guide-map-heading { margin-bottom: 17px; }
body.sponsor-studio .ws-guide-map h2 { font-size: clamp(25px,2.4vw,34px); letter-spacing: -.045em; }
body.sponsor-studio .ws-guide-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }
body.sponsor-studio .ws-guide-card { display: flex; flex-direction: column; min-height: 235px; padding: 23px; border: 1px solid var(--site-line); border-radius: 19px; background: var(--site-panel); box-shadow: var(--site-shadow); backdrop-filter: blur(20px); }
body.sponsor-studio .ws-guide-card > span { color: var(--site-red); font-size: 12px; font-weight: 850; letter-spacing: .1em; }
body.sponsor-studio .ws-guide-card h3 { margin: 18px 0 9px; color: var(--site-ink); font-size: 19px; letter-spacing: -.035em; }
body.sponsor-studio .ws-guide-card p { color: var(--site-muted); line-height: 1.55; font-size: 13px; }
body.sponsor-studio .ws-guide-card a { display: inline-flex; margin: auto 13px 0 0; padding-top: 15px; color: var(--site-ink); font-size: 12px; font-weight: 800; text-decoration: none; }
body.sponsor-studio .ws-guide-card a:hover { color: var(--site-red); }
body.sponsor-studio .ws-main a:not(.ws-button):not(.ws-demo-account) { color: var(--site-ink); text-decoration-color: var(--site-red); text-underline-offset: 3px; }
body.sponsor-studio .ws-main a:not(.ws-button):not(.ws-demo-account):hover { color: var(--site-red); }
body.sponsor-studio .ws-guide-journey ol { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; padding-left: 0; list-style: none; counter-reset: journey; }
body.sponsor-studio .ws-guide-journey li { counter-increment: journey; padding: 16px; border-radius: 13px; background: var(--site-soft); font-size: 13px; line-height: 1.5; }
body.sponsor-studio .ws-guide-journey li::before { content: counter(journey,decimal-leading-zero); display: block; margin-bottom: 9px; color: var(--site-red); font-size: 12px; font-weight: 800; }
body.sponsor-studio .ws-howto { margin: 0 0 20px; border-left: 4px solid var(--site-red); }
body.sponsor-studio .ws-howto p { max-width: 780px; line-height: 1.55; }
body.sponsor-studio .ws-howto-action { padding: 11px 15px; border-radius: 11px; background: var(--site-soft); color: var(--site-ink); font-weight: 650; }
body.sponsor-studio .ws-guide-results { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding: 0; list-style: none; }
body.sponsor-studio .ws-guide-results li { padding: 18px; border: 1px solid var(--site-line); border-radius: 14px; background: var(--site-soft); line-height: 2; }
body.sponsor-studio .ws-guide-results strong { display: block; font-size: 17px; }
body.sponsor-studio .ws-guide-result-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
body.sponsor-studio .ws-guide-result-links a { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 9px; border: 1px solid var(--site-line); border-radius: 999px; background: var(--site-field); color: var(--site-ink); font-size: 11px; font-weight: 750; text-decoration: none; }
body.sponsor-studio .ws-guide-result-links a:hover { border-color: var(--site-red); color: var(--site-red); }
body.sponsor-studio .ws-demo-draft-form { display: grid; gap: 13px; padding: 17px 3px 5px; }
body.sponsor-studio .ws-demo-draft-form label { display: grid; gap: 7px; color: var(--site-ink); font-size: 12px; font-weight: 750; }
body.sponsor-studio .ws-demo-draft-form input, body.sponsor-studio .ws-demo-draft-form textarea { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--site-line); border-radius: 10px; background: var(--site-field); color: var(--site-ink); font-family: inherit; font-size: 14px; line-height: 1.5; }
body.sponsor-studio .ws-draft-status { margin: 0; color: var(--site-muted); font-size: 12px; }
body.sponsor-studio a.ws-button, body.sponsor-studio button.ws-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; box-shadow: 0 5px 15px rgba(160,16,38,.12); transition: transform .16s,box-shadow .16s,background .16s; }
body.sponsor-studio a.ws-button:hover, body.sponsor-studio button.ws-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(160,16,38,.2); }
body.sponsor-studio a.ws-button:focus-visible, body.sponsor-studio button.ws-button:focus-visible { outline: 3px solid var(--site-ink); outline-offset: 3px; }
body.sponsor-studio button.ws-button:disabled { opacity: .55; box-shadow: none; cursor: not-allowed; }
@media (max-width: 1150px) { body.sponsor-studio .ws-guide-grid, body.sponsor-studio .ws-guide-journey ol { grid-template-columns: repeat(2,minmax(0,1fr)); } }
:root[data-site-theme="cinematic"] body.sponsor-studio .ws-scout-archive { color: #f6dfa4; background: #56451b; }
:root[data-site-theme="cinematic"] body.sponsor-studio .ws-scout-reason { color: #f3b997; }
:root[data-site-theme="cinematic"] body.sponsor-studio summary,
:root[data-site-theme="cinematic"] body.sponsor-studio .ws-main a:not(.ws-button):not(.ws-demo-account) { color: #d3e7ff; }
:root[data-site-theme="cinematic"] body.sponsor-studio .ws-main a:visited:not(.ws-button):not(.ws-demo-account) { color: #d9cbff; }

/* Workbench uses its existing data and forms with the same glass surfaces. */
body.workbench { background: radial-gradient(ellipse at 82% 10%,#dce8fa,transparent 43%),radial-gradient(ellipse at 18% 76%,#ffe1e7,transparent 41%),#f7f9fc; color: var(--site-ink); }
:root[data-site-theme="cinematic"] body.workbench { background: radial-gradient(ellipse at 82% 10%,#233e65,transparent 45%),#0c1c33; }
.workbench .wb-header { background: var(--site-panel); border-bottom: 1px solid var(--site-line); backdrop-filter: blur(22px); box-shadow: 0 4px 25px rgba(17,38,71,.06); }
.workbench .wb-header a, .workbench .wb-header a.brand, .workbench .wb-header .who { color: var(--site-ink); }
.workbench .wb-header a.brand { font-weight: 800; }
.workbench .wb-header a.brand { display: inline-flex; align-items: center; gap: 9px; line-height: 1.05; }
.workbench .site-brand-mark { display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: var(--site-red); color: #fff; font-size: 17px; letter-spacing: -.06em; }
.workbench .wb-header a.brand small { display: block; margin-top: 4px; font-size: 7px; letter-spacing: .16em; color: var(--site-muted); }
.workbench .wb-header a:hover { color: var(--site-red); }
.workbench main { max-width: 1500px; padding: 28px clamp(22px,3vw,48px); gap: 22px; }
.workbench main h1 { font-size: clamp(30px,3vw,43px); letter-spacing: -.05em; }
.workbench .card, .workbench details.stage, .workbench .wb-preview-package,
.workbench #test-send-preview, .workbench .recipient-preview,
.workbench .table-wrap, .workbench .wb-opportunities tr {
  background: var(--site-panel); color: var(--site-ink); border: 1px solid var(--site-line);
  border-radius: 19px; box-shadow: var(--site-shadow); backdrop-filter: blur(20px);
}
.workbench .card { padding: clamp(20px,2vw,30px); }
.workbench .muted, .workbench .empty, .workbench label, .workbench th,
.workbench .filters, .workbench .who { color: var(--site-muted); }
.workbench input, .workbench textarea, .workbench select { background: var(--site-field); color: var(--site-ink); border: 1px solid var(--site-line); border-radius: 10px; }
.workbench button:not(.secondary):not(.danger):not([data-site-theme]) { background: var(--site-red); color: #fff; }
.workbench button.secondary { background: var(--site-soft); color: var(--site-ink); }
.workbench a, .workbench details.stage pre, .workbench #control-confirm pre { color: var(--site-ink); }
.workbench .badge { border: 1px solid var(--site-line); }
.workbench .recipient-preview pre { color: var(--site-ink) !important; }
.workbench .recipient-preview .muted { color: var(--site-muted); }
.workbench code { background: var(--site-soft); color: var(--site-ink); }
.workbench .wb-preview-banner { background: var(--site-panel); color: var(--site-muted); border-bottom-color: var(--site-line); }
.workbench .wb-opportunities tr:target { outline: 2px solid var(--site-red); }

/* Console: keep every operator control, change only its palette and surfaces. */
:root[data-site-theme="bright"] body:has(.app-shell) { --bg:#f7f9fc; --panel:rgba(255,255,255,.8); --panel-2:#f0f5fb; --panel-3:#e5edf8; --line:rgba(20,45,81,.14); --muted:#586a83; --text:#112647; --green:#cf1630; --green-dark:#fce8ec; --amber:#ac6920; --red:#c9263b; --blue:#244e82; }
:root[data-site-theme="cinematic"] body:has(.app-shell) { --bg:#0c1c33; --panel:rgba(21,43,76,.85); --panel-2:#1a3356; --panel-3:#244169; --line:rgba(221,232,255,.18); --muted:#bdcbe0; --text:#f6f8ff; --green:#eb3852; --green-dark:#401e36; --amber:#e9b45f; --red:#ef7c79; --blue:#a1c9ff; }
body:has(.app-shell) { color: var(--text); background: var(--bg); }
body:has(.app-shell) .app-shell { background: radial-gradient(ellipse at 80% 10%,rgba(208,224,247,.45),transparent 47%),var(--bg); }
:root[data-site-theme="cinematic"] body:has(.app-shell) .app-shell { background: radial-gradient(ellipse at 80% 10%,#233e65,transparent 47%),var(--bg); }
body:has(.app-shell) .rail, body:has(.app-shell) .activity, body:has(.app-shell) .workspace { background: var(--panel); backdrop-filter: blur(20px); }
body:has(.app-shell) .brand-mark, body:has(.app-shell) .welcome-mark,
body:has(.app-shell) .send-button, body:has(.app-shell) .approval-actions .approve { background: var(--site-red); color: #fff; }
body:has(.app-shell) .composer-box, body:has(.app-shell) .prompt-grid button,
body:has(.app-shell) .new-thread, body:has(.app-shell) .message.user .bubble,
body:has(.app-shell) .approval-card { border-radius: 15px; border: 1px solid var(--site-line); background: var(--site-panel); box-shadow: var(--site-shadow); }
body:has(.app-shell) .topbar, body:has(.app-shell) .activity { border-color: var(--site-line); }
body:has(.app-shell) .approval-card pre { color: var(--site-ink); }
body:has(.app-shell) .composer { background: linear-gradient(to top,var(--bg) 72%,transparent); }
body:has(.app-shell) .composer textarea::placeholder { color: var(--site-muted); }
body:has(.app-shell) .activity-toggle b, body:has(.app-shell) .message.assistant .message-mark { color: var(--site-red); background: var(--site-soft); }
body:has(.app-shell) .status-dot:not(.warn):not(.fail) { background: #2faf68; box-shadow: 0 0 0 3px rgba(47,175,104,.12); }
body:has(.app-shell) .state-pill.complete { color: #268955; border-color: #66b783; }
body:has(.app-shell) .site-theme-switch { margin-right: 7px; }

body.login-page { background: radial-gradient(ellipse at 80% 15%,#dce8fa,transparent 43%),#f7f9fc; color: var(--site-ink); }
:root[data-site-theme="cinematic"] body.login-page { background: radial-gradient(ellipse at 80% 15%,#233e65,transparent 45%),#0c1c33; }
body.login-page form { background: var(--site-panel); color: var(--site-ink); border: 1px solid var(--site-line); box-shadow: var(--site-shadow); backdrop-filter: blur(20px); border-radius: 22px; }
body.login-page .sub, body.login-page label { color: var(--site-muted); }
body.login-page input { background: var(--site-field); color: var(--site-ink); border-color: var(--site-line); }
body.login-page button[type="submit"] { background: var(--site-red); }
body.login-page .error { color: var(--site-red); }
body.login-page .site-theme-switch { margin-top: 6px; }

@media (prefers-reduced-transparency: reduce) {
  .workbench .card, body.sponsor-studio .ws-card, body:has(.app-shell) .rail { backdrop-filter: none; }
}
