/* KHP Security Console v2 — light. Structure from the reference dashboards (Exon gauge and
   connected-systems table, Trellix top-N panels and dense alert table, fitness-style activity
   strip, big-number tiles), rendered on light surfaces. No external fonts: the CSP is self-only. */
:root {
  color-scheme: light;
  --ground: #F3F5F6; --surface: #FFFFFF; --raised: #F8FAFA; --ink: #0B1B22; --body: #33444C; --muted: #5A6A72; --faint: #8A989E;
  --line: #E1E7EA; --line-soft: #EEF2F3; --input: #CBD5D9;
  --brand: #0B7A83; --brand-ink: #0B5D64; --brand-soft: #E6F3F4; --brand-line: #A9D3D7; --brand-mid: #7DBEC4;
  --crit: #A4161A; --crit-mark: #C8372D; --crit-bg: #FDECEC; --crit-line: #F3B8B8;
  --high: #8A4200; --high-mark: #D9822B; --high-bg: #FFF1E5; --high-line: #F5C9A0;
  --low: #5E4A00; --low-bg: #FFF8DB; --low-line: #EBD98A;
  --info: #1D4F91; --info-mark: #4F7FC0; --info-bg: #E8F1FB; --info-line: #B6CDEB;
  --shadow: 0 1px 2px rgba(11, 27, 34, .04), 0 8px 24px -16px rgba(11, 27, 34, .18);
  --mono: "JetBrains Mono", "Cascadia Mono", "DejaVu Sans Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: #0B6B73; } a:hover { color: #08525A; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- shell */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.nav { flex: 1 1 236px; max-width: 280px; background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 760px) { .nav { max-width: none; border-right: 0; border-bottom: 1px solid var(--line); } }
.nav .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; }
.nav .brand img { width: 64px; height: auto; filter: brightness(0) saturate(100%) invert(31%) sepia(62%) saturate(1037%) hue-rotate(147deg) brightness(91%) contrast(92%); }
.nav .brand span { font-size: 15px; font-weight: 700; color: var(--ink); padding-left: 10px; border-left: 1px solid var(--line); }
.navlabel { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--body); text-decoration: none; font-weight: 500; }
.nav a svg { color: var(--faint); flex: 0 0 auto; }
.nav a:hover { background: var(--raised); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.nav a[aria-current="page"] svg { color: var(--brand); }
.nav .badge { margin-left: auto; background: var(--crit-bg); color: var(--crit); border: 1px solid var(--crit-line); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav .ext { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.nav .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.nav .me b { display: block; font-size: 13px; } .nav .me small { font-size: 12px; color: var(--muted); }

main { flex: 999 1 560px; min-width: 0; padding: 18px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) { main { padding: 16px 16px 40px; } }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; font-size: 12px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.live i { width: 7px; height: 7px; border-radius: 99px; background: var(--brand); }
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); }

/* ---- cards & grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 650; }
.card.center { text-align: center; } .card.center .ring { margin: 4px auto 0; }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.col-3 { flex: 3 1 520px; min-width: 0; } .col-2 { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
section.col-2 { display: block; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.split { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.split h2 { margin: 0; }

/* ---- hero: sentence + gauge */
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px 28px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  background-image: linear-gradient(120deg, #FFFFFF 55%, #EEF7F7); }
.hero-text { flex: 1 1 420px; min-width: 0; }
.headline { margin: 0 0 6px; font-size: 30px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; max-width: 760px; }
.hero-text p { margin: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.hero-gauge { flex: 0 0 260px; text-decoration: none; color: var(--ink); }
.gauge { margin: 0; position: relative; }
.gauge svg { width: 100%; height: auto; display: block; }
.gauge figcaption { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.gauge figcaption b { display: block; font-size: 30px; font-weight: 750; letter-spacing: -0.02em; }
.gauge figcaption span { font-size: 12px; color: var(--muted); }
.seg { transition: opacity .15s; } .seg:hover { opacity: .75; }
.seg-ok { fill: var(--brand); } .seg-crit { fill: var(--crit-mark); } .seg-high { fill: var(--high-mark); }

/* ---- tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); min-width: 0; }
a.tile:hover { border-color: var(--brand-line); color: var(--ink); }
.tile .label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.tile .value { font-size: 32px; font-weight: 750; line-height: 1.1; letter-spacing: -0.02em; }
.tile .note { font-size: 12.5px; color: var(--muted); }
.v-crit { color: var(--crit); } .v-high { color: var(--high); } .v-ok { color: var(--brand-ink); }
.spark { width: 100%; height: 30px; display: block; margin-top: 2px; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--brand-soft); }

/* ---- needs-you list */
.today { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.item { padding: 14px 0; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.item:first-child { border-top: 0; padding-top: 4px; }
.item.acked { opacity: 0.65; }
.item > .sev { min-width: 88px; justify-content: center; }
.item .body { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item .area { font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; }
.item .title { font-size: 15px; font-weight: 650; color: var(--ink); text-decoration: none; } .item .title:hover { color: var(--brand-ink); text-decoration: underline; }
.item .detail { color: var(--body); font-size: 13px; }
.item .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.item .clock { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .item .side { flex: 1 1 100%; flex-direction: row; justify-content: space-between; align-items: center; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sev { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 750; letter-spacing: 0.06em; border-radius: 6px; padding: 4px 7px; border: 1px solid; flex: 0 0 auto; }
.sev svg { width: 9px; height: 9px; fill: currentColor; }
.sev-critical { background: var(--crit-bg); color: var(--crit); border-color: var(--crit-line); }
.sev-high { background: var(--high-bg); color: var(--high); border-color: var(--high-line); }
.sev-low { background: var(--low-bg); color: var(--low); border-color: var(--low-line); }
.sev-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.state-ok { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; border: 1px solid; white-space: nowrap; }
.pill-ok { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.pill-high { background: var(--high-bg); color: var(--high); border-color: var(--high-line); }
.pill-crit { background: var(--crit-bg); color: var(--crit); border-color: var(--crit-line); }
.pill-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent; white-space: nowrap; }
.btn-brand, .btn-dark { background: var(--brand); color: #FFF; } .btn-brand:hover, .btn-dark:hover { background: var(--brand-ink); color: #FFF; }
.btn-line { background: var(--surface); color: var(--ink); border-color: var(--input); } .btn-line:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-lg { min-height: 46px; font-size: 15px; width: 100%; }
.inline { display: inline; margin: 0; }

/* ---- charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: Inter, "Segoe UI", system-ui, sans-serif; }
.chart .area { fill: url(#none); fill: var(--brand-soft); }
.chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; }
.chart .avg { stroke: var(--brand-mid); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .avg-t { fill: var(--brand-ink); }
.chart .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart .hit { fill: transparent; } .chart .hit:hover { fill: rgba(11, 122, 131, .06); }
.bar-warn { fill: var(--high-mark); } .bar-notice { fill: #B6CDEB; } .bar-ok { fill: var(--brand); } .bar-unknown { fill: #CBD5D9; }
.heat { fill: var(--line-soft); } .heat.h1 { fill: #CCE8EA; } .heat.h2 { fill: #7DBEC4; } .heat.h3 { fill: #1F8E97; } .heat.h4 { fill: #0B5D64; }
.heat:hover { stroke: var(--ink); stroke-width: 1; }
.keys { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.keys span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k-line::before { background: var(--brand); height: 3px !important; vertical-align: 3px !important; }
.k-warn::before { background: var(--high-mark); } .k-notice::before { background: #B6CDEB; }
.k-ok::before { background: var(--brand); } .k-unknown::before { background: #CBD5D9; }
.ring { width: 150px; height: 150px; display: block; }
.ring .track { fill: none; stroke: var(--line-soft); stroke-width: 10; }
.ring .val { fill: none; stroke-width: 10; stroke-linecap: round; }
.ring .val.ok { stroke: var(--brand); } .ring .val.crit { stroke: var(--crit-mark); }
.ring-big { font-size: 18px; font-weight: 750; fill: var(--ink); }
.ring-small { font-size: 10px; fill: var(--muted); }
.segbar { display: inline-flex; gap: 3px; }
.segbar i { width: 7px; height: 14px; border-radius: 2px; background: var(--line); }
.segbar i.on { background: var(--brand); } .segbar i.bad { background: var(--high-mark); }

/* ---- bars & lists */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) 52px; gap: 14px; align-items: center; min-height: 46px; border-bottom: 1px solid var(--line-soft); }
.bars li:last-child { border-bottom: 0; }
.bars .name { display: flex; flex-direction: column; min-width: 0; }
.bars .name .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .name small { font-size: 12px; color: var(--muted); }
.track { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; display: block; }
.fill { height: 8px; border-radius: 999px; background: var(--brand-mid); display: block; }
.fill.warn { background: var(--high-mark); } .fill.brand { background: var(--brand); }
.bars .days { font-weight: 700; text-align: right; }
.topn { list-style: none; margin: 0; padding: 0; }
.topn li { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 36px; gap: 12px; align-items: center; min-height: 34px; }
.topn .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.topn b { text-align: right; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 38px; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: 0; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chips .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; text-decoration: none; background: var(--surface); color: var(--body); border: 1px solid var(--input); }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.chip[aria-current="true"] { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }

/* ---- tables (Trellix density, light) */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; box-shadow: var(--shadow); }
.table-wrap.flat { box-shadow: none; border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 900px; }
th { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--raised); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
td.wrap { white-space: normal; min-width: 260px; }
tbody tr:hover td { background: #F7FAFA; }
tr:last-child td { border-bottom: 0; }
table.compact { min-width: 0; }
table.compact th { background: none; padding: 6px 4px; } table.compact td { padding: 9px 4px; }
.person { display: inline-flex; align-items: center; gap: 8px; }
.avatar-s { width: 24px; height: 24px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.tier { display: inline-block; min-width: 24px; text-align: center; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 6px; background: var(--line-soft); }
.tier-1 { background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); }
.t-crit { color: var(--crit); font-weight: 600; } .t-high { color: var(--high); font-weight: 600; } .t-ok { color: var(--brand-ink); font-weight: 600; }

/* ---- alert detail */
.hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.hero .text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.hero h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.hero h1 .mono { font-size: inherit; font-weight: 650; }
.hero p { margin: 0; font-size: 15px; color: var(--body); max-width: 760px; }
.countdown { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 24px; border-radius: 12px; background: var(--crit-bg); border: 1px solid var(--crit-line); color: var(--crit); min-width: 170px; }
.countdown small { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.countdown b { font-size: 38px; line-height: 1.05; }
.countdown span { font-size: 13px; color: var(--body); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.timeline .at { flex: 0 0 120px; font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.timeline .pip { flex: 0 0 10px; height: 10px; margin-top: 5px; border-radius: 999px; background: var(--brand); }
.timeline .pip.crit { background: var(--crit-mark); } .timeline .pip.grey { background: var(--faint); } .timeline .pip.warn { background: var(--high-mark); }
.timeline b { display: block; font-size: 14px; } .timeline small { font-size: 13px; color: var(--muted); }
.decision { border: 2px solid var(--brand-line); }
.options { display: flex; flex-direction: column; gap: 10px; border: 0; margin: 0; padding: 0; }
.option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.option:has(input:checked) { border: 2px solid var(--brand); background: var(--brand-soft); }
.option input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; }
.option b { display: block; font-size: 15px; } .option small { font-size: 13px; color: var(--muted); }
.option.denied { opacity: 0.55; cursor: not-allowed; }
textarea { width: 100%; font: inherit; border: 1px solid var(--input); border-radius: 8px; padding: 10px; resize: vertical; background: var(--surface); color: var(--ink); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.notice { border-radius: 10px; padding: 14px 16px; border: 1px solid var(--brand-line); background: var(--brand-soft); }
.ladder { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ladder li { display: flex; gap: 12px; align-items: center; }
.ladder .lv { flex: 0 0 32px; height: 32px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; border: 2px solid var(--brand); color: var(--brand-ink); }
.ladder .lv.on { background: var(--brand); color: #FFF; }
.ladder .lv.later { border-style: dashed; border-color: var(--faint); color: var(--muted); }
.ladder b { display: block; } .ladder small { color: var(--muted); font-size: 13px; }

/* ---- readiness checks */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.mark { flex: 0 0 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; border: 1px solid; }
.mark svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; }
.mark.done { background: var(--brand); color: #FFF; border-color: var(--brand); }
.mark.crit { background: var(--crit-bg); color: var(--crit); border-color: var(--crit-line); }
.mark.high { background: var(--high-bg); color: var(--high); border-color: var(--high-line); }
.checks .body { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.checks .body b { font-size: 14.5px; } .checks .body small { font-size: 13px; color: var(--muted); }
.checks .fix { flex: 1 1 100%; font-size: 13px; color: var(--body); padding-left: 42px; }
.progress { display: flex; align-items: center; gap: 10px; }
.progress .track { width: 140px; }
.flash { padding: 12px 16px; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-ink); font-weight: 600; }
.flash.err { background: var(--crit-bg); border-color: var(--crit-line); color: var(--crit); }

/* ---- one dashboard: SOC sub-menu, sign-out, vault frame, sign-in page */
.nav li.sub ul { margin: 2px 0 6px 20px; padding-left: 10px; border-left: 1px solid var(--line); gap: 0; }
.nav li.sub a { min-height: 32px; font-size: 13px; font-weight: 500; }
.nav .me { flex-wrap: wrap; }
.nav .me .who { min-width: 0; flex: 1 1 120px; }
.nav .me .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--brand-ink); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.page-head.tight { align-items: center; }
.vault-frame { flex: 1 1 auto; min-height: 78vh; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.vault-frame iframe { width: 100%; height: 78vh; border: 0; display: block; }
.empty { color: var(--muted); padding: 18px 0; margin: 0; }
.pill-muted { background: var(--raised); color: var(--muted); border-color: var(--line); }
.notice.warn { border-color: var(--high-line); background: var(--high-bg); }
.login-body { background: var(--ground); background-image: radial-gradient(1200px 500px at 85% -10%, #E3F2F3, transparent 60%); }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; }
.login-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 6px 0 0; font-size: 24px; letter-spacing: -0.015em; }
.login-card p { margin: 0; color: var(--body); }
.brand-row { display: flex; align-items: center; gap: 10px; }
.brand-row img { width: 64px; filter: brightness(0) saturate(100%) invert(31%) sepia(62%) saturate(1037%) hue-rotate(147deg) brightness(91%) contrast(92%); }
.brand-row span { font-weight: 700; padding-left: 10px; border-left: 1px solid var(--line); }
.login-notes { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
/* forms used across SOC sections */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; align-items: end; }
.field input, .field select, .field textarea, input.in, select.in { width: 100%; min-height: 36px; font: inherit; font-size: 13.5px; border: 1px solid var(--input); border-radius: 8px; padding: 6px 10px; background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus, input.in:focus, select.in:focus { outline: 2px solid var(--brand-line); border-color: var(--brand); }
label.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; }
.btn-danger { background: var(--crit-mark); color: #FFF; } .btn-danger:hover { background: var(--crit); color: #FFF; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
details.inline-form > summary { cursor: pointer; list-style: none; display: inline-flex; }
details.inline-form > summary::-webkit-details-marker { display: none; }
details.inline-form[open] > div { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: minmax(84px, 110px) minmax(0, 1fr) auto; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line-soft); align-items: start; }
.feed li:first-child { border-top: 0; }
.feed .t { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 2px; white-space: nowrap; }
.feed .what { min-width: 0; overflow-wrap: anywhere; }
.feed .what b { display: block; font-size: 13.5px; } .feed .what small { display: block; color: var(--muted); font-size: 12.5px; }
pre.code { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; }
tr.group td { background: var(--raised); font-weight: 600; }

/* ---- art-director pass 3: one spacing rhythm, layouts that follow their card's width */
.card { container-type: inline-size; }
.card > * + * { margin-top: 12px; }
.card > h2 + *, .card > .split + * { margin-top: 10px; }
.card > .split { margin-bottom: 0; }
.grid3 > .wide, .grid3 > .span-all { grid-column: 1 / -1; }
.grid3 > .card { margin: 0; }
/* In a narrow card a feed row stacks: time on its own line, then text with the badge at the end. */
@container (max-width: 520px) {
  .feed li { grid-template-columns: minmax(0, 1fr) auto; }
  .feed li > .t { grid-column: 1 / -1; padding-top: 0; }
  .topn li { grid-template-columns: minmax(0, 1fr) 72px 32px; }
  .kv { flex-wrap: wrap; }
}
/* Long values (emails, IPs, user agents) wrap instead of pushing the layout. */
td .mono, td.mono { overflow-wrap: anywhere; }
td.wrap, td .wrap { white-space: normal; }
.what b, .item .title { overflow-wrap: anywhere; }
.hero > * + *, .card.hero > * + * { margin-top: 0; }

/* ---- native Passwords (assets/pw/passwords.js) */
.status { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--muted); }
.status.err { color: var(--crit); font-weight: 600; } .status.ok { color: var(--brand-ink); font-weight: 600; }
#signin { display: flex; flex-direction: column; gap: 12px; }
#tfa { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--brand-line); background: var(--brand-soft); border-radius: 10px; }
#tfa[hidden] { display: none; }
.pw-app { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-height: 70vh; display: flex; flex-direction: column; overflow: hidden; }
.pw-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; text-align: center; }
.pw-spinner { width: 28px; height: 28px; border-radius: 99px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: pwspin .9s linear infinite; }
@keyframes pwspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pw-spinner { animation: none; } }
.pw-unlock { margin: auto; width: 100%; max-width: 380px; padding: 40px 20px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.pw-unlock h2 { margin: 0; font-size: 22px; } .pw-unlock .field { text-align: left; } .pw-unlock p { margin: 0; }
.pw-lockicon { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: var(--brand-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
.pw-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--raised); }
.pw-searchwrap { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--input); border-radius: 9px; padding: 0 10px; color: var(--faint); }
.pw-searchwrap:focus-within { border-color: var(--brand); outline: 2px solid var(--brand-line); }
.pw-search { border: 0 !important; outline: 0 !important; padding: 0 !important; min-height: 36px; flex: 1; }
.pw-count { font-size: 12.5px; margin-right: auto; }
.pw-body { flex: 1; display: grid; grid-template-columns: 220px minmax(260px, 340px) minmax(0, 1fr); min-height: 0; }
@media (max-width: 1100px) { .pw-body { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); } .pw-filters { display: none; } }
@media (max-width: 700px) { .pw-body { grid-template-columns: 1fr; } .pw-list { max-height: 45vh; border-right: 0 !important; border-bottom: 1px solid var(--line); } }
.pw-filters { border-right: 1px solid var(--line); padding: 12px 10px; overflow-y: auto; max-height: 72vh; }
.pw-filters ul { list-style: none; margin: 0 0 6px; padding: 0; }
.pw-filters .navlabel { margin: 12px 8px 4px; }
.pw-filter { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 13px; color: var(--body); text-align: left; cursor: pointer; }
.pw-filter span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-filter svg { color: var(--faint); flex: 0 0 auto; }
.pw-filter:hover { background: var(--raised); }
.pw-filter[aria-current="true"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.pw-filter[aria-current="true"] svg { color: var(--brand); }
.pw-sub .pw-filter { padding-left: 30px; font-size: 12.5px; }
.pw-n { font-size: 11.5px; color: var(--faint); }
.pw-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 72vh; }
.pw-list ul { list-style: none; margin: 0; padding: 6px; }
.pw-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 10px; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.pw-row:hover { background: var(--raised); }
.pw-row[aria-selected="true"] { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.pw-rowtext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pw-rowtext b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-rowtext small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-badges { display: flex; gap: 4px; align-items: center; flex: 0 0 auto; }
.pw-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--muted); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.pw-badge.org { color: var(--info); background: var(--info-bg); border-color: var(--info-line); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-star { color: #C99A06; display: inline-flex; }
.pw-av { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 14px; background: var(--brand-soft); color: var(--brand-ink); }
.pw-av.t2 { background: #FFF4D6; color: #7A5600; } .pw-av.t3 { background: var(--info-bg); color: var(--info); } .pw-av.t4 { background: #EEE9FB; color: #4B3A8C; } .pw-av.t5 { background: #ECEFF1; color: #33444C; }
.pw-av.lg { width: 44px; height: 44px; flex-basis: 44px; font-size: 18px; border-radius: 12px; }
.pw-detail { padding: 20px 22px; overflow-y: auto; max-height: 72vh; min-width: 0; }
.pw-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.pw-head h2 { margin: 0; font-size: 19px; overflow-wrap: anywhere; } .pw-head p { margin: 2px 0 0; }
.pw-fields { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pw-field { padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.pw-field:first-child { border-top: 0; }
.pw-field dt { font-size: 11.5px; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.pw-field dd { margin: 2px 0 0; display: flex; align-items: center; gap: 10px; min-height: 30px; }
.pw-val { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.pw-val.pre { white-space: pre-wrap; }
.pw-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.pw-actions .btn-sm { min-height: 30px; width: 32px; padding: 0; }
.pw-totpwrap { flex: 1; display: flex; align-items: center; gap: 10px; }
.pw-totp { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: .06em; color: var(--brand-ink); }
.pw-ring { --p: 1; width: 18px; height: 18px; border-radius: 99px; background: conic-gradient(var(--brand) calc(var(--p) * 360deg), var(--line-soft) 0); }
.pw-ring.low { background: conic-gradient(var(--crit-mark) calc(var(--p) * 360deg), var(--line-soft) 0); }
.pw-meta { margin: 12px 2px 0; }
.pw-dialog { border: 1px solid var(--line); border-radius: 14px; padding: 22px; width: min(420px, 92vw); box-shadow: 0 20px 60px -20px rgba(11, 27, 34, .35); }
.pw-dialog::backdrop { background: rgba(11, 27, 34, .25); }
.pw-dialog form { display: flex; flex-direction: column; gap: 12px; }
.pw-dialog h3 { margin: 0; } .pw-dialog p { margin: 0; }
.pw-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #FFF; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); z-index: 50; max-width: 90vw; }
.pw-toast.err { background: var(--crit); }

/* ---- Passwords stage 2: create / edit / trash / folders / attachments */
.pw-new { position: relative; }
.pw-new > summary { list-style: none; cursor: pointer; }
.pw-new > summary::-webkit-details-marker { display: none; }
.pw-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.pw-menu button { border: 0; background: none; text-align: left; font: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.pw-menu button:hover { background: var(--brand-soft); color: var(--brand-ink); }
.pw-itemactions { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.btn-danger-line { background: var(--surface); color: var(--crit); border-color: var(--crit-line); }
.btn-danger-line:hover { background: var(--crit-bg); color: var(--crit); }
.linkbtn.danger { color: var(--crit); }
.pw-add span { color: var(--brand-ink); font-weight: 600; }
.pw-listhead { display: flex; align-items: center; gap: 10px; padding: 8px 14px; margin: 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.pw-listhead b { color: var(--ink); margin-right: auto; }
.pw-editor { display: flex; flex-direction: column; gap: 14px; }
.pw-editor .pw-head { margin-bottom: 0; }
.pw-group { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.pw-group.pw-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pw-group .field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--body); }
.pw-group .field > span { color: var(--muted); }
.pw-group textarea.in { min-height: 90px; resize: vertical; }
.pw-inline { display: flex; gap: 6px; align-items: center; }
.pw-inline > .in { flex: 1; min-width: 0; }
.pw-field-edit .pw-ftype { flex: 0 0 104px; }
.pw-list-edit { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pw-list-edit > .pw-inline { width: 100%; }
.pw-checks { display: flex; flex-direction: column; gap: 6px; padding: 4px 2px; font-weight: 500; }
.pw-checks[hidden] { display: none; }
.pw-flags { flex-direction: row; flex-wrap: wrap; gap: 18px; font-weight: 500; }
.pw-sticky { position: sticky; bottom: -20px; background: var(--surface); padding: 12px 0; border-top: 1px solid var(--line-soft); }
.pw-genwrap[hidden] { display: none; }
.pw-gen { margin-top: 8px; padding: 12px; border: 1px solid var(--brand-line); background: var(--brand-soft); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; font-weight: 500; }
.pw-gen-out { display: block; font-size: 15px; font-weight: 700; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.pw-gen-len input { width: 100%; accent-color: var(--brand); }
.pw-gen-opts { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.pw-attach { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pw-attach h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.pw-attach ul { list-style: none; margin: 0 0 8px; padding: 0; }
.pw-attach li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.pw-attach li:first-child { border-top: 0; }
.pw-history { margin-top: 14px; }
.pw-history > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.pw-history[open] > summary { margin-bottom: 8px; }
.pw-detail .notice { margin: 0 0 12px; padding: 10px 12px; }
.pw-gen-opts label.check { white-space: nowrap; }
.pw-gen-opts input, .pw-flags input, .pw-checks input { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--brand); }

/* ---- Settings (assets/pw/settings.js) */
.area-app { min-height: 60vh; padding: 0; }
.set-tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); background: var(--raised); overflow-x: auto; }
.set-tabs a { padding: 10px 14px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--body); font-weight: 600; font-size: 13.5px; white-space: nowrap; border: 1px solid transparent; border-bottom: 0; }
.set-tabs a:hover { color: var(--brand-ink); }
.set-tabs a[aria-current="page"] { background: var(--surface); color: var(--brand-ink); border-color: var(--line); margin-bottom: -1px; }
.set-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.set-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.set-card h2 { margin: 0; font-size: 15.5px; }
.set-card p { margin: 0; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.set-row:first-of-type { border-top: 0; }
.set-row > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.set-row .muted { font-size: 13px; }
.set-form { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
.set-form .field, .pw-dialog .field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.set-phrase { font-size: 14px; font-weight: 700; color: var(--brand-ink); letter-spacing: .02em; overflow-wrap: anywhere; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 8px; padding: 8px 10px; }
.set-phrase-sm { font-size: 12px; color: var(--brand-ink); }
.set-meter { display: inline-block; width: 70px; height: 6px; border-radius: 99px; background: var(--line-soft); vertical-align: middle; position: relative; overflow: hidden; }
.set-meter::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--crit-mark); border-radius: 99px; }
.set-meter[data-level="1"]::after { width: 25%; } .set-meter[data-level="2"]::after { width: 50%; background: var(--high-mark); }
.set-meter[data-level="3"]::after { width: 75%; background: var(--brand-mid); } .set-meter[data-level="4"]::after { width: 100%; background: var(--brand); }
.set-qr form { align-items: stretch; }
.set-qrbox { display: flex; justify-content: center; padding: 8px; background: #FFF; border: 1px solid var(--line); border-radius: 12px; }
.set-qrbox svg { width: 200px; height: 200px; }
.set-keys { list-style: none; margin: 0; padding: 0; }
.set-keys li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.set-yubi { display: flex; flex-direction: column; gap: 6px; }
.notice.small { font-size: 12.5px; padding: 8px 10px; }
.login-step { display: flex; flex-direction: column; gap: 12px; }
.login-step h2 { margin: 0; font-size: 19px; }

/* ---- Tools / Send (wave 2) */
.tools-out { font-size: 18px; min-height: 44px; display: flex; align-items: center; }
.tools-opts { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.tools-opts input[type=range] { width: 100%; accent-color: var(--brand); }
.tools-file { align-self: flex-start; cursor: pointer; }
.tools-file input { display: none; }
.tools-step { display: flex; flex-direction: column; gap: 12px; }
.tools-h3 { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.tools-map select.in { min-width: 220px; }
.tools-where { display: flex; flex-direction: column; gap: 10px; }
.chips .chip { cursor: pointer; }
.send-text { white-space: pre-wrap; user-select: all; }
.login-card .pre, .login-card pre { margin: 0; }

/* ---------------------------------------------------------------- Organisation (W3) */
#org-body.set-body { max-width: none; padding: 24px 28px 28px; gap: 18px; }
.org-switch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.org-badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 6px; padding: 3px 8px; }
.org-switch-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; margin-right: auto; }
.org-switch-name b { font-size: 15px; color: var(--ink); }
.org-switch-sel { display: flex; align-items: center; gap: 8px; }
.org-switch-sel select { min-width: 240px; max-width: 60vw; }
.org-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.org-head h2 { margin: 0; font-size: 18px; color: var(--ink); }
.org-head p { margin: 4px 0 0; max-width: 620px; }
.org-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.org-filters .field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.org-filter { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.org-table td { vertical-align: middle; }
.org-table td:last-child { position: relative; }
.org-person { display: flex; gap: 10px; align-items: flex-start; }
.org-person .avatar-s { margin-top: 2px; flex: none; }
.org-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.org-badges:empty { display: none; }
.org-menu { position: absolute; right: 8px; top: calc(100% - 6px); z-index: 20; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.org-menu-item { text-align: left; background: none; border: 0; border-radius: 6px; padding: 9px 10px; font: inherit; font-size: 13.5px; color: var(--body); cursor: pointer; }
.org-menu-item:hover, .org-menu-item:focus-visible { background: var(--raised); color: var(--ink); }
.org-menu-item.danger { color: var(--crit); }
.org-menu-item.danger:hover { background: var(--crit-bg); }
.pw-dialog.wide { width: min(680px, 94vw); max-height: 88vh; }
.pw-dialog h4 { margin: 6px 0 0; font-size: 13px; color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.org-roles { display: flex; flex-direction: column; gap: 6px; }
.org-role { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.org-role:has(input:checked) { border-color: var(--brand-line); background: var(--brand-soft); }
.org-role:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.org-role > span { display: flex; flex-direction: column; gap: 2px; }
.org-role input { margin-top: 3px; }
.org-perms, .org-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.org-matrix { display: flex; flex-direction: column; gap: 8px; }
.org-matrix .table-wrap { max-height: 300px; overflow: auto; }
.org-matrix td:last-child { width: 240px; }
.org-matrix select { width: 100%; }
.org-pick { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.org-pick li { padding: 8px 10px; border-top: 1px solid var(--line-soft); }
.org-pick li:first-child { border-top: 0; }
.org-pick label.check { align-items: flex-start; }
.org-fp { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.org-fp li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.org-fp label.check { align-items: flex-start; }
.org-phrase { color: var(--brand-ink); font-size: 13.5px; margin: 4px 0 2px; word-break: break-word; }
.org-inline { display: flex; gap: 8px; align-items: center; }
.org-inline .in { flex: 1; min-width: 0; }
.org-cards { display: flex; flex-direction: column; gap: 14px; }
.org-policy-opts:empty { display: none; }
.org-policy-opts { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; background: var(--raised); border-radius: 8px; }
@media (max-width: 640px) {
  .org-switch-sel select { min-width: 0; width: 100%; }
  .org-switch-sel { width: 100%; }
  .org-matrix td:last-child { width: auto; }
}
.pw-dialog .pw-val { white-space: pre-wrap; }
.set-tabs { overflow-y: hidden; }
.org-filters > select.in { width: auto; flex: 0 0 auto; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Get the extension (public) */
.gx { max-width: 1040px; margin: 0 auto; padding: 32px 20px 40px; display: flex; flex-direction: column; gap: 22px; }
.gx-hero { padding: 8px 0 4px; }
.gx-hero h1 { margin: 4px 0 8px; font-size: 30px; letter-spacing: -0.02em; color: var(--ink); }
.gx-lead { margin: 0 0 6px; font-size: 16px; color: var(--body); max-width: 680px; }
.gx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.gx-card { display: flex; flex-direction: column; gap: 12px; }
.gx-card h2 { margin: 0; font-size: 17px; }
.gx-card p { margin: 0; }
.gx-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.gx-step { display: flex; gap: 12px; align-items: flex-start; }
.gx-step b { color: var(--ink); }
.gx-step p { margin: 2px 0 0; color: var(--body); font-size: 14px; }
.gx-num { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.gx-it .kv b { word-break: break-all; }
.gx-foot { text-align: center; }

/* ---------------------------------------------------------------- Organisation: art-director pass */
.set-body:has(> .table-wrap) { max-width: none; }
.org-head h2 { font-size: 20px; letter-spacing: -0.01em; }
.org-head .row-actions { gap: 8px; }
.org-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.org-kpi { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .12s, box-shadow .12s, background .12s; }
.org-kpi:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.org-kpi:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.org-kpi.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.org-kpi-value { font-size: 26px; font-weight: 750; line-height: 1.15; color: var(--ink); letter-spacing: -0.02em; }
.org-kpi-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.org-kpi.warn .org-kpi-value { color: var(--high); }
.org-kpi.crit .org-kpi-value { color: var(--crit); }
.org-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.org-toolbar > select.in { width: auto; min-width: 170px; }
.org-search-wrap { position: relative; flex: 1 1 320px; max-width: 460px; display: flex; align-items: center; }
.org-search-wrap svg { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.org-search-wrap .in { width: 100%; padding-left: 36px; }
.org-count { margin-left: auto; }
.org-wrap { border-radius: 12px; }
table.org-table { min-width: 980px; }
.org-table th { padding: 11px 16px; }
.org-table td { padding: 12px 16px; }
.org-table th.r, .org-table td.r { text-align: right; }
.org-members col.c-member { width: 26%; } .org-members col.c-dept { width: 12%; } .org-members col.c-role { width: 13%; }
.org-members col.c-acct { width: 22%; } .org-members col.c-status { width: 9%; } .org-members col.c-2fa { width: 8%; } .org-members col.c-act { width: 10%; }
.org-members td { white-space: normal; }
.org-person { display: flex; gap: 12px; align-items: center; min-width: 0; }
.org-avatar { flex: none; width: 36px; height: 36px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 750; letter-spacing: .02em; border: 1px solid transparent; }
.org-avatar.t-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.org-avatar.t-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.org-avatar.t-high { background: var(--high-bg); color: var(--high); border-color: var(--high-line); }
.org-avatar.t-low { background: var(--low-bg); color: var(--low); border-color: var(--low-line); }
.org-avatar.t-plum { background: #F3EDF7; color: #5B3A72; border-color: #DCCDE6; }
.org-who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.org-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.org-name b { color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-mail { font-family: var(--mono); font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-you { font-size: 11px; font-weight: 700; color: var(--info); background: var(--info-bg); border: 1px solid var(--info-line); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.org-dept { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--body); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.org-rolename { font-weight: 600; color: var(--ink); white-space: nowrap; }
.org-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.org-tag { font-size: 11.5px; font-weight: 650; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.org-tag.soft { color: var(--muted); background: var(--raised); border-color: var(--line); }
.org-tag.warn { color: var(--high); background: var(--high-bg); border-color: var(--high-line); }
.org-tag.crit { color: var(--crit); background: var(--crit-bg); border-color: var(--crit-line); }
.org-2fa { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; }
.org-2fa::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--faint); }
.org-2fa.on { color: var(--brand-ink); } .org-2fa.on::before { background: var(--brand); }
.org-2fa.off { color: var(--crit); } .org-2fa.off::before { background: var(--crit-mark); }
.org-row-actions { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
.org-more { min-width: 34px; padding: 0 8px; font-size: 16px; line-height: 1; letter-spacing: 1px; }
.org-table tr.is-revoked td { opacity: .6; }
.org-none { text-align: center; color: var(--muted); padding: 28px 16px !important; }
.org-menu { top: calc(100% - 4px); }
@media (max-width: 760px) {
  #org-body.set-body { padding: 16px; }
  .org-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-count { margin-left: 0; width: 100%; }
}

/* Access lists inside dialogs: two columns that always fit (no sideways scroll). */
.org-matrix table { min-width: 0; table-layout: fixed; }
.org-matrix td { white-space: normal; padding: 9px 12px; }
.org-matrix td:last-child { width: 230px; }
.org-matrix td .muted.small { overflow-wrap: anywhere; }
.org-matrix .table-wrap { max-height: 320px; overflow-y: auto; overflow-x: hidden; }
.org-pick { max-height: 300px; }
@media (max-width: 640px) { .org-matrix td:last-child { width: 160px; } }

/* ---------------------------------------------------------------- Organisation: member and collection pages */
.org-back { align-self: flex-start; font-size: 13px; font-weight: 650; color: var(--brand-ink); text-decoration: none; }
.org-back:hover { text-decoration: underline; }
.org-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, var(--surface), var(--raised)); }
.org-hero-main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.org-hero h2 { margin: 0; font-size: 22px; letter-spacing: -0.015em; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.org-hero .org-mail { margin-top: 2px; }
.org-hero-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.org-hero-actions { flex-wrap: wrap; justify-content: flex-end; }
.org-hero-icon { width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); flex: none; }
.org-avatar.big { width: 60px; height: 60px; font-size: 20px; }
.org-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.org-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.org-card h3, .org-section h3 { margin: 0; font-size: 15px; color: var(--ink); }
.org-card h4 { margin: 8px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.org-card .kv { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.org-card .kv:first-of-type { border-top: 0; }
.org-card .kv span:first-child { color: var(--muted); }
.org-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.org-section { display: flex; flex-direction: column; gap: 10px; }
.org-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.org-section-head p { margin: 4px 0 0; }
.org-level { display: inline-block; font-size: 12.5px; font-weight: 650; border-radius: 6px; padding: 2px 8px; border: 1px solid var(--line); background: var(--raised); color: var(--body); white-space: nowrap; }
.org-level.l-manage { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.org-level.l-edit, .org-level.l-editHide { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.org-level.l-viewHide, .org-level.l-editHide { box-shadow: inset 0 -2px 0 var(--high-line); }
.org-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.org-kpi.static { cursor: default; }
.org-kpi.static:hover { box-shadow: none; border-color: var(--line); }
.org-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.org-preview h5 { margin: 0 0 6px; font-size: 12.5px; color: var(--ink); }
.org-preview ul, .org-review, .org-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.org-review { max-height: 220px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.org-perm-list { list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.org-perm-list li.on { color: var(--brand-ink); font-weight: 600; }
.org-namelink { color: inherit; text-decoration: none; }
.org-namelink:hover b { text-decoration: underline; }
.org-table a b { color: var(--ink); }
@media (max-width: 760px) { .org-preview { grid-template-columns: 1fr; } .org-hero-actions { justify-content: flex-start; } }
.org-table td.r select.in { width: auto; min-width: 210px; max-width: 260px; }

/* ---------------------------------------------------------------- Alert page */
a.alert-link { color: var(--ink); font-weight: 600; text-decoration: none; }
a.alert-link:hover { text-decoration: underline; color: var(--brand-ink); }
.alert-hero h1 { margin: 10px 0 6px; font-size: 24px; letter-spacing: -0.015em; color: var(--ink); }
.alert-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.alert-hero-top .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.alert-rule { margin: 0; color: var(--body); max-width: 860px; }
.alert-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.alert-facts div { display: flex; flex-direction: column; gap: 2px; }
.alert-facts span { font-size: 12px; }
.alert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.alert-grid .card .kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.alert-grid .card .kv:first-of-type { border-top: 0; }
.alert-grid .card .kv b.wrap { text-align: right; overflow-wrap: anywhere; }
.alert-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--body); }
.alert-action { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.alert-events td { white-space: normal; }

/* ---------------------------------------------------------------- Email, mailbox style */
.mail-view { padding: 0; overflow: hidden; }
.mail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 24px 10px; flex-wrap: wrap; }
.mail-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); overflow-wrap: anywhere; }
.mail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mail-from { display: flex; align-items: flex-start; gap: 12px; padding: 6px 24px 16px; border-bottom: 1px solid var(--line); }
.mail-avatar { flex: none; width: 42px; height: 42px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 16px; }
.mail-who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mail-when { text-align: right; font-size: 13px; white-space: nowrap; }
.mail-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 24px; border-bottom: 1px solid var(--line-soft); }
.mail-file { font-size: 12.5px; border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; background: var(--raised); }
.mail-images { padding: 10px 24px; background: var(--low-bg); border-bottom: 1px solid var(--low-line); color: var(--low); font-size: 13px; }
.mail-frame { display: block; width: 100%; height: 72vh; min-height: 420px; border: 0; background: #fff; }
.mail-note { margin: 0; padding: 10px 24px; border-top: 1px solid var(--line-soft); }
.mail-links td { white-space: normal; }
.mail-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mail-facts div { display: flex; flex-direction: column; gap: 4px; }

/* ---------------------------------------------------------------- Employee timeline */
.tl-wrap { overflow-x: hidden; }
table.tl-table { min-width: 0; table-layout: fixed; width: 100%; }
.tl-table td { white-space: normal; vertical-align: top; }
.tl-table col.tl-when { width: 108px; } .tl-table col.tl-event { width: 24%; } .tl-table col.tl-who { width: 24%; }
.tl-table col.tl-item { width: 18%; } .tl-table col.tl-where { width: 16%; } .tl-table col.tl-out { width: 96px; }
.tl-break { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 900px) { .tl-table col.tl-item, .tl-table col.tl-where { width: auto; } .tl-wrap { overflow-x: auto; } table.tl-table { min-width: 760px; } }

/* ---------------------------------------------------------------- Domains: vendors and countdown */
.countdown { font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------------------------------------------------------------- Domains table (.dt)
   Fixed layout so it always fits the content area; below ~940px of room it scrolls inside its card
   with the domain column pinned. Quiet by default: only the countdown, auto-renew off and the
   state badge carry colour, and every coloured mark also has words or a glyph. */
.dt-hint { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 9px 14px; border: 1px solid var(--info-line); background: var(--info-bg); border-radius: 10px; font-size: 13px; color: var(--body); }
.dt-hint-i { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border-radius: 999px; background: var(--info-mark); color: #FFF; font: italic 700 11px/18px Georgia, serif; text-align: center; }
.dt-hint b { color: var(--ink); font-weight: 650; }
.dt-hint a { font-weight: 600; white-space: nowrap; }
.dt-outer { container: dt / inline-size; }
.dt-scroll { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
table.dt { table-layout: fixed; width: 100%; min-width: 940px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.dt col.c-tier { width: 48px; } .dt col.c-vendor { width: 106px; } .dt col.c-exp { width: 164px; }
.dt col.c-auto { width: 88px; } .dt col.c-chk { width: 182px; } .dt col.c-state { width: 146px; }
.dt thead th { position: sticky; top: 0; z-index: 3; height: 40px; padding: 0 12px; background: var(--raised); border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); }
.dt thead th:first-child { border-top-left-radius: 13px; } .dt thead th:last-child { border-top-right-radius: 13px; }
.dt .th-sub { font-weight: 400; color: var(--faint); }
.dt th.c, .dt td.c { text-align: center; }
.dt tbody th, .dt tbody td { height: 52px; padding: 6px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; text-align: left;
  font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--body); background: var(--surface); }
.dt tbody tr:last-child > * { border-bottom: 0; }
.dt tbody tr:last-child > :first-child { border-bottom-left-radius: 13px; } .dt tbody tr:last-child > :last-child { border-bottom-right-radius: 13px; }
.dt tbody tr:hover > * { background: #F6F9F9; }
.dt tbody tr.is-problem > :first-child { box-shadow: inset 3px 0 0 var(--crit-mark); }
.dt .cell-main, .dt .cell-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt .cell-main { color: var(--ink); line-height: 19px; }
.dt .cell-sub { margin-top: 1px; font-size: 12px; line-height: 16px; color: var(--muted); }
.dt-domain .cell-main { font-weight: 600; font-size: 13.5px; }
.dt td.dt-empty { height: 96px; text-align: center; color: var(--muted); }
.dt .tier { min-width: 22px; padding: 1px 6px; font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--line-soft); border: 1px solid transparent; }
.dt .tier-1 { color: var(--brand-ink); background: var(--brand-soft); border-color: var(--brand-line); }

/* The one placeholder style for unknown values. */
.nil { color: var(--faint); font-weight: 400; }

/* Expiry date with the live countdown under it (countdown.js keeps text and data-state current). */
.dt-exp .cell-main { font-variant-numeric: tabular-nums; }
.renew-note { margin-left: 8px; cursor: help; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.days-left { display: flex; width: max-content; align-items: center; gap: 6px; max-width: 100%; height: 20px; margin-top: 0; padding: 0 8px 0 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--body); background: var(--line-soft); }
.days-left::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 99px; background: var(--brand); }
.days-left[data-state="ok"] { padding-left: 0; background: none; color: var(--muted); font-weight: 500; }
.days-left[data-state="high"] { color: var(--high); background: var(--high-bg); }
.days-left[data-state="high"]::before { background: var(--high-mark); }
.days-left[data-state="crit"], .days-left[data-state="expired"] { color: var(--crit); background: var(--crit-bg); }
.days-left[data-state="crit"]::before, .days-left[data-state="expired"]::before { background: var(--crit-mark); }
.days-left[data-state="expired"]::before { border-radius: 1px; transform: rotate(45deg); }

/* Auto-renew: Off warns, On is calm, Unknown uses .nil. */
.ar-on { color: var(--body); }
.ar-on::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 99px; background: var(--brand); vertical-align: 1px; }
.ar-off { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px 0 4px; border-radius: 6px; font-size: 12px; font-weight: 650;
  color: var(--high); background: var(--high-bg); border: 1px solid var(--high-line); }
.ar-g { width: 14px; height: 14px; border-radius: 99px; background: var(--high-mark); color: #FFF; font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; }

/* Checks: three small labelled badges; the glyph says the state, colour repeats it. */
.chk { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 6px 0 4px; margin-right: 4px; border-radius: 6px; border: 1px solid;
  font-size: 11.5px; font-weight: 600; line-height: 1; cursor: default; }
.chk:last-child { margin-right: 0; }
.chk-g { width: 10px; text-align: center; font-size: 11px; font-weight: 800; }
.chk-ok { color: var(--brand-ink); background: var(--surface); border-color: var(--line); }
.chk-ok .chk-g { color: var(--brand); }
.chk-off { color: var(--muted); background: var(--raised); border-color: var(--line); }
.chk-unknown { color: var(--faint); background: var(--surface); border-color: var(--line); border-style: dashed; }
.chk-warn { color: var(--high); background: var(--high-bg); border-color: var(--high-line); }
.chk-crit { color: var(--crit); background: var(--crit-bg); border-color: var(--crit-line); }

/* State: short, sentence case, coloured by severity. Active stays quiet. */
.st { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; border: 1px solid transparent;
  font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.st::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.st-ok { padding-left: 0; color: var(--muted); font-weight: 500; }
.st-ok::before { background: var(--brand); }
.st-high { color: var(--high); background: var(--high-bg); border-color: var(--high-line); }
.st-crit { color: var(--crit); background: var(--crit-bg); border-color: var(--crit-line); }
a.st:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Vendor: plain name, or a quiet "Set vendor"; the editor opens as a small popover. */
.vendor-edit { position: relative; }
.vendor-edit summary { list-style: none; cursor: pointer; display: block; max-width: 100%; }
.vendor-edit summary::-webkit-details-marker { display: none; }
.vendor-val, .vendor-set { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
  border-bottom: 1px dashed transparent; line-height: 18px; }
.vendor-val { color: var(--ink); }
.vendor-set { color: var(--faint); }
.vendor-edit summary:hover .vendor-val, .vendor-edit summary:hover .vendor-set, .vendor-edit[open] summary .vendor-set, .vendor-edit[open] summary .vendor-val { color: var(--brand-ink); border-bottom-color: var(--brand-mid); }
.vendor-edit[open] form { position: absolute; top: calc(100% + 8px); left: -10px; z-index: 6; width: 280px; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 36px -14px rgba(11, 27, 34, .35); white-space: normal; }
.vendor-edit[open] form small { font-size: 11.5px; line-height: 1.4; }

/* ---------------------------------------------------------------- Domains by vendor (.vg)
   One section per vendor: the header is an account summary, the body the vendor's ledger. All
   ledgers share one fixed column layout so the sections read as one table. */
.vstrip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.vs-item { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; box-shadow: 0 1px 2px rgba(11, 27, 34, .04); }
.vs-item.vs-all { padding-left: 12px; }
.vs-item:hover { border-color: var(--brand-line); color: var(--ink); }
.vs-item[aria-current="true"] { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.vs-item.is-empty { opacity: .55; }
.vs-name { font-weight: 600; white-space: nowrap; }
.vs-count { color: var(--muted); font-weight: 500; }
.vs-flag { display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: var(--crit); background: var(--crit-bg); border: 1px solid var(--crit-line); }
.vs-flag::before { content: ""; width: 5px; height: 5px; border-radius: 99px; background: var(--crit-mark); }

.mono-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 750; letter-spacing: .02em; line-height: 1; }
.mono-badge.mono-sm { width: 24px; height: 24px; border-radius: 7px; font-size: 10.5px; }
.tone-a { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.tone-b { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.tone-c { background: #F3EDF7; color: #5B3A72; border-color: #DCCDE6; }
.tone-d { background: #EEF1F5; color: #34465E; border-color: #D3DAE4; }
.tone-e { background: #F4EFE7; color: #6A5132; border-color: #E2D5C2; }
.tone-none { background: var(--surface); color: var(--faint); border: 1px dashed var(--input); }

.dt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.dt-toolbar .chips { margin-bottom: 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--line-soft); border: 1px solid var(--line); }
.seg a { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.seg a:hover { color: var(--ink); }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 27, 34, .10), 0 0 0 1px var(--line); }

.vg-list { display: flex; flex-direction: column; gap: 14px; }
.vg { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); scroll-margin-top: 16px; }
.vg:target { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.vg-head { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "mono title conn" ". facts facts";
  column-gap: 14px; row-gap: 12px; align-items: center; padding: 16px 52px 16px 18px; list-style: none; cursor: pointer; border-radius: 13px; }
.vg-head::-webkit-details-marker { display: none; }
.vg-head.has-act { padding-right: 190px; }
.vg-head:hover { background: var(--raised); }
.vg-d[open] > .vg-head { border-radius: 13px 13px 0 0; }
.vg-head::after { content: ""; position: absolute; right: 22px; top: 29px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.vg-d[open] > .vg-head::after { transform: rotate(45deg); top: 26px; }
@media (prefers-reduced-motion: reduce) { .vg-head::after { transition: none; } }
.vg-head > .mono-badge { grid-area: mono; }
.vg-title { grid-area: title; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.vg-name { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.005em; color: var(--ink); }
.vg-count { font-size: 13px; color: var(--muted); }
.vg-conn { grid-area: conn; justify-self: end; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.conn::before { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.conn-ok { color: var(--brand-ink); } .conn-ok::before { background: var(--brand); }
.conn-bad { color: var(--crit); } .conn-bad::before { background: var(--crit-mark); }
.conn-info { color: var(--info); } .conn-info::before { background: var(--info-mark); }
.conn-off { color: var(--muted); font-weight: 500; } .conn-off::before { background: none; border: 1.5px solid var(--faint); width: 5px; height: 5px; }
.vg-facts { grid-area: facts; display: flex; flex-wrap: wrap; row-gap: 10px; }
.vg-fact { display: flex; flex-direction: column; gap: 3px; padding: 0 22px; border-left: 1px solid var(--line); min-width: 0; }
.vg-fact:first-child { padding-left: 0; border-left: 0; }
.vg-fact .k { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.vg-fact .v { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.vg-fact .v .days-left { margin-top: 0; }
.fact-crit { color: var(--crit); } .fact-high { color: var(--high); }
.fact-ok { color: var(--muted); font-weight: 500; }
.fact-of { color: var(--muted); font-weight: 400; }
.vg-fact .v.fact-dim, .vg-fact .v.fact-dim .fact-of { color: var(--faint); font-weight: 500; }
.vg-act { position: absolute; top: 19px; right: 46px; display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--brand-ink); text-decoration: none; white-space: nowrap; }
.vg-act:hover { background: var(--brand-soft); color: var(--brand-ink); }
.vg-act::after { content: "→"; margin-left: 6px; }
.vg-body.dt-scroll { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; box-shadow: none; }
.dt-g thead th { height: 34px; font-size: 11.5px; background: var(--raised); }
.dt-g thead th:first-child, .dt-g thead th:last-child { border-radius: 0; }
.dt col.c-act { width: 52px; }
.dt td.dt-act { padding: 0 10px 0 0; text-align: right; }
.row-act { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; color: var(--faint); cursor: pointer; }
.row-act::-webkit-details-marker { display: none; }
.row-act svg { width: 15px; height: 15px; }
.dt tbody tr:hover .row-act, .row-act:focus-visible, .vendor-edit[open] > .row-act { color: var(--brand-ink); background: var(--brand-soft); }
.vendor-edit-act[open] form { left: auto; right: -2px; text-align: left; }
.vf-label { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; } .vf-label b { color: var(--ink); font-weight: 600; }
.vg-empty { padding: 40px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--input); border-radius: 14px; margin-bottom: 14px; }
.vg-empty p { margin: 0; } .vg-empty .vg-empty-title { font-size: 15px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
@container dt (max-width: 760px) {
  .vg-head.has-act { padding-right: 52px; }
  .vg-head.has-act .vg-title { padding-right: 130px; }
  .vg-head { grid-template-areas: "mono title title" ". conn conn" ". facts facts"; }
  .vg-conn { justify-self: start; }
  .vg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
  .vg-fact, .vg-fact:first-child { padding: 0; border-left: 0; }
}

/* Lots of room: cap the domain column so the other columns breathe instead of one wide gap. */
@container dt (min-width: 1300px) { .dt col.c-domain { width: 36%; } }
/* Not enough room: scroll inside the card, keep the domain column and header readable. */
@container dt (max-width: 939px) {
  .dt-scroll { overflow-x: auto; }
  .dt tbody th.dt-domain, .dt thead th:first-child { position: sticky; left: 0; z-index: 2; box-shadow: inset -1px 0 0 var(--line); }
  .dt thead th:first-child { z-index: 4; }
  .dt tbody tr.is-problem > th.dt-domain { box-shadow: inset 3px 0 0 var(--crit-mark), inset -1px 0 0 var(--line); }
  .dt col.c-domain { width: 240px; }
}

/* ---------------------------------------------------------------- Popup notifications */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--info-mark); border-radius: 12px; box-shadow: 0 14px 40px -18px rgba(11, 27, 34, .45); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; animation: toast-in .18s ease-out; }
.toast-critical { border-left-color: var(--crit-mark); }
.toast-warning { border-left-color: var(--high-mark); }
.toast-notice { border-left-color: var(--brand); }
.toast-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.toast-kind { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-ink); }
.toast-critical .toast-kind { color: var(--crit); } .toast-warning .toast-kind { color: var(--high); }
.toast-time { margin-left: auto; }
.toast-close { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.toast-title { color: var(--ink); font-size: 14px; overflow-wrap: anywhere; }
.toast-detail { font-size: 12.5px; color: var(--body); overflow-wrap: anywhere; }
.toast-link { align-self: flex-start; font-size: 12.5px; font-weight: 650; color: var(--brand-ink); }
.toast-actions { display: flex; gap: 8px; margin-top: 6px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------------------------------------------------------------- Vendors, analytics, report */
.vendor-form .pw-grid2 { margin-bottom: 12px; }
.vendor-help { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--body); }
.small-head { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.vendors-table td { white-space: normal; vertical-align: middle; }
.vendors-table td.vendor-acct { max-width: 260px; }
.vendors-table .acct-user { overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.vendors-table td.vendor-actions { width: 1%; white-space: nowrap; }
.vendors-table td.vendor-actions .row-actions { flex-wrap: nowrap; }

/* Row-action sheets: popover dialogs in the top layer (no script), one open at a time. */
.sheet { border: 1px solid var(--line); border-radius: 14px; padding: 0; margin: auto; width: min(540px, calc(100vw - 32px)); max-height: min(88vh, 760px); overflow: auto; background: var(--surface); color: var(--body); box-shadow: 0 28px 70px -24px rgba(11, 27, 34, .42); white-space: normal; text-align: left; }
.sheet::backdrop { background: rgba(11, 27, 34, .28); }
.sheet:popover-open { animation: sheet-in .16s ease-out; }
.sheet form { display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.sheet-head h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.sheet-eyebrow { margin: 0; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); }
.sheet-badge { flex: none; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 750; font-size: 15px; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); }
.sheet-x { flex: none; margin-left: auto; align-self: flex-start; width: 30px; height: 30px; border: 1px solid transparent; border-radius: 8px; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.sheet-x:hover { background: var(--raised); border-color: var(--line); color: var(--ink); }
.sheet-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.sheet .field { gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.sheet .field input { color: var(--ink); font-weight: 400; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.sheet-keys { margin: 0; padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sheet-keys legend { padding: 0 6px; margin-left: -6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sheet-keys p { margin: 0; }
.sheet-help { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.sheet-help b { color: var(--body); }
.sheet-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); background: var(--raised); }
.sheet-foot label.check { margin-right: auto; font-weight: 600; color: var(--body); }
.sheet-danger .sheet-badge { background: var(--crit-bg); color: var(--crit); border-color: var(--crit-line); }
.sheet-danger .sheet-eyebrow { color: var(--crit); }
.sheet-facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--body); }
.sheet-word { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
@keyframes sheet-in { from { transform: translateY(6px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet:popover-open { animation: none; } }
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin: 16px 0; }
.small-value { font-size: 20px !important; }
.hbar { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.hbar-label { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line-soft); overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-left: 6px; }
.legend.l-ok { background: var(--brand); } .legend.l-warn { background: var(--high-mark); } .legend.l-unknown { background: var(--faint); }
.report-table td { white-space: normal; }
.report-body { background: var(--ground); }
.report { max-width: 1100px; margin: 0 auto; padding: 28px 20px; display: flex; flex-direction: column; gap: 16px; }
.report-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.report-head h1 { margin: 0; font-size: 24px; }
@media print {
  .no-print, .toasts, .sidebar, nav.side { display: none !important; }
  .report-body, body { background: #fff; }
  .card, .tile { box-shadow: none !important; break-inside: avoid; }
  .report { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
}
