/* Signet console. Tollan's console design language (tokens, shell, cards, tables, pills),
   with Signet's teal as the primary colour. Light theme, like Tollan. */

@font-face { font-family: Roboto; font-weight: 400; font-display: swap; src: url(fonts/roboto-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 500; font-display: swap; src: url(fonts/roboto-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 700; font-display: swap; src: url(fonts/roboto-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --c-primary: #0a6e6a;
  --c-primary-600: #085c59;
  --c-primary-soft: #e3f1f0;
  --c-primary-ring: rgba(10, 110, 106, .16);
  --c-bg: #f0f3fb;
  --c-surface: #fff;
  --c-surface-2: #f5f7fb;
  --c-border: #deebfd;
  --c-border-2: #e6eaf2;
  --c-line: #eef1f7;
  --c-text: #2c303b;
  --c-text-2: #5b626b;
  --c-muted: #7a8190;
  --c-danger: #d63b3b;
  --c-warn: #d08700;
  --c-info: #2f80ed;
  --c-ok: #1e9e5a;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-card: -8px 12px 18px 0 rgba(218, 222, 232, .55);
  --shadow-pop: 0 18px 50px rgba(28, 39, 60, .18);
  --nav-h: 60px;
  --sidebar-w: 240px;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 14px/1.5 Roboto, system-ui, sans-serif; color: var(--c-text); background: var(--c-bg); }
h1 { font-size: 22px; font-weight: 500; margin: 0; }
h2 { font-size: 17px; font-weight: 500; margin: 0; }
h3 { font-size: 15px; font-weight: 500; margin: 0 0 4px; }
a { color: var(--c-primary); text-decoration: none; }
.mono { font-family: var(--mono); }
.muted { color: var(--c-muted); }
.pad { padding: 20px 24px; }
.nowrap { white-space: nowrap; }
svg.icon { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* --- shell --- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--nav-h); display: flex; align-items: center; gap: 16px;
  padding: 0 24px; background: var(--c-surface); border-bottom: 1px solid var(--c-border-2); z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--sidebar-w) - 24px); color: var(--c-text); }
.brand__mark svg { width: 28px; height: 28px; display: block; }
.brand__name { font-size: 19px; font-weight: 500; letter-spacing: .02em; }
.topbar__hub { color: var(--c-text-2); font-size: 13px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--c-surface-2); }
.topbar__spacer { flex: 1; }
.topbar__user { display: flex; align-items: center; gap: 8px; color: var(--c-text-2); }
.topbar__user svg { color: var(--c-primary); }

.sidebar { position: fixed; top: var(--nav-h); bottom: 0; left: 0; width: var(--sidebar-w); padding: 18px 12px;
  background: var(--c-surface); border-right: 1px solid var(--c-border-2); }
.nav__heading { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin: 14px 12px 6px; }
.nav__item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--c-text-2); font-weight: 500; }
.nav__item:hover { background: var(--c-surface-2); }
.nav__item.is-active { background: var(--c-primary-soft); color: var(--c-primary); }
.nav__item.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c-primary); }

.main { margin: var(--nav-h) 0 0 var(--sidebar-w); padding: 28px 32px 60px; }
.main__inner { max-width: 1320px; margin: 0 auto; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .main__inner { animation: none; } }

/* --- page header --- */
.page-header { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-header__text { flex: 1; min-width: 0; }
.crumbs { font-size: 12px; color: var(--c-muted); margin-bottom: 4px; }
.crumbs a { color: var(--c-muted); }
.subtitle { color: var(--c-text-2); margin-top: 4px; }

/* --- stat tiles --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.stat__icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.stat__icon svg { width: 22px; height: 22px; fill: currentColor; }
.stat__value { font-size: 24px; font-weight: 500; line-height: 1.1; }
.stat__label { color: var(--c-text-2); font-size: 13px; }
.tone-teal { background: var(--c-primary-soft); color: var(--c-primary); }
.tone-green { background: #e6f6ee; color: var(--c-ok); }
.tone-orange { background: #fdf2e0; color: var(--c-warn); }
.tone-red { background: #fde8e8; color: var(--c-danger); }
.tone-blue { background: #e8f1fd; color: var(--c-info); }

/* --- cards and tables --- */
.card { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-card); margin-bottom: 22px; }
.card__head { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--c-line); }
.card__head h2 { flex: 1; }
.card__body { padding: 20px 24px; }
.card__body--flush { padding: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.table-toolbar { display: flex; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--c-line); }
.search { position: relative; flex: 1; max-width: 380px; }
.search svg { position: absolute; left: 11px; top: 10px; width: 20px; height: 20px; fill: var(--c-muted); }
.search input[type=search] { padding-left: 38px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted);
  padding: 12px 24px; background: var(--c-surface-2); white-space: nowrap; }
td { padding: 13px 24px; border-top: 1px solid var(--c-line); vertical-align: middle; }
td .sub { display: block; font-size: 12px; color: var(--c-muted); }
.table-foot { padding: 12px 24px; color: var(--c-muted); font-size: 13px; border-top: 1px solid var(--c-line); }

/* --- pills, tags --- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; text-transform: capitalize; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--online { background: #e6f6ee; color: var(--c-ok); }
.pill--offline { background: var(--c-surface-2); color: var(--c-muted); }
.pill--revoked { background: #fde8e8; color: var(--c-danger); }
.pill--pending { background: #e8f1fd; color: var(--c-info); }
.log { margin: 0; max-height: 420px; overflow: auto; padding: 14px 16px; border-radius: var(--radius-sm); background: #1f2430; color: #d7dce6;
  font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.card__head .btn { margin-left: auto; }
.modal.modal--wide { width: min(880px, calc(100vw - 32px)); }
.script-editor { width: 100%; min-height: 320px; padding: 10px 12px; font: 12.5px/1.55 var(--mono); color: inherit; background: var(--c-surface);
  border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); resize: vertical; outline: none; tab-size: 4; white-space: pre; }
.script-editor:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-ring); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag--warn { background: #fdf2e0; color: var(--c-warn); }
.tag--ok { background: #e6f6ee; color: var(--c-ok); }
.tag--info { background: #e8f1fd; color: var(--c-info); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
a.topbar__user { color: var(--c-text-2); }
a.topbar__user:hover { color: var(--c-primary); }
.secret { font: 500 18px/1.4 var(--mono); letter-spacing: .04em; }
.otp-setup { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; align-items: start; }
.otp-setup img { width: 180px; height: 180px; image-rendering: pixelated; border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); }
.code-input { max-width: 180px; font: 500 20px var(--mono) !important; letter-spacing: .3em; text-align: center; }
select.inline { height: 32px; width: auto; padding: 0 8px; }

/* --- forms and buttons --- */
input[type=text], input[type=search], input[type=password], input[type=number], input[type=email], select { width: 100%; height: 40px; padding: 0 12px; font: inherit; color: inherit;
  border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); background: var(--c-surface); outline: none; }
input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-ring); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 500; }
.hint { font-size: 12px; color: var(--c-muted); }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; font: inherit; font-weight: 500; cursor: pointer;
  border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); white-space: nowrap; }
.btn:hover { background: var(--c-surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; box-shadow: 0 6px 14px rgba(10, 110, 106, .25); }
.btn--primary:hover { background: var(--c-primary-600); }
.btn--danger { color: var(--c-danger); border-color: #f2c4c4; }
.btn--danger:hover { background: #fdf0f0; }
.btn--danger-solid { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }

/* --- key/value, code --- */
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.kv dt { color: var(--c-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.code { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: #f6f8fc; border: 1px solid var(--c-border-2); }
.code pre { margin: 0; flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 var(--mono); }
.list { margin: 0; padding: 0; list-style: none; }
.list li { padding: 9px 0; border-top: 1px solid var(--c-line); display: flex; gap: 14px; }
.list li:first-child { border-top: 0; }
.list time { color: var(--c-muted); white-space: nowrap; font-size: 13px; }

/* --- states --- */
.empty { text-align: center; padding: 48px 24px; }
.empty__icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--c-primary-soft); color: var(--c-primary); }
.empty p { color: var(--c-text-2); max-width: 460px; margin: 6px auto 18px; }
.banner { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.banner--ok { background: #e6f6ee; color: #146c3f; }
.banner--error { background: #fde8e8; color: #9b2222; }
.toasts { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 10px; z-index: 30; }
.toast { max-width: 420px; padding: 12px 16px; border-radius: var(--radius-sm); background: #2c303b; color: #fff; box-shadow: var(--shadow-pop); }
.toast--error { background: #9b2222; }

/* --- dialogs --- */
.modal { width: min(620px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-pop); color: var(--c-text); }
.modal::backdrop { background: rgba(28, 39, 60, .35); }
.modal__head { padding: 18px 24px; border-bottom: 1px solid var(--c-line); }
.modal__body { padding: 20px 24px; }
.modal__body ol { padding-left: 20px; margin: 0; }
.modal__body li { margin-bottom: 16px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--c-line); background: var(--c-surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* --- signed out: the sign-in screen without the shell --- */
body.anon .sidebar, body.anon #who, body.anon .topbar__hub { display: none; }
body.anon .main { margin-left: 0; }
.auth { max-width: 440px; margin: 48px auto; }
.auth h1 { margin-bottom: 6px; }
.auth li { margin-bottom: 8px; }
.auth .btn--primary { width: 100%; justify-content: center; margin-top: 4px; }
.form-error { color: var(--c-danger); min-height: 21px; margin: 10px 0 0; }

/* --- settings --- */
.choices { display: grid; gap: 12px; }
.choice { display: flex; gap: 14px; padding: 16px 18px; border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--c-primary); background: var(--c-primary-soft); }
.choice input { margin-top: 3px; accent-color: var(--c-primary); }
.choice strong { display: block; font-weight: 500; }
.choice span { color: var(--c-text-2); }
.card__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--c-line); }

@media (max-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* --- device tabs, update picking, security advice --- */
.tabs { display: flex; gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--c-border-2); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  color: var(--c-text-2); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--c-text); }
.tab.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab__count { min-width: 22px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--c-surface); color: var(--c-text-2);
  font-size: 12px; line-height: 20px; text-align: center; }
.tab.is-active .tab__count { background: var(--c-primary-soft); color: var(--c-primary); }
.tab .tab__count.is-warn { background: #fdf2e0; color: var(--c-warn); }
th.check, td.check { width: 48px; padding-right: 0; }
th.num, td.num { width: 56px; text-align: right; padding-right: 8px; font-variant-numeric: tabular-nums; }
input[type=checkbox] { width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--c-primary); cursor: pointer; }
.tag--danger { background: #fde8e8; color: var(--c-danger); }
.checks { margin: 0; padding: 0; list-style: none; }
.checks li { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-top: 1px solid var(--c-line); }
.checks li:first-child { border-top: 0; }
.checks li > div { flex: 1; min-width: 0; }
.checks strong { display: block; font-weight: 500; }
.checks .detail { color: var(--c-text-2); }
.checks .is-ok { color: var(--c-ok); }
.checks .is-warn { color: var(--c-warn); }
.checks .is-info { color: var(--c-info); }
.checks code { font: 12.5px var(--mono); background: var(--c-surface-2); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.pkgs { max-height: 160px; overflow: auto; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--c-surface-2); font-size: 13px; word-spacing: .3em; }

/* --- row action icons --- */
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--c-text-2); cursor: pointer; }
.icon-btn:hover { background: var(--c-primary-soft); color: var(--c-primary); }
.icon-btn:disabled { opacity: .35; cursor: default; background: none; color: var(--c-text-2); }
.icon-btn svg { width: 20px; height: 20px; }
td.row-actions { width: 1%; padding-top: 6px; padding-bottom: 6px; white-space: nowrap; }

/* --- SSH terminal page --- */
body.term-page { height: 100vh; overflow: hidden; }
.term-page .brand__mark img { width: 28px; height: 28px; display: block; }
.term-title { font-size: 16px; }
.term-title strong { font-weight: 500; }
.term-main { position: fixed; inset: var(--nav-h) 0 0 0; overflow: auto; }
.term-card { max-width: 540px; margin: 40px auto; padding: 24px 28px; }
.term-card h2 { margin-bottom: 6px; }
.term-card textarea { width: 100%; padding: 8px 12px; font: 12px/1.5 var(--mono); color: inherit; border: 1px solid var(--c-border-2);
  border-radius: var(--radius-sm); resize: vertical; outline: none; }
.term-card textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-ring); }
.term-card .hint input[type=file] { display: block; margin-top: 6px; font: inherit; }
.field__label { font-weight: 500; }
.term-key { margin-bottom: 12px; }
.term-key summary { cursor: pointer; color: var(--c-primary); font-weight: 500; margin-bottom: 14px; }
.term-actions { display: flex; gap: 10px; margin-top: 16px; }
.term-screen { position: absolute; inset: 0; padding: 8px 4px 4px 12px; background: #1f2430; }
.icon-slot { display: inline-block; width: 32px; }

/* --- live gauges --- */
.gauges-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-bottom: 22px; }
.gauges.is-stale .gauge { opacity: .55; }
.gauge { padding: 16px 20px 14px; background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.gauge h3 { margin: 0 0 12px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.gauge__body { display: flex; align-items: center; gap: 18px; min-height: 84px; }
.gauge__main { font-size: 15px; font-weight: 500; }
.gauge__sub { margin-top: 2px; font-size: 13px; color: var(--c-text-2); }
.donut { position: relative; flex: none; width: 84px; height: 84px; }
.donut svg { display: block; width: 100%; height: 100%; }
.donut__track { fill: none; stroke: var(--c-surface-2); stroke-width: 10; }
.donut__fill { fill: none; stroke: var(--c-primary); stroke-width: 10; stroke-linecap: round; }
.donut__fill.is-warn { stroke: var(--c-warn); }
.donut__fill.is-bad { stroke: var(--c-danger); }
.donut__value { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 500; }
.net { display: grid; gap: 6px; flex: none; min-width: 120px; font-size: 17px; font-weight: 500; white-space: nowrap; }
.net__rx { color: var(--c-primary); }
.net__tx { color: var(--c-info); }
.spark { display: block; width: 100%; height: 40px; margin-top: 14px; }
.spark--empty { display: grid; place-items: center; font-size: 12px; color: var(--c-muted); background: var(--c-surface-2); border-radius: 6px; }
.spark__area { fill: var(--c-primary-soft); }
.spark__line { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark__line--0 { stroke: var(--c-primary); }
.spark__line--1 { stroke: var(--c-info); }
.banner--info { background: #e8f1fd; color: #1d4f91; }

/* --- device list status signs --- */
th.status, td.status { width: 64px; text-align: center; padding-left: 8px; padding-right: 8px; }
.sign { display: inline-grid; place-items: center; vertical-align: middle; }
.sign svg { width: 22px; height: 22px; }
.sign--bad { color: var(--c-danger); }
.sign--warn { color: #e0a800; }
.sign--ok { color: var(--c-ok); }

/* --- software library --- */
.key-line { display: flex; align-items: center; gap: 10px; }
.key-line svg { width: 20px; height: 20px; fill: currentColor; }
.key-line .btn { margin-left: auto; }
.modal input[type=file] { font: inherit; }
tr.is-dim td { color: var(--c-muted); }

/* --- device overview strip --- */
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px; padding: 10px 20px; }
.fact { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.fact__label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.fact__value { overflow-wrap: anywhere; }
.fact .pill { padding: 1px 8px; }
.warn-text { color: var(--c-warn); font-weight: 500; }

/* --- organizations --- */
.card__head > .muted { font-size: 13px; }
.card__head .icon-btn { margin-left: -6px; }
.page-header .icon-btn { width: 38px; height: 38px; }
.pick-list { max-height: 360px; overflow-y: auto; margin: 12px 0 8px; border: 1px solid var(--c-line); border-radius: var(--radius-sm); }
.pick-list th { position: sticky; top: 0; }
.modal .search { max-width: none; }

/* --- paged tables --- */
.pager { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.pager__nav { display: flex; align-items: center; gap: 10px; margin-left: auto; color: var(--c-muted); }
td.empty-row { padding: 20px 24px; }
.org-admins { display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid var(--c-line); font-size: 13px; color: var(--c-text-2); }
.org-admins svg { width: 16px; height: 16px; fill: var(--c-primary); }
.org-admins .btn { margin-left: auto; }

/* Android enrollment: the provisioning QR code, kept sharp when scaled. */
.qr { display: block; width: min(320px, 100%); height: auto; margin: 0 auto 16px; padding: 12px; background: #fff; border-radius: 8px; image-rendering: pixelated; }
.steps { margin: 0 0 12px; padding-left: 20px; line-height: 1.6; }

/* Two ways to the same result, side by side with a big OR between them; stacked on narrow screens. */
.or-split { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; margin-bottom: 16px; }
.or-split__opt { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); }
.or-split__opt h3, .or-split__opt p { margin: 0; }
.or-split__opt .code { align-self: stretch; }
.or-split__opt > .btn { margin-top: auto; }
.or-split__or { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; color: var(--c-muted); }
.or-split__or::before, .or-split__or::after { content: ''; flex: 1; width: 1px; background: var(--c-border-2); }
@media (max-width: 760px) {
  .or-split { grid-template-columns: minmax(0, 1fr); }
  .or-split__or { flex-direction: row; }
  .or-split__or::before, .or-split__or::after { width: auto; height: 1px; }
}
/* The panel under a new package: an amber pulse while the agent has not connected, green once it has. */
.wait { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); background: var(--c-surface-2); }
.wait p { margin: 4px 0 0; }
.wait__dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c-warn); animation: pulse 1.6s ease-in-out infinite; }
.wait.is-ok { background: #e6f6ee; border-color: #c4ead6; }
.wait.is-ok .wait__dot { background: var(--c-ok); animation: none; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .wait__dot { animation: none; } }

/* Remote screen (screen.html, ADR-0014): the device's picture, as large as the window allows. */
.screen-view { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.screen-view canvas { max-width: 100%; max-height: calc(100% - 92px); min-height: 0; border-radius: 14px; background: #000;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.25); touch-action: none; cursor: pointer; outline: none; }
.screen-view canvas:focus-visible { box-shadow: 0 0 0 3px var(--c-primary-ring), 0 8px 32px rgba(15, 23, 42, 0.25); }
.screen-view .hint { max-width: 560px; text-align: center; margin: 0; }
.screen-keys { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.term-page .term-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Remote desktop (rdp.html, ADR-0015): IronRDP's element fills the window under the top bar. */
.rdp-view { position: absolute; inset: 0; background: #0f172a; }
.rdp-view iron-remote-desktop { display: block; width: 100%; height: 100%; }
/* Reports (ADR-0019): the report's own heading shows only on paper; the console around it does not. */
.report-head { display: none; }
.audit-export { flex-wrap: wrap; align-items: center; }
.audit-export input[type=date] { height: 32px; padding: 0 8px; font: inherit; border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); }
@media print {
  .sidebar, .topbar, .toasts, .no-print, .page-header, .search, .table-foot { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; }
  .report-head { display: block; margin-bottom: 12px; }
  .report-head h2 { margin: 0 0 4px; }
  .card, .stat { box-shadow: none; border: 1px solid #d0d5dd; break-inside: avoid; }
  .main__inner { animation: none; max-width: none; }
  tr { break-inside: avoid; }
}
/* Terminal uploads: a note over the terminal's corner, and a drop target over the whole window. */
.term-upload { position: absolute; right: 16px; bottom: 16px; z-index: 5; max-width: min(520px, calc(100% - 32px)); padding: 10px 14px;
  border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font-size: 13px; box-shadow: var(--shadow-card); }
.term-upload.is-ok { color: var(--c-ok); }
.term-upload.is-bad { color: var(--c-danger); }
.term-upload .btn { margin-left: 10px; vertical-align: middle; }
/* The SSH window's file browser (files.js): fills the window in place of the terminal. */
.term-files { position: absolute; inset: 0; margin: 0; border-radius: 0; display: flex; flex-direction: column; }
.term-files .table-wrap { flex: 1; overflow: auto; }
.files-bar { align-items: center; gap: 4px; padding: 10px 16px; }
.files-bar input[type=text] { flex: 1; height: 34px; margin: 0 6px; font: 13px var(--mono); }
.term-files th, .term-files td { padding: 7px 16px; }
.term-files thead th { position: sticky; top: 0; z-index: 1; }
.term-files th.num, .term-files td.num { width: 96px; white-space: nowrap; }
.term-files td.muted { white-space: nowrap; }
.files-name { word-break: break-all; }
.files-name svg.icon { width: 18px; height: 18px; margin-right: 10px; vertical-align: -4px; color: var(--c-muted); }
.term-drop { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 10; display: grid; place-items: center; padding: 24px; text-align: center;
  background: rgba(10, 110, 106, .88); color: #fff; font-size: 20px; font-weight: 500; border: 3px dashed #fff; pointer-events: none; }
/* Private networks (ADR-0020): the map editor. Machines are SVG boxes; each link is an arrow from the
   machine that connects to the one it reaches, labelled with the address to connect to. */
.netmap__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--c-line); }
.seg { display: inline-flex; border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg__btn { height: 36px; padding: 0 14px; border: 0; background: var(--c-surface); font: inherit; font-weight: 500; color: var(--c-text-2); cursor: pointer; }
.seg__btn + .seg__btn { border-left: 1px solid var(--c-border-2); }
.seg__btn.is-on { background: var(--c-primary-soft); color: var(--c-primary); }
.seg__btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: -2px; }
input.netmap__port { width: 110px; height: 38px; }
.netmap__hint { flex: 1 1 280px; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--c-text-2); font-size: 13px; }
.netmap__body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.netmap__canvas { min-width: 0; background-color: var(--c-surface-2); background-image: radial-gradient(var(--c-border-2) 1px, transparent 1px);
  background-size: 20px 20px; border-radius: 0 0 0 var(--radius); }
.netmap__svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.netmap__panel { display: flex; flex-direction: column; gap: 10px; max-height: 760px; padding: 16px; overflow-y: auto; border-left: 1px solid var(--c-line); }
.netmap__panel h3, .netmap__panel .hint { margin: 0; }
.netmap__panel .search { max-width: none; }
.netmap__list { display: grid; gap: 8px; }
.netmap__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; font: inherit; text-align: left; color: var(--c-text);
  border: 1px solid var(--c-border-2); border-radius: var(--radius-sm); background: var(--c-surface); cursor: grab; touch-action: none; }
.netmap__item:hover:not(:disabled) { border-color: var(--c-primary); }
.netmap__item:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 1px; }
.netmap__item:disabled { cursor: not-allowed; opacity: .55; }
.netmap__item .sub { display: block; font-size: 12px; color: var(--c-muted); }
.netmap__state { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c-muted); }
.netmap__state.is-on { background: var(--c-ok); }
.netmap__ghost { position: fixed; z-index: 40; pointer-events: none; transform: translate(-50%, -50%); padding: 8px 14px; font-weight: 500;
  border: 2px solid var(--c-primary); border-radius: var(--radius-sm); background: var(--c-surface); box-shadow: var(--shadow-pop); }
.netmap__node { outline: none; }
.netmap__node.is-movable { cursor: grab; }
.netmap__box { fill: var(--c-surface); stroke: var(--c-border-2); stroke-width: 1.5; }
.netmap__node:hover .netmap__box { stroke: var(--c-primary); }
.netmap__node.is-from .netmap__box, .netmap__node.is-to .netmap__box { stroke: var(--c-primary); stroke-width: 2.5; fill: var(--c-primary-soft); }
.netmap__node:focus-visible .netmap__box { stroke: var(--c-primary); stroke-width: 2.5; stroke-dasharray: 5 3; }
.netmap__name { font: 500 14px Roboto, system-ui, sans-serif; fill: var(--c-text); }
.netmap__sub { font: 12px var(--mono); fill: var(--c-muted); }
.netmap__dot { fill: var(--c-muted); }
.netmap__dot.is-on { fill: var(--c-ok); }
.netmap__badge { font: 500 11px Roboto, system-ui, sans-serif; letter-spacing: .05em; text-transform: uppercase; fill: var(--c-primary); }
.netmap__remove { cursor: pointer; opacity: 0; }
.netmap__node:hover .netmap__remove, .netmap__node:focus-visible .netmap__remove, .netmap__node.is-from .netmap__remove,
.netmap__node.is-to .netmap__remove { opacity: 1; }
.netmap__remove circle { fill: var(--c-surface); stroke: var(--c-border-2); }
.netmap__remove path { stroke: var(--c-text-2); stroke-width: 1.6; }
.netmap__remove:hover circle { fill: #fde8e8; stroke: var(--c-danger); }
.netmap__remove:hover path { stroke: var(--c-danger); }
.netmap__link { outline: none; cursor: pointer; }
.netmap__hit { fill: none; stroke: transparent; stroke-width: 16; }
.netmap__line { fill: none; stroke: var(--c-text-2); stroke-width: 2; }
.netmap__link:hover .netmap__line { stroke: var(--c-primary); }
.netmap__link.is-waiting .netmap__line { stroke: var(--c-muted); stroke-dasharray: 6 5; }
.netmap__link.is-selected .netmap__line, .netmap__link:focus-visible .netmap__line { stroke: var(--c-primary); stroke-width: 3; }
.netmap__label { font: 12px var(--mono); fill: var(--c-text-2); paint-order: stroke; stroke: var(--c-surface-2); stroke-width: 5px; stroke-linejoin: round; }
.netmap__link.is-selected .netmap__label { fill: var(--c-primary); font-weight: 500; }
.netmap__arrow--ready path { fill: var(--c-text-2); }
.netmap__arrow--wait path { fill: var(--c-muted); }
.netmap__arrow--sel path { fill: var(--c-primary); }
@media (max-width: 900px) {
  .netmap__body { grid-template-columns: minmax(0, 1fr); }
  .netmap__panel { max-height: none; border-left: 0; border-top: 1px solid var(--c-line); }
}
.netmap__panel .search { flex: none; }
.netmap__packet { fill: var(--c-primary); }
.netmap__packet.is-back { fill: var(--c-info); }
.netmap__link.is-busy .netmap__line { stroke: var(--c-primary); }
.netmap__link.is-problem .netmap__line { stroke: var(--c-danger); }
.netmap__link.is-problem .netmap__label { fill: var(--c-danger); }
.netmap__arrow--busy path { fill: var(--c-primary); }
.netmap__arrow--bad path { fill: var(--c-danger); }
@media (prefers-reduced-motion: reduce) { .netmap__link.is-busy .netmap__line { stroke-width: 4; } }
.netmap__publish { margin-left: auto; }
.netmap__link.is-draft .netmap__line { stroke: var(--c-primary); stroke-dasharray: 3 5; opacity: .75; }
.netmap__link.is-draft .netmap__label { fill: var(--c-primary); }

/* Firewall tab (firewall.js) */
.fw-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.fw-status > span:nth-child(2) { flex: 1; min-width: 220px; }
.fw-rules { margin: 0 -24px 16px; }
.fw-rules tr.is-new td { background: #f2f9f5; }
.fw-rules tr.is-removed td { color: var(--c-muted); text-decoration: line-through; }
.fw-rules tr.is-removed td.row-actions { text-decoration: none; }
.fw-lock { display: inline-flex; color: var(--c-muted); cursor: help; }
.fw-empty { margin: 0 0 16px; }
.fw-add__row { display: grid; grid-template-columns: 110px 140px 1fr 1fr 1fr auto; gap: 8px; }
.fw-add .hint { margin: 4px 0 0; }
.fw-pending { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; padding: 12px 16px;
  border-radius: var(--radius-sm); background: #e8f1fd; color: #1d4f91; }
.fw-pending > span { flex: 1; min-width: 160px; }
.fw-listen { margin-top: 20px; }
.fw-listen h3 { margin: 0 0 8px; font-size: 14px; }
.fw-listen__list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.fw-listen__list li { display: flex; align-items: center; gap: 6px; }
.fw-listen__list .sub { font-size: 12px; color: var(--c-muted); }
.fw-notes { margin: 18px 0 0; padding-left: 18px; }
.fw-notes li { margin: 2px 0; }
.fw-ruleset { margin-top: 14px; }
.fw-ruleset summary { cursor: pointer; color: var(--c-muted); font-size: 13px; }
.fw-ruleset pre { margin-top: 8px; }
@media (max-width: 760px) {
  .fw-add__row { grid-template-columns: 1fr 1fr; }
  .fw-add__row input:nth-of-type(n) { grid-column: 1 / -1; }
  .fw-rules { margin: 0 -16px 16px; }
}
.fw-tick { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.table-check { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--c-muted); font-size: 14px; cursor: pointer; }
