/* TechOps Portable – Fluent-inspired design system (dark + light). */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --radius: 8px; --radius-sm: 5px; --radius-lg: 12px;
  --sidebar-w: 248px;
  --accent: #4f8cff; --accent-strong: #2f6fef; --accent-soft: rgba(79, 140, 255, .14); --on-accent: #fff;
  --ok: #3fb950; --ok-soft: rgba(63, 185, 80, .14);
  --warn: #d29922; --warn-soft: rgba(210, 153, 34, .16);
  --err: #f0524f; --err-soft: rgba(240, 82, 79, .14);
  --info: #58a6ff; --info-soft: rgba(88, 166, 255, .14);
  --shadow: 0 8px 28px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111318; --bg-alt: #161920; --surface: #1b1f27; --surface-2: #222733; --surface-3: #2a3040;
  --border: #2c3240; --border-strong: #3a4254; --text: #e6e9ef; --text-2: #aab1bf; --text-3: #7d8596;
  --hover: rgba(255, 255, 255, .05); --active: rgba(255, 255, 255, .09); --mica: linear-gradient(160deg, #141821 0%, #10131a 60%, #121622 100%);
  --code-bg: #0d1016;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9; --bg-alt: #eceff5; --surface: #ffffff; --surface-2: #f6f8fb; --surface-3: #eef1f6;
  --border: #dde2ea; --border-strong: #c8cfdb; --text: #1b1f27; --text-2: #4d5566; --text-3: #7a8294;
  --hover: rgba(0, 0, 0, .04); --active: rgba(0, 0, 0, .07); --mica: linear-gradient(160deg, #eef2f9 0%, #f5f6fa 60%, #eef1f8 100%);
  --accent: #2f6fef; --accent-strong: #1f5bd6; --accent-soft: rgba(47, 111, 239, .1);
  --ok: #1f883d; --warn: #9a6700; --err: #cf222e; --info: #0969da;
  --shadow: 0 8px 28px rgba(20, 30, 50, .14), 0 2px 6px rgba(20, 30, 50, .08);
  --code-bg: #f6f8fa;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); background-image: var(--mica); overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 15.5px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; overflow: auto; max-height: 60vh; white-space: pre-wrap; word-break: break-word; margin: 0; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 24px; height: 24px; } .icon.xl { width: 40px; height: 40px; stroke-width: 1.4; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: 52px 1fr; height: 100vh; }
.sidebar { grid-row: 1 / 3; background: var(--bg-alt); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.brand { color: var(--text); text-decoration: none !important; line-height: 1.2; }
.brand .logo { width: 38px; height: 38px; border-radius: 10px; flex: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.brand small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.brand-hero { display: flex; justify-content: center; }
.brand-hero img { width: min(300px, 70vw); height: auto; border-radius: 22px; box-shadow: 0 10px 34px rgba(0, 0, 0, .28); }
.center { text-align: center; }
.page > .this-pc { margin-bottom: 14px; }
.brand-inline { display: inline-flex; align-items: center; gap: 8px; }
.brand-inline img { width: 22px; height: 22px; border-radius: 6px; }
.nav { overflow-y: auto; padding: 4px 8px 12px; flex: 1; }
.nav-group { margin-top: 12px; }
.nav-group > h4 { padding: 4px 10px; font-size: 10.5px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-2); position: relative; font-size: 13.5px; }
.nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--active); color: var(--text); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav .badge { margin-left: auto; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 10px 12px; font-size: 12px; color: var(--text-3); display: flex; flex-direction: column; gap: 4px; }
.sidebar-foot .row { flex-wrap: nowrap; min-width: 0; }
.sidebar-foot .row span { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(20px); }
.searchbox { flex: 1; min-width: 0; max-width: 560px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text-3); cursor: text; white-space: nowrap; }
.searchbox .ph { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
kbd { white-space: nowrap; }
.searchbox:hover { border-color: var(--border-strong); }
.searchbox kbd { margin-left: auto; }
kbd { font: 11px var(--font); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; color: var(--text-2); background: var(--surface-2); }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.chip.clickable { cursor: pointer; } .chip.clickable:hover { border-color: var(--border-strong); color: var(--text); }
.main { overflow: auto; min-height: 0; position: relative; }
.page { padding: 22px 28px 60px; max-width: 1600px; margin: 0 auto; animation: fadein .18s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.crumbs a { color: var(--text-3); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 500 13px var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; user-select: none; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.subtle { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.subtle:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.icon-only { width: 32px; padding: 0; }
.btn.sm.icon-only { width: 26px; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
input, select, textarea { font: 13.5px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 32px; width: 100%; outline: none; transition: border-color .12s, box-shadow .12s; }
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 140px; tab-size: 4; background: var(--code-bg); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--accent); margin: 0; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field > small { color: var(--text-3); font-size: 11.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.input-row { display: flex; gap: 6px; align-items: center; }
.input-row > input, .input-row > select { flex: 1; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type="search"] { max-width: 320px; }
.toolbar select { width: auto; min-width: 150px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; min-width: 0; }
.card > .card-head { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; }
.card > .card-head h3 { flex: 1; display: flex; align-items: center; gap: 8px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 14px 18px 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; transition: border-color .12s, transform .12s; }
.stat:hover { border-color: var(--accent); transform: translateY(-1px); }
.stat .label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .value { font: 600 26px var(--font-display); letter-spacing: -.02em; }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv > dt { color: var(--text-3); }
.kv > dd { margin: 0; word-break: break-word; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-3); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .grow { flex: 1; }
.empty { text-align: center; padding: 38px 16px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { width: 42px; height: 42px; stroke-width: 1.2; opacity: .6; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 600; color: var(--text-2); padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { color: var(--text); }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .08s; }
table.data tbody tr:hover { background: var(--hover); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.selected { background: var(--accent-soft); }
table.data td.actions { text-align: right; white-space: nowrap; width: 1%; }
table.data .wrap { white-space: normal; }
.table-foot { padding: 8px 12px; color: var(--text-3); font-size: 12px; border-top: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }

/* ---------- tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: none; border: 0; color: var(--text-2); font: 500 13.5px var(--font); padding: 9px 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .count { font-size: 11px; color: var(--text-3); background: var(--surface-3); border-radius: 99px; padding: 0 6px; }

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), #8b5cf6); border-radius: 99px; transition: width .3s var(--ease); }
.progress.indeterminate > div { width: 35% !important; position: absolute; animation: indet 1.3s infinite var(--ease); }
.progress.ok > div { background: var(--ok); } .progress.err > div { background: var(--err); } .progress.warn > div { background: var(--warn); }
@keyframes indet { from { left: -35%; } to { left: 100%; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; gap: 10px; color: var(--text-3); padding: 24px; justify-content: center; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.log { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font: 12px/1.5 var(--mono); max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.log .err { color: var(--err); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5, 8, 14, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 150; animation: fadein .12s; overflow: auto; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); width: min(640px, 100%); display: flex; flex-direction: column; max-height: 88vh; }
.modal.wide { width: min(980px, 100%); } .modal.xwide { width: min(1280px, 100%); } .modal.narrow { width: min(440px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 10px; }
.modal-head h2 { flex: 1; font-size: 17px; }
.modal-body { padding: 6px 20px 16px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal.danger .modal-head h2 { color: var(--err); }
.warning-box { border: 1px solid var(--err); background: var(--err-soft); color: var(--text); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 10px; }
.warning-box .icon { color: var(--err); margin-top: 1px; }
.note-box { border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; display: flex; gap: 10px; }
.note-box.warn { border-color: var(--warn); background: var(--warn-soft); }
.note-box.ok { border-color: var(--ok); background: var(--ok-soft); }
.note-box.info { border-color: var(--info); background: var(--info-soft); }
.note-box .icon { margin-top: 1px; }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; max-width: 420px; }
.toast { background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--info); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; animation: slidein .2s var(--ease); font-size: 13px; }
.toast.ok { border-left-color: var(--ok); } .toast.warn { border-left-color: var(--warn); } .toast.err { border-left-color: var(--err); }
.toast .grow { word-break: break-word; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.menu { position: fixed; z-index: 160; min-width: 190px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; animation: fadein .08s; }
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: 13px var(--font); padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.menu button:hover { background: var(--hover); }
.menu button.danger { color: var(--err); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

.palette { width: min(720px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 16px; padding: 14px 18px; min-height: 52px; box-shadow: none !important; background: transparent; }
.palette .results { max-height: 60vh; overflow: auto; padding: 6px; }
.palette .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 4px; }
.palette .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.palette .item.sel { background: var(--accent-soft); }
.palette .item .t { font-weight: 500; }
.palette .item .s { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette .answer { margin: 6px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); }
.palette .hint { padding: 8px 14px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; display: flex; gap: 14px; }

/* ---------- lock / first run ---------- */
.lockscreen { position: fixed; inset: 0; display: grid; place-items: center; background: var(--mica), var(--bg); z-index: 100; padding: 20px; overflow: auto; }
.lock-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 30px; display: flex; flex-direction: column; gap: 16px; }
.lock-card.wide { width: min(640px, 100%); }
.lock-card .logo { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; font: 800 26px var(--font-display); }
.strength { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strength > div { height: 100%; transition: width .2s, background .2s; }

/* ---------- misc components ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: start; }
.timeline li:last-child { border-bottom: 0; }
.timeline .ti { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.timeline .ti .icon { width: 13px; height: 13px; }
.timeline .when { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.timeline .what { min-width: 0; }
.timeline .what .sum { color: var(--text-2); font-size: 12.5px; word-break: break-word; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 24px; text-align: center; color: var(--text-3); transition: border-color .12s, background .12s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.global-drop { position: fixed; inset: 0; z-index: 70; background: rgba(47, 111, 239, .18); border: 3px dashed var(--accent); display: grid; place-items: center; pointer-events: none; font: 600 22px var(--font-display); color: var(--text); }
.wizard-steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-steps .step { display: flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; }
.wizard-steps .step b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 11px; }
.wizard-steps .step.active { color: var(--text); border-color: var(--accent); }
.wizard-steps .step.active b { background: var(--accent); color: #fff; }
.wizard-steps .step.done b { background: var(--ok); color: #fff; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.qa { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; color: var(--text); font: 500 13px var(--font); text-align: left; transition: border-color .12s, transform .12s, background .12s; }
.qa:hover { border-color: var(--accent); background: var(--surface-3); transform: translateY(-1px); }
.qa .qi { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.alert-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.alert-item:hover { background: var(--hover); }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--text-3); font: 11px var(--font); }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter .bar { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter .bar > div { height: 100%; border-radius: 99px; background: var(--accent); }
.meter .bar.warn > div { background: var(--warn); } .meter .bar.err > div { background: var(--err); }
.secret { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); }
.pill-list { display: flex; flex-wrap: wrap; gap: 5px; }
.split { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.list-pane { max-height: calc(100vh - 220px); overflow: auto; }
.list-item { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.list-item:hover { background: var(--hover); }
.list-item.active { background: var(--accent-soft); border-color: var(--accent); }
.list-item .t { font-weight: 600; } .list-item .s { font-size: 12px; color: var(--text-3); }
.prose { line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.chat { display: flex; flex-direction: column; gap: 12px; }

/* ====================================================================== */
/* OS-style desktop shell                                                 */
/* ====================================================================== */
body.desktop-on { overflow: hidden; }
.os-desktop {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 240px; grid-template-rows: 36px 1fr 48px;
  color: #e9edf6; font-family: var(--font);
  background-color: #070a12;
  background-image:
    radial-gradient(1200px 700px at 72% 18%, rgba(56, 120, 220, .34), transparent 60%),
    radial-gradient(900px 600px at 20% 80%, rgba(120, 70, 210, .28), transparent 62%),
    radial-gradient(1400px 900px at 50% 50%, rgba(20, 150, 180, .16), transparent 70%),
    radial-gradient(600px 400px at 85% 75%, rgba(230, 90, 160, .14), transparent 65%),
    linear-gradient(160deg, #070a14 0%, #0a0f1d 55%, #090b16 100%);
}
.os-desktop::after {
  /* faint starfield */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 65% 15%, #cfe, transparent),
    radial-gradient(1px 1px at 80% 55%, #fff, transparent), radial-gradient(1px 1px at 40% 70%, #dfe, transparent),
    radial-gradient(1px 1px at 12% 85%, #fff, transparent), radial-gradient(1px 1px at 90% 88%, #cfe, transparent),
    radial-gradient(1px 1px at 55% 45%, #fff, transparent);
  background-repeat: no-repeat;
}

/* menu bar */
.os-menubar { grid-column: 1 / 3; grid-row: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px;
  background: rgba(10, 14, 24, .66); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255, 255, 255, .07); z-index: 5; }
.os-menu-brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; color: #fff; font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.os-menu-brand img { width: 20px; height: 20px; border-radius: 5px; }
.os-menu-brand:hover, .os-mb-btn:hover { background: rgba(255, 255, 255, .08); }
.os-mb-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: #cdd5e6; cursor: pointer; padding: 5px 9px; border-radius: 7px; font-size: 12.5px; }
.os-mb-search { display: inline-flex; align-items: center; gap: 7px; color: #aab3c6; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
  padding: 4px 10px; border-radius: 99px; cursor: text; font-size: 12px; margin-left: 4px; }
.os-mb-search kbd { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #cdd5e6; }
.os-mb-spacer { flex: 1; }
.os-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; margin-right: 4px; }
.os-clock-time { font-weight: 700; font-size: 13px; } .os-clock-date { font-size: 10.5px; color: #9aa4ba; }

/* icon field */
.os-iconfield { grid-column: 1; grid-row: 2; position: relative; z-index: 1; overflow: auto;
  display: grid; grid-template-columns: repeat(auto-fill, 96px); grid-auto-rows: 96px; gap: 8px; align-content: start; padding: 20px; }
.os-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: none; border: 1px solid transparent; border-radius: 12px; cursor: pointer; color: #e7ecf7; padding: 8px 4px; }
.os-icon:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); }
.os-icon-badge { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px;
  background: linear-gradient(160deg, rgba(79, 140, 255, .32), rgba(120, 70, 210, .28)); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .14); }
.os-icon-badge .icon { width: 30px; height: 30px; stroke: #eaf0ff; }
.os-icon-label { font-size: 11.5px; text-align: center; max-width: 90px; line-height: 1.15; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }

/* windows */
.os-windows { grid-column: 1; grid-row: 2; position: relative; z-index: 2; overflow: hidden; pointer-events: none; }
.os-window { position: absolute; pointer-events: auto; display: flex; flex-direction: column; min-width: 340px; min-height: 220px;
  background: var(--surface); color: var(--text); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), 0 4px 14px rgba(0, 0, 0, .4); }
.os-window.active { border-color: color-mix(in srgb, var(--accent) 55%, rgba(255, 255, 255, .2)); }
.os-window.maximized { border-radius: 0; }
.os-win-bar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; cursor: move;
  background: color-mix(in srgb, var(--surface-2) 90%, transparent); border-bottom: 1px solid var(--border); user-select: none; }
.os-win-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.os-win-sp { flex: 1; }
.os-win-btn { display: grid; place-items: center; width: 30px; height: 26px; border: 0; background: none; color: var(--text-2); border-radius: 6px; cursor: pointer; }
.os-win-btn:hover { background: var(--hover); color: var(--text); }
.os-win-btn.danger:hover { background: var(--err); color: #fff; }
.os-win-content { flex: 1; overflow: auto; min-height: 0; background: var(--bg); background-image: var(--mica); }
.os-page { padding: 18px 20px 40px; max-width: none; }

/* right stats dock */
.os-dock { grid-column: 2; grid-row: 2; overflow: auto; padding: 12px 12px 18px;
  background: rgba(9, 12, 20, .62); backdrop-filter: blur(16px); border-left: 1px solid rgba(255, 255, 255, .07);
  display: flex; flex-direction: column; gap: 12px; font-size: 12px; }
.os-dock-clock { text-align: center; padding: 6px 0 2px; }
.os-dock-time { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: 1px; color: #eaf1ff; }
.os-dock-date { font-size: 11px; color: #9aa4ba; }
.os-dock-sect { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; padding: 9px 10px; }
.os-dock-sect.muted { color: #8893a8; text-align: center; }
.os-dock-h { display: flex; align-items: center; gap: 7px; font-weight: 700; color: #dce3f2; margin-bottom: 7px; text-transform: uppercase; font-size: 10.5px; letter-spacing: .07em; }
.os-dock-h .icon { width: 14px; height: 14px; }
.os-dock-pct { margin-left: auto; font-family: var(--mono); color: #eaf1ff; font-size: 12px; }
.os-stat-row { display: flex; justify-content: space-between; gap: 8px; color: #b7c0d4; padding: 2px 0; }
.os-stat-k { color: #8e99b0; } .os-stat-v { font-family: var(--mono); color: #d6ddee; text-align: right; }
.os-stat-sub { color: #7f8aa0; font-size: 10.5px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-bar { height: 7px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.os-bar-fill { height: 100%; border-radius: 6px; background: var(--accent); transition: width .5s var(--ease); }
.os-bar-fill.ok { background: linear-gradient(90deg, #2f7fef, #35b6c9); } .os-bar-fill.warn { background: #d29922; } .os-bar-fill.err { background: #f0524f; }
.os-cores { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 7px; }
.os-core { flex: 1; height: 100%; display: flex; align-items: flex-end; background: rgba(255, 255, 255, .06); border-radius: 3px; overflow: hidden; }
.os-core-fill { width: 100%; background: #35b6c9; border-radius: 3px; transition: height .5s var(--ease); }
.os-core-fill.warn { background: #d29922; } .os-core-fill.err { background: #f0524f; }

/* taskbar */
.os-taskbar { grid-column: 1 / 3; grid-row: 3; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: rgba(10, 14, 24, .72); backdrop-filter: blur(18px); border-top: 1px solid rgba(255, 255, 255, .08); z-index: 5; }
.os-tb-launch { display: grid; place-items: center; width: 36px; height: 34px; border-radius: 9px; border: 0; cursor: pointer;
  color: #eaf0ff; background: linear-gradient(160deg, rgba(79, 140, 255, .4), rgba(120, 70, 210, .34)); }
.os-tb-launch:hover { filter: brightness(1.12); }
.os-tasklist { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.os-task { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; cursor: pointer;
  color: #c7cfe0; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); white-space: nowrap; font-size: 12.5px; }
.os-task:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.os-task.active { background: rgba(79, 140, 255, .22); border-color: rgba(79, 140, 255, .5); color: #fff; }
.os-task.min { opacity: .6; }

@media (max-width: 820px) {
  .os-desktop { grid-template-columns: 1fr; grid-template-rows: 36px 1fr 48px; }
  .os-dock { display: none; }
}
.msg { max-width: 88%; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.file-icon { width: 18px; text-align: center; }

@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .nav a span, .nav-group h4, .brand span, .sidebar-foot { display: none; }
  .split { grid-template-columns: 1fr; }
  .page { padding: 16px; }
}
@media print {
  .sidebar, .topbar, .toasts { display: none !important; }
  .shell { display: block; } .main { overflow: visible; } body { overflow: visible; background: #fff; }
}
