/* © 2026 SwiftSku Inc. Proprietary and confidential.
   SwiftDesk design tokens: SwiftSku Blue (#429ED8), white, and shades of that blue only.
   Green, amber and red appear only on status badges and banners, always with a word. */
:root, [data-theme="dark"] {
  --bg: #0A1824; --surface: #10222F; --surface-2: #142A3A; --border: #1F3A4E; --control-border: #5A85A3;
  --text: #F2F8FC; --text-muted: #9DBBD0; --brand: #429ED8; --brand-text: #429ED8; --on-brand: #0B2233;
  --grade-2: #8CC8EE; --grade-3: #7E97A9; --success: #4ADE80; --warning: #FBBF24; --danger: #F87171;
  --shadow: none; color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F5FAFD; --surface: #FFFFFF; --surface-2: #EEF6FB; --border: #D6E8F4; --control-border: #6F97B4;
  --text: #0B2233; --text-muted: #45657C; --brand: #429ED8; --brand-text: #1C6FA6; --on-brand: #0B2233;
  --grade-2: #0F4F7A; --grade-3: #5C7486; --success: #15803D; --warning: #B45309; --danger: #B91C1C; color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.caller-app { font-size: 16px; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.25; font-weight: 600; }
h1 { font-size: 24px; } h2 { font-size: 20px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
a { color: var(--brand-text); }
.muted { color: var(--text-muted); } .small { font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; } .col { display: flex; flex-direction: column; gap: 8px; }
.wrap { flex-wrap: wrap; } .grow { flex: 1; } .right { margin-left: auto; } .gap16 { gap: 16px; } .gap4 { gap: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.card.tight { padding: 12px; }
.btn { appearance: none; border: 1px solid var(--control-border); background: transparent; color: var(--text); border-radius: 8px; min-height: 40px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; }
.btn.small { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible, a:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--control-border); border-radius: 4px; padding: 0 4px; color: var(--text-muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--control-border); border-radius: 8px; min-height: 40px; padding: 8px 12px; width: 100%; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; letter-spacing: .02em; }
.field { margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--control-border); border-radius: 999px; padding: 4px 12px; min-height: 32px; cursor: pointer; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.chip.selected { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.badge.g1 { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.badge.g2 { color: var(--grade-2); } .badge.g3 { color: var(--grade-3); }
.badge.ok { color: var(--success); } .badge.warn { color: var(--warning); } .badge.bad { color: var(--danger); } .badge.info { color: var(--brand-text); }
.banner { padding: 8px 16px; border-radius: 8px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.banner.grey { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.banner.amber { border: 1px solid var(--warning); color: var(--warning); }
.banner.red { border: 1px solid var(--danger); color: var(--danger); }
.banner.blue { border: 1px solid var(--brand); color: var(--brand-text); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-size: 12px; color: var(--text-muted); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.tbl tr.click:hover td { background: var(--surface-2); cursor: pointer; }
.tbl td.n { text-align: right; font-variant-numeric: tabular-nums; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--surface); border: 1px solid var(--success); color: var(--text); padding: 10px 16px; border-radius: 8px; z-index: 1000; display: flex; gap: 8px; align-items: center; max-width: 420px; }
.toast.err { border-color: var(--danger); }
.modal-back { position: fixed; inset: 0; background: rgba(5, 14, 22, .7); display: flex; align-items: center; justify-content: center; z-index: 900; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; width: min(520px, 92vw); max-height: 88vh; overflow: auto; }
.modal.wide { width: min(980px, 96vw); }
.licence { font-size: 12px; color: var(--text-muted); padding: 8px 16px; text-align: center; }
.logo-full { height: 28px; width: auto; display: block; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: none; color: var(--text-muted); font: inherit; font-weight: 600; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.empty { padding: 32px; text-align: center; color: var(--text-muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-muted); }
.dot.ok { background: var(--success); } .dot.warn { background: var(--warning); } .dot.bad { background: var(--danger); } .dot.blue { background: var(--brand); }
pre.code { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; font-size: 12px; max-height: 420px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: fadein .15s ease-out; } @keyframes fadein { from { opacity: 0; transform: translateY(6px); } } }

/* ---------- shared components added in the UI pass ---------- */
.ico { flex: none; display: inline-block; vertical-align: middle; }
.btn .ico { margin: 0 -2px; }
.row > .field { flex: 1 1 170px; min-width: 0; margin-bottom: 0; }
.row:has(> .field) { flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.row.wrap { flex-wrap: wrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
.table-wrap .tbl { min-width: 560px; }
.table-wrap .tbl td:first-child { min-width: 140px; }
.tbl td { overflow-wrap: break-word; }
.tbl td a, .tbl td code { overflow-wrap: anywhere; }
.tbl th { white-space: nowrap; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--text-muted); }
.empty-state .e-ico { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; color: var(--brand-text); background: color-mix(in srgb, var(--brand) 12%, transparent); margin-bottom: 4px; }
.empty-state strong { color: var(--text); font-size: 15px; }
.empty-state p { margin: 0; max-width: 420px; font-size: 14px; }
.empty-state .btn { margin-top: 8px; }
.modal .modal-body { min-width: 0; }
.chip { max-width: 100%; }
@media (max-width: 640px) {
  .modal-back { align-items: stretch; }
  .modal, .modal.wide { width: 100vw; max-height: 100vh; height: 100%; border-radius: 0; padding: 18px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .btn { min-height: 40px; }
}
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; }
.gate-card { width: min(440px, 100%); padding: 28px; }
.gate-card h1 { margin: 0 0 6px; font-size: 24px; }
.gate-card .banner { margin-bottom: 8px; }

input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); -webkit-text-fill-color: var(--text-muted); cursor: not-allowed; opacity: 1; }
input:disabled::placeholder, textarea:disabled::placeholder { color: transparent; }

.idle-warn { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: min(560px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--warning); border-radius: 10px; padding: 12px 16px; box-shadow: 0 12px 32px rgba(5, 14, 22, .35); }
.idle-warn span { flex: 1 1 240px; color: var(--text-muted); font-size: 14px; }
/* © 2026 SwiftSku Inc. Proprietary and confidential.
   Console shell: collapsible grouped sidebar (full or icon rail), top bar with breadcrumbs, page header,
   responsive down to phones (sidebar becomes a drawer under 1024px). */
:root { --side-w: 268px; --rail-w: 72px; --top-h: 56px; }
body { overflow-x: hidden; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .18s ease; }
.shell.rail { grid-template-columns: var(--rail-w) minmax(0, 1fr); }

/* ---------- sidebar ---------- */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); z-index: 40; min-width: 0; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 16px 14px 14px 18px; min-height: 64px; border-bottom: 1px solid var(--border); }
.side-brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; text-decoration: none; color: var(--text); }
.side-brand .logo-full { height: auto; width: 112px; min-width: 112px; }
.side-head .close-drawer { display: none; }
.side-brand .mark { display: none; width: 30px; height: 30px; }
.side-brand .name { font-weight: 700; font-size: 16px; padding-left: 12px; border-left: 1px solid var(--border); white-space: nowrap; }
.icon-btn { appearance: none; border: 1px solid transparent; background: transparent; color: var(--text-muted); width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dotc { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--brand); color: var(--on-brand); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 16px; scrollbar-width: thin; }
.nav-item, .nav-group > summary { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 9px; color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer; border: 0; background: none; font-family: inherit; text-align: left; }
.nav-item:hover, .nav-group > summary:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--text); font-weight: 600; }
.nav-item.on .ico { color: var(--brand-text); }
.nav-item .lbl, .nav-group > summary .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count { font-size: 11px; background: var(--brand); color: var(--on-brand); border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.nav-group { margin-top: 6px; }
.nav-group > summary { list-style: none; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); min-height: 34px; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .chev { transition: transform .15s ease; opacity: .7; }
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-group .items { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 4px 10px; margin-left: 9px; border-left: 1px solid var(--border); }
.nav-group .items .nav-item { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.nav-group.has-active > summary { color: var(--text); }
.side-foot { border-top: 1px solid var(--border); padding: 10px; display: flex; align-items: center; gap: 8px; }
.me-card { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: 10px; text-decoration: none; color: var(--text); }
.me-card:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--on-brand); background: var(--brand); }
.me-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-txt strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt span { font-size: 12px; color: var(--text-muted); }

/* rail (collapsed) */
.shell.rail .side-brand .logo-full, .shell.rail .side-brand .name, .shell.rail .nav-item .lbl, .shell.rail .nav-group > summary .lbl,
.shell.rail .nav-group > summary .chev, .shell.rail .nav-group .items, .shell.rail .me-txt, .shell.rail .nav-item .count { display: none; }
.shell.rail .side-foot .icon-btn { margin: 2px 0; }
.topbar .collapse-btn { margin-left: -8px; }
.shell.rail .side-brand .mark { display: block; }
.shell.rail .side-head { padding: 14px; justify-content: center; flex-direction: column; gap: 8px; }
.shell.rail .nav-item, .shell.rail .nav-group > summary { justify-content: center; padding: 9px 0; }
.shell.rail .nav-group > summary { color: var(--text-muted); text-transform: none; }
.shell.rail .nav-group.has-active > summary { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand-text); }
.shell.rail .side-foot { flex-direction: column; padding: 10px 6px; }
.shell.rail .me-card { justify-content: center; flex: none; }

/* ---------- top bar + content ---------- */
.content { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .cur { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumbs .ico { flex: none; opacity: .6; }
.top-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.env-pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--brand); color: var(--brand-text); }
.page-wrap { padding: 24px 28px 32px; flex: 1; width: 100%; max-width: 1480px; }
.content > .licence { margin-top: auto; border-top: 1px solid var(--border); }

/* page header */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .ph-txt { flex: 1 1 320px; min-width: 0; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.page-head .ph-desc { margin: 6px 0 0; color: var(--text-muted); max-width: 760px; font-size: 14px; }
.page-head .ph-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-head .ph-actions > select, .page-head .ph-actions > input { width: auto; min-width: 170px; }

/* tiles, stats, misc */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile:hover { border-color: var(--control-border); }
.tile.red { border-color: var(--danger); } .tile.amber { border-color: var(--warning); }
.tile .nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; font-size: 12px; color: var(--text-muted); }
.tile .nums b { display: block; color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.tile .store { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.stat .s-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--brand-text); background: color-mix(in srgb, var(--brand) 13%, transparent); }
.stat .s-txt { min-width: 0; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .l { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card > h3:first-child, .card > .row:first-child h3 { margin-bottom: 12px; }
.section-gap { margin-top: 16px; }
.report-card { text-decoration: none; color: inherit; display: flex; gap: 14px; align-items: flex-start; transition: border-color .12s; }
.report-card:hover { border-color: var(--brand); }
.report-card p { margin: 4px 0 0; }
.audit-fact { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.seg { display: inline-flex; border: 1px solid var(--control-border); border-radius: 8px; overflow: hidden; flex-wrap: nowrap; }
.seg button { background: none; border: none; color: var(--text); padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; border-right: 1px solid var(--control-border); white-space: nowrap; }
.seg button:last-child { border-right: none; }
.seg button.on { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.vis td select { min-height: 32px; padding: 4px 8px; font-size: 13px; min-width: 120px; }
.vis td.locked select { opacity: .55; }
.step-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--surface); min-width: 0; }
.step-card textarea { min-height: 54px; }
.cond { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; margin-bottom: 6px; }
.heat { display: grid; grid-template-columns: 48px repeat(24, minmax(18px, 1fr)); gap: 2px; font-size: 10px; min-width: 560px; }
.heat div { text-align: center; padding: 4px 0; border-radius: 3px; }
.split-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 16px; }

/* scrim for the mobile drawer */
.scrim { display: none; }

@media (max-width: 1180px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .shell, .shell.rail { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: none; }
  .shell.drawer-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(5, 14, 22, .55); }
  .shell.rail .side-brand .logo-full, .shell.rail .side-brand .name, .shell.rail .nav-item .lbl, .shell.rail .nav-group > summary .lbl, .shell.rail .nav-group > summary .chev, .shell.rail .me-txt { display: revert; }
  .shell.rail .nav-group .items { display: flex; }
  .shell.rail .side-brand .mark { display: none; }
  .collapse-btn { display: none !important; }
  .side-head .close-drawer { display: inline-flex; margin-left: auto; }
  .scrim { position: fixed; inset: 0; z-index: 35; }
  .shell.drawer-open .scrim { display: block; }
  .topbar { padding: 0 14px; }
  .topbar .menu-btn { display: inline-flex; }
  .page-wrap { padding: 18px 16px 28px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .grid3 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 21px; }
  .page-head .ph-actions { width: 100%; justify-content: flex-start; }
  .page-head .ph-actions > select, .page-head .ph-actions > input { flex: 1 1 160px; min-width: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px; } .stat .s-ico { display: none; } .stat .v { font-size: 20px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .audit-fact { grid-template-columns: minmax(0, 1fr); }
  .cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .env-pill { display: none; }
}
.boot { min-height: 100vh; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; }

/* ---------- forms: sections, hints, checkboxes, read-only mode ---------- */
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; }
.form-section { padding: 4px 0 8px; }
.form-section + .form-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.form-section h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 500; letter-spacing: 0; margin: 0; cursor: pointer; }
label.check input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; min-height: 40px; align-items: center; }
fieldset.readonly-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.readonly-fieldset:disabled input, fieldset.readonly-fieldset:disabled select, fieldset.readonly-fieldset:disabled textarea {
  background: var(--surface-2); border-color: var(--border); color: var(--text-muted); cursor: not-allowed; opacity: 1; -webkit-text-fill-color: var(--text-muted); }
fieldset.readonly-fieldset:disabled label.check { cursor: not-allowed; color: var(--text-muted); }
fieldset.readonly-fieldset.editing { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 8px; border-radius: 6px; }
.edit-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.edit-bar .ico { vertical-align: -2px; }
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card.flush { padding: 4px 4px 0; }

/* ---------- people ---------- */
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.person-cell { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.person-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.person-cell strong { font-weight: 600; }
.person-head { display: flex; gap: 16px; align-items: flex-start; }
.person-head h1 { margin: 0; font-size: 24px; }
.person-head .ph-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.person-head .chips { gap: 6px; }
.person-head .chip { cursor: default; min-height: 26px; padding: 2px 10px; font-size: 12px; }
.person-head .chip.on { border-color: var(--brand); color: var(--brand-text); }
.journey ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; position: relative; }
.journey li { position: relative; display: flex; gap: 10px; align-items: flex-start; min-width: 0; color: var(--text-muted); }
.journey li strong { color: var(--text); display: block; font-size: 13px; }
.journey .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--control-border); background: var(--surface); margin-top: 2px; }
.journey li.done .dot { border-color: var(--brand); background: var(--brand); }
.journey li:not(:last-child)::after { content: ''; position: absolute; top: 9px; left: 22px; right: -6px; height: 2px; background: var(--border); z-index: 0; }
.journey li.done:not(:last-child)::after { background: color-mix(in srgb, var(--brand) 55%, transparent); }
.journey li > div { position: relative; z-index: 1; background: var(--surface); padding-right: 6px; min-width: 0; overflow-wrap: anywhere; }
.person-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.person-grid .col-side > .card + .card, .person-grid .col-main > .card + .card { margin-top: 16px; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--text-muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-stats > div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.mini-stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12px; color: var(--text-muted); }
.danger-zone .btn.danger { margin-left: auto; }
.big-code { font-size: 34px; font-weight: 800; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; margin: 12px 0; }
ol.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
ol.timeline > li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
ol.timeline > li:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-top: 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.tl-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
ul.tl-changes { margin: 2px 0; padding-left: 16px; font-size: 13px; color: var(--text); }
ul.tl-changes li { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .person-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .journey ol { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .journey li::after { display: none; }
  .person-head { flex-direction: column; }
  .person-head h1 { font-size: 21px; }
}

/* ---------- call script: bar, tabs ---------- */
.tabs.wrap-tabs { flex-wrap: wrap; }
.script-bar { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.sb-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sb-what { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1 1 300px; min-width: 0; }
.sb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sb-note { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }
.sb-note .ico { margin-top: 2px; color: var(--brand-text); }
.sb-note > span:nth-child(2) { flex: 1 1 360px; min-width: 0; }
.sb-note strong { color: var(--text); }
.sb-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.sb-edit input { flex: 1 1 260px; min-width: 0; width: auto; }
.ro-hint { margin: 0 0 10px; display: flex; align-items: center; gap: 4px; }
.hist-day + .hist-day { margin-top: 12px; }
.hist-day h4 { margin: 0 0 8px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
ul.usage { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
ul.usage li { display: flex; justify-content: space-between; background: var(--surface-2); border-radius: 6px; padding: 4px 10px; }

/* ---------- call flow map ---------- */
.fm-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12px; margin-bottom: 10px; color: var(--text); }
.fm-legend i.lg { display: inline-block; width: 26px; height: 0; border-top: 2px solid var(--brand); vertical-align: middle; margin-right: 6px; }
.fm-legend i.lg.end { border-top-color: var(--text-muted); }
.fm-legend i.lg.alt { border-top: 2px dashed var(--brand-text); }
.fm-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.fm-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background:
  radial-gradient(circle, color-mix(in srgb, var(--text-muted) 22%, transparent) 1px, transparent 1.2px) 0 0 / 18px 18px, var(--bg); }
.fm-canvas { position: relative; min-width: 640px; padding: 16px; }
.fm-edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.fm-edge { fill: none; stroke-width: 1.6; opacity: .75; transition: opacity .12s, stroke-width .12s; }
.fm-edge.main { stroke: var(--brand); }
.fm-edge.end { stroke: var(--text-muted); opacity: .45; }
.fm-edge.alt { stroke: var(--brand-text); stroke-dasharray: 5 4; }
.fm-mk.main { fill: var(--brand); } .fm-mk.end { fill: var(--text-muted); } .fm-mk.alt { fill: var(--brand-text); }
.fm-canvas.focus .fm-edge { opacity: .12; }
.fm-canvas.focus .fm-edge.hot { opacity: 1; stroke-width: 2.4; }
.fm-canvas.focus .fm-node:not(.linked) { opacity: .55; }
.fm-cols { position: relative; display: grid; grid-template-columns: minmax(300px, 560px) minmax(90px, 1fr) minmax(170px, 230px); align-items: start; }
.fm-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fm-col.ends { gap: 10px; }
.fm-col-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.fm-owner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; border: 1px dashed var(--brand-text); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: var(--text); }
.fm-node { position: relative; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); transition: border-color .12s, box-shadow .12s, opacity .12s; }
.fm-node:hover { border-color: var(--control-border); }
.fm-node:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fm-node.selected { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.fm-node.t-outcome { border-left-color: var(--text-muted); padding: 8px 10px; }
.fm-node.t-type { border-left-color: color-mix(in srgb, var(--brand) 55%, var(--surface)); }
.fm-node.problem { border-color: var(--warning); }
.fm-node-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fm-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fm-type { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-text); }
.t-outcome .fm-type { color: var(--text-muted); }
.fm-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.fm-lock { margin-left: auto; color: var(--text-muted); }
.fm-say { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
ul.fm-answers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fm-ans { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13px; background: var(--surface-2); border-radius: 6px; padding: 4px 6px; }
.fm-key { width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--control-border); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.fm-ans-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-port { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--brand-text); white-space: nowrap; max-width: 190px; }
.fm-port .fm-target { overflow: hidden; text-overflow: ellipsis; }
.fm-port.to-end { color: var(--text-muted); }
.fm-port.skip, .fm-port.owner { color: var(--brand-text); }
.fm-then, .fm-cond { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.fm-then { justify-content: space-between; }
.fm-cond { color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: 6px; }
.fm-flag { font-size: 12px; color: var(--warning); font-weight: 600; }
.fm-side { position: fixed; z-index: 25; top: var(--top-h); right: 0; bottom: 0; width: min(420px, 100vw); padding: 12px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px);
  border-left: 1px solid var(--border); box-shadow: -12px 0 32px rgba(5, 14, 22, .25); transform: translateX(105%); transition: transform .18s ease; overflow-y: auto; }
.fm.insp-open .fm-side { transform: none; }
.fm-insp-card { min-height: 100%; }
.fm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; border: 1px solid var(--border); background: var(--surface); }
.fm-check.ok .ico { color: var(--success); }
details.fm-check { display: block; border-color: var(--warning); }
details.fm-check summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--warning); list-style: none; }
details.fm-check summary::-webkit-details-marker { display: none; }
.fm-check-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
@media (min-width: 1100px) and (max-width: 1599px) {
  .page-wrap:has(.fm.insp-open) { padding-right: 452px; }
}
@media (min-width: 1600px) {
  .fm-layout { grid-template-columns: minmax(0, 1fr) 400px; }
  .fm-side { position: sticky; top: calc(var(--top-h) + 12px); transform: none; box-shadow: none; border: 0; background: none; backdrop-filter: none; padding: 0; z-index: auto; max-height: calc(100vh - var(--top-h) - 24px); }
  .fm-close { display: none; }
}
.fm-insp-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.fm-insp-head h3 { margin: 0; }
.fm-ans-edit { display: flex; flex-direction: column; gap: 6px; }
.fm-ans-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.fm-ans-row:last-child { border-bottom: 0; }
.fm-ans-row .fm-dest { grid-column: 2 / -1; grid-row: 2; min-width: 0; }
.fm-dest select, .fm-ans-row select { width: 100%; min-width: 180px; min-height: 34px; padding: 4px 8px; }
.fm-ans-row .badge.small { margin-left: 6px; white-space: normal; }
.fm-ans-row .grow { min-width: 0; }
.fm-ans-row .btn { grid-column: 3; grid-row: 1; padding: 2px 6px; min-height: 28px; }
.fm-insp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fm-add-ans { margin-top: 8px; }
.fm-insp-actions { margin-top: 10px; }
.fm-problems-wrap h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.fm-problems { display: flex; flex-direction: column; gap: 6px; }
.fm-problems .banner { font-weight: 500; align-items: flex-start; }
@media (max-width: 760px) {
  .fm-canvas { min-width: 0; padding: 10px; }
  .fm-cols { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .fm-gutter, .fm-edges { display: none; }
  .fm-port { max-width: 150px; }
}
fieldset.readonly-fieldset:disabled ::placeholder { color: transparent; }
ul.session-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
ul.session-list li { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.col-main > .card + .card, .col-side > .card + .card, .stack > .card + .card { margin-top: 16px; }
.pw-reminder { padding: 12px 28px 0; max-width: 1480px; width: 100%; }
.pw-reminder .banner { font-weight: 500; flex-wrap: wrap; }
.pw-reminder .banner .grow { flex: 1 1 260px; min-width: 0; }
@media (max-width: 1023px) { .pw-reminder { padding: 12px 16px 0; } }
.owner-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--brand-text); border: 1px solid currentColor; border-radius: 999px; padding: 0 7px; vertical-align: 1px; }

/* ---------- session rules (person page) ---------- */
.rule-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.rule { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.rule + .rule { border-top: 1px dashed var(--border); }
.rule-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rule-txt strong { font-size: 14px; }
.rule-txt span { font-size: 12px; color: var(--text-muted); }
label.switch { position: relative; display: inline-flex; flex: none; margin: 0; cursor: pointer; }
label.switch input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
label.switch .track { width: 44px; height: 24px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--control-border); transition: background .15s; display: inline-block; position: relative; }
label.switch .knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-muted); transition: transform .15s, background .15s; }
label.switch input:checked + .track { background: var(--brand); border-color: var(--brand); }
label.switch input:checked + .track .knob { transform: translateX(20px); background: var(--on-brand); }
label.switch input:focus-visible + .track { outline: 2px solid var(--brand-text); outline-offset: 2px; }
label.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }

/* Activity timeline bar (person page "Today", Activity page). States: on_call / wrapping = brand blues; training = dark blue;
   idle / paused = amber with the legend word; away / signed_in / offline = greys; outage = red; empty_queue = light. */
div.timeline { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); margin: 6px 0 2px; }
div.timeline > span { display: block; height: 100%; min-width: 1px; }
.st-on_call { background: var(--brand); }
.st-wrapping { background: var(--grade-2); }
.st-training { background: var(--brand-text); opacity: .75; }
.st-idle { background: var(--warning); opacity: .55; }
.st-paused { background: var(--warning); }
.st-away, .st-signed_in { background: var(--grade-3); }
.st-offline { background: var(--border); }
.st-outage { background: var(--danger); }
.st-empty_queue { background: var(--surface-2); background-image: repeating-linear-gradient(135deg, var(--border) 0 3px, transparent 3px 6px); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.tl-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

/* API keys */
.never-list { margin: 6px 0 0; padding-left: 18px; color: var(--text-muted); }
.never-list li { margin: 2px 0; }
.mod-grid { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.mod-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.mod-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mod-eps { grid-column: 1 / -1; min-width: 0; }
.ep-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ep-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 13px; min-width: 0; }
.ep-list li code { overflow-wrap: anywhere; }
.ep-list li.off { opacity: .55; }
.method { display: inline-block; min-width: 54px; text-align: center; font: 600 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; border-radius: 4px; padding: 0 6px; border: 1px solid var(--control-border); color: var(--text); background: var(--surface-2); }
.method.m-get { color: var(--brand-text); border-color: var(--brand); }
.method.m-post, .method.m-patch, .method.m-put { color: var(--warning); border-color: var(--warning); }
.method.m-delete { color: var(--danger); border-color: var(--danger); }
details.mod-ref { border-top: 1px solid var(--border); padding: 10px 0; }
details.mod-ref > summary { cursor: pointer; }
input.secret-box { flex: 1; min-width: 0; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.rule textarea, .rule input[type=number], .rule input[type=date] { max-width: 280px; }
@media (max-width: 720px) { .mod-row { grid-template-columns: minmax(0, 1fr); } .rule.has-field { flex-wrap: wrap; } .rule.has-field .rule-txt { flex-basis: 100%; } .rule.has-field textarea, .rule.has-field input[type=number], .rule.has-field input[type=date] { max-width: none; width: 100%; } }
