/* Halawi Chroma: base design system shared with Halawi Slate (tokens, shell, controls, overlays) */
:root {
  --violet: #9b3df5; --magenta: #c84fb4; --coral: #ea6a5a;
  --grad: linear-gradient(100deg, #9b3df5 0%, #c84fb4 55%, #ea6a5a 100%);
  --bg: #0a0a0c; --bg-1: #0d0d11; --bg-2: #121217; --bg-3: #17171e; --bg-4: #1d1d26;
  --glass: rgba(255,255,255,.028); --glass-2: rgba(255,255,255,.045); --glass-3: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.075); --line-2: rgba(255,255,255,.12); --line-3: rgba(255,255,255,.18);
  --text: #eeedf3; --text-2: #cbc5d4; --muted: #9c95a8; --dim: #6f6979;
  --ok: #3fb68b; --warn: #e8a33d; --bad: #ef5b62; --info: #7b93ff;
  --accent: #b46cff; --accent-bg: rgba(155,61,245,.14); --accent-line: rgba(155,61,245,.45);
  --focus: 0 0 0 2px rgba(180,108,255,.65);
  --r: 10px; --r-sm: 7px; --r-lg: 14px;
  --shadow: 0 10px 40px -12px rgba(0,0,0,.65), 0 2px 8px rgba(0,0,0,.35);
  --sb-w: 248px; --top-h: 54px;
  --f-ui: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-data: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --f-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f6f5f9; --bg-1: #ffffff; --bg-2: #ffffff; --bg-3: #f1eff6; --bg-4: #e9e6f0;
  --glass: rgba(20,10,40,.025); --glass-2: rgba(20,10,40,.04); --glass-3: rgba(20,10,40,.07);
  --line: rgba(20,10,40,.09); --line-2: rgba(20,10,40,.14); --line-3: rgba(20,10,40,.22);
  --text: #17141f; --text-2: #3b3547; --muted: #6a6377; --dim: #958fa1;
  --accent: #8b35ec; --accent-bg: rgba(139,53,236,.09); --accent-line: rgba(139,53,236,.4);
  --shadow: 0 12px 40px -14px rgba(30,10,60,.25), 0 2px 8px rgba(30,10,60,.08);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--f-data); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow: hidden; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(900px 500px at 85% -10%, rgba(155,61,245,.10), transparent 60%), radial-gradient(700px 400px at -10% 110%, rgba(234,106,90,.06), transparent 60%); }
html[data-theme="light"] body::before { opacity: .6; }
h1, h2, h3, h4 { font-family: var(--f-ui); font-weight: 600; letter-spacing: -.01em; margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.ic { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .grow { flex: 1; } .r { text-align: right; } .nowrap { white-space: nowrap; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 1000; background: var(--bg-3); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }
::selection { background: rgba(155,61,245,.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(127,120,140,.28); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(127,120,140,.45); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sb-w) 1fr; height: 100vh; height: 100dvh; transition: grid-template-columns .22s ease; }
.app.sb-collapsed { --sb-w: 64px; }
.sidebar { background: var(--bg-1); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.sb-top { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; min-height: var(--top-h); }
.sb-logo { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none !important; }
.sb-logo img { height: 18px; width: auto; display: block; }
.sb-logo .sb-name { font-family: var(--f-ui); font-weight: 600; font-size: 15px; letter-spacing: .02em; color: var(--text); white-space: nowrap; }
.sb-logo .sb-name em { font-style: normal; color: var(--muted); font-weight: 400; }
.sb-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 4px 18px -6px rgba(155,61,245,.7); }
.sb-mark .ic { width: 16px; height: 16px; }
.sb-proj { margin: 4px 10px 8px; padding: 9px 10px; border: 1px solid var(--line); background: var(--glass); border-radius: var(--r); display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; text-align: left; width: calc(100% - 20px); }
.sb-proj:hover { border-color: var(--line-2); background: var(--glass-2); }
.sb-proj .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sb-proj .t { min-width: 0; flex: 1; }
.sb-proj .t b { display: block; font: 500 13px/1.25 var(--f-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-proj .t small { color: var(--muted); font-size: 11.5px; }
.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 12px; }
.sb-grp { font: 500 10.5px/1 var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 14px 10px 6px; white-space: nowrap; }
.sb-link { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font: 400 13.5px/1.2 var(--f-ui); text-decoration: none !important; position: relative; white-space: nowrap; margin: 1px 0; }
.sb-link:hover { background: var(--glass-2); color: var(--text); }
.sb-link.on { background: var(--accent-bg); color: var(--text); }
.sb-link.on::before { content: ''; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.sb-link.on .ic { color: var(--accent); }
.sb-link .kbd-hint { margin-left: auto; font-size: 10.5px; color: var(--dim); font-family: var(--f-mono); }
.sb-link .cnt { margin-left: auto; font-size: 11px; color: var(--muted); background: var(--glass-2); padding: 1px 7px; border-radius: 20px; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px; }
.sb-backup { margin: 4px 2px 6px; padding: 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--glass); font-size: 12px; color: var(--muted); }
.sb-backup b { color: var(--text); font-weight: 500; font-family: var(--f-ui); font-size: 12.5px; }
.sb-backup.due { border-color: rgba(232,163,61,.45); background: rgba(232,163,61,.07); }
.sb-backup .btn { margin-top: 8px; width: 100%; justify-content: center; }
.sb-legal { display: flex; gap: 10px; padding: 6px 10px 2px; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.sb-legal a { color: var(--dim); }
.app.sb-collapsed .sb-name, .app.sb-collapsed .sb-proj .t, .app.sb-collapsed .sb-grp, .app.sb-collapsed .sb-link span, .app.sb-collapsed .sb-link .kbd-hint, .app.sb-collapsed .sb-link .cnt, .app.sb-collapsed .sb-backup, .app.sb-collapsed .sb-legal, .app.sb-collapsed .sb-logo img { display: none; }
.app.sb-collapsed .sb-link { justify-content: center; padding: 9px 0; }
.app.sb-collapsed .sb-proj { justify-content: center; padding: 9px 0; }
.app.sb-collapsed .sb-grp { display: block; height: 10px; padding: 0; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { height: var(--top-h); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); position: relative; z-index: 20; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font: 400 13.5px var(--f-ui); color: var(--muted); }
.crumbs a { color: var(--muted); white-space: nowrap; }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.crumbs .sep { color: var(--dim); }
.crumbs .sep .ic { width: 13px; height: 13px; }
.crumbs b { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save-ind { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); white-space: nowrap; cursor: default; }
.save-ind i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(63,182,139,.15); }
.save-ind.dirty i { background: var(--warn); box-shadow: 0 0 0 3px rgba(232,163,61,.15); }
.save-ind.saving i { background: var(--info); animation: pulse 1s infinite; }
.save-ind.error { color: var(--bad); border-color: rgba(239,91,98,.5); }
.save-ind.error i { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.cmdk-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 10px; min-width: 210px; border: 1px solid var(--line); background: var(--glass); border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 13px; }
.cmdk-btn:hover { border-color: var(--line-2); color: var(--text-2); }
.cmdk-btn kbd { margin-left: auto; }
kbd { font: 500 11px/1 var(--f-mono); padding: 3px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--glass-2); color: var(--muted); white-space: nowrap; }
.content { flex: 1; overflow: auto; min-height: 0; position: relative; }
.page { padding: 22px 26px 60px; max-width: 1680px; margin: 0 auto; animation: fadeUp .28s ease both; }
.page--wide { max-width: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-hd { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-hd .eyebrow { margin-bottom: 4px; }
.page-hd h1 { font-size: 24px; line-height: 1.2; font-weight: 600; }
.page-hd p { margin: 4px 0 0; color: var(--muted); max-width: 760px; }
.page-hd .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font: 500 11px/1 var(--f-ui); text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--glass-2); color: var(--text); font: 500 13px/1 var(--f-ui); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; text-decoration: none !important; }
.btn:hover { background: var(--glass-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: linear-gradient(100deg, #8f37ee, #b146c9 60%, #d75f78); border-color: transparent; color: #fff; box-shadow: 0 6px 20px -8px rgba(155,61,245,.75), inset 0 1px 0 rgba(255,255,255,.18); }
.btn--primary:hover { filter: brightness(1.08); background: linear-gradient(100deg, #8f37ee, #b146c9 60%, #d75f78); border-color: transparent; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--glass-2); border-color: var(--line); color: var(--text); }
.btn--danger { background: rgba(239,91,98,.14); border-color: rgba(239,91,98,.45); color: #ff8d92; }
html[data-theme="light"] .btn--danger { color: #c62f37; }
.btn--danger:hover { background: rgba(239,91,98,.24); border-color: rgba(239,91,98,.6); }
.btn.danger, .ctx-i.danger { color: #ff8d92; }
html[data-theme="light"] .btn.danger, html[data-theme="light"] .ctx-i.danger { color: #c62f37; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 6px; }
.btn--sm .ic { width: 14px; height: 14px; }
.btn--lg { height: 42px; padding: 0 18px; font-size: 14px; border-radius: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; flex: none; position: relative; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--glass-2); color: var(--text); border-color: var(--line); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn--sm { width: 26px; height: 26px; }
.icon-btn--sm .ic { width: 14px; height: 14px; }
.icon-btn .pip { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; border-radius: 10px; background: var(--coral); color: #fff; font: 600 9.5px/15px var(--f-ui); padding: 0 4px; text-align: center; }
.input { width: 100%; height: 36px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 400 13.5px var(--f-data); transition: border-color .15s, box-shadow .15s; }
html[data-theme="light"] .input { background: #fff; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; min-height: 64px; }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239c95a8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.input:hover { border-color: var(--line-3); }
.input:focus { outline: none; border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(155,61,245,.18); }
.input--sm { height: 30px; font-size: 12.5px; padding: 0 9px; }
select.input--sm { padding-right: 26px; background-position: right 8px center; }
.input--color { padding: 3px; width: 54px; }
input[type="date"].input, input[type="time"].input { font-variant-numeric: tabular-nums; }
::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }
html[data-theme="light"] ::-webkit-calendar-picker-indicator { filter: none; }
.search-in { position: relative; display: flex; align-items: center; }
.search-in .ic { position: absolute; left: 9px; color: var(--dim); width: 14px; height: 14px; pointer-events: none; }
.search-in .input { padding-left: 29px; min-width: 200px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-l { font: 500 12px/1.2 var(--f-ui); color: var(--text-2); letter-spacing: .01em; }
.field-l em { font-style: normal; color: var(--dim); font-weight: 400; }
.field-h { color: var(--dim); font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 16px; }
.form-grid .field--full { grid-column: 1 / -1; }
.form-sec { grid-column: 1 / -1; font: 500 11px/1 var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.form-sec:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; height: 36px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { width: 34px; height: 20px; border-radius: 20px; background: var(--glass-3); border: 1px solid var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked + span { background: var(--violet); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.switch em { font-style: normal; color: var(--text-2); font-size: 13px; }
input[type="checkbox"] { accent-color: var(--violet); width: 15px; height: 15px; cursor: pointer; }
input[type="range"] { accent-color: var(--violet); }

/* ---------- panels / cards ---------- */
.panel { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg); position: relative; min-width: 0; }
.panel-hd { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-hd h3 { font-size: 14px; font-weight: 500; }
.panel-hd .acts { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.panel-bd { padding: 16px; }
.panel-bd--flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi { padding: 15px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--glass); position: relative; overflow: hidden; min-width: 0; }
.kpi .l { font: 500 11px/1 var(--f-ui); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .l .ic { width: 13px; height: 13px; }
.kpi .v { font: 600 26px/1.15 var(--f-ui); margin-top: 10px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .bar { margin-top: 10px; }
.kpi.warn .v { color: var(--warn); } .kpi.bad .v { color: var(--bad); } .kpi.ok .v { color: var(--ok); }
.kpi::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(155,61,245,.5), transparent); opacity: .5; }
.bar { height: 6px; border-radius: 6px; background: var(--glass-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--grad); transition: width .4s ease; }
.bar.ok > i { background: var(--ok); } .bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 20px; font: 500 11.5px/1 var(--f-ui); white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge--n { background: var(--glass-2); color: var(--muted); border-color: var(--line); }
.badge--ok { background: rgba(63,182,139,.12); color: #5fd3a8; border-color: rgba(63,182,139,.25); }
.badge--warn { background: rgba(232,163,61,.12); color: #f2b85e; border-color: rgba(232,163,61,.25); }
.badge--bad { background: rgba(239,91,98,.12); color: #ff8389; border-color: rgba(239,91,98,.28); }
.badge--info { background: rgba(123,147,255,.12); color: #9eb0ff; border-color: rgba(123,147,255,.25); }
.badge--accent { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-line); }
html[data-theme="light"] .badge--ok { color: #1d8a61; } html[data-theme="light"] .badge--warn { color: #a86a0c; } html[data-theme="light"] .badge--bad { color: #c62f37; } html[data-theme="light"] .badge--info { color: #3c55d0; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; margin: 1px 4px 1px 0; border-radius: 6px; background: var(--glass-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chip button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--dim); display: grid; }
.chip button:hover { color: var(--bad); }
.chip button .ic { width: 12px; height: 12px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.overdue { color: var(--bad); font-weight: 500; }
.lnk { display: inline-flex; align-items: center; gap: 4px; }
.lnk .ic { width: 13px; height: 13px; }
.tick { color: var(--ok); }
.callout { display: flex; gap: 12px; padding: 13px 15px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--glass-2); align-items: flex-start; flex-wrap: wrap; }
.callout > .ic { margin-top: 2px; width: 18px; height: 18px; }
.callout > div { flex: 1; min-width: 200px; }
.callout--warn { border-color: rgba(232,163,61,.4); background: rgba(232,163,61,.07); } .callout--warn > .ic { color: var(--warn); }
.callout--accent { border-color: var(--accent-line); background: var(--accent-bg); } .callout--accent > .ic { color: var(--accent); }
.callout--bad { border-color: rgba(239,91,98,.45); background: rgba(239,91,98,.07); } .callout--bad > .ic { color: var(--bad); }
.callout b { font-family: var(--f-ui); font-weight: 500; }
.callout p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
.callout .acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-self: center; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; border: 0; background: none; cursor: pointer; color: var(--muted); font: 400 13.5px var(--f-ui); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--violet); }
.tab .ic { width: 15px; height: 15px; }
.tab-c { font-size: 11px; background: var(--glass-2); color: var(--muted); padding: 1px 7px; border-radius: 20px; }
.seg { display: inline-flex; padding: 3px; background: var(--glass-2); border: 1px solid var(--line); border-radius: 9px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 6px; cursor: pointer; color: var(--muted); font: 500 12.5px var(--f-ui); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--bg-4); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
html[data-theme="light"] .seg button.on { background: #fff; }
.seg button .ic { width: 14px; height: 14px; }

/* ---------- toasts / modals / menus / drawer ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 440px; padding: 10px 10px 10px 13px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; animation: toastIn .25s cubic-bezier(.2,.9,.3,1.2); }
.toast.out { animation: toastOut .22s ease forwards; }
.toast-ic { color: var(--info); display: grid; }
.toast--success .toast-ic { color: var(--ok); } .toast--warn .toast-ic { color: var(--warn); } .toast--error .toast-ic { color: var(--bad); }
.toast--error { border-color: rgba(239,91,98,.45); }
.toast-msg { flex: 1; }
.toast-x { border: 0; background: none; color: var(--dim); cursor: pointer; display: grid; padding: 3px; border-radius: 5px; }
.toast-x:hover { color: var(--text); background: var(--glass-2); }
.toast-x .ic { width: 14px; height: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
.modal-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(5,5,8,.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; animation: fade .18s ease; }
html[data-theme="light"] .modal-wrap { background: rgba(30,20,50,.35); }
.modal-wrap.out { animation: fade .18s ease reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); animation: pop .22s cubic-bezier(.2,.9,.3,1.15); overflow: hidden; }
.modal--sm { max-width: 440px; } .modal--lg { max-width: 860px; } .modal--xl { max-width: 1120px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-hd { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.modal-hd h2 { font-size: 17px; font-weight: 600; flex: 1; }
.modal-bd { padding: 4px 18px 18px; overflow: auto; }
.modal-ft { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--glass); flex-wrap: wrap; }
.ctx { position: fixed; z-index: 400; min-width: 210px; max-height: 70vh; overflow: auto; padding: 5px; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 11px; box-shadow: var(--shadow); animation: pop .14s ease; }
.ctx-i { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px; border: 0; background: none; border-radius: 7px; cursor: pointer; font: 400 13px var(--f-ui); text-align: left; color: var(--text-2); }
.ctx-i:hover, .ctx-i:focus { background: var(--glass-3); color: var(--text); outline: none; }
.ctx-i:disabled { opacity: .4; cursor: default; }
.ctx-i kbd { margin-left: auto; }
.ctx-i .ic { width: 15px; height: 15px; color: var(--muted); }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 2px; }
.ctx-hd { font: 500 10.5px var(--f-ui); text-transform: uppercase; letter-spacing: .1em; color: var(--dim); padding: 8px 9px 4px; }
#drawer-host { position: fixed; top: 0; right: 0; bottom: 0; z-index: 150; pointer-events: none; }
.drawer { pointer-events: auto; position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px -30px rgba(0,0,0,.7); display: flex; flex-direction: column; animation: slideIn .24s cubic-bezier(.2,.9,.3,1); }
.drawer.out { animation: slideIn .2s ease reverse forwards; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-hd { display: flex; align-items: flex-start; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.drawer-hd > div:first-child { flex: 1; min-width: 0; }
.drawer-hd h2 { font-size: 17px; margin-top: 6px; overflow-wrap: anywhere; }
.drawer-bd { flex: 1; overflow: auto; padding: 18px; }
.drawer-ft { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.drawer-ft .btn:first-child { margin-right: auto; }

/* ---------- command palette ---------- */
.cmdk { position: fixed; inset: 0; z-index: 250; background: rgba(5,5,8,.55); backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; animation: fade .15s; }
.cmdk-box { width: min(660px, calc(100vw - 24px)); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 40px 100px -20px rgba(0,0,0,.85); overflow: hidden; animation: pop .18s ease; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk-in .ic { color: var(--muted); width: 18px; height: 18px; }
.cmdk-in input { flex: 1; height: 54px; border: 0; background: none; color: var(--text); font: 400 16px var(--f-ui); outline: none; }
.cmdk-list { max-height: 420px; overflow: auto; padding: 6px; }
.cmdk-grp { font: 500 10.5px var(--f-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); padding: 10px 10px 5px; }
.cmdk-i { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; cursor: pointer; color: var(--text-2); font-size: 13.5px; }
.cmdk-i .ic { color: var(--muted); }
.cmdk-i .sub { color: var(--dim); font-size: 12px; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.cmdk-i kbd { margin-left: auto; }
.cmdk-i.on { background: var(--accent-bg); color: var(--text); }
.cmdk-i.on .ic { color: var(--accent); }
.cmdk-ft { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); flex-wrap: wrap; }

/* ---------- misc ---------- */
.kbd-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 26px; }
.kbd-grid div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kbd-grid div span:last-child { display: flex; gap: 4px; }
.kbd-grid h4 { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); margin-top: 14px; font-weight: 500; }
.notif { position: fixed; z-index: 120; top: 50px; right: 70px; width: 390px; max-width: calc(100vw - 20px); max-height: 72vh; overflow: auto; background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); animation: pop .16s ease; }
.notif-hd { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font: 500 13.5px var(--f-ui); position: sticky; top: 0; background: var(--bg-3); }
.notif .alert-list { padding: 4px 8px 8px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid rgba(232,163,61,.3); background: linear-gradient(90deg, rgba(232,163,61,.13), rgba(232,163,61,.03)); color: var(--text); flex: none; flex-wrap: wrap; }
.banner > .ic { color: var(--warn); }
.banner.accent { border-bottom-color: var(--accent-line); background: linear-gradient(90deg, rgba(155,61,245,.16), rgba(200,79,180,.04)); }
.banner.accent > .ic { color: var(--accent); }
.banner.bad { border-bottom-color: rgba(239,91,98,.4); background: linear-gradient(90deg, rgba(239,91,98,.16), rgba(239,91,98,.03)); }
.banner.bad > .ic { color: var(--bad); }
.banner .acts { margin-left: auto; display: flex; gap: 6px; }
.big-callout { display: flex; gap: 14px; padding: 16px; border-radius: 12px; background: linear-gradient(120deg, rgba(155,61,245,.16), rgba(234,106,90,.09)); border: 1px solid var(--accent-line); margin-bottom: 14px; }
.big-callout > .ic { width: 26px; height: 26px; color: var(--accent); flex: none; }
.big-callout b { font: 600 15px var(--f-ui); display: block; margin-bottom: 2px; }
.big-callout p { margin: 0; color: var(--text-2); font-size: 13px; }
.first-run ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.first-run ul li { margin: 5px 0; }
.snap-list { list-style: none; padding: 0; margin: 0; }
.snap-list li { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.snap-list li .t { flex: 1; min-width: 160px; }
.snap-list li .t b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snap-list li .t small { color: var(--muted); }
.boot { position: fixed; inset: 0; display: grid; place-items: center; z-index: 500; background: var(--bg); transition: opacity .3s; }
.boot.gone { opacity: 0; pointer-events: none; }
.boot-in { display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--muted); font: 400 13px var(--f-ui); }
.boot-bar { width: 140px; height: 2px; border-radius: 2px; background: var(--glass-3); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--grad); animation: boot 1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
noscript .nojs { position: fixed; inset: 0; display: grid; place-items: center; background: #0a0a0c; color: #eee; z-index: 999; padding: 30px; text-align: center; }

