@property --beam-angle { syntax:"<angle>"; initial-value:0deg; inherits:false; }

:root {
  color-scheme:dark;
  --bg:#050706; --surface:#0b0f0d; --surface-soft:#111713; --sidebar:#080b09;
  --line:#1e2a22; --line-strong:#304137; --text:#f4f7f5; --muted:#9aa69e; --muted-soft:#758078;
  --accent:#2ee66b; --accent-hover:#52f083; --accent-soft:rgba(46,230,107,.09); --accent-ink:#5bf38c;
  --warning:#f4b740; --danger:#ff5a64; --danger-soft:rgba(255,90,100,.1);
  --shadow:0 12px 30px rgba(0,0,0,.28); --shadow-hover:0 18px 46px rgba(0,0,0,.42),0 0 0 1px rgba(46,230,107,.08);
  --ease:cubic-bezier(.2,.8,.2,1); font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

* { box-sizing:border-box; }
html { background:var(--bg); }
body { margin:0; min-height:100vh; color:var(--text); background:var(--bg); font-size:14px; line-height:1.5; letter-spacing:0; -webkit-font-smoothing:antialiased; }
.skip-link { position:fixed; top:10px; left:10px; z-index:100; padding:10px 12px; color:#041108; background:var(--accent); border-radius:8px; font-weight:800; transform:translateY(-160%); transition:transform .18s var(--ease); }
.skip-link:focus { transform:translateY(0); }
::selection { color:#031006; background:rgba(46,230,107,.88); }
button,input,select,textarea { font:inherit; }
button { border:0; cursor:pointer; }
button { white-space:nowrap; }
button:disabled { cursor:not-allowed; opacity:.55; }
.hidden { display:none!important; }
input,select,textarea { width:100%; padding:11px 12px; color:var(--text); background:var(--surface); border:1px solid var(--line-strong); border-radius:8px; outline:none; transition:border-color .2s var(--ease),box-shadow .2s var(--ease),background .2s var(--ease); }
input:hover,select:hover,textarea:hover { border-color:#496052; }
input:focus,select:focus,textarea:focus,button:focus-visible { border-color:var(--accent); outline:3px solid rgba(46,230,107,.14); outline-offset:1px; }
textarea { resize:vertical; }

.sidebar { position:fixed; inset:0 auto 0 0; z-index:10; width:256px; display:flex; flex-direction:column; background:var(--sidebar); border-right:1px solid var(--line); }
.brand { height:68px; display:flex; align-items:center; gap:11px; padding:0 20px; border-bottom:1px solid var(--line); }
.brand strong { font-size:1.18rem; font-weight:800; letter-spacing:0; }
.brand-mark { width:32px; height:32px; display:grid; place-items:center; color:var(--accent); background:var(--accent-soft); border:1px solid #245a35; border-radius:9px; box-shadow:0 0 18px rgba(46,230,107,.08); }
.brand-mark svg { width:20px; height:20px; stroke-width:2.35; }
.sidebar-icon { margin-left:auto; width:32px; height:32px; display:grid; place-items:center; color:var(--muted); background:transparent; border:1px solid transparent; border-radius:8px; }
.sidebar-icon:hover { color:var(--text); background:var(--surface-soft); border-color:var(--line); }
.sidebar-icon svg { width:17px; height:17px; }
.sidebar nav { display:grid; gap:4px; padding:20px 12px; }
.nav-item,.footer-action { position:relative; min-height:44px; display:flex; align-items:center; gap:12px; padding:0 13px; color:var(--muted); background:transparent; border-radius:8px; text-align:left; font-weight:650; transition:color .18s var(--ease),background .18s var(--ease),transform .18s var(--ease); }
.nav-item svg,.footer-action svg { width:19px; height:19px; flex:0 0 19px; stroke-width:1.9; }
.nav-item:hover,.footer-action:hover { color:var(--text); background:var(--surface-soft); }
.nav-item:active,.footer-action:active { transform:scale(.985); }
.nav-item.active { color:var(--accent-ink); background:var(--accent-soft); }
.nav-item.active::before { content:""; position:absolute; inset-block:10px; inset-inline-start:-12px; width:3px; background:var(--accent); border-radius:0 4px 4px 0; box-shadow:0 0 14px rgba(46,230,107,.48); }
.sidebar-footer { margin-top:auto; display:grid; gap:2px; padding:14px 12px 16px; border-top:1px solid var(--line); }
.plan-state { margin-bottom:7px; padding:9px 12px; color:var(--accent-ink); background:var(--accent-soft); border:1px solid #245a35; border-radius:8px; font-size:.68rem; font-weight:800; letter-spacing:0; text-align:center; }
.footer-action { width:100%; min-height:38px; font-size:.88rem; }

.shell { width:calc(100% - 256px); min-height:100vh; margin-left:256px; padding:32px 42px 60px; }
body.sidebar-collapsed .sidebar { width:76px; }
body.sidebar-collapsed .shell { width:calc(100% - 76px); margin-left:76px; }
body.sidebar-collapsed .brand { padding:0 22px; }
body.sidebar-collapsed .brand strong,body.sidebar-collapsed .nav-item span,body.sidebar-collapsed .footer-action span,body.sidebar-collapsed .plan-state,body.sidebar-collapsed .sidebar-icon { display:none; }
body.sidebar-collapsed .nav-item,body.sidebar-collapsed .footer-action { justify-content:center; padding:0; }

h1,h2,h3,p { margin:0; }
h1,h2,h3 { letter-spacing:0; text-wrap:balance; font-weight:600; line-height:1.4; }
h2 { font-size:18px; }
h3 { font-size:16px; }
strong,b { font-weight:600; }
.topbar { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; max-width:1400px; margin:0 auto 22px; padding-bottom:24px; border-bottom:1px solid var(--line); }
.topbar h1 { font-size:24px; line-height:1.35; font-weight:600; }
.title-line { display:flex; align-items:center; gap:10px; }
.environment-badge { padding:5px 8px; color:var(--accent-ink); background:var(--accent-soft); border:1px solid #245a35; border-radius:999px; font-size:.68rem; font-weight:800; text-transform:uppercase; }
.topbar p { max-width:680px; margin-top:7px; color:var(--muted); line-height:1.55; }
.top-actions,.chip-actions,.queue-actions,.status-row { display:flex; align-items:center; gap:9px; }
.primary,.ghost,.danger,.mini { min-height:40px; padding:0 15px; border-radius:8px; font-weight:750; transition:transform .18s var(--ease),background .18s var(--ease),border-color .18s var(--ease),box-shadow .18s var(--ease); }
.primary { color:#041108; background:var(--accent); box-shadow:0 8px 22px rgba(46,230,107,.18); }
.primary:hover { background:var(--accent-hover); box-shadow:0 10px 28px rgba(46,230,107,.26); transform:translateY(-1px); }
.ghost,.mini { color:var(--text); background:var(--surface); border:1px solid var(--line-strong); }
.ghost:hover,.mini:hover { background:var(--surface-soft); border-color:#496052; }
.danger { color:#fff; background:var(--danger); }
.primary:active,.ghost:active,.danger:active,.mini:active { transform:translateY(0) scale(.985); }
.mini { min-height:32px; padding:0 10px; font-size:.8rem; }
.danger-text { color:var(--danger); }

.metrics { max-width:1400px; margin:0 auto 22px; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.metric,.panel,.chip-card,.queue-item { background:var(--surface); border:1px solid var(--line); border-radius:8px; }
.metric,.chip-card,.feature-card { position:relative; isolation:isolate; }
.metric::before,.chip-card::before,.feature-card::before,.panel:focus-within::before { content:""; position:absolute; inset:-1px; z-index:2; border-radius:inherit; padding:1px; pointer-events:none; background:conic-gradient(from var(--beam-angle),transparent 0turn,transparent .68turn,rgba(46,230,107,.96) .80turn,rgba(126,255,165,.54) .87turn,transparent .96turn,transparent 1turn); -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; animation:borderBeam 8s linear infinite; }
.metric:nth-child(2)::before { animation-delay:-1.6s; }.metric:nth-child(3)::before { animation-delay:-3.2s; }.metric:nth-child(4)::before { animation-delay:-4.8s; }.metric:nth-child(5)::before { animation-delay:-6.4s; }
.chip-card:nth-child(even)::before,.feature-card:nth-child(even)::before { animation-delay:-4s; }
@keyframes borderBeam { to { --beam-angle:360deg; } }
.metric { min-width:0; padding:17px 18px; transition:transform .24s var(--ease),box-shadow .24s var(--ease),border-color .24s var(--ease); }
.metric:hover,.chip-card:hover,.feature-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-hover); border-color:#3c5e47; }
.metric strong { display:block; margin-bottom:5px; font-size:1.62rem; line-height:1; font-weight:750; font-variant-numeric:tabular-nums; }
.metric span,.muted,label,.section-head span { color:var(--muted); }

.view { display:none; max-width:1400px; margin:0 auto; }
.view.active { display:block; animation:viewIn .38s var(--ease); }
@keyframes viewIn { from { opacity:.25; transform:translateY(8px); filter:blur(2px); } to { opacity:1; transform:none; filter:none; } }
.app-only.hidden { display:none !important; }
.split { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(330px,.72fr); gap:20px; align-items:start; }
.split > *,.stack > * { min-width:0; }
.onboarding-panel { margin-bottom:14px; }
.checklist { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.checklist-item { min-height:44px; display:flex; align-items:center; gap:9px; padding:9px 11px; color:var(--muted); background:var(--surface-soft); border:1px solid var(--line); border-radius:8px; text-align:left; white-space:normal; }
.checklist-item svg { width:17px; height:17px; flex:0 0 17px; }
.checklist-item.done { color:var(--accent-ink); border-color:#245a35; background:var(--accent-soft); }
.bulk-bar { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-bottom:16px; padding:11px 14px; }
.bulk-bar .check { margin-right:auto; color:var(--text); font-weight:700; }
.activity-panel { margin-bottom:20px; }
.activity-chart { height:150px; display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:9px; }
.activity-day { min-width:0; display:grid; grid-template-rows:1fr auto auto; gap:4px; text-align:center; color:var(--muted); }
.activity-day .bars { min-height:90px; display:flex; align-items:flex-end; justify-content:center; gap:4px; padding:8px 4px; background:var(--surface-soft); border:1px solid var(--line); border-radius:8px; }
.bar { width:min(16px,38%); height:100%; border-radius:3px 3px 1px 1px; background:var(--accent); transform:scaleY(var(--height)); transform-origin:center bottom; transition:transform .35s var(--ease); }
.bar.received { background:#f4b740; }
.activity-day strong { color:var(--text); font-size:.74rem; text-transform:capitalize; }
.activity-day small { font-size:.68rem; }
.activity-legend { display:flex; align-items:center; gap:7px; font-size:.74rem; }
.activity-legend i { width:8px; height:8px; border-radius:2px; background:var(--accent); }
.activity-legend .received-key { margin-left:4px; background:var(--warning); }
.section-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; margin-bottom:15px; }
.section-head h2 { font-size:1.22rem; }
.section-head.subhead { margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
.section-head.subhead h2 { font-size:1rem; }
.chip-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(330px,1fr)); gap:14px; }
.chip-card,.panel { padding:18px; }
.chip-card,.feature-card,.panel { transition:transform .24s var(--ease),box-shadow .24s var(--ease),border-color .24s var(--ease); }
.panel { position:relative; }
.status-row { justify-content:space-between; margin-bottom:14px; }
.chip-title { display:flex; align-items:flex-start; gap:10px; min-width:0; }
.chip-title>input { width:auto; margin-top:4px; accent-color:var(--accent); }
.runtime-line { display:flex; align-items:center; gap:7px; margin:-4px 0 12px; color:var(--muted); font-size:.74rem; }
.runtime-dot { width:7px; height:7px; flex:0 0 7px; border-radius:50%; background:var(--warning); box-shadow:0 0 10px rgba(244,183,64,.25); }
.runtime-dot.online { background:var(--accent); box-shadow:0 0 10px rgba(46,230,107,.5); }
.badge { display:inline-flex; min-height:26px; align-items:center; padding:0 9px; border-radius:999px; color:var(--muted); background:var(--surface-soft); border:1px solid var(--line); font-size:.69rem; font-weight:800; letter-spacing:0; }
.badge.CONNECTED,.badge.SENT,.badge.ACTIVE,.badge.COMPLETED { color:#68f696; background:rgba(46,230,107,.1); border-color:#245a35; }
.badge.QR,.badge.AUTHENTICATED,.badge.BOOTING { color:#ffd06b; background:rgba(244,183,64,.1); border-color:#5a4723; }
.badge.FAILED,.badge.ERROR,.badge.AUTH_FAILED { color:#ff8b92; background:var(--danger-soft); border-color:#5d282d; }
.badge.REVIEW { color:var(--accent-ink); background:var(--accent-soft); border-color:#245a35; }
.chip-meta { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:14px 0; }
.chip-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; align-items:stretch; }
.chip-actions .connect-action { grid-column:1/-1; }
.chip-actions button { width:100%; min-width:0; min-height:42px; display:flex; align-items:center; justify-content:center; gap:8px; padding-inline:10px; overflow:hidden; }
.chip-actions button svg { width:17px; height:17px; flex:0 0 17px; }
.chip-actions button span { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.chip-meta div { padding:10px; border:1px solid var(--line); border-radius:8px; background:var(--surface-soft); }
.chip-meta strong,.chip-meta span { display:block; }
.chip-meta span { margin-top:2px; color:var(--muted); font-size:.73rem; }
.phase-progress { height:5px; margin:2px 0 7px; overflow:hidden; background:#162019; border-radius:999px; }
.phase-progress span { display:block; width:100%; height:100%; background:var(--accent); border-radius:inherit; transform:scaleX(var(--progress)); transform-origin:left center; transition:transform .35s var(--ease); }
.phase-caption { display:block; margin-bottom:14px; color:var(--muted); font-size:.74rem; font-variant-numeric:tabular-nums; }
.modes { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-bottom:14px; }
.check { display:flex; align-items:center; gap:8px; }
.check input { width:auto; accent-color:var(--accent); }
.advanced { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
.advanced summary { color:var(--muted); cursor:pointer; font-weight:700; }
.advanced summary:hover { color:var(--text); }
.advanced-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.advanced-grid label { display:grid; gap:5px; font-size:.8rem; }
.proxy-control { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:8px; padding:11px; background:var(--surface-soft); border:1px solid var(--line); border-radius:8px; }
.proxy-control>div { display:grid; gap:2px; min-width:0; }
.proxy-control>div strong { font-size:.82rem; }
.proxy-control>div span,.proxy-control>small { color:var(--muted); font-size:.72rem; overflow-wrap:anywhere; }
.proxy-control>small { grid-column:1/-1; color:#ff9aa0; }
.proxy-control.ready { border-color:#245a35; background:var(--accent-soft); }
.proxy-control.blocked { border-color:#5d282d; background:var(--danger-soft); }
.proxy-control button { min-width:0; display:flex; align-items:center; justify-content:center; gap:7px; }
.proxy-control button svg { width:16px; height:16px; flex:0 0 16px; }
.stack,.form,.queue-list,.message-list,.event-list,.table { display:grid; gap:11px; }
.form label { display:grid; gap:7px; font-weight:650; }
.form label.check { display:flex; align-items:center; gap:9px; min-height:28px; }
.form h2 { margin-bottom:3px; }
.event-list,.queue-list,.message-list,.table { max-height:650px; overflow:auto; padding-right:3px; scrollbar-color:var(--line-strong) transparent; scrollbar-width:thin; }
.event,.row { padding:11px; border:1px solid var(--line); border-radius:8px; background:var(--surface-soft); }
.row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.row-actions { display:flex; align-items:center; gap:8px; flex:0 0 auto; }
.compact-check { color:var(--text); font-size:.78rem; font-weight:700; white-space:nowrap; }
.event time,.row small,.queue-item small { display:block; margin-top:4px; color:var(--muted); }
.queue-item { display:grid; gap:10px; padding:13px; }
.type-label { margin:0!important; color:var(--accent-ink)!important; font-weight:750; text-transform:uppercase; letter-spacing:0; }
.conversation-turn { margin:0!important; color:var(--warning)!important; font-weight:700; }
.queue-body { color:var(--text); line-height:1.5; white-space:pre-wrap; }
.queue-route { color:var(--text) !important; font-weight:700; overflow-wrap:anywhere; }
.message-list { max-height:390px; }
.message-row { display:grid; gap:8px; padding:12px; border:1px solid var(--line); border-radius:8px; background:var(--surface-soft); }
.message-row.outbound { background:var(--accent-soft); border-color:#245a35; }
.message-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; }
.message-meta span,.message-row time { color:var(--muted); font-size:.76rem; overflow-wrap:anywhere; }
.message-row p { line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
.compact-select { width:auto; min-width:170px; padding:7px 9px; }
.compact-search { width:min(230px,45vw); padding:7px 9px; }
.filter-row { display:flex; flex-wrap:wrap; min-width:0; max-width:100%; align-items:center; justify-content:flex-end; gap:8px; }
.empty-state { padding:18px; color:var(--muted); border:1px dashed var(--line-strong); border-radius:8px; line-height:1.5; }
.file-output { display:block; min-height:42px; padding:10px 12px; color:var(--muted); background:var(--surface-soft); border:1px solid var(--line); border-radius:8px; overflow-wrap:anywhere; }
.icon-button { width:44px; height:44px; flex:0 0 44px; display:grid; place-items:center; color:var(--muted); background:transparent; border:1px solid var(--line); border-radius:8px; }
.icon-button:hover { color:#ff8b92; background:var(--danger-soft); border-color:#73343a; }
.output-panel { display:grid; gap:12px; }
.capability-strip { display:flex; flex-wrap:wrap; gap:7px; padding-top:4px; }
.capability { padding:6px 9px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:var(--surface-soft); font-size:.72rem; font-weight:750; }
.capability.ready { color:#68f696; background:rgba(46,230,107,.1); border-color:#245a35; }
.capability.pending { color:#ffd06b; background:rgba(244,183,64,.1); border-color:#5a4723; }
.settings-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; align-items:start; }
.integration-block { display:grid; gap:10px; padding:16px 0; border-top:1px solid var(--line); }
.integration-block:first-of-type { padding-top:5px; border-top:0; }
.integration-block .section-head { margin-bottom:0; }
.integration-block .section-head h3 { font-size:.98rem; }
.restore-form { margin-top:8px; padding-top:15px; border-top:1px solid var(--line); }
.diagnostic-dialog { width:min(560px,calc(100vw - 28px)); }
.diagnostic-summary { display:grid; gap:16px; margin-top:20px; }
.diagnostic-summary p { color:var(--muted); line-height:1.6; }
.diagnostic-summary dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin:0; }
.diagnostic-summary dl div { padding:11px; background:var(--surface-soft); border:1px solid var(--line); border-radius:8px; }
.diagnostic-summary dt { color:var(--muted); font-size:.72rem; }
.diagnostic-summary dd { margin:4px 0 0; overflow-wrap:anywhere; font-weight:700; }
.conversation-row { border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--surface-soft); }
.conversation-row>.row { border:0; border-radius:0; }
.conversation-row small { max-width:580px; }
.conversation-preview { padding:0 11px 11px; color:var(--muted); }
.conversation-preview summary { cursor:pointer; font-size:.78rem; font-weight:700; }
.conversation-preview ol { display:grid; gap:7px; margin:10px 0 0; padding-left:21px; color:var(--text); font-size:.82rem; line-height:1.45; }
.inline-status { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.dialog-search { display:flex; align-items:center; gap:8px; margin-top:18px; padding:0 11px; background:var(--surface-soft); border:1px solid var(--line-strong); border-radius:8px; }
.dialog-search svg { width:18px; color:var(--muted); }
.dialog-search input { border:0; background:transparent; box-shadow:none; outline:0; }
.global-results { display:grid; gap:7px; max-height:440px; margin-top:12px; overflow:auto; }
.global-result { display:grid; gap:3px; padding:11px; color:var(--text); background:var(--surface-soft); border:1px solid var(--line); border-radius:8px; text-align:left; white-space:normal; }
.global-result:hover { border-color:#3c5e47; background:var(--accent-soft); }
.global-result small { color:var(--muted); overflow-wrap:anywhere; }
input[type="file"] { padding:8px; background:var(--surface-soft); }
input[type="file"]::file-selector-button { margin-right:10px; padding:7px 10px; color:var(--text); background:var(--surface); border:1px solid var(--line-strong); border-radius:7px; font-weight:700; cursor:pointer; }

.how-hero { max-width:850px; margin:42px auto 58px; text-align:center; }
.how-hero h1 { font-size:28px; line-height:1.35; letter-spacing:0; }
.how-hero h1::after { content:""; display:block; width:54px; height:4px; margin:20px auto 0; background:var(--accent); border-radius:999px; }
.how-hero p { max-width:760px; margin:18px auto 0; color:var(--muted); font-size:1.08rem; line-height:1.6; }
.how-section,.day-flow { max-width:1220px; margin:0 auto; }
.how-heading { margin-bottom:24px; }
.how-heading h2,.day-flow h2 { font-size:1.6rem; line-height:1.2; }
.how-heading p,.day-flow p { margin-top:7px; color:var(--muted); }
.feature-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.feature-card { min-height:225px; display:grid; grid-template-columns:24px 1fr; align-content:start; gap:14px; padding:24px; border:1px solid var(--line); border-radius:10px; background:var(--surface); }
.feature-card>svg { width:22px; height:22px; color:var(--accent); stroke-width:2; }
.feature-card h3 { font-size:1.08rem; line-height:1.3; }
.feature-card p { margin-top:24px; color:var(--muted); line-height:1.58; }
.warning-feature>svg { color:var(--warning); }
.day-flow { margin-top:54px; padding:32px 0 10px; border-top:1px solid var(--line); }
.flow-steps { display:flex; align-items:center; gap:12px; margin-top:24px; }
.flow-steps span { display:flex; align-items:center; gap:9px; color:var(--muted); font-weight:650; }
.flow-steps b { width:28px; height:28px; display:grid; place-items:center; color:#041108; background:var(--accent); border-radius:50%; }
.flow-steps svg { width:18px; color:var(--line-strong); }

dialog { width:min(430px,calc(100vw - 28px)); padding:23px; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 28px 80px rgba(0,0,0,.58); }
dialog::backdrop { background:rgba(0,0,0,.68); backdrop-filter:blur(4px); }
.login-dialog { width:min(390px,calc(100vw - 28px)); }
.login-dialog .brand-mark { margin-bottom:4px; }
.icon-close { float:right; width:34px; height:34px; color:var(--text); background:var(--surface-soft); border:1px solid var(--line); border-radius:50%; }
.qr-box { min-height:320px; display:grid; place-items:center; margin:18px 0; padding:12px; background:#fff; color:#18211b; text-align:center; overflow-wrap:anywhere; border:1px solid var(--line); border-radius:8px; }
.qr-box img { width:min(300px,100%); height:auto; aspect-ratio:1; }
.toast { position:fixed; right:22px; bottom:22px; z-index:30; max-width:min(380px,calc(100vw - 44px)); padding:12px 16px; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:9px; box-shadow:0 18px 44px rgba(0,0,0,.46); opacity:0; transform:translateY(10px); pointer-events:none; transition:opacity 180ms ease,transform 180ms var(--ease); }
.toast.show { opacity:1; transform:translateY(0); }
.toast[data-tone="error"] { color:#ff9aa0; background:#241012; border-color:#682d32; }
.operation-summary { margin:12px 0; padding:12px 0; border-block:1px solid var(--line); overflow-wrap:anywhere; }
.operation-summary p,.operation-summary small { display:block; margin-top:5px; color:var(--muted); }
.operation-summary ul { margin:6px 0; padding-left:18px; color:var(--warning); font-size:13px; }
.session-alerts { max-width:1400px; margin:0 auto; }
.session-alert { display:flex; align-items:center; gap:10px; padding:12px 0; margin-bottom:12px; border-bottom:1px solid var(--line); color:var(--warning); }
.session-alert svg { flex:0 0 18px; width:18px; }
.session-alert span { flex:1; overflow-wrap:anywhere; }
.failure-row { padding:20px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.failure-row p { margin:8px 0; }
.failure-row .row-actions { margin-top:12px; flex-wrap:wrap; }
.session-save { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:16px; }
.draft-label { display:none; color:var(--warning); font-size:12px; flex-basis:100%; }
.advanced[data-dirty="true"] .draft-label { display:block; }
.media-preview { margin-top:20px; min-height:80px; }
.media-preview img,.media-preview video { display:block; max-width:100%; max-height:60vh; object-fit:contain; }
audio { display:block; width:100%; margin:12px 0; }
.delivery-timeline { padding-left:20px; margin:20px 0; }
.delivery-timeline li { margin-bottom:14px; overflow-wrap:anywhere; }
.delivery-timeline time { display:block; color:var(--muted); font-size:12px; }
.onboarding-panel,.activity-panel { padding:12px 0; margin-bottom:16px; border-bottom:1px solid var(--line); }
.onboarding-panel summary,.activity-panel summary { cursor:pointer; font-weight:500; }
.onboarding-panel .checklist,.activity-panel .activity-chart { margin-top:16px; }
#failureCount { margin-left:auto; font-size:12px; }
@media(max-width:520px) { .session-alert{flex-wrap:wrap}.session-alert button{margin-left:28px}.session-save button{flex:1} }

/* Shared, restrained typography across operational surfaces. */
.brand strong { font-size:18px; font-weight:600; }
.nav-item,.footer-action,.primary,.ghost,.danger,.mini,.form label,
.advanced summary,.compact-check,.bulk-bar .check,.flow-steps span { font-size:14px; font-weight:500; }
.metric strong { font-size:24px; line-height:1.25; font-weight:600; }
.section-head h2,.how-heading h2,.day-flow h2 { font-size:18px; line-height:1.4; }
.section-head.subhead h2,.integration-block .section-head h3,.feature-card h3 { font-size:16px; }
.badge,.plan-state,.environment-badge,.capability { font-size:12px; font-weight:500; text-transform:none; }
.advanced-grid label,.proxy-control>div strong,.conversation-preview summary,
.message-meta span,.message-row time { font-size:13px; font-weight:400; }
.runtime-line,.phase-caption,.chip-meta span,.proxy-control>div span,.proxy-control>small,
.diagnostic-summary dt,.activity-day strong,.activity-day small,.activity-legend { font-size:12px; }
.queue-route,.type-label,.conversation-turn,.diagnostic-summary dd { font-weight:500; }
.type-label { text-transform:none; }
.message-row p { font-size:16px; line-height:1.65; }
.conversation-preview ol,.how-hero p { font-size:16px; line-height:1.6; }

@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation:none!important; }
  .metric::before,.chip-card::before,.feature-card::before,.panel:focus-within::before { background:none; }
}
@media (max-width:1250px) { .topbar{display:grid}.top-actions{width:100%;flex-wrap:wrap}.top-actions .primary,.top-actions .ghost{flex:1 1 150px} }
@media (max-width:1100px) { .feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.split,.settings-layout{grid-template-columns:1fr}.checklist{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (max-width:760px) {
  body.sidebar-collapsed .sidebar { width:100%; }
  body.sidebar-collapsed .brand strong,body.sidebar-collapsed .nav-item span { display:inline; }
  body.sidebar-collapsed .nav-item { padding:0 13px; }
  .sidebar{position:static;width:100%;border-right:0;border-bottom:1px solid var(--line)}
  .brand{height:60px;padding:0 18px}.sidebar nav{grid-template-columns:repeat(4,minmax(120px,1fr));padding:10px 14px;overflow-x:auto}.sidebar-footer{display:none}
  .nav-item.active::before{inset:auto 12px -10px;height:3px;width:auto;border-radius:4px 4px 0 0}
  .shell,body.sidebar-collapsed .shell{width:100%;margin-left:0;padding:24px 18px 50px}.sidebar-icon{display:none}.topbar{display:grid}.top-actions{width:100%;display:flex;flex-wrap:wrap}.top-actions .icon-button{flex:0 0 44px;width:44px;height:44px}.top-actions .primary,.top-actions .ghost{flex:1 1 145px;min-height:44px}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.feature-grid{grid-template-columns:1fr;gap:14px}.feature-card{min-height:0;padding:22px}.feature-card p{margin-top:15px}
  .bulk-bar{align-items:stretch;display:grid;grid-template-columns:1fr auto}.bulk-bar .check{grid-column:1/-1}.checklist{grid-template-columns:1fr}.filter-row{align-items:stretch;display:grid}.compact-search{width:100%}
  .how-hero{margin:24px auto 42px;text-align:left}.how-hero h1{font-size:2.25rem}.how-hero h1::after{margin-left:0}.how-hero p{font-size:1rem}.flow-steps{display:grid}.flow-steps>svg{display:none}
}
@media (max-width:520px) { .sidebar nav{grid-template-columns:repeat(3,minmax(112px,1fr))}.nav-item{justify-content:center;min-height:40px;padding:0 10px;font-size:.82rem}.nav-item svg{display:none}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metrics .metric:last-child{grid-column:1/-1}.modes,.chip-meta,.advanced-grid,.form-grid,.diagnostic-summary dl{grid-template-columns:1fr}.chip-grid{grid-template-columns:1fr}.queue-actions{flex-wrap:wrap}.queue-actions button{flex:1 1 100%}.proxy-control{grid-template-columns:1fr 1fr}.proxy-control>div{grid-column:1/-1}.section-head{align-items:flex-start}.compact-select{min-width:150px}.row{align-items:flex-start}.row-actions{align-items:flex-end;flex-direction:column} }
@media (max-width:520px) { .mini,.icon-close{min-height:44px}.activity-legend{align-items:flex-end;flex-wrap:wrap;justify-content:flex-end}.section-head .activity-legend{max-width:130px} }
