/* MaxDok styles. Colours are tokens so light and dark themes share every rule. */

:root {
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --surface-3: #e8edf5;
  --border: #e2e7ef;
  --border-strong: #cfd7e3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --side-bg: #0b1324;
  --side-text: #cbd5e1;
  --side-muted: #7c8aa5;
  --side-hover: rgba(255, 255, 255, .06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-ctl: 9px;
  --radius-lg: 14px;
  --side-strong: #fff;
  --side-line: rgba(255, 255, 255, .08);
  --side-line-strong: rgba(255, 255, 255, .16);
  --side-fill: rgba(255, 255, 255, .05);
  --side-input: rgba(0, 0, 0, .25);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 50px rgba(15, 23, 42, .18);
  --tint: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--font);
  font-size: 15px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #121a2b;
  --surface-2: #172135;
  --surface-3: #1e2a42;
  --border: #23304a;
  --border-strong: #2f3d5a;
  --text: #e6ebf4;
  --text-2: #c3cddd;
  --muted: #8b98b0;
  --danger: #f87171;
  --warn: #fbbf24;
  --ok: #34d399;
  --side-bg: #080d19;
  --shadow: none;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
  --tint: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0b1020;
    --surface: #121a2b;
    --surface-2: #172135;
    --surface-3: #1e2a42;
    --border: #23304a;
    --border-strong: #2f3d5a;
    --text: #e6ebf4;
    --text-2: #c3cddd;
    --muted: #8b98b0;
    --danger: #f87171;
    --warn: #fbbf24;
    --ok: #34d399;
    --side-bg: #080d19;
    --shadow: none;
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .5);
    --tint: color-mix(in srgb, var(--accent) 18%, var(--surface));
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.015em; margin: 0; line-height: 1.25; }
h2 { font-size: 1rem; font-weight: 650; margin: 0 0 .75rem; }
h3 { font-size: .92rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.mono, code, pre { font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace; font-size: .88em; }
pre.note-body { white-space: pre-wrap; word-wrap: break-word; margin: 0; font-family: inherit; font-size: 1rem; }
.icon { flex: none; vertical-align: middle; }

/* ---- Layout ---- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .2rem .55rem 1.2rem; color: var(--side-strong); font-weight: 750; font-size: 1.12rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { max-height: 34px; max-width: 170px; object-fit: contain; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: .9rem; font-weight: 800; }
.brand .sub { display: block; font-size: .7rem; font-weight: 500; color: var(--side-muted); letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 1rem .7rem .35rem; }
.nav a, .nav button.linkish {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--side-text); font-weight: 500; font-size: .93rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.nav a:hover, .nav button.linkish:hover { background: var(--side-hover); color: var(--side-strong); text-decoration: none; }
.nav a.active { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--side-strong); }
.nav a.active .icon { color: color-mix(in srgb, var(--accent) 55%, #fff); }
.nav a .nav-count { margin-left: auto; min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.25rem; text-align: center; }
.sidebar .spacer { flex: 1; }
.userbox { border-top: 1px solid var(--side-line); padding-top: .8rem; }
.sidebar-foot .version { color: var(--side-muted); font-size: .72rem; padding: .5rem .7rem 0; }
.userchip { display: flex; align-items: center; gap: .6rem; padding: .3rem .7rem .6rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.userchip .who { min-width: 0; font-size: .82rem; }
.userchip .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip .who .ws { color: var(--side-muted); font-size: .74rem; }

.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: .75rem; padding: .7rem 2rem; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
}
.topbar .menu-btn { display: none; }
.main { padding: 1.6rem 2rem 4rem; max-width: 1320px; width: 100%; }

/* Bottom-left menus: Admin and the person's own menu open upwards */
.sidebar-foot { border-top: 1px solid var(--side-line); padding-top: .6rem; display: grid; gap: .25rem; }
.side-menu { position: relative; }
.side-menu > summary { list-style: none; cursor: pointer; }
.side-menu > summary::-webkit-details-marker { display: none; }
.side-trigger { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 500; font-size: .93rem; }
.side-trigger:hover, .side-menu[open] > .side-trigger { background: var(--side-hover); color: var(--side-strong); }
.side-trigger.active { color: var(--side-strong); }
.side-trigger span { flex: 1; }
.side-menu .chev { margin-left: auto; transition: transform .15s; opacity: .7; }
.side-menu:not([open]) .chev { transform: rotate(180deg); }
.side-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 70; background: var(--side-pop, #111c33); border: 1px solid var(--side-line); border-radius: 12px; padding: .35rem; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.user-menu > summary.userchip { border-radius: var(--radius-sm); padding: .5rem .7rem; }
.user-menu > summary.userchip:hover, .user-menu[open] > summary.userchip { background: var(--side-hover); }
img.avatar { object-fit: cover; padding: 0; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.5rem; }
.help-menu .menu-pop { min-width: 220px; }

/* ---- Search ---- */
.search { position: relative; flex: 1; max-width: 560px; }
.search input[type=search] {
  width: 100%; padding: .6rem .8rem .6rem 2.3rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-ctl); font: inherit; color: var(--text);
}
.search .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font: 600 .72rem/1 ui-monospace, monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: .2rem .4rem; background: var(--surface-2); }
.search-pop {
  position: absolute; top: calc(100% + 6px); left: 0; width: min(620px, 92vw); z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); max-height: 70vh; overflow: auto; padding: .5rem;
}
.search-pop:empty { display: none; }
.result-group { padding: .25rem .4rem .5rem; }
.result-group h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .45rem .3rem .25rem; }
.result-group a { display: flex; align-items: center; gap: .55rem; padding: .4rem .5rem; border-radius: 7px; color: var(--text); }
.result-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); }
.result-group a:hover { background: var(--surface-2); text-decoration: none; }
.result-group.web-search { border-top: 1px solid var(--border); padding-top: .4rem; }
.result-group.web-search a { color: var(--accent); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; padding: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.topbar .right { margin-left: auto; display: flex; gap: .5rem; align-items: center; }

/* ---- Page header ---- */
.crumbs { font-size: .84rem; color: var(--muted); margin-bottom: .45rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.page-head .title { display: flex; gap: .9rem; align-items: center; }
.page-head .sub { color: var(--muted); margin-top: .25rem; font-size: .93rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.3rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .85rem; gap: .5rem; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: .55rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 1rem 1.2rem .2rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.tile { display: block; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.tile .title { font-weight: 650; }
.tile-head { display: flex; align-items: center; gap: .7rem; }
.stats { display: flex; gap: 1rem; color: var(--muted); font-size: .84rem; margin-top: .55rem; }
.stat { display: flex; align-items: center; gap: .3rem; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi { padding: 1rem 1.2rem; }
.kpi .n { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: .84rem; }

/* Type badges: coloured rounded squares with an icon */
.tbadge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--tint); color: var(--accent); }
.tbadge.lg { width: 46px; height: 46px; border-radius: 12px; }
.tbadge.sm { width: 26px; height: 26px; border-radius: 7px; }
.tbadge.xs { width: 22px; height: 22px; border-radius: 6px; }
.tbadge.t-wan { background: color-mix(in srgb, #0ea5e9 14%, var(--surface)); color: #0284c7; }
.tbadge.t-lan { background: color-mix(in srgb, #6366f1 14%, var(--surface)); color: #4f46e5; }
.tbadge.t-wifi { background: color-mix(in srgb, #14b8a6 14%, var(--surface)); color: #0d9488; }
.tbadge.t-network_device { background: color-mix(in srgb, #f97316 14%, var(--surface)); color: #ea580c; }
.tbadge.t-credential { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); color: #b45309; }
.tbadge.t-server { background: color-mix(in srgb, #8b5cf6 14%, var(--surface)); color: #7c3aed; }
.tbadge.t-workstation { background: color-mix(in srgb, #3b82f6 14%, var(--surface)); color: #2563eb; }
.tbadge.t-printer { background: color-mix(in srgb, #ec4899 14%, var(--surface)); color: #db2777; }
.tbadge.t-user { background: color-mix(in srgb, #10b981 14%, var(--surface)); color: #059669; }
.tbadge.t-asset { background: color-mix(in srgb, #64748b 16%, var(--surface)); color: #475569; }
:root[data-theme="dark"] .tbadge { filter: brightness(1.35); }

/* ---- Field lists ---- */
dl.fields { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: .55rem 1rem; margin: 0; }
dl.fields dt { color: var(--muted); font-size: .9rem; }
dl.fields dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
dl.fields.values dd { white-space: normal; }
.copy { cursor: pointer; border-bottom: 1px dashed var(--border-strong); }
.copy:hover { border-bottom-color: var(--accent); }
.secret { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.secret .val { font-family: ui-monospace, monospace; letter-spacing: .08em; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem .2rem .3rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .86rem; }
.chip:hover { text-decoration: none; border-color: var(--accent); }

/* ---- Tables ---- */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .55rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.list td { padding: .7rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: var(--surface-2); }
table.list td.name a { font-weight: 600; color: var(--text); }
table.list td.name a:hover { color: var(--accent); }
.table-wrap { overflow-x: auto; }
.group-row td { background: var(--surface-2); font-weight: 600; font-size: .84rem; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.4rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; gap: .45rem; padding: .65rem .7rem; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.count { background: var(--surface-3); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; color: var(--muted); font-weight: 600; }

/* ---- Badges ---- */
.badge { display: inline-block; white-space: nowrap; font-size: .74rem; font-weight: 600; padding: .12rem .55rem; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.badge.expired { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.badge.expiring { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }

/* ---- Buttons and forms ---- */
.btn, button, input[type=submit] {
  display: inline-flex; align-items: center; gap: .45rem; justify-content: center;
  font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2;
  padding: .58rem 1rem; border-radius: var(--radius-ctl); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08); transition: filter .12s, background .12s;
}
.btn:hover, button:hover { filter: brightness(1.07); text-decoration: none; }
.btn.ghost, button.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm, button.sm { padding: .36rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn.xs, button.xs { padding: .2rem .5rem; font-size: .76rem; border-radius: 6px; box-shadow: none; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date],
input[type=search], input[type=number], input[type=tel], select, textarea {
  font: inherit; width: 100%; padding: .58rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-ctl);
  background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); border-color: var(--accent); }
input[type=color] { width: 64px; height: 40px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); }
textarea.mono { font-size: .9rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; color: var(--text-2); }
.form-row.checkbox label { display: inline; font-weight: 500; }
.form-row .help { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.errorlist { color: var(--danger); margin: .25rem 0; padding: 0; list-style: none; font-size: .85rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; }
.form-actions .right { margin-left: auto; }

/* Switch */
.switch { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); padding: 0; box-shadow: none; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { left: 18px; }
.switch:hover { filter: none; }
.toggle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .6rem; }
.toggle-item { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.toggle-item .lbl { flex: 1; min-width: 0; }
.toggle-item .lbl div { font-weight: 600; font-size: .9rem; }
.toggle-item .lbl span { font-size: .78rem; color: var(--muted); }
.toggle-item form { margin: 0; }

/* ---- Messages ---- */
.messages { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.messages li { padding: .7rem 1rem; border-radius: 10px; margin-bottom: .5rem; background: color-mix(in srgb, var(--ok) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 28%, transparent); }
.messages li.error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.messages li.info, .messages li.warning { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }

/* ---- Photos ---- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.gallery figure { margin: 0; background: var(--surface-2); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.gallery figcaption { min-height: 1.9rem; padding: .35rem .55rem; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone {
  display: flex; align-items: center; justify-content: center; gap: .6rem; border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 1.1rem; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 1rem;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dropzone input[type=file] { display: none; }
.dropzone strong { color: var(--accent); }
.lightbox { position: fixed; inset: 0; background: rgba(2, 6, 23, .9); display: none; z-index: 100; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 76vh; border-radius: 8px; }
.lightbox .bar { display: flex; gap: .5rem; margin-top: .8rem; align-items: center; width: min(820px, 100%); }
.lightbox .bar input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .lightbox .bar { flex-wrap: wrap; } .lightbox .bar input { flex-basis: 100%; } }
.lightbox .meta { color: #c9ced6; font-size: .8rem; margin-top: .45rem; }
.lightbox .close { position: absolute; top: 1rem; right: 1rem; background: transparent; border: 0; font-size: 2rem; color: #fff; box-shadow: none; }
.lightbox .nav-btn { position: absolute; top: 45%; background: rgba(255,255,255,.12); border: 0; font-size: 1.6rem; color: #fff; padding: .4rem .8rem; box-shadow: none; }
.lightbox .prev { left: 1rem; } .lightbox .next { right: 1rem; }

.empty { text-align: center; color: var(--muted); padding: 2.2rem 1rem; }
.empty .btn { margin-top: .8rem; }
.empty-inline { color: var(--muted); font-size: .88rem; padding: .3rem 0; }

/* Type picker */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.type-card { display: flex; gap: .85rem; align-items: flex-start; color: var(--text); }
.type-card:hover { text-decoration: none; }
.type-card .d { color: var(--muted); font-size: .84rem; }

/* Photos & files on a record */
.sub-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .6rem; }
details.paste { margin-top: .7rem; }
details.paste summary { cursor: pointer; color: var(--muted); font-size: .88rem; display: inline-flex; align-items: center; gap: .4rem; }
details.paste textarea { width: 100%; }
.file-list { display: grid; gap: .4rem; }
.file-row { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 10px; }
.file-row .lbl { flex: 1; min-width: 0; }
.file-row .lbl a { font-weight: 600; word-break: break-all; }
.file-row .lbl span { display: block; color: var(--muted); font-size: .78rem; }
pre.file-text { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; overflow: auto; max-height: 75vh; font-size: .84rem; margin: 0; white-space: pre; }

/* Drop-down menu (Add record) */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .35rem; }
.menu-pop a { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 8px; color: var(--text); font-weight: 500; font-size: .92rem; }
.menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .menu-foot { border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .3rem; }

/* Theme switch: sun, a sliding switch, moon */
.theme-switch { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .6rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); box-shadow: none; font-weight: 600; font-size: .82rem; }
.theme-switch:hover { filter: none; color: var(--text); border-color: var(--border-strong); }
.theme-switch .track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.theme-switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #f59e0b; transition: left .15s, background .15s; }
.theme-switch[aria-checked="true"] .track { background: var(--accent); border-color: var(--accent); }
.theme-switch[aria-checked="true"] .track::after { left: 16px; background: #fff; }
.theme-switch .lbl-text { min-width: 5.2em; text-align: left; }

/* Ticked lists (assigned devices on a contact) */
.form-row div:has(> div > label > input[type=checkbox]) { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: .4rem .6rem; background: var(--surface); }
.form-row div > div > label:has(input[type=checkbox]) { display: flex; gap: .5rem; align-items: center; font-weight: 500; padding: .2rem 0; color: var(--text); }

/* Extra fields on the record form */
.extra-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: .5rem; margin-bottom: .5rem; }
.type-switch { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.type-switch select { min-width: 220px; }

/* Modal (link picker) */
dialog.modal { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; width: min(560px, 94vw); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(2, 6, 23, .55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: .8rem 1.2rem 1.2rem; max-height: 60vh; overflow: auto; }
.pick-list form { margin: 0; }
.pick-list button.pick { display: flex; width: 100%; align-items: center; gap: .65rem; background: none; border: 1px solid transparent; color: var(--text); padding: .5rem .55rem; border-radius: 9px; box-shadow: none; font-weight: 500; text-align: left; }
.pick-list button.pick:hover { background: var(--surface-2); border-color: var(--border); filter: none; }
.pick-list .meta { color: var(--muted); font-size: .8rem; margin-left: auto; }

/* ---- Auth pages ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(1000px 500px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
  radial-gradient(800px 400px at 110% 110%, color-mix(in srgb, var(--accent) 14%, transparent), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 2.1rem; box-shadow: var(--shadow-lg); }
.auth-card .brand { justify-content: center; padding: 0 0 1.3rem; color: var(--text); }
.auth-card .brand img { max-height: 56px; max-width: 240px; }
.auth-card h1 { font-size: 1.3rem; margin-bottom: 1.1rem; text-align: center; }
.allauth p { margin: 0 0 .9rem; }
.allauth label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; }
.allauth input[type=checkbox] { width: auto; margin-right: .4rem; vertical-align: middle; }
.allauth p:has(> input[type=checkbox]) { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: .4rem; }
.allauth p:has(> input[type=checkbox]) label { margin: 0; font-weight: 500; }
.allauth form button { width: 100%; }
.allauth section { margin-bottom: 1.5rem; }
.allauth ul { padding-left: 1.1rem; }
.account-page form button { width: auto; }
.allauth img { background: #fff; padding: .5rem; border-radius: 8px; }
.main.account-page { max-width: 760px; }
.account-page h1 { margin-bottom: 1rem; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 60; height: 100vh; box-shadow: var(--shadow-lg); }
  .sidebar.open { display: flex; }
  .topbar { padding: .6rem 1rem; }
  .topbar .menu-btn { display: inline-grid; }
  .search kbd { display: none; }
  .theme-switch .lbl-text { display: none; }
  .extra-row { grid-template-columns: minmax(0, 1fr) auto; }
  .extra-row input[name=extra_value] { grid-column: 1 / -1; grid-row: 2; }
  .main { padding: 1.1rem 1rem 3rem; }
  .grid-2, .grid-3, .grid-main, .form-grid { grid-template-columns: minmax(0, 1fr); }
  dl.fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .card-head { flex-wrap: wrap; gap: .5rem; }
  dl.fields dd { margin-bottom: .7rem; }
}

/* Phones: tables become stacked cards instead of scrolling sideways */
@media (max-width: 640px) {
  table.list.cards thead { display: none; }
  table.list.cards, table.list.cards tbody, table.list.cards tr { display: block; width: 100%; }
  table.list.cards tr { padding: .6rem 0; border-bottom: 1px solid var(--border); }
  table.list.cards tr:last-child { border-bottom: 0; }
  table.list.cards td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .2rem .1rem; text-align: right; }
  table.list.cards td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-family: "Inter", ui-sans-serif, system-ui, sans-serif; letter-spacing: 0; text-align: left; flex: none; }
  table.list.cards td.name { display: block; text-align: left; font-size: 1rem; padding-bottom: .3rem; }
  table.list.cards td.name::before, table.list.cards td.row-actions::before { content: none; }
  table.list.cards td.row-actions { justify-content: flex-start; padding-top: .4rem; }
  table.list.cards td.blank { display: none; }
  table.list.cards tbody tr:hover td { background: none; }
  .table-wrap:has(> table.cards) { overflow: visible; }
  .file-row { flex-wrap: wrap; }
}

input[type=file] { font: inherit; font-size: .88rem; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: .7rem; padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }

/* Billing */
.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 12px; margin-bottom: 1.2rem;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); font-size: .92rem; }
.notice .icon { flex: none; margin-top: .15rem; color: var(--accent); }
.notice.error { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.notice.error .icon { color: var(--danger); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.plan { position: relative; display: flex; flex-direction: column; }
.plan.popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); }
.plan-tag { position: absolute; top: -.7rem; right: 1rem; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; }
.plan .price .n { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.checks { list-style: none; padding: 0; margin: .4rem 0 1.2rem; display: grid; gap: .45rem; font-size: .9rem; flex: 1; }
.checks li { display: flex; gap: .5rem; align-items: center; }
.checks .icon { color: var(--ok, #059669); flex: none; }
@media (max-width: 900px) { .plans { grid-template-columns: minmax(0, 1fr); } }

/* Users */
.action-list { display: grid; gap: .5rem; justify-items: start; }
.action-list form { margin: 0; }
.inline-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.inline-form input { width: auto; }

/* Integrations */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.integration { display: flex; flex-direction: column; }
.integration .title { font-weight: 650; }

/* Export options */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .4rem .8rem; }
.check-line { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.check-line input { width: auto; margin: 0; }

/* Help & FAQ */
.help-search { display: flex; gap: .5rem; max-width: 560px; margin-bottom: 1.4rem; }
.help-search input { flex: 1; }
.help-group { margin-bottom: 1.6rem; }
.help-group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .6rem; }
.help-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; }
.help-list a { display: block; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; }
.help-list a:hover { border-color: var(--accent); }
.help-list a strong { display: block; margin-bottom: .2rem; }
.help-list a span { color: var(--muted); font-size: .86rem; }
.article { max-width: 760px; line-height: 1.65; }
.article h2 { margin-top: 1.6rem; }
.article h3 { margin-top: 1.2rem; }
.article ol, .article ul { padding-left: 1.3rem; }
.article li { margin: .25rem 0; }
.article code { font-family: var(--mono, ui-monospace, monospace); font-size: .88em; background: var(--surface-2, rgba(127,127,127,.12)); padding: .1rem .35rem; border-radius: 5px; }
.article pre { background: var(--surface-2, rgba(127,127,127,.12)); padding: .8rem 1rem; border-radius: 8px; overflow-x: auto; }
.article pre code { background: none; padding: 0; }
.article table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .92rem; }
.article th, .article td { border: 1px solid var(--border); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.article blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 3px solid var(--accent); background: var(--surface-2, rgba(127,127,127,.08)); border-radius: 0 8px 8px 0; }
.report { padding: .8rem 0; border-top: 1px solid var(--border); }
.report:first-of-type { border-top: 0; }
.report.resolved { opacity: .6; }
.report pre { white-space: pre-wrap; font-family: inherit; margin: .4rem 0 0; }
.grid-help { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; font-size: .92rem; }
@media (max-width: 900px) { .grid-help { grid-template-columns: minmax(0, 1fr); } }

/* Sign in with Google / Microsoft */
.social-login { margin-top: 1.2rem; display: grid; gap: .55rem; }
.social-login .or { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .82rem; }
.social-login .or::before, .social-login .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn.wide { width: 100%; justify-content: center; }

/* Password generator */
.pw-wrap { display: flex; gap: .4rem; align-items: stretch; }
.pw-wrap input { flex: 1; min-width: 0; }
.pw-wrap .pw-gen { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.pwgen-out { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; word-break: break-all; min-height: 3rem; user-select: all; }
.pwgen input[type=range] { width: 100%; }

/* ---- DokBot Max ---- */
.dokbot-mini { margin: 1rem .1rem 0; padding: .6rem; border-radius: var(--radius); background: var(--side-fill); border: 1px solid var(--side-line); transition: border-color .15s, background .15s; }
.dokbot-mini.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.dokbot-mini-head { display: flex; align-items: center; gap: .45rem; color: var(--side-strong); font-weight: 650; font-size: .88rem; padding: 0 .1rem .45rem; }
.dokbot-mini-head .icon { color: color-mix(in srgb, var(--accent) 50%, #fbbf24); }
.dokbot-mini .dokbot-open { margin-left: auto; background: none; border: 0; box-shadow: none; color: var(--side-muted); padding: .1rem; transform: rotate(90deg); }
.dokbot-mini .dokbot-open:hover { color: var(--side-strong); }
.dokbot-mini textarea { width: 100%; resize: none; background: var(--side-input); border: 1px solid var(--side-line); color: var(--side-strong); font-size: .85rem; padding: .45rem .55rem; border-radius: var(--radius-sm); min-height: 0; }
.dokbot-mini textarea::placeholder { color: var(--side-muted); }
.dokbot-mini textarea:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, #fff); }
.dokbot-mini-tools { display: flex; gap: .25rem; margin-top: .4rem; }
.dokbot-mini-tools button { background: transparent; border: 0; box-shadow: none; color: var(--side-text); padding: .3rem .4rem; border-radius: 7px; display: inline-grid; place-items: center; }
.dokbot-mini-tools button:hover { background: var(--side-hover); color: var(--side-strong); }
.dokbot-mini-tools .send { margin-left: auto; background: var(--accent); color: #fff; }
.dokbot-mini-tools .send:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
[data-dokbot-mic].on { color: var(--danger) !important; animation: dokbot-pulse 1.2s infinite; }
@keyframes dokbot-pulse { 50% { opacity: .45; } }
.topbar .dokbot-launch { display: none; }

.dokbot { position: fixed; top: 0; bottom: 0; left: 248px; width: min(480px, calc(100vw - 248px)); z-index: 55; background: var(--surface); border-right: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.dokbot[hidden] { display: none; }
.dokbot-head { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border-bottom: 1px solid var(--border); }
.dokbot-head select { width: auto; max-width: 190px; margin-left: auto; font-size: .82rem; padding: .3rem .5rem; }
.dokbot-head select[hidden] + .icon-btn { margin-left: auto; }
.dokbot-title { display: flex; flex-direction: column; line-height: 1.15; }
.dokbot-title span { color: var(--muted); font-size: .76rem; }
.dokbot-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; background: color-mix(in srgb, #f59e0b 22%, var(--surface)); flex: none; }
.dokbot-avatar.sm { width: 28px; height: 28px; font-size: 1rem; }
.dokbot-log { flex: 1; overflow-y: auto; padding: 1rem .9rem; display: flex; flex-direction: column; gap: .8rem; }
.dokbot-msg { display: flex; gap: .5rem; align-items: flex-start; }
.dokbot-msg.me { justify-content: flex-end; }
.dokbot-msg .bubble { max-width: 88%; padding: .6rem .8rem; border-radius: 14px; background: var(--surface-2); font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; min-width: 0; }
.dokbot-msg.me .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.dokbot-msg.bot .bubble { border-top-left-radius: 4px; }
.dokbot-msg .bubble p { margin: 0 0 .45rem; }
.dokbot-msg .bubble p:last-child { margin-bottom: 0; }
.dokbot-msg .bubble ul, .dokbot-msg .bubble ol { margin: .2rem 0 .45rem; padding-left: 1.2rem; }
.dokbot-msg .bubble code { font-size: .82em; background: color-mix(in srgb, var(--text) 8%, transparent); padding: .05rem .3rem; border-radius: 4px; }
.dokbot-msg .chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .35rem 0; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.dokbot-msg.me .chip { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); color: #fff; }
.chip.link { color: var(--accent); font-weight: 600; }
.chip.link:hover { text-decoration: none; border-color: var(--accent); }
.chip button { background: none; border: 0; box-shadow: none; padding: 0 .1rem; color: inherit; font-size: 1rem; line-height: 1; }
.dokbot-empty { text-align: center; color: var(--text-2); margin: auto 0; padding: 1rem; }
.dokbot-empty p { margin: .4rem 0; }
.dokbot-big { font-size: 2.6rem; }
.dokbot-ideas { display: flex; flex-direction: column; gap: .4rem; margin-top: .9rem; align-items: center; }
.dokbot-ideas .chip { cursor: pointer; font-size: .82rem; padding: .4rem .8rem; box-shadow: none; }
.dokbot-ideas .chip:hover { border-color: var(--accent); color: var(--accent); }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: dokbot-pulse 1s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
.dokbot-import { margin-top: .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); padding: .6rem; }
.dokbot-import-title { font-weight: 650; margin-bottom: .4rem; }
.dokbot-table { overflow-x: auto; max-width: 100%; }
.dokbot-table table { border-collapse: collapse; font-size: .76rem; min-width: 100%; }
.dokbot-table th, .dokbot-table td { border-bottom: 1px solid var(--border); padding: .25rem .4rem; text-align: left; white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.dokbot-table th { color: var(--muted); font-weight: 600; }
.dokbot-problems { color: var(--warn); font-size: .78rem; margin-top: .4rem; }
.dokbot-import-actions { display: flex; gap: .4rem; margin-top: .55rem; }
.dokbot-import-done { color: var(--ok); font-weight: 600; font-size: .85rem; margin-top: .5rem; }
.dokbot-composer { border-top: 1px solid var(--border); padding: .65rem .8rem .8rem; }
.dokbot-composer textarea { width: 100%; resize: none; min-height: 0; }
.dokbot-staged { display: flex; flex-wrap: wrap; gap: .3rem; }
.dokbot-staged:not(:empty) { margin-bottom: .45rem; }
.dokbot-tools { display: flex; align-items: center; gap: .35rem; margin-top: .45rem; }
.dokbot-tools .btn span { font-size: .8rem; }
.dokbot-tools button[type=submit] { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; }
.dokbot-hint { color: var(--muted); font-size: .74rem; line-height: 1.2; }
.dokbot-drop { display: none; position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 2px dashed var(--accent); border-radius: 4px; color: var(--accent); font-weight: 650; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; pointer-events: none; }
.dokbot.dragging .dokbot-drop { display: flex; }
@media (max-width: 900px) {
  .topbar .dokbot-launch { display: inline-grid; }
  .dokbot { left: 0; width: 100vw; border-right: 0; }
}
.dokbot-avatar.xs { width: 22px; height: 22px; font-size: .85rem; background: rgba(245, 158, 11, .25); }
@media (max-width: 640px) {
  .dokbot-title span { display: none; }
  .dokbot-head { gap: .4rem; padding: .6rem; }
  .dokbot-head select { max-width: 120px; }
}

/* Live demo */
.demo-banner { display: flex; align-items: center; gap: .5rem; padding: .45rem 1.2rem; font-size: .86rem; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.demo-banner svg { flex: none; color: var(--accent); }
.plan-banner.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); border-bottom-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.plan-banner.warn svg { color: var(--warn); }
.plan-banner a { font-weight: 600; margin-left: .3rem; }
.demo-login { margin: 0 0 1.2rem; padding: .8rem 1rem; border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.demo-login p { margin: .35rem 0 .6rem; line-height: 1.7; }
.auth-foot { margin: 1.4rem 0 0; text-align: center; font-size: .78rem; color: var(--muted); }

/* Audit log */
.audit-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.audit-filters > * { width: auto; margin: 0; }
.audit-filters input[type=search] { flex: 1 1 220px; }
.audit-filters select { flex: 0 1 190px; min-width: 0; }
.audit-row { display: grid; grid-template-columns: 11rem 1fr; gap: .9rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.audit-row:first-child { border-top: 0; padding-top: 0; }
.audit-row .when { color: var(--muted); font-size: .84rem; }
.audit-row .what { min-width: 0; overflow-wrap: anywhere; }
.audit-act { font-weight: 600; }
.audit-act.a-deleted, .audit-act.a-sign_in_failed { color: var(--danger); }
.audit-act.a-viewed_password, .audit-act.a-exported, .audit-act.a-shared { color: var(--accent); }
.audit-changes { margin: .3rem 0; padding-left: 1rem; font-size: .86rem; }
.audit-changes .k { color: var(--muted); }
.audit-changes del { color: var(--danger); text-decoration: line-through; }
.audit-changes ins { text-decoration: none; }
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin-top: 1rem; }
.card .audit-row .when { font-size: .8rem; }
.stack .card .audit-row { grid-template-columns: 1fr; gap: .1rem; }
@media (max-width: 700px) { .audit-row { grid-template-columns: 1fr; gap: .2rem; } }

/* Shared (public, read-only) pages */
.share-body { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.share-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.4rem; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.share-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.share-brand img { max-height: 40px; max-width: 200px; }
.share-brand .mark { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.share-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 2rem; }
.share-section { margin-top: 1.6rem; }
.share-h { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1.05rem; margin: 0 0 .7rem; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .9rem; }
.share-record .tile-head { margin-bottom: .6rem; }
.share-contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.share-note { margin-bottom: .6rem; }
.share-note summary { cursor: pointer; }
.share-narrow { max-width: 460px; margin: 3rem auto; }
.share-foot { text-align: center; padding: 1.2rem; color: var(--muted); font-size: .8rem; }
@media (max-width: 520px) { .share-grid { grid-template-columns: 1fr; } }
.code-block { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem; margin: .3rem 0 .8rem; }
.danger-text { color: var(--danger); }
.card-head .actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
a.kpi { color: inherit; text-decoration: none; } a.kpi:hover { border-color: var(--accent); }
.inline-actions { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; }

/* Knowledge base */
.kb-search { margin-bottom: .8rem; max-width: 460px; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips .chip { padding: .3rem .75rem; font-size: .86rem; }
.chip.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip .count { color: var(--muted); font-weight: 500; }
.kb-row { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.kb-row:last-child { border-bottom: 0; }
.link-button { background: none; border: 0; box-shadow: none; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; }

/* Checklists */
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.progress.done > span { background: var(--ok); }
.check-item { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.check-item:last-child { border-bottom: 0; }
.check-step { display: flex; align-items: flex-start; gap: .6rem; border-bottom: 1px solid var(--border); }
.check-step:last-child { border-bottom: 0; }
.check-step .check-item { flex: 1; border-bottom: 0; }
.check-step .check-meta .chip { font-size: .75rem; }
.step-assign { padding-top: .6rem; flex: none; }
.step-assign[open] { flex-basis: 100%; }
.check-step:has(.step-assign[open]) { flex-wrap: wrap; }
.step-assign summary { list-style: none; cursor: pointer; text-align: right; }
.step-assign summary::-webkit-details-marker { display: none; }
.owner-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.owner-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--muted); }
.step-assign .owner-form { margin: .3rem 0 .7rem 1.95rem; }
.owner-form select, .owner-form input[type=date] { width: auto; max-width: 100%; }
.work-row { display: flex; justify-content: space-between; gap: .8rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.work-row:last-child { border-bottom: 0; }
.work-row .when { font-size: .8rem; white-space: nowrap; color: var(--muted); }
.work-row .when.late { color: var(--danger); font-weight: 600; }
.work-row .when.today { color: var(--warn); font-weight: 600; }
.check-item input[type=checkbox] { width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; flex: none; cursor: pointer; }
.check-item.done .check-text { text-decoration: line-through; color: var(--muted); }
.check-item .check-meta { font-size: .8rem; color: var(--muted); }
.share-tick { width: 1.25rem; height: 1.25rem; flex: none; margin-top: .1rem; border: 2px solid var(--border); border-radius: 6px; display: grid; place-items: center; color: #fff; }
.check-item.done .share-tick { background: var(--ok); border-color: var(--ok); }
.run-row { display: grid; grid-template-columns: 1fr 140px auto; gap: .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.run-row:last-child { border-bottom: 0; }
@media (max-width: 640px) { .run-row { grid-template-columns: 1fr; gap: .3rem; } }

/* Runbook (printable) */
.runbook h2 { margin-top: 1.6rem; padding-bottom: .3rem; border-bottom: 2px solid var(--border); }
.runbook h3 { margin: 1rem 0 .3rem; }
.runbook table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.runbook th, .runbook td { text-align: left; padding: .3rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.runbook .rb-record { break-inside: avoid; margin-bottom: .8rem; }
.runbook .rb-fields { display: grid; grid-template-columns: max-content 1fr; gap: .15rem 1rem; font-size: .9rem; }
.runbook .rb-fields dt { color: var(--muted); }
.runbook .rb-fields dd { margin: 0; word-break: break-word; }
.runbook-cover { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.powered-by { display: none; }
@media print {
  .powered-by { display: block; margin-top: 2rem; padding-top: .6rem; border-top: 1px solid #ddd; font-size: 11px; color: #555 !important; text-align: right; }
  .sidebar, .topbar, .no-print, .messages, .dokbot, .demo-banner { display: none !important; }
  body, .main, .main-col { background: #fff !important; color: #000 !important; margin: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .runbook h2 { break-after: avoid; }
}
.switch-card details { border-top: 1px solid var(--border); padding: .7rem 0 .2rem; }
.switch-card summary { cursor: pointer; padding: .2rem 0; }
.switch-card details form { margin-top: .5rem; }

/* Version history */
.history-entry { margin-bottom: 1rem; }
.history-diff td { vertical-align: top; font-size: .88rem; overflow-wrap: anywhere; }
.history-diff td.before { color: var(--danger); }
.history-diff td.after { color: var(--ok); }
.health-badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .2rem; }

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sortable::after { content: "↕"; opacity: .35; margin-left: .3rem; font-size: .8em; }
th.sortable[aria-sort="ascending"]::after { content: "↑"; opacity: .9; }
th.sortable[aria-sort="descending"]::after { content: "↓"; opacity: .9; }
.row-pick { width: 1.05rem; height: 1.05rem; margin: 0 .35rem 0 0; vertical-align: -.15rem; cursor: pointer; }
/* Prospects: stage and follow-up edited right in the list */
table.list td select[data-autosubmit], table.list td input[data-autosubmit] { padding: .25rem .4rem; font-size: .85rem; width: auto; min-width: 0; }
table.list td input.due { border-color: var(--danger); color: var(--danger); }
tr:target td { background: color-mix(in srgb, var(--accent, #1d4ed8) 10%, transparent); }

/* Home widgets */
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.home-grid .widget { margin: 0; min-width: 0; }
.home-grid .widget.wide { grid-column: 1 / -1; }
.widget-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.widget-head h2 { margin: 0; font-size: 1rem; flex: 1; }
.widget-grip, .widget-tools { display: none; }
.widget-grip { cursor: grab; color: var(--muted); padding: .15rem; border-radius: 6px; }
.widget-grip:focus-visible { outline: 2px solid var(--accent); }
.widget-tools { align-items: center; gap: .2rem; }
.widget-tools [data-widget-show] { display: none; }
.home-edit-hint { display: none; }
.home-editing .home-edit-hint { display: block; }
.home-editing .widget-grip, .home-editing .widget-tools { display: flex; }
.home-editing .home-grid .widget { outline: 2px dashed var(--border-strong); outline-offset: -2px; }
.home-editing .widget[data-hidden="1"] { opacity: .55; }
.home-editing .widget[data-hidden="1"] [data-widget-show] { display: inline-flex; }
.home-editing .widget[data-hidden="1"] [data-widget-hide], .home-editing .widget[data-hidden="1"] [data-widget-size],
.home-editing .widget[data-hidden="1"] [data-widget-move] { display: none; }
.widget.dragging { opacity: .4; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.stat-row > * { display: flex; flex-direction: column; padding: .4rem .2rem; color: var(--text); }
.stat-row > a:hover { text-decoration: none; color: var(--accent); }
.stat-row strong { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.stat-row span { color: var(--muted); font-size: .82rem; }
.attn-row { display: flex; align-items: center; gap: .65rem; padding: .5rem .55rem; border-radius: 8px; color: var(--text); }
.attn-row + .attn-row { margin-top: .2rem; }
.attn-row:hover { background: var(--surface-2); text-decoration: none; }
.attn-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.attn-row.warn .attn-icon { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.attn-row.bad .attn-icon { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.mini-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; margin: .5rem 0 .2rem; }
.mini-label:first-child { margin-top: 0; }
.client-row { display: flex; align-items: center; gap: .55rem; padding: .32rem .3rem; border-radius: 7px; color: var(--text); }
.client-row:hover { background: var(--surface-2); text-decoration: none; }
.avatar.xs { width: 22px; height: 22px; font-size: .68rem; }
.widget-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--border); font-size: .86rem; }
.btn.active { background: var(--tint); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--accent); }
@media (max-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Getting started panel on Home */
.welcome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.4rem; margin-bottom: 1.2rem; align-items: start; }
.welcome .progress { margin-bottom: .8rem; }
.welcome-steps { list-style: none; margin: 0; padding: 0; }
.welcome-steps li { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem 0; }
.welcome-steps li.done strong { color: var(--muted); text-decoration: line-through; font-weight: 600; }
.step-mark { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .78rem; font-weight: 700;
  background: var(--tint); color: var(--accent); }
.welcome-steps li.done .step-mark { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.welcome-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .6rem; font-size: .88rem; }
.welcome-video { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.welcome-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center; padding: 1rem; color: var(--accent); }
.video-placeholder strong { color: var(--text); }
@media (max-width: 900px) { .welcome { grid-template-columns: minmax(0, 1fr); } .welcome-video { order: -1; } }

/* Privacy Policy and Terms pages */
.auth-card.legal { max-width: 780px; }
.auth-card.legal h1 { text-align: left; font-size: 1.6rem; }
.auth-card.legal .article { max-width: none; }
.auth-card.legal .article h2 { font-size: 1.08rem; }
.legal-links { margin-top: 1.4rem; }
.signup-agree { display: flex; gap: .5rem; align-items: flex-start; font-size: .88rem; }
.signup-agree input { margin-top: .2rem; width: auto; }

/* Deleting an account or workspace */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone h2 { display: flex; align-items: center; gap: .5rem; }

/* Network diagram (client › Diagram) */
.diagram-card { margin-bottom: 1rem; }
.diagram-scroll { overflow-x: auto; padding: 0 1rem 1rem; }
.diagram { position: relative; margin: 0 auto; }
.diagram-lines { position: absolute; inset: 0; }
.diagram-lines line { stroke: var(--border-strong); stroke-width: 2; }
.diagram-lines line.assumed { stroke-dasharray: 5 5; opacity: .8; }
.diagram-node { position: absolute; display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); color: var(--text); text-decoration: none; overflow: hidden; }
a.diagram-node:hover { border-color: var(--accent); }
.diagram-node.k-internet { background: var(--tint); border-style: dashed; justify-content: center; }
.diagram-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.diagram-text strong { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diagram-text span { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbadge.t-internet { background: color-mix(in srgb, #0ea5e9 14%, var(--surface)); color: #0284c7; }
@media print { .diagram-scroll { overflow: visible; } }

/* IP addresses (client › IP addresses) */
.ipam-net { margin-bottom: 1rem; }
.ipam-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: .2rem 0 .35rem; }
.ipam-bar span { display: block; height: 100%; background: var(--accent); }
.ipam-stats { margin-bottom: .6rem; }

/* Racks */
.rack-page { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .rack-page { grid-template-columns: minmax(0, 1fr); } }
.rack-list { display: grid; gap: 1rem; }
.rack-views { --u: 22px; display: flex; flex-wrap: wrap; gap: 1.2rem; padding: .2rem 0; }
.rack-col { min-width: 230px; }
.rack-title { margin-bottom: .3rem; text-align: center; }
.rack { display: grid; grid-template-columns: 30px 1fr; background: var(--surface-2); border: 3px solid var(--border-strong); border-radius: 6px; padding: 2px 4px 2px 0; width: 260px; max-width: 100%; }
.rack-u { grid-column: 1 / -1; border-top: 1px dashed var(--border); display: flex; align-items: center; font-size: .66rem; color: var(--muted); font-family: ui-monospace, monospace; }
.rack-u span { width: 26px; text-align: right; }
.rack-u:first-child { border-top: 0; }
.rack-item { grid-column: 2; display: flex; align-items: center; gap: .4rem; margin: 1px 0; padding: 0 .45rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 4px; font-size: .78rem; color: var(--text); overflow: hidden; z-index: 1; }
a.rack-item:hover { border-color: var(--accent); text-decoration: none; }
.rack-item.plain { background: var(--surface-3); color: var(--text-2); }
.rack-item .tbadge.sm { width: 18px; height: 18px; border-radius: 5px; }
.rack-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

/* Status tiles and board */
.tiles-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: .7rem; margin-bottom: 1.2rem; }
.status-tile { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; border-radius: var(--radius-sm); border: 1px solid var(--border); border-left: 4px solid var(--muted); background: var(--surface); color: var(--text); box-shadow: var(--shadow); min-width: 0; }
a.status-tile:hover { text-decoration: none; border-color: var(--border-strong); }
.status-tile .st-title { font-size: .74rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-tile .st-value { font-size: 1.15rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-tile .st-detail { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-tile.s-ok { border-left-color: var(--ok); }
.status-tile.s-warn { border-left-color: var(--warn); }
.status-tile.s-bad { border-left-color: var(--danger); }
.status-tile.s-bad .st-value { color: var(--danger); }
.sb-cell { display: inline-block; min-width: 3.2rem; text-align: center; padding: .2rem .5rem; border-radius: 6px; font-weight: 600; font-size: .82rem; background: var(--surface-3); color: var(--text-2); }
a.sb-cell:hover { text-decoration: none; filter: brightness(.95); }
.sb-cell.s-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.sb-cell.s-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.sb-cell.s-bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.status-board th { white-space: nowrap; }

/* Busy buttons: a spinner while the server works (see "Busy feedback" in app.js) */
button.is-busy, .btn.is-busy { position: relative; pointer-events: none; opacity: .85; }
button.is-busy::before, .btn.is-busy::before { content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .45em; vertical-align: -.12em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .7s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.is-busy::before, .btn.is-busy::before { animation-duration: 2s; } }
.icon-btn.is-busy svg { display: none; }
.icon-btn.is-busy::before { margin-right: 0; }

/* Jump to (command palette), sidebar recents and shortcuts */
.jump-btn { display: flex; align-items: center; gap: .55rem; width: 100%; margin: .8rem 0 0; padding: .5rem .7rem; border-radius: var(--radius-sm);
  background: var(--side-fill); border: 1px solid var(--side-line); color: var(--side-muted); font: inherit; font-size: .88rem; cursor: pointer; box-shadow: none; }
.jump-btn:hover { background: var(--side-hover); color: var(--side-strong); border-color: var(--side-line-strong); }
.jump-btn span { flex: 1; text-align: left; }
.jump-btn kbd { background: var(--side-line); border: 0; color: var(--side-muted); font-size: .7rem; padding: .1rem .35rem; border-radius: 5px; }
.side-recent { margin-top: .9rem; display: grid; gap: 1px; }
.side-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 0 .7rem .35rem; }
.side-recent a { display: flex; align-items: center; gap: .6rem; padding: .38rem .7rem; border-radius: var(--radius-sm); color: var(--side-text); font-size: .88rem; }
.side-recent a:hover { background: var(--side-hover); color: var(--side-strong); text-decoration: none; }
.side-recent a.active { color: var(--side-strong); background: var(--side-fill); }
.side-recent .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot-avatar { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: .68rem; font-weight: 700;
  background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--side-strong); }

dialog.palette { border: 0; padding: 0; background: transparent; width: min(640px, 94vw); margin: 12vh auto auto; max-height: 76vh; overflow: visible; }
dialog.palette::backdrop { background: rgba(2, 6, 23, .5); backdrop-filter: blur(3px); }
dialog.palette[open] .palette-box { animation: palette-in .14s ease-out; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
.palette-box { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 30px 80px rgba(2, 6, 23, .35); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; }
.palette-input { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input input { flex: 1; border: 0; outline: 0; background: none; box-shadow: none; padding: 0; font-size: 1.05rem; color: var(--text); }
.palette-input input:focus { box-shadow: none; }
.palette-list { overflow-y: auto; padding: .4rem; min-height: 60px; }
.palette-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; padding: .65rem .7rem .3rem; }
.palette-item { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 10px; color: var(--text); }
.palette-item:hover { text-decoration: none; }
.palette-item[aria-selected="true"] { background: var(--tint); }
.palette-item[aria-selected="true"] .pi-icon { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.pi-icon { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.pi-text { display: flex; flex-direction: column; min-width: 0; }
.pi-title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-sub { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 1.4rem; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 1.1rem; padding: .55rem 1rem; border-top: 1px solid var(--border); font-size: .76rem; color: var(--muted); background: var(--surface-2); }
.palette-foot kbd, .palette-input kbd, .shortcuts kbd { font: 600 .72rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: .2rem .4rem; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); margin-right: .2rem; }
.shortcuts { display: grid; grid-template-columns: max-content 1fr; gap: .6rem 1.2rem; margin: 0; align-items: center; }
.shortcuts dd { margin: 0; color: var(--text-2); }
@media (max-width: 720px) { dialog.palette { margin-top: 4vh; } .palette-foot { display: none; } }

/* Client header */
.client-head { align-items: center; }
.ch-id { display: flex; align-items: center; gap: .95rem; min-width: 0; }
.client-avatar { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; font-weight: 750; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7c3aed)); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
.client-head h1 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pin-form { display: inline-flex; margin: 0; }
.pin-btn { background: none; border: 0; box-shadow: none; padding: .25rem; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pin-btn:hover { background: var(--surface-2); color: var(--text); }
.pin-btn.on { color: var(--accent); }
.pin-btn.on svg { fill: color-mix(in srgb, var(--accent) 25%, transparent); }
.ch-facts { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: .3rem; color: var(--muted); font-size: .9rem; }
.ch-facts > span { display: inline-flex; align-items: center; gap: .35rem; }
.ch-facts .icon { opacity: .75; }
@media (max-width: 720px) { .client-avatar { width: 42px; height: 42px; font-size: 1.1rem; } }
.topbar .mobile-search { display: none; }
@media (max-width: 640px) {
  .topbar .search { display: none; }
  .topbar .mobile-search { display: inline-grid; }
  .topbar .right { margin-left: auto; }
}

/* Integrations page */
.int-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .6rem 0 .8rem; margin-bottom: .6rem; background: var(--bg); }
.int-toolbar input { max-width: 340px; }
.int-toolbar .chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.int-toolbar .chip { padding: .3rem .7rem; font-size: .84rem; }
.int-toolbar .count.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.integration.is-on { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.int-about { margin: .4rem 0 .6rem; }
.int-about summary { cursor: pointer; color: var(--accent); font-weight: 550; list-style: none; }
.int-about summary::-webkit-details-marker { display: none; }
.int-about summary::after { content: " ›"; }
.int-about[open] summary::after { content: " ⌄"; }
.int-group.is-empty { display: none; }

/* Sign-in: brand panel beside the form */
.auth-side { display: none; }
.auth.split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); place-items: stretch; padding: 0; background: var(--bg); }
.auth.split .auth-side { display: flex; position: relative; overflow: hidden; color: #e2e8f0;
  background: radial-gradient(900px 600px at 0% 0%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%),
              radial-gradient(700px 500px at 100% 100%, rgba(124, 58, 237, .45), transparent 60%), #0b1324; }
.auth.split .auth-card { align-self: center; justify-self: center; margin: 2rem; box-shadow: none; border: 0; background: transparent; max-width: 400px; }
.auth.split .auth-card .brand { display: none; }
.auth.split .auth-card h1 { text-align: left; font-size: 1.7rem; letter-spacing: -.02em; }
.auth-side-inner { position: relative; z-index: 1; margin: auto; padding: 3rem; max-width: 520px; }
.auth-side-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: #fff; margin-bottom: 2.6rem; }
.auth-side-brand img { max-height: 44px; max-width: 220px; }
.auth-side-brand .mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.auth-side h2 { font-size: clamp(1.7rem, 2.6vw, 2.4rem); line-height: 1.15; letter-spacing: -.025em; color: #fff; margin: 0 0 1.8rem; }
.auth-side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .95rem; }
.auth-side li { display: flex; align-items: center; gap: .75rem; font-size: 1.02rem; color: #cbd5e1; }
.auth-side li .icon { flex: none; color: #fff; padding: 7px; width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); }
.auth-side kbd { font: 600 .78rem ui-monospace, monospace; padding: .1rem .35rem; border-radius: 5px; background: rgba(255, 255, 255, .12); color: #fff; }
.auth-glow { position: absolute; inset: auto -20% -40% auto; width: 420px; height: 420px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 35%, transparent); filter: blur(90px); z-index: -1; }
@media (max-width: 860px) {
  .auth.split { grid-template-columns: 1fr; padding: 1.5rem; background: radial-gradient(1000px 500px at 10% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--bg); }
  .auth.split .auth-side { display: none; }
  .auth.split .auth-card { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); margin: 0; }
  .auth.split .auth-card .brand { display: flex; }
}

/* Home: how to start */
.start-panel { margin-bottom: 1.2rem; padding: 1.6rem; border-radius: 18px; border: 1px solid var(--border);
  background: radial-gradient(700px 300px at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent), var(--surface); }
.start-head h2 { font-size: 1.35rem; margin: 0 0 .3rem; letter-spacing: -.01em; }
.start-head p { color: var(--muted); margin: 0 0 1.2rem; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .9rem; }
.start-card { display: flex; flex-direction: column; gap: .45rem; padding: 1.1rem; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s; }
.start-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.start-card > span:not(.start-icon) { color: var(--muted); font-size: .9rem; }
.start-card .start-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--tint); color: var(--accent); margin-bottom: .2rem; }
.start-card.sample { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); }
.start-card.sample .btn { align-self: flex-start; margin-top: auto; }

/* Record header: the values people copy most */
.facts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.record-facts { margin: -.4rem 0 1.2rem; }
.fact { display: inline-flex; align-items: center; gap: .45rem; padding: .22rem .6rem .22rem .5rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: .84rem; cursor: pointer; transition: border-color .15s; }
.fact:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.fact .fl { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.fact .fv { color: var(--text); font-weight: 560; }
.fact.copy { text-decoration: none; }
.fact.warranty { cursor: default; }
.fact.warranty.expired { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.fact.warranty.expired .fv { color: var(--danger); }
.fact.warranty.expiring { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.fact.warranty.expiring .fv { color: var(--warn); }

/* Client Records tab toolbar */
.rec-toolbar { display: grid; gap: .6rem; }
.rec-toolbar input { max-width: 460px; }
.rec-toolbar .chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.rec-toolbar .chip { padding: .2rem .6rem .2rem .25rem; font-size: .82rem; }
.rec-group { scroll-margin-top: 1rem; }

/* Client info requests */
.info-main { max-width: 920px; }
.info-hero { margin: .4rem 0 1.4rem; }
.info-hero h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 .5rem; letter-spacing: -.01em; }
.info-hero p { color: var(--text-2); max-width: 680px; margin: 0 0 .8rem; }
.info-message { margin: 0 0 .9rem; padding: .7rem 1rem; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--text); }
.info-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.info-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 999px; font-size: .8rem; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.info-pill.warn { background: color-mix(in srgb, var(--warn, #d97706) 12%, var(--surface)); border-color: color-mix(in srgb, var(--warn, #d97706) 35%, var(--border)); color: var(--text); font-weight: 600; }
.info-section { margin-bottom: 1rem; }
.info-section h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.08rem; margin: 0 0 .4rem; }
.info-section h2 .icon { color: var(--accent); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem 1rem; }
.info-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-field { display: flex; flex-direction: column; gap: .25rem; font-size: .84rem; color: var(--text-2); font-weight: 550; min-width: 0; }
.info-field.wide { grid-column: 1 / -1; }
.info-field input, .info-field textarea, .info-field select { width: 100%; font-weight: 400; }
.info-field .req { font-style: normal; color: var(--danger); font-size: .75rem; font-weight: 600; margin-left: .3rem; }
.info-field .is-missing { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.info-row { border: 1px solid var(--border); border-radius: 12px; padding: .6rem .9rem .9rem; margin: 0 0 .8rem; min-width: 0; transition: opacity .2s; }
.info-row legend { font-weight: 650; padding: 0 .35rem; font-size: .92rem; }
.info-row [data-info-remove] { margin-top: .6rem; }
.info-row.is-gone { opacity: .55; }
.info-row.is-gone .info-grid { text-decoration: line-through; }
.info-check { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; margin-top: .5rem; cursor: pointer; }
.info-yesno { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.info-q + .info-q { margin-top: .9rem; }
.info-file input { padding: .4rem 0; }
.info-submit { position: sticky; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 1rem; margin: 1rem -.2rem 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); }
.info-submit button { font-size: 1rem; padding: .7rem 1.3rem; }
.info-thanks { text-align: center; }
.info-done { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: color-mix(in srgb, var(--ok, #16a34a) 14%, var(--surface)); color: var(--ok, #16a34a); margin-bottom: .4rem; }
.info-new { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.2rem; align-items: start; }
.info-new-main > .card { margin-bottom: 1rem; }
.info-new-side { position: sticky; top: 1rem; display: grid; gap: 1rem; }
.info-new-side h2 { display: flex; align-items: center; gap: .4rem; font-size: .98rem; margin: 0 0 .5rem; }
.gap-list { margin: 0 0 .5rem; padding-left: 1.1rem; font-size: .9rem; }
.next-steps { margin: 0; padding-left: 1.1rem; font-size: .86rem; color: var(--text-2); display: grid; gap: .4rem; }
.step-h { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; margin: 0 0 .8rem; }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.pick-card { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.pick-card:hover { border-color: var(--accent); }
.pick-card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.pick-card input { margin-top: .2rem; }
.pick-card > span { display: flex; flex-direction: column; gap: .15rem; }
.info-vendor-pick { margin-top: 1rem; }
.check-chip { cursor: pointer; }
.check-chip:has(input:checked) { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.check-chip input { margin: 0; }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.q-row .info-check { margin-top: 0; white-space: nowrap; }
button.chip { cursor: pointer; font: inherit; font-size: .8rem; }
.sticky-actions { position: sticky; bottom: 0; padding: .8rem 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); z-index: 5; }
table.diff td:first-child { width: 2rem; }
table.diff td.old { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
table.diff td.new { font-weight: 600; }
.new-item { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.new-item:last-child { border-bottom: 0; }
.vendor-review { padding: .5rem 0 .8rem; border-bottom: 1px solid var(--border); }
.vendor-review:last-child { border-bottom: 0; }
.answer { padding: .5rem 0; border-bottom: 1px solid var(--border); }
@media (max-width: 860px) { .info-new { grid-template-columns: minmax(0, 1fr); } .info-new-side { position: static; } }
@media (max-width: 640px) {
  .info-grid, .info-grid.three { grid-template-columns: minmax(0, 1fr); }
  .q-row { grid-template-columns: minmax(0, 1fr) auto; }
  .q-row input[type=text] { grid-column: 1 / -1; }
}

/* Browser extension page */
.ext-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: center; margin-bottom: 1rem; }
.ext-hero h2 { margin-top: 0; }
.ext-mock { border: 1px solid var(--border); border-radius: 14px; background: var(--bg); padding: .7rem; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); display: grid; gap: .45rem; font-size: .85rem; }
.ext-mock-top { display: flex; align-items: center; gap: .45rem; font-weight: 700; }
.ext-mock-top .mark { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: .75rem; }
.ext-mock-search { border: 1px solid var(--border); border-radius: 8px; padding: .35rem .55rem; color: var(--muted); background: var(--surface); }
.ext-mock-item { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 10px; padding: .5rem .6rem; background: var(--surface); display: grid; gap: .3rem; }
.copy-box { padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); margin-bottom: .6rem; }
@media (max-width: 860px) { .ext-hero { grid-template-columns: minmax(0, 1fr); } }

/* Phones: keep the first screen useful */
@media (max-width: 640px) {
  .welcome-video:has(.video-placeholder) { display: none; }
  .sticky-actions { flex-wrap: wrap; }
  .sticky-actions button, .sticky-actions .btn { white-space: nowrap; font-size: .85rem; padding: .5rem .75rem; }
  .info-submit button { width: 100%; justify-content: center; }
}

.verified { color: var(--ok); white-space: nowrap; }
.verified .icon { vertical-align: -2px; }
.nowrap { white-space: nowrap; }
.ext-tabs { margin-bottom: .9rem; }
.ext-tabs .tab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; color: var(--muted); font-weight: 550; padding: .5rem .65rem; box-shadow: none; }
.ext-tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.card-head-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.disc-table td { vertical-align: middle; }
.disc-table select { min-width: 9rem; }
.disc-ports { display: flex; flex-wrap: wrap; gap: .25rem; max-width: 16rem; }

/* Backups page */
.stat-row strong.text-bad { color: var(--danger); }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: .6rem; }

/* Client review */
.review .tiles-row { margin-top: .4rem; }
.review table.review-kv th { width: 45%; font-weight: 500; color: var(--muted); }
@media print { .review .tiles-row { break-inside: avoid; } }
.check-meta .text-bad { color: var(--danger); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg a { padding: .25rem .75rem; color: var(--text-2); text-decoration: none; font-size: .82rem; }
.seg a + a { border-left: 1px solid var(--border); }
.seg a.on { background: var(--surface-2); color: var(--text); font-weight: 600; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.overview-preview { max-height: 80vh; overflow: auto; }
.overview-preview table { display: block; overflow-x: auto; }
@media (max-width: 900px) { .overview-grid { grid-template-columns: 1fr; } }
.bulk-bar { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 60; display: flex; gap: .6rem; align-items: center;
  padding: .55rem .7rem .55rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 12px 32px rgba(15, 23, 42, .22); }
.bulk-bar[hidden] { display: none; }
.bulk-count { font-weight: 600; font-size: .9rem; white-space: nowrap; }
.bulk-bar .btn { white-space: nowrap; }
td.name input[data-bulk], th input[data-bulk-all] { width: 1rem; height: 1rem; margin: 0 .35rem 0 0; vertical-align: -2px; cursor: pointer; }
.bulk-list { columns: 2 220px; margin: .4rem 0 0; padding-left: 1.1rem; }
.bulk-actions { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.bulk-actions form { display: flex; flex-direction: column; gap: .6rem; }

/* software and vulnerabilities */
.sw-row { padding: .55rem 0; border-top: 1px solid var(--border); display: grid; gap: .3rem; }
.card-head + .sw-row { border-top: 0; }
.sw-list { max-height: 320px; overflow: auto; display: grid; gap: .25rem; }
.sev { display: inline-block; min-width: 2.6rem; text-align: center; font-weight: 700; border-radius: 6px; padding: .1rem .35rem; font-size: .8rem; background: var(--surface-2); }
.sev.crit { background: var(--danger); color: #fff; }
.sev.high { background: #F97316; color: #fff; }
.sev.med { background: #FACC15; color: #1F2937; }


/* ---- Looks: Admin › Branding › Look sets these attributes on <html> (see templates/base.html) ---- */
/* Corners */
:root[data-corners="sharp"] { --radius: 4px; --radius-sm: 3px; --radius-ctl: 4px; --radius-lg: 6px; }
:root[data-corners="round"] { --radius: 20px; --radius-sm: 12px; --radius-ctl: 999px; --radius-lg: 24px; }
:root[data-corners="round"] textarea { border-radius: 14px; }
/* Density: everything is sized in rem, so the root size scales the whole app */
:root[data-density="compact"] { font-size: 14px; }
:root[data-density="compact"] .main { padding-top: 1.1rem; }
:root[data-density="compact"] .card { padding: .9rem 1rem; }
:root[data-density="spacious"] { font-size: 16.5px; }
:root[data-density="spacious"] .card { padding: 1.4rem 1.6rem; }
/* Fonts */
:root[data-font="system"] { --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-font="serif"] { --font: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif; }
:root[data-font="rounded"] { --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI", system-ui, sans-serif; }
:root[data-font="serif"] h1, :root[data-font="serif"] h2 { letter-spacing: 0; }
/* Light sidebar */
:root[data-side="light"] {
  --side-bg: var(--surface); --side-text: var(--text-2); --side-muted: var(--muted); --side-strong: var(--text);
  --side-hover: var(--surface-2); --side-line: var(--border); --side-line-strong: var(--border-strong);
  --side-fill: var(--surface-2); --side-input: var(--surface); --side-pop: var(--surface);
}
:root[data-side="light"] .sidebar { border-right: 1px solid var(--border); }
:root[data-side="light"] .nav a.active { background: var(--tint); color: var(--accent); }
:root[data-side="light"] .nav a.active .icon { color: var(--accent); }
/* Sidebar in the accent colour */
:root[data-side="accent"] {
  --side-bg: color-mix(in srgb, var(--accent) 82%, #020617); --side-text: rgba(255, 255, 255, .86);
  --side-muted: rgba(255, 255, 255, .62); --side-hover: rgba(255, 255, 255, .12); --side-line: rgba(255, 255, 255, .16);
  --side-fill: rgba(255, 255, 255, .1); --side-pop: color-mix(in srgb, var(--accent) 70%, #020617);
}
:root[data-side="accent"] .nav a.active { background: rgba(255, 255, 255, .18); }
:root[data-side="accent"] .nav a.active .icon { color: #fff; }
:root[data-side="accent"] .brand .mark { background: #fff; color: var(--accent); }
/* Page backgrounds (light mode only; dark mode keeps its own) */
:root[data-surface="warm"][data-theme="light"] { --bg: #f6f3ee; --surface: #fffdfa; --surface-2: #f4efe7; --surface-3: #ebe4d8; --border: #e7dfd2; --border-strong: #d6cbb9; }
:root[data-surface="white"][data-theme="light"] { --bg: #ffffff; --surface: #ffffff; --surface-2: #f6f7f9; --surface-3: #eceff3; --border: #e5e7eb; }
:root[data-surface="white"][data-theme="light"] .card { box-shadow: none; }
@media (prefers-color-scheme: light) {
  :root[data-surface="warm"]:not([data-theme="dark"]) { --bg: #f6f3ee; --surface: #fffdfa; --surface-2: #f4efe7; --surface-3: #ebe4d8; --border: #e7dfd2; --border-strong: #d6cbb9; }
  :root[data-surface="white"]:not([data-theme="dark"]) { --bg: #ffffff; --surface: #ffffff; --surface-2: #f6f7f9; --surface-3: #eceff3; --border: #e5e7eb; }
  :root[data-surface="white"]:not([data-theme="dark"]) .card { box-shadow: none; }
}
/* Bold headings */
:root[data-headings="bold"] h1 { font-weight: 800; letter-spacing: -.03em; }
:root[data-headings="bold"] .page-head h1 { font-size: 2rem; }

/* The look picker on Admin › Branding */
.look-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.look-card { position: relative; display: grid; gap: .5rem; padding: .6rem; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.look-card:hover { border-color: var(--border-strong); }
.look-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.look-card input { position: absolute; opacity: 0; pointer-events: none; }
.look-card strong { font-size: .92rem; }
.look-card span.small { color: var(--muted); }
.look-mini { display: grid; grid-template-columns: 26% 1fr; height: 84px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #f4f6fa; }
.look-mini i { display: block; }
.look-mini .s { background: #0b1324; }
.look-mini .m { padding: 8px; display: grid; gap: 6px; align-content: start; }
.look-mini .m b { display: block; height: 7px; width: 55%; border-radius: 3px; background: #0f172a; opacity: .75; }
.look-mini .m u { display: block; height: 22px; border-radius: 6px; background: #fff; border: 1px solid #e2e7ef; }
.look-mini .m u + u { width: 70%; }
.look-mini.classic { background: #fff; } .look-mini.classic .s { background: #f1f4f9; border-right: 1px solid #e2e7ef; }
.look-mini.classic .m u { border-radius: 2px; height: 16px; }
.look-mini.bold .s { background: var(--accent); } .look-mini.bold { background: #f6f3ee; }
.look-mini.bold .m u { border-radius: 12px; height: 26px; } .look-mini.bold .m b { height: 10px; }
.look-mini.custom { background: conic-gradient(from 90deg at 30% 60%, #fde68a, #a7f3d0, #bfdbfe, #fbcfe8, #fde68a); }
.look-mini.custom .s { background: rgba(15, 23, 42, .55); }
.look-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem 1rem; margin-top: 1rem; }
:root[data-side="accent"] .sidebar .avatar, :root[data-side="accent"] .dokbot-mini-tools .send { background: #fff; color: var(--accent); }

/* virtualization */
.vm-host { padding: .8rem 0; border-top: 1px solid var(--border); }
.vm-host:first-of-type { border-top: 0; }
.vm-host-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }

/* Setup wizard (docs/setup.py) */
.btn.link { background: none; border: 0; box-shadow: none; color: var(--accent); padding: .3rem 0; font-weight: 500; }
.btn.link:hover { text-decoration: underline; background: none; }
.setup-hero { display: flex; gap: 1rem; align-items: flex-start; margin: .4rem 0 1.4rem; max-width: 760px; }
.setup-hero h1 { margin: 0 0 .3rem; }
.setup-hero p { margin: 0; }
.setup-hero-icon { width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.setup-group { margin-bottom: 1.3rem; }
.setup-group h2 { margin: 0; font-size: 1.05rem; }
.setup-group p { margin: .15rem 0 .6rem; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .55rem; }
.pick { display: flex; align-items: center; gap: .6rem; padding: .65rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.pick:hover { border-color: var(--border-strong); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick-name { flex: 1; min-width: 0; font-weight: 600; font-size: .92rem; }
.pick-tick { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; color: transparent; flex: none; }
.pick:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent) inset; }
.pick:has(input:checked) .pick-tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.setup-bar { position: sticky; bottom: 0; display: flex; gap: .6rem; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  padding: .8rem 0; margin-top: .4rem; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.setup-bar [data-pick-count] { margin-right: auto; }
.setup-later { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.setup-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.setup-steps { position: sticky; top: 1rem; }
.setup-steps .progress { margin: .2rem 0 .6rem; }
.setup-steps li.current strong { color: var(--accent); }
.setup-steps li.current .step-mark { background: var(--accent); color: var(--accent-ink, #fff); }
.setup-main { max-width: 760px; }
.setup-how { border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem .9rem; margin: .4rem 0 1rem; background: var(--tint); }
.setup-how p { margin: .25rem 0 0; font-size: .92rem; }
.setup-how.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.setup-how.ok .btn { margin-top: .5rem; }
.setup-fields .form-row { margin-bottom: .7rem; }
.setup-nav { display: flex; gap: .6rem; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; }
.setup-finish { max-width: 620px; margin: 2rem auto; text-align: center; padding: 2rem 1.4rem; }
.setup-finish .setup-hero-icon { margin: 0 auto .8rem; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.setup-card { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.2rem;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 65%); }
.setup-card h2 { margin: 0 0 .2rem; }
.setup-card p { margin: 0 0 .4rem; }
.setup-card-text { flex: 1; min-width: 0; }
.setup-card .chip { font-size: .75rem; }
.setup-card-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
@media (max-width: 800px) {
  .setup-layout { grid-template-columns: minmax(0, 1fr); }
  .setup-steps { position: static; }
  .setup-card { flex-wrap: wrap; }
  .setup-nav { flex-wrap: wrap; }
}

/* Invoices (docs/accounting.py) */
.invoice-list td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .invoice-list td.num { text-align: right; } }

/* Connection mapping (docs/connections.py) */
.talk-row { display: flex; justify-content: space-between; gap: .8rem; padding: .35rem 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.talk-row:last-child { border-bottom: 0; }
.talk-row > :last-child { text-align: right; }
.talk-row > :first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex-shrink: 0; max-width: 45%; }
.talks h3 { margin: .2rem 0 .2rem; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.talk-map { width: 100%; max-width: 860px; margin: 0 auto; }
.talk-map svg { width: 100%; height: auto; display: block; }
.talk-line { stroke: color-mix(in srgb, var(--accent) 45%, transparent); stroke-width: 1.6; }
.talk-line:hover { stroke: var(--accent); stroke-width: 3; }
.talk-arrow { fill: color-mix(in srgb, var(--accent) 60%, transparent); }
.talk-node circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.talk-node.k-server circle { fill: var(--accent); }
.talk-node.k-workstation circle { stroke: var(--muted); }
.talk-node.k-internet circle, .talk-node.k-unknown circle { stroke: var(--warn); stroke-dasharray: 3 2; }
.talk-node text { font-size: 13px; font-weight: 600; fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.talk-node a:hover text { fill: var(--accent); }
.retire-verdict { display: flex; gap: 1rem; align-items: flex-start; }
.retire-verdict h2 { margin: 0 0 .2rem; }
.retire-verdict p { margin: 0; }
.retire-verdict.v-safe .setup-hero-icon { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.retire-verdict.v-in_use .setup-hero-icon { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.retire-verdict.v-unknown .setup-hero-icon { background: var(--tint); color: var(--muted); }
.retire-list { list-style: none; margin: 0; padding: 0; }
.retire-list li { display: flex; gap: .6rem; align-items: baseline; padding: .35rem 0; }
.retire-list .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); transform: translateY(-1px); }
.retire-list .lv-bad .dot { background: var(--danger); }
.retire-list .lv-warn .dot { background: var(--warn); }
.retire-list .lv-info .dot { background: var(--accent); }

/* Monitoring status */
.health-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); flex-shrink: 0; margin-right: .35rem; vertical-align: middle; }
.health-dot.h-up { background: #16a34a; }
.health-dot.h-warn { background: #f59e0b; }
.health-dot.h-down { background: #dc2626; box-shadow: 0 0 0 0 rgb(220 38 38 / .6); animation: health-pulse 1.6s infinite; }
.health-dot.h-paused { background: #94a3b8; }
.health-dot.h-unknown { background: transparent; border: 2px solid #94a3b8; }
.health-dot.on-node { position: absolute; top: .4rem; right: .4rem; margin: 0; border: 2px solid var(--surface); width: .75rem; height: .75rem; }
.diagram-node:has(.h-down) { border-color: #dc2626; }
.health-legend { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: 0 0 .8rem; font-size: .9rem; }
.fact.health.h-down { border-color: #dc2626; }
.fact.health.h-down .fv { color: #dc2626; }
.fact.health.h-warn .fv { color: #b45309; }
@keyframes health-pulse { 70% { box-shadow: 0 0 0 .45rem rgb(220 38 38 / 0); } 100% { box-shadow: 0 0 0 0 rgb(220 38 38 / 0); } }
@media (prefers-reduced-motion: reduce) { .health-dot.h-down { animation: none; } }

/* Knowledge base pages (1.52): tree, callouts, editor, comments */
.kb-home { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; margin-top: 1rem; align-items: start; }
.kb-home > div > .card + .card { margin-top: 1rem; }
.kb-aside { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.kb-aside h3, .kb-side h3, .kb-children h3, .kb-comments h3 { margin: 0 0 .6rem; font-size: .95rem; display: flex; align-items: center; gap: .4rem; }
.kb-mini { display: flex; justify-content: space-between; gap: .6rem; padding: .32rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.kb-mini:last-child { border-bottom: 0; }
.kb-mini a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-mini .muted { flex: none; }
.kb-space-head { display: flex; justify-content: space-between; align-items: center; }
.kb-space-head h2 { margin: 0 0 .4rem; }
.kb-tree, .kb-tree ul { list-style: none; margin: 0; padding: 0; }
.kb-tree ul { padding-left: 1.1rem; border-left: 1px solid var(--border); margin-left: .45rem; }
.kb-tree li { padding: .18rem 0; }
.kb-tree li > a, .kb-tree summary > a { display: inline-block; padding: .18rem .45rem; border-radius: 6px; color: var(--text); font-weight: 500; }
.kb-tree li > a:hover, .kb-tree summary > a:hover { background: var(--surface-2); text-decoration: none; }
.kb-tree a.here { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.kb-tree summary { cursor: pointer; list-style: none; margin-left: -.95rem; }
.kb-tree summary::-webkit-details-marker { display: none; }
.kb-tree summary::before { content: "▸"; display: inline-block; width: .95rem; color: var(--muted); font-size: .8rem; transition: transform .12s; }
.kb-tree details[open] > summary::before { transform: rotate(90deg); }
.kb-tree > li { padding-left: .95rem; }
.kb-tree.compact { font-size: .9rem; }
.kb-labels { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.kb-label { font-size: .8rem; padding: .12rem .5rem; border-radius: 6px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.kb-label span { color: var(--muted); margin-left: .2rem; }
.kb-label.active, .kb-label:hover { background: var(--accent); color: #fff; text-decoration: none; }
.kb-label.active span, .kb-label:hover span { color: #fff; }
.kb-page { display: block; }
.kb-page.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1rem; align-items: start; }
.kb-page > div > .card + .card { margin-top: 1rem; }
.kb-page .article { max-width: none; }
.kb-side { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); min-width: 0; position: sticky; top: 1rem; }
.kb-outline a { display: block; padding: .22rem 0; font-size: .88rem; color: var(--text-2); }
.kb-outline a.lvl3 { padding-left: .8rem; } .kb-outline a.lvl4 { padding-left: 1.6rem; font-size: .84rem; }
.kb-child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.kb-child { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.kb-child:hover { border-color: var(--accent); text-decoration: none; }
.kb-file { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.kb-file form { margin-left: auto; }

/* callouts, collapsibles, table of contents, task lists: anywhere Markdown shows */
.callout { border: 1px solid var(--c-line, var(--border)); background: var(--c-bg, var(--surface-2)); border-left: 4px solid var(--c, var(--accent)); border-radius: 10px; padding: .7rem 1rem; margin: 1rem 0; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { margin: 0 0 .3rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.callout-icon { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--c, var(--accent)); color: #fff; font-size: .72rem; font-weight: 800; flex: none; }
.callout-info, .c-info { --c: #2f7de1; } .callout-tip, .c-tip { --c: #7c4ddb; } .callout-note, .c-note { --c: #64748b; }
.callout-success, .c-success { --c: var(--ok); } .callout-warning, .c-warning { --c: var(--warn); } .callout-danger, .c-danger { --c: var(--danger); }
.callout { --c-bg: color-mix(in srgb, var(--c) 7%, var(--surface)); --c-line: color-mix(in srgb, var(--c) 25%, var(--border)); }
.article details { border: 1px solid var(--border); border-radius: 10px; padding: .55rem .9rem; margin: 1rem 0; background: var(--surface); }
.article details > summary { cursor: pointer; font-weight: 600; }
.article details[open] > summary { margin-bottom: .4rem; }
.article .toc { border: 1px solid var(--border); border-radius: 10px; padding: .6rem 1rem; background: var(--surface-2); margin: .5rem 0 1rem; display: inline-block; min-width: 260px; }
.article .toc::before { content: "Contents"; display: block; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem; }
.article .toc ul { list-style: none; padding-left: .9rem; margin: 0; } .article .toc > ul { padding-left: 0; }
.article li.task { list-style: none; margin-left: -1.3rem; display: flex; gap: .5rem; align-items: baseline; }
.article li.task .tick { width: 15px; height: 15px; border: 1.5px solid var(--border-strong); border-radius: 4px; flex: none; position: relative; top: 2px; }
.article li.task.done .tick { background: var(--ok); border-color: var(--ok); }
.article li.task.done .tick::after { content: "✓"; color: #fff; font-size: 11px; position: absolute; left: 2px; top: -2px; }
.article li.task.done { color: var(--muted); text-decoration: line-through; }
.article img { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.article h2[id], .article h3[id] { scroll-margin-top: 1rem; }

/* editor */
.kb-editor-form { max-width: none; }
.kb-title-row input { font-size: 1.35rem; font-weight: 700; padding: .55rem .75rem; }
.kb-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: .5rem; }
.kb-editor { margin-top: .8rem; border: 1px solid var(--border); border-radius: 12px; overflow: visible; background: var(--surface); }
.kb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; padding: .35rem .45rem; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 5; }
.kb-toolbar button, .kb-tool { background: none; border: 0; box-shadow: none; color: var(--text-2); padding: .3rem .5rem; border-radius: 6px; font-size: .84rem; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; min-height: 0; }
.kb-toolbar button:hover, .kb-tool:hover { background: var(--surface-3); color: var(--text); }
.kb-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 .25rem; }
.kb-spacer { flex: 1; }
.kb-insert { position: relative; } .kb-insert > summary { list-style: none; } .kb-insert > summary::-webkit-details-marker { display: none; }
.kb-insert .menu-pop { left: 0; right: auto; }
.menu-pop button, .menu-pop form button { display: flex; width: 100%; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: 8px; color: var(--text); background: none; border: 0; box-shadow: none; font-weight: 500; font-size: .92rem; text-align: left; cursor: pointer; min-height: 0; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.kb-view button { border-radius: 0; padding: .25rem .7rem; } .kb-view button + button { border-left: 1px solid var(--border); }
.kb-view button.on { background: var(--surface); color: var(--accent); font-weight: 600; }
.kb-panes { display: grid; grid-template-columns: 1fr; }
.kb-panes textarea { border: 0; border-radius: 0; min-height: 460px; resize: vertical; box-shadow: none; padding: .9rem 1rem; line-height: 1.55; font-size: .9rem; }
.kb-panes textarea:focus { outline: none; box-shadow: none; }
.kb-panes textarea.drop { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.kb-panes .kb-preview { display: none; padding: .9rem 1.2rem; max-width: none; overflow: auto; max-height: 75vh; }
.kb-panes[data-mode="split"] { grid-template-columns: 1fr 1fr; }
.kb-panes[data-mode="split"] .kb-preview { display: block; border-left: 1px solid var(--border); }
.kb-panes[data-mode="preview"] textarea { display: none; }
.kb-panes[data-mode="preview"] .kb-preview { display: block; min-height: 460px; }
.kb-status { padding: .4rem .8rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.kb-their { white-space: pre-wrap; max-height: 300px; overflow: auto; background: var(--surface); padding: .6rem; border-radius: 8px; font-size: .82rem; }
.kb-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; margin-top: .6rem; }
.kb-pick { display: flex; flex-direction: column; gap: .3rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: var(--surface); transition: border-color .12s, transform .12s; }
.kb-pick strong { display: flex; align-items: center; gap: .45rem; }
.kb-pick:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.kb-pick.blank { border-style: dashed; }
.kb-pick.own { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }

/* comments */
.kb-comment { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.kb-comment.resolved { opacity: .6; }
.kb-comment.reply { margin-left: 2.2rem; border-bottom: 0; padding-bottom: .2rem; }
.kb-comment:target { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 8px; }
.kb-comment-head { display: flex; align-items: center; gap: .5rem; }
.kb-comment-head .avatar { width: 26px; height: 26px; font-size: .72rem; }
.kb-comment-actions { margin-left: auto; display: flex; gap: .7rem; }
.kb-comment-body { margin: .3rem 0 0 2.15rem; line-height: 1.5; }
.mention { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 9%, transparent); padding: 0 .2rem; border-radius: 4px; }
.kb-reply { margin: .3rem 0 0 2.15rem; } .kb-reply summary { color: var(--accent); cursor: pointer; }
.kb-reply form { display: flex; gap: .5rem; margin-top: .4rem; align-items: flex-start; } .kb-reply textarea { flex: 1; }
.kb-new-comment { margin-top: .8rem; position: relative; }
.kb-mention-pop { position: absolute; z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: .3rem; min-width: 260px; }
.kb-mention-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; box-shadow: none; color: var(--text); padding: .35rem .5rem; border-radius: 6px; min-height: 0; }
.kb-mention-pop button.on, .kb-mention-pop button:hover { background: var(--surface-2); }
.kb-reply form, .kb-new-comment { position: relative; }

@media (max-width: 900px) {
  .kb-home, .kb-page.with-side { grid-template-columns: 1fr; }
  .kb-side { position: static; }
  .kb-meta { grid-template-columns: 1fr 1fr; }
  .kb-panes[data-mode="split"] { grid-template-columns: 1fr; }
  .kb-hint { display: none; }
}
@media print { .kb-side, .kb-comments, .kb-children { display: none; } .kb-page.with-side { display: block; } }
.kb-page .article h2, .kb-preview h2 { font-size: 1.3rem; margin: 1.6rem 0 .5rem; }
.kb-page .article h3, .kb-preview h3 { font-size: 1.08rem; margin: 1.2rem 0 .4rem; }
.kb-page .article h1 { font-size: 1.6rem; }

/* E-signatures */
.file-row .lbl .sign-status { color: var(--text); margin-top: .15rem; }
.file-row .lbl .sign-status a { font-weight: 500; }
.sign-row { display: flex; gap: .5rem; margin-top: .45rem; }
.sign-row input { flex: 1; min-width: 0; }
#sign-dialog label.check { display: flex; align-items: center; gap: .45rem; margin: .3rem 0; font-weight: 400; }

/* Security coverage */
.coverage .cov-tool { display: block; margin: .1rem 0; }
.coverage td[data-label="Client"] a { white-space: nowrap; }

/* Webhook events */
.wh-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem 1rem; margin-top: .4rem; }
.wh-group { border: 0; padding: 0; margin: 0; }
.wh-group legend { padding: 0; margin-bottom: .1rem; font-weight: 600; }
.wh-events[hidden] { display: none; }

/* Inbox (mail intake) */
.inbox-sources { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.inbox-source { display: flex; gap: .55rem; align-items: flex-start; padding: .65rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); min-width: 0; }
.inbox-source .icon { color: var(--accent); margin-top: .2rem; flex: none; }
.inbox-source strong { word-break: break-all; }
.inbox-bulk { display: flex; gap: .5rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.inbox-bulk .info-check { margin-right: auto; }
.inbox-list { list-style: none; margin: 0; padding: 0; }
.inbox-row { display: flex; gap: .7rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.inbox-row:last-child { border-bottom: 0; }
.inbox-row:hover { background: var(--side-hover, var(--tint)); }
.inbox-link { display: flex; gap: .75rem; align-items: flex-start; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.inbox-link:hover { text-decoration: none; }
.inbox-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.inbox-top { display: flex; gap: .5rem; align-items: center; min-width: 0; }
.inbox-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-when { margin-left: auto; white-space: nowrap; }
.inbox-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.inbox-row.unread .inbox-subject { color: var(--text); font-weight: 600; }
.inbox-row.unread .dot-avatar { background: var(--accent); color: #fff; }
.inbox-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.inbox-file { display: flex; flex-direction: column; gap: 1rem; }
.inbox-file .card { margin: 0; }
.inbox-file h2 { font-size: 1rem; margin: 0 0 .6rem; }
.inbox-body { white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: .95rem; line-height: 1.55; margin: 0; background: none; border: 0; padding: 0; max-height: 70vh; overflow: auto; }
@media (max-width: 900px) { .inbox-detail { grid-template-columns: 1fr; } }
.inbox-top .chip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; flex-shrink: 1; }
.inbox-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
@media (max-width: 600px) {
  .inbox-top .chip { display: none; }
  .inbox-row { padding: .7rem .8rem; gap: .55rem; }
  .inbox-actions .btn { flex: 1 1 100%; }
}

/* ---- HIPAA and PCI DSS checklist ---- */
.comp-summary { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; margin-bottom: 1rem; }
.comp-summary p { flex: 1 1 320px; margin: 0; }
.comp-stat { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: .6rem .9rem; border-radius: 12px; background: var(--surface-3); }
.comp-stat strong { font-size: 1.6rem; line-height: 1.1; }
.comp-stat span { font-size: .78rem; color: var(--muted); }
.comp-stat.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.comp-stat.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.comp-stat.you { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); }
.comp-group { margin-bottom: 1rem; }
.comp-item { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem 0; border-top: 1px solid var(--border); }
.comp-item:first-of-type { border-top: 0; }
.comp-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.comp-item.ok .comp-icon { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.comp-item.warn .comp-icon { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.comp-item.you .comp-icon { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.comp-text { flex: 1; min-width: 0; }
.comp-title { font-weight: 600; }
.comp-ref { font-size: .72rem; color: var(--muted); white-space: nowrap; padding-top: .2rem; }
@media (max-width: 640px) { .comp-item { flex-wrap: wrap; } .comp-ref { width: 100%; padding-left: 36px; white-space: normal; } }
.audit-chain { margin-bottom: 1rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.audit-chain.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.audit-chain.bad { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
