/* Kavach design system ------------------------------------------------------------ */

:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #ffffff;
  --surface-chart: #fcfcfb;
  --surface-2: #f4f4f1;
  --surface-3: #ebebe6;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #898781;
  --accent: #2a78d6;
  --accent-hover: #256abf;
  --accent-strong: #1c5cab;
  --accent-soft: #eaf2fc;
  --accent-soft-2: #d7e7fa;
  --accent-ink: #184f95;
  --on-accent: #ffffff;

  --good: #0ca30c;
  --good-ink: #006300;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --critical-soft: #fbeaea;
  --warning-soft: #fdf4df;
  --good-soft: #e6f5e6;

  --series-1: #2a78d6;
  --series-1-hover: #1c5cab;
  --meter-track: #cde2fb;
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow-sm: 0 1px 2px rgba(11, 11, 11, 0.05);
  --shadow: 0 1px 3px rgba(11, 11, 11, 0.06), 0 6px 16px rgba(11, 11, 11, 0.05);
  --shadow-lg: 0 12px 40px rgba(11, 11, 11, 0.18), 0 2px 8px rgba(11, 11, 11, 0.08);
  --sidebar-w: 248px;
  --topbar-h: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #161615;
  --surface-chart: #1a1a19;
  --surface-2: #1f1f1e;
  --surface-3: #2a2a28;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-2: #c3c2b7;
  --text-3: #898781;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-strong: #6da7ec;
  --accent-soft: #14253a;
  --accent-soft-2: #1b3352;
  --accent-ink: #9ec5f4;
  --good-ink: #0ca30c;
  --critical-soft: #3a1c1c;
  --warning-soft: #3a2f14;
  --good-soft: #15301a;
  --series-1: #3987e5;
  --series-1-hover: #6da7ec;
  --meter-track: #0d366b;
  --grid: #2c2c2a;
  --axis: #383835;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #161615;
    --surface-chart: #1a1a19;
    --surface-2: #1f1f1e;
    --surface-3: #2a2a28;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #898781;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-strong: #6da7ec;
    --accent-soft: #14253a;
    --accent-soft-2: #1b3352;
    --accent-ink: #9ec5f4;
    --good-ink: #0ca30c;
    --critical-soft: #3a1c1c;
    --warning-soft: #3a2f14;
    --good-soft: #15301a;
    --series-1: #3987e5;
    --series-1-hover: #6da7ec;
    --meter-track: #0d366b;
    --grid: #2c2c2a;
    --axis: #383835;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.boot { display: grid; place-items: center; height: 100vh; }

/* ------------------------------------------------------------------ layout */

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 12px;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff;
  display: grid; place-items: center; flex: none;
}
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.nav-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; text-decoration: none; margin-bottom: 1px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.active svg { color: var(--accent); }
.nav .count {
  margin-left: auto; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2);
  border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums;
}
.nav a.active .count { background: var(--accent-soft-2); color: var(--accent-ink); }
.nav .count.alert { background: var(--critical-soft); color: var(--critical); }
.sidebar-foot { margin-top: auto; padding-top: 12px; }
.ai-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.search-trigger {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-3);
  cursor: pointer; text-align: left; box-shadow: var(--shadow-sm);
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd {
  font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--text-3);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; background: var(--surface-2);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-2); }

/* ------------------------------------------------------------------ primitives */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head .meta { color: var(--text-3); font-size: 12px; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-3); }
.secondary { color: var(--text-2); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--critical); }
.btn.danger:hover { background: var(--critical-soft); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--radius-xs); }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: var(--radius-xs); gap: 5px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.xs.icon { width: 26px; }
.btn.wa { color: #128c4b; }
:root[data-theme="dark"] .btn.wa { color: #3ccf7a; }
.btn-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.btn-group button { border: 0; background: var(--surface); padding: 0 12px; height: 32px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; }
.btn-group button + button { border-left: 1px solid var(--border); }
.btn-group button.on { background: var(--accent-soft); color: var(--accent-ink); }

/* forms */
.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.input::placeholder { color: var(--text-3); }
.input.sm { height: 30px; font-size: 13px; padding: 0 8px; }
select.input { padding-right: 28px; 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='%23898781' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field.req > label::after { content: " *"; color: var(--critical); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 34px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-2); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input-icon { width: 300px; max-width: 100%; }
.toolbar select.input { width: auto; min-width: 140px; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.chip-filter.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.chip-filter .n { font-variant-numeric: tabular-nums; color: var(--text-3); font-weight: 600; }
.chip-filter.on .n { color: var(--accent-ink); }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; background: var(--surface); position: sticky; top: 0; z-index: 1;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th .arrow { font-size: 10px; margin-left: 3px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .primary-cell { font-weight: 550; color: var(--text); }
.table .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.table.compact td { padding: 8px 12px; }
.table.dense td, .table.dense th { padding-left: 9px; padding-right: 9px; }
.table.dense td:first-child, .table.dense th:first-child { padding-left: 14px; }
.table.dense td:last-child, .table.dense th:last-child { padding-right: 14px; }
.table.compact th { padding: 8px 12px; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap; border: 1px solid var(--border);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.badge.good .dot { background: var(--good); }
.badge.warning .dot { background: var(--warning); }
.badge.serious .dot { background: var(--serious); }
.badge.critical .dot { background: var(--critical); }
.badge.info .dot { background: var(--accent); }
.badge.plain { background: transparent; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.days { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.days.critical { color: var(--critical); }
.days.warning { color: #a86f00; }
:root[data-theme="dark"] .days.warning { color: var(--warning); }
.days.ok { color: var(--text-3); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px;
  background: var(--accent-soft); color: var(--accent-ink); flex: none; letter-spacing: .02em;
}
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.callout.info { background: var(--accent-soft); border-color: transparent; color: var(--text); }
.callout.info svg { color: var(--accent); }
.callout.warning { background: var(--warning-soft); border-color: transparent; color: var(--text); }
.callout.warning svg { color: #c98500; }
.callout.critical { background: var(--critical-soft); border-color: transparent; color: var(--text); }
.callout.critical svg { color: var(--critical); }
.callout.good { background: var(--good-soft); border-color: transparent; color: var(--text); }
.callout.good svg { color: var(--good); }
.callout svg { flex: none; margin-top: 1px; }

.empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty .empty-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); color: var(--text-3); display: grid; place-items: center; margin: 0 auto 12px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty .actions { margin-top: 14px; display: flex; justify-content: center; gap: 8px; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; flex: none; }
.spinner.sm { width: 14px; height: 14px; }
.spinner.lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 60px; }
.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; }
@keyframes shimmer { to { background-position: -200% 0; } }
.refetching { opacity: .55; transition: opacity .15s; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11px; background: var(--surface-3); border-radius: 999px; padding: 0 7px; font-weight: 600; color: var(--text-2); }

/* definition lists */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 20px; }
.dl > div { min-width: 0; }
.dl dt { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.dl dd.empty-val { color: var(--text-3); font-weight: 400; }

/* ------------------------------------------------------------------ modal, drawer, toasts */

.overlay { position: fixed; inset: 0; background: rgba(11, 11, 11, 0.42); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .12s ease-out; }
:root[data-theme="dark"] .overlay { background: rgba(0, 0, 0, 0.6); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; border: 1px solid var(--border); animation: pop .14s ease-out; }
.modal.wide { max-width: 820px; }
.modal.xl { max-width: 1100px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: 10px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); animation: pop .16s ease-out; font-size: 13.5px; }
.toast svg { flex: none; margin-top: 1px; }
.toast.error svg { color: #ff8a8a; }
.toast.success svg { color: #5fd35f; }
:root[data-theme="dark"] .toast { background: #f4f4f1; color: #0b0b0b; }
:root[data-theme="dark"] .toast.error svg { color: var(--critical); }
:root[data-theme="dark"] .toast.success svg { color: var(--good-ink); }

/* command palette */
.palette { width: 100%; max-width: 680px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; animation: pop .12s ease-out; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; height: 54px; font-size: 16px; }
.palette-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette-item.on { background: var(--accent-soft); }
.palette-item .pi-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.palette-item.on .pi-icon { background: var(--surface); color: var(--accent); }
.palette-item .pi-title { font-weight: 500; }
.palette-item .pi-sub { font-size: 12px; color: var(--text-3); }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); background: var(--surface-2); }
mark { background: var(--warning-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
:root[data-theme="dark"] mark { background: #5a4a14; }

/* dropdown menu */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text); text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .menu-head { padding: 8px 10px; }

/* typeahead */
.typeahead { position: relative; }
.typeahead-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 70; max-height: 260px; overflow-y: auto; padding: 4px; }
.typeahead-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.typeahead-list button:hover, .typeahead-list button.on { background: var(--accent-soft); }
.typeahead .selected { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }

/* drop zone */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--text-2);
  background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .dz-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 10px; background: var(--accent-soft); color: var(--accent); }
.dropzone.compact { padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; }
.dropzone.compact .dz-icon { margin: 0; width: 36px; height: 36px; }

/* ------------------------------------------------------------------ stat tiles, charts, meters */

.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat .stat-label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; font-weight: 500; }
.stat .stat-label svg { color: var(--text-3); }
.stat .stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.stat .stat-sub { font-size: 12.5px; color: var(--text-3); }
.stat .stat-sub b { color: var(--text-2); font-weight: 600; }
.stat.link { cursor: pointer; transition: border-color .12s; }
.stat.link:hover { border-color: var(--border-strong); }
.hero-value { font-size: 48px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }

.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--series-1); transition: fill .1s, opacity .1s; }
.chart .bar.dim { opacity: .45; }
.chart .bar.on { fill: var(--series-1-hover); }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .bar-label { fill: var(--text-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 5;
}
.chart-tip .tv { font-weight: 650; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .tl { color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.chart-tip .key { width: 10px; height: 2px; background: var(--series-1); border-radius: 1px; }
.view-toggle { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 2px; border-radius: 7px; border: 1px solid var(--border); }
.view-toggle button { border: 0; background: none; height: 24px; padding: 0 9px; border-radius: 5px; font-size: 12px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.view-toggle button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.barlist { display: flex; flex-direction: column; gap: 4px; }
.barlist-row { display: grid; grid-template-columns: minmax(100px, 150px) 1fr; align-items: center; gap: 12px; padding: 6px 6px; border-radius: 6px; }
.barlist-row:hover { background: var(--surface-2); }
.barlist-label { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.barlist-bar { height: 12px; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.barlist-val { font-size: 12px; color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.barlist-val .muted { font-weight: 400; }

.meter { height: 8px; border-radius: 4px; background: var(--meter-track); overflow: hidden; }
.meter > div { height: 100%; background: var(--series-1); border-radius: 4px; }
.meter-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.meter-row:last-child { border-bottom: 0; }

.timeline { position: relative; height: 6px; border-radius: 3px; background: var(--meter-track); }
.timeline > div { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 3px; }

/* ------------------------------------------------------------------ list items */

.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .li-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { width: 34px; height: 40px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; font-size: 9.5px; font-weight: 700; color: var(--text-2); flex: none; letter-spacing: .03em; }
.file-icon.pdf { color: #c4372f; }
.file-icon.xls, .file-icon.xlsx, .file-icon.csv { color: #1d7a45; }
.file-icon.doc, .file-icon.docx { color: #2a5cad; }
.icon-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.icon-tile.accent { background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------------ assistant */

.chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 0; height: calc(100vh - var(--topbar-h)); margin: -24px; }
.chat-side { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.chat-side .head { padding: 14px; border-bottom: 1px solid var(--border); }
.chat-sessions { overflow-y: auto; padding: 8px; flex: 1; }
.chat-session { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 13px; }
.chat-session:hover { background: var(--surface-2); color: var(--text); }
.chat-session.on { background: var(--accent-soft); color: var(--accent-ink); }
.chat-session .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-session .del { opacity: 0; }
.chat-session:hover .del { opacity: 1; }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 28px 24px 12px; }
.chat-inner { max-width: 860px; margin: 0 auto; }
.msg { display: flex; gap: 12px; margin-bottom: 22px; }
.msg .who { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 600; }
.msg.user .who { background: var(--surface-3); color: var(--text-2); }
.msg.assistant .who { background: var(--accent); color: #fff; }
.msg .bubble { min-width: 0; flex: 1; }
.msg.user .bubble .text { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: inline-block; white-space: pre-wrap; max-width: 100%; }
.msg-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.step-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.step-chip svg { color: var(--text-3); }
.step-detail { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 8px; white-space: pre-wrap; color: var(--text-2); overflow-x: auto; }
.msg-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.source-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: 320px; }
.source-chip:hover { border-color: var(--accent); text-decoration: none; }
.source-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thinking { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2); padding: 6px 0; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer-wrap { padding: 12px 24px 20px; }
.composer { max-width: 860px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2), var(--shadow); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; max-height: 180px; min-height: 24px; padding: 6px 0; line-height: 1.5; }
.composer-hint { max-width: 860px; margin: 6px auto 0; font-size: 11.5px; color: var(--text-3); text-align: center; }
.chat-welcome { text-align: center; padding: 6vh 0 24px; }
.chat-welcome .orb { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; text-align: left; }
.suggestion { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .12s, transform .12s; }
.suggestion:hover { border-color: var(--accent); transform: translateY(-1px); }
.suggestion .s-title { font-weight: 550; display: flex; align-items: center; gap: 8px; }
.suggestion .s-title svg { color: var(--accent); }
.suggestion .s-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

.md { line-height: 1.6; overflow-wrap: anywhere; }
.md > *:first-child { margin-top: 0; }
.md p, .md ul, .md ol { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 16px 0 8px; font-size: 15px; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; }
.md table { border-collapse: collapse; margin: 8px 0 12px; font-size: 13px; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.md td { font-variant-numeric: tabular-nums; }
.md blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.ref { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; padding: 0 6px; height: 19px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-ink); vertical-align: 1px; text-decoration: none; margin: 0 1px; }
.ref:hover { background: var(--accent-soft-2); text-decoration: none; }

/* assistant: attachments + change proposals */
.attach-row { max-width: 860px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 6px 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); max-width: 300px; }
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip.error { border-color: var(--critical); color: var(--critical); }
.msg.user .attach-chip { margin-top: 6px; }
.chat-drop { outline: 2px dashed var(--accent); outline-offset: -8px; background: var(--accent-soft); }
.op-card { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); margin-top: 12px; overflow: hidden; }
.op-card.executed { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.op-card.failed { border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.op-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.op-head h4 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.op-action { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.op-action .op-title { font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.op-action .op-num { width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; display: inline-grid; place-items: center; flex: none; }
.op-action ul { margin: 6px 0 0 28px; padding: 0; color: var(--text-2); font-size: 13px; }
.op-diff { margin: 8px 0 0 28px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.op-diff .lbl { color: var(--text-3); }
.op-diff .chg { font-variant-numeric: tabular-nums; }
.op-diff .chg s { color: var(--text-3); margin-right: 6px; }
.op-checks { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.op-checks .op-checks-title { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.check-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 2px 0; }
.check-item svg { flex: none; margin-top: 2px; }
.check-item.pass svg { color: var(--good); }
.check-item.warn svg { color: #c98500; }
.check-item.fail svg { color: var(--critical); }
.check-item .muted { font-size: 12px; }
.op-foot { display: flex; gap: 8px; align-items: center; padding: 12px 14px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ misc pages */

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: radial-gradient(1200px 600px at -10% -10%, #3987e5 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #1c5cab 0%, transparent 55%), #0d2a4f;
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h1 { font-size: 34px; letter-spacing: -0.03em; margin: 22px 0 10px; max-width: 460px; }
.login-art p { color: rgba(255, 255, 255, 0.78); max-width: 440px; font-size: 15px; }
.login-feats { display: grid; gap: 14px; margin-top: 34px; max-width: 440px; }
.login-feat { display: flex; gap: 12px; align-items: flex-start; }
.login-feat .lf-icon { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.12); display: grid; place-items: center; flex: none; }
.login-feat b { display: block; font-weight: 600; }
.login-feat span { color: rgba(255, 255, 255, 0.7); font-size: 13px; }
.login-form-wrap { display: grid; place-items: center; padding: 32px; }
.login-form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }

.steps { display: flex; gap: 0; margin-bottom: 22px; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-weight: 500; font-size: 13px; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--border-strong); font-size: 12px; font-weight: 600; flex: none; }
.step.on { color: var(--text); }
.step.on .n { border-color: var(--accent); background: var(--accent); color: #fff; }
.step.done .n { border-color: var(--accent); color: var(--accent); }
.step .bar { flex: 1; height: 1px; background: var(--border-strong); margin: 0 8px; }

.choice-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.choice { border: 1.5px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; background: var(--surface); transition: border-color .12s; }
.choice:hover { border-color: var(--border-strong); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice .c-title { font-weight: 600; display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.choice .c-sub { font-size: 12.5px; color: var(--text-2); }

.doc-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.doc-preview { height: calc(100vh - 200px); min-height: 520px; border: 0; width: 100%; border-radius: 0 0 var(--radius) var(--radius); background: var(--surface-2); }
.doc-preview-img { max-width: 100%; display: block; margin: 0 auto; }
.text-preview { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; line-height: 1.55; max-height: 560px; overflow: auto; color: var(--text-2); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.fact { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; border: 1px solid var(--border); }
.fact .fl { font-size: 11.5px; color: var(--text-3); }
.fact .fv { font-weight: 550; font-size: 13px; overflow-wrap: anywhere; }

.profile-head { display: flex; gap: 16px; align-items: center; }
.contact-line { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; margin-top: 6px; }
.contact-line span, .contact-line a { display: inline-flex; gap: 6px; align-items: center; }
.contact-line svg { color: var(--text-3); }

.pipeline { display: flex; gap: 6px; flex-wrap: wrap; }
.pipeline button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.pipeline button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.quick-ask { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-sm); }
.quick-ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2); }
.quick-ask input { flex: 1; border: 0; outline: 0; background: transparent; height: 36px; font-size: 14.5px; }
.quick-ask .spark { color: var(--accent); }

.code-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-family: var(--mono); font-size: 12.5px; overflow-x: auto; }
.code-box span { flex: 1; white-space: nowrap; }
.setup-steps { counter-reset: s; display: grid; gap: 14px; }
.setup-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.setup-step::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.setup-step.done::before { content: "✓"; background: var(--good-soft); color: var(--good-ink); }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1320px) {
  .hide-md { display: none; }
}
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .chat-layout { grid-template-columns: 1fr; margin: -16px; }
  .chat-side { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .suggestions { grid-template-columns: 1fr; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .search-trigger kbd { display: none; }
}
@media (max-width: 600px) {
  .grid-5, .grid-4 { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
}
@media print {
  .sidebar, .topbar, .actions, .toolbar { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
