:root {
  --bg: #0b1017; --bg-2: #0e141d; --panel: #111923; --panel-2: #151f2b;
  --ink: #eef3f8; --ink-2: #a3b1c2; --muted: #6b7c90;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.15);
  --mint: #34d399; --cyan: #5eead4; --blue: #5b9cf5;
  --crit: #f07171; --high: #fb923c; --med: #fbbf24; --ok: #34d399;
  --r: 12px;
}

/* Scrollbars in the same dark as the panels they sit in, so a wide org
   chart or evidence table reads as one surface, not a system widget. */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; } }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.25); background-clip: padding-box; }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-scrollbar-corner { background: transparent; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 "IBM Plex Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.logo i { width: 9px; height: 9px; background: var(--mint); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 10px var(--mint); }

/* ─── login ─── */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 70% -10%, rgba(52,211,153,.08), transparent 55%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 20px; letter-spacing: -.02em; margin-top: 8px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.login-card input { background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; color: var(--ink); padding: 10px 12px; outline: none; }
.login-card input:focus { border-color: var(--mint); }
.err { color: var(--crit); font-size: 12.5px; }
.demo { font-size: 11px; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 12px; }
.demo code { color: var(--cyan); }

.btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 9px; padding: 9px 16px; font-weight: 600; font-size: 13px; border: 1px solid var(--line-2); }
.btn.primary { background: var(--mint); color: #062d1f; border-color: transparent; }
.btn.primary:hover { box-shadow: 0 6px 20px -6px rgba(52,211,153,.6); }
.btn.ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn.danger { color: var(--crit); }
.btn.sm { padding: 5px 10px; font-size: 11.5px; }
.link { color: var(--cyan); font-size: 12px; }
.link:hover { text-decoration: underline; }

/* ─── shell ─── */
.app { min-height: 100%; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: rgba(11,16,23,.92); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 20; }
.store-id { flex: 1; min-width: 0; }
.store-id b { display: block; font-size: 14px; }
.store-id span { font-size: 11px; color: var(--muted); }
.period { margin-top: 4px; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 8px; font-size: 11px; font-family: "IBM Plex Mono", monospace; }
.chips { display: flex; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 9px; padding: 5px 11px; font-size: 10px; letter-spacing: .1em; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.chip b { font-size: 13px; color: var(--ink); letter-spacing: 0; font-family: "IBM Plex Mono", monospace; }
.chip.bad b { color: var(--crit); } .chip.crit b { color: var(--high); }
.ibtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font-size: 15px; position: relative; }
.ibtn:hover { border-color: var(--cyan); color: var(--cyan); }
.badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; border-radius: 999px; background: var(--crit); color: #fff; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.whoami { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px 4px 5px; background: var(--panel); }
.av { width: 27px; height: 27px; border-radius: 8px; background: var(--mint); color: #062d1f; font-weight: 700; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; font-family: "IBM Plex Mono", monospace; flex: none; }
.who b { display: block; font-size: 12px; line-height: 1.2; }
.who span { display: block; font-size: 10px; color: var(--muted); }

.scopebar { display: flex; align-items: center; gap: 10px; padding: 7px 18px; font-size: 12px; color: var(--ink-2); background: rgba(94,234,212,.06); border-bottom: 1px solid rgba(94,234,212,.2); }
.scopebar .tag { font-size: 9px; letter-spacing: .14em; color: var(--cyan); border: 1px solid rgba(94,234,212,.4); border-radius: 999px; padding: 2px 9px; }
.scopebar b { color: var(--ink); }
.scopebar .mine { color: var(--crit); font-weight: 600; }

.crumbs { display: flex; gap: 6px; align-items: center; padding: 12px 18px 0; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.crumbs b { color: var(--ink); }

.view { flex: 1; padding: 14px 18px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }
h2.sec { font-size: 11px; letter-spacing: .18em; color: var(--muted); font-weight: 600; margin: 18px 0 10px; display: flex; align-items: center; gap: 10px; }
h2.sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ─── org chart ─── */
.viewtabs { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; margin-left: auto; }
.viewtabs button { font-size: 10px; letter-spacing: .12em; padding: 5px 12px; color: var(--muted); }
.viewtabs button + button { border-left: 1px solid var(--line); }
.viewtabs button.on { background: var(--mint); color: #062d1f; }
/* The chart may use the whole window: management reads across, staff read
   down, so a 43-seat store is a row of columns rather than a scroll. */
.chartwrap { overflow-x: auto; width: 100vw; margin-left: calc(50% - 50vw); padding: 8px 24px 24px; }
.chart-hint { font-size: 11px; color: var(--muted); margin: 6px 0 4px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { display: flex; justify-content: center; padding-top: 22px; position: relative; }
.tree ul::before { content: ""; position: absolute; top: 0; left: 50%; width: 0; height: 22px; border-left: 1px solid var(--line-2); }
.tree > li { padding-top: 0; }
.tree li { position: relative; padding: 22px 8px 0; text-align: center; }
.tree li::before, .tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 1px solid var(--line-2); }
.tree li::after { right: auto; left: 50%; border-left: 1px solid var(--line-2); }
.tree li:only-child::before, .tree li:only-child::after { display: none; }
.tree li:only-child { padding-top: 22px; }
.tree > li:only-child { padding-top: 0; }
.tree li:first-child::before, .tree li:last-child::after { border: 0 none; }
.tree li:last-child::before { border-right: 1px solid var(--line-2); border-radius: 0 6px 0 0; }
.tree li:first-child::after { border-radius: 6px 0 0 0; }
.tree > li::before, .tree > li::after { display: none; }
.tree li > ul::before { height: 22px; }
.tree li.solo > ul::before { display: none; }

.node { display: inline-flex; align-items: center; gap: 9px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; min-width: 150px; max-width: 200px; position: relative; transition: border-color .15s, transform .12s; user-select: none; }
.node.head, .node.root { min-width: 180px; max-width: 224px; }
/* Staff stack under their head in one column; the rail on the left is the
   reporting line. */
.tree ul.staff { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 16px 0 0 0; justify-content: flex-start; }
.tree ul.staff::before { height: 16px; }
.tree ul.staff > li { padding: 0 0 0 26px; text-align: left; }
.tree ul.staff > li::before { content: ""; position: absolute; left: 10px; right: auto; top: -6px; bottom: 50%; width: 12px; height: auto; border: 0; border-left: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); border-radius: 0 0 0 6px; display: block; }
.tree ul.staff > li::after { content: ""; position: absolute; left: 10px; right: auto; top: 50%; bottom: -7px; width: 0; height: auto; border: 0; border-left: 1px solid var(--line-2); display: block; }
.tree ul.staff > li:last-child::after { display: none; }
.tree ul.staff > li:only-child { padding-top: 0; }
.tree ul.staff .node { display: flex; width: 100%; min-width: 172px; max-width: 200px; padding: 7px 10px; }
.tree ul.staff .node .nav { width: 26px; height: 26px; }
.tree li:has(> ul.staff) { text-align: center; }
.node:hover { border-color: var(--line-2); transform: translateY(-1px); }
.node.flag { border-color: rgba(251,146,60,.5); }
.node.crit { border-color: rgba(240,113,113,.6); }
.node.head { border-width: 1.5px; background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--panel); }
.node.root { border-color: rgba(94,234,212,.5); }
.node.locked { opacity: .45; }
.node.me { box-shadow: 0 0 0 2px rgba(52,211,153,.35); }
.node .nav { width: 28px; height: 28px; border-radius: 8px; flex: none; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; background: #16202b; color: var(--ink-2); border: 1px solid var(--line-2); font-family: "IBM Plex Mono", monospace; position: relative; }
.node.flag .nav { color: #ffdcc7; border-color: rgba(251,146,60,.5); } .node.crit .nav { color: #ffd2d2; border-color: rgba(240,113,113,.6); }
.node .nav::after { content: ""; position: absolute; right: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #3d4d5e; border: 2px solid var(--panel); }
.node.flag .nav::after { background: var(--high); box-shadow: 0 0 8px var(--high); } .node.crit .nav::after { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.node.locked .nav::after { display: none; }
.node .nt { min-width: 0; flex: 1; }
.node .nt b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .nt span { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node .nusd { font-size: 10px; font-weight: 700; color: var(--crit); font-family: "IBM Plex Mono", monospace; flex: none; }
.node .dept { position: absolute; top: -8px; left: 10px; font-size: 8px; letter-spacing: .12em; color: var(--cyan); background: var(--bg); border: 1px solid rgba(94,234,212,.35); border-radius: 4px; padding: 1px 6px; }
.node .fold { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font-size: 8.5px; letter-spacing: .06em; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.node.open .fold { color: var(--mint); border-color: rgba(52,211,153,.4); }

/* ─── department grid ─── */
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.dcard { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .12s; }
.dcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.dcard.hot { border-color: rgba(240,113,113,.4); }
.dcard.locked { opacity: .65; }
.dcard .k { font-size: 9.5px; letter-spacing: .16em; color: var(--muted); }
.dcard h3 { font-size: 16px; letter-spacing: -.01em; }
.dcard p { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.dcard .nums { display: flex; gap: 14px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.dcard .nums div { font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.dcard .nums b { display: block; font-size: 16px; letter-spacing: 0; color: var(--ink); font-family: "IBM Plex Mono", monospace; }
.dcard .nums b.bad { color: var(--crit); } .dcard .nums b.ok { color: var(--ok); }
.dcard .lock { font-size: 12px; color: var(--ink-2); border-top: 1px dashed var(--line-2); padding-top: 10px; margin-top: auto; }
.dcard .lock b { color: var(--cyan); font-weight: 500; }

/* ─── findings ─── */
.dhead { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px; }
.dhead .k { font-size: 9.5px; letter-spacing: .16em; color: var(--muted); }
.dhead h1 { font-size: 22px; letter-spacing: -.02em; margin-top: 3px; }
.dhead p { color: var(--ink-2); margin-top: 6px; max-width: 60em; }
.stats { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 120px; }
.stat span { display: block; font-size: 9.5px; letter-spacing: .1em; color: var(--muted); }
.stat b { font-size: 18px; font-family: "IBM Plex Mono", monospace; }
.stat b.bad { color: var(--crit); } .stat b.ok { color: var(--ok); }

.flist { display: flex; flex-direction: column; gap: 8px; }
.frow { display: grid; grid-template-columns: 8px 1fr auto auto; gap: 14px; align-items: center; text-align: left; background: var(--panel); border: 1px solid var(--line); border-left-width: 3px; border-radius: 10px; padding: 12px 14px; }
.frow:hover { border-color: var(--line-2); }
.frow.critical { border-left-color: var(--crit); } .frow.high { border-left-color: var(--high); } .frow.medium { border-left-color: var(--med); }
.frow .dot { width: 8px; height: 8px; border-radius: 50%; }
.frow .t { min-width: 0; }
.frow .t b { display: block; font-size: 13.5px; }
.frow .t > span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.frow .st { font-size: 9px; letter-spacing: .1em; border-radius: 5px; padding: 3px 8px; }
.st.new { color: var(--muted); border: 1px solid var(--line-2); }
.st.assigned { color: var(--blue); background: rgba(91,156,245,.13); }
.st.fixed, .st.verified { color: var(--mint); background: rgba(52,211,153,.13); }
.st.dismissed { color: var(--muted); background: rgba(255,255,255,.05); text-decoration: line-through; }
.frow .usd { font-family: "IBM Plex Mono", monospace; font-weight: 600; color: var(--mint); font-size: 14px; }
.mine-pill { font-size: 9px; letter-spacing: .1em; color: var(--crit); border: 1px solid rgba(240,113,113,.45); border-radius: 5px; padding: 2px 7px; margin-left: 8px; vertical-align: 1px; }
.kind-pill { font-size: 9px; letter-spacing: .1em; color: var(--cyan); border: 1px solid rgba(94,234,212,.4); border-radius: 5px; padding: 2px 7px; margin-left: 8px; vertical-align: 1px; }
.hist { display: flex; gap: 8px; margin-top: 14px; }
.hist div { border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; min-width: 88px; }
.hist div.on { border-color: var(--cyan); }
.hist span { display: block; font-size: 9.5px; letter-spacing: .1em; color: var(--muted); }
.hist b { display: block; font-size: 18px; font-family: "IBM Plex Mono", monospace; }
.hist i { font-style: normal; font-size: 11px; color: var(--ink-2); }
.dex-log { display: flex; flex-direction: column; gap: 10px; max-width: 720px; margin: 8px 0 14px; }
.dex-m { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.dex-m.you { border-color: rgba(94,234,212,.25); }
.dex-m b { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.dex-m p { margin-top: 4px; color: var(--ink-2); white-space: pre-wrap; }
.dex-cite { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.dex-cite a { font: 10px/1 "IBM Plex Mono", monospace; color: var(--cyan); border: 1px solid rgba(94,234,212,.35); border-radius: 4px; padding: 2px 7px; text-decoration: none; }
.dex-form { display: flex; gap: 8px; max-width: 720px; }
.dex-form input { flex: 1; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; }
table.std { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.std th { text-align: left; font-size: 9.5px; letter-spacing: .1em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.std td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.std td.num { font-family: "IBM Plex Mono", monospace; color: var(--ink); }
.empty { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 22px; color: var(--ink-2); text-align: center; }

/* ─── finding detail ─── */
.fdet { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
@media (max-width: 960px) { .fdet { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card + .card { margin-top: 14px; }
.card h4 { font-size: 10px; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.sev { font-size: 9.5px; letter-spacing: .12em; font-weight: 700; }
.sev.critical { color: var(--crit); } .sev.high { color: var(--high); } .sev.medium { color: var(--med); }
.fdet h1 { font-size: 21px; letter-spacing: -.02em; margin: 6px 0 8px; }
.fdet .big { font-size: 30px; font-family: "IBM Plex Mono", monospace; color: var(--mint); }
.fdet .prose { color: var(--ink-2); line-height: 1.6; }
.fdet .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.meta i { font-style: normal; font-size: 9.5px; letter-spacing: .1em; color: var(--cyan); border: 1px solid rgba(94,234,212,.35); border-radius: 5px; padding: 2px 8px; }
.mine-note { border-left: 3px solid var(--crit); background: rgba(240,113,113,.07); border-radius: 0 8px 8px 0; padding: 10px 13px; margin: 12px 0; font-size: 12.5px; color: var(--ink-2); }
.mine-note b { color: var(--crit); }
.evwrap { overflow-x: auto; }
table.ev { width: 100%; border-collapse: collapse; font-size: 11.5px; font-family: "IBM Plex Mono", monospace; }
.ev th { text-align: left; font-family: "IBM Plex Sans", sans-serif; font-size: 9.5px; letter-spacing: .1em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.ev td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; color: var(--ink-2); }
.ev tr:nth-child(odd) td { background: rgba(255,255,255,.015); }
.ev td.bad { color: var(--crit); font-weight: 600; } .ev td.id { color: var(--ink); }
.peer { display: flex; gap: 14px; font-size: 12.5px; }
.peer div { flex: 1; } .peer span { display: block; font-size: 9.5px; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.peer .f { color: var(--crit); } .peer .c { color: var(--ok); }
.play { background: rgba(52,211,153,.06); border: 1px solid rgba(52,211,153,.2); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.play b { color: var(--mint); font-size: 10px; letter-spacing: .12em; display: block; margin-bottom: 5px; }

.lc { display: flex; gap: 3px; }
.lc button { flex: 1; font-size: 9.5px; letter-spacing: .08em; font-weight: 700; color: var(--muted); border: 1px solid var(--line); padding: 8px 2px; }
.lc button:first-child { border-radius: 8px 0 0 8px; } .lc button:last-child { border-radius: 0 8px 8px 0; }
.lc button.on { background: var(--mint); color: #062d1f; border-color: transparent; }
.lc button.done { color: var(--mint); border-color: rgba(52,211,153,.35); }
.lc-meta { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.lc-meta select, .lc-meta input, .lc-meta textarea { width: 100%; margin-top: 3px; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 9px; font-size: 12px; }
.lc-state { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin-top: 10px; }
.lc-state b { color: var(--ink); }

/* ─── modal ─── */
.veil { position: fixed; inset: 0; z-index: 60; background: rgba(4,7,11,.72); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal { width: min(720px, 100%); max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 40px 90px -20px rgba(0,0,0,.7); }
.mh { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.mh .k { font-size: 9.5px; letter-spacing: .16em; color: var(--muted); }
.mh h2 { font-size: 18px; letter-spacing: -.02em; }
.mh p { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.mx { margin-left: auto; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; padding: 3px 10px; font-size: 14px; }
.mx:hover { color: var(--ink); }
.ms { padding: 14px 20px; border-top: 1px solid var(--line); }
.ms:first-of-type { border-top: 0; }
.ms h4 { font-size: 10px; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin-bottom: 9px; }
.arow { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: flex-start; }
.arow:last-child { border-bottom: 0; }
.arow .d { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.arow .t { flex: 1; } .arow .t span { display: block; font-size: 10.5px; color: var(--muted); }
.arow.acked { opacity: .55; }

/* team */
.trow { display: grid; grid-template-columns: 28px 1.3fr 74px 1.3fr 1fr auto; gap: 10px; align-items: center; background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 7px; font-size: 12px; }
.trow .who b { display: block; } .trow .who span { display: block; font-size: 10px; color: var(--muted); }
.trow .role { font-size: 9px; letter-spacing: .1em; border: 1px solid; border-radius: 5px; padding: 2px 0; text-align: center; }
.role.admin { color: var(--mint); } .role.manager { color: var(--blue); } .role.viewer { color: var(--muted); }
.trow .scope { display: flex; flex-wrap: wrap; gap: 4px; }
.sc { font-size: 8.5px; letter-spacing: .06em; color: var(--ink-2); background: rgba(255,255,255,.05); border-radius: 4px; padding: 2px 6px; }
.sc.all { color: var(--mint); background: rgba(52,211,153,.1); }
.trow .meta { font-size: 10px; color: var(--muted); line-height: 1.4; }
.tform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.tform label { font-size: 11px; color: var(--muted); display: block; }
.tform input, .tform select { width: 100%; margin-top: 4px; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12px; }
.checks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px 12px; margin-top: 12px; }
.checks label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.checks input { accent-color: var(--mint); }
.actions { display: flex; gap: 8px; margin-top: 14px; }

/* palette */
.pal-veil { align-items: flex-start; padding-top: 12vh; }
.pal { width: min(560px, 92vw); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; }
.pal input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); outline: none; color: var(--ink); font-size: 15px; padding: 15px 18px; }
.pal-res { max-height: 340px; overflow-y: auto; padding: 6px; }
.pr { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; border-radius: 9px; font-size: 13px; }
.pr:hover, .pr.on { background: rgba(255,255,255,.05); }
.pr .k { font-size: 9px; letter-spacing: .08em; border-radius: 5px; padding: 2px 0; width: 66px; text-align: center; flex: none; }
.pr .k.person { color: var(--blue); background: rgba(91,156,245,.12); } .pr .k.finding { color: var(--high); background: rgba(251,146,60,.12); } .pr .k.document { color: var(--cyan); background: rgba(94,234,212,.1); }
.pr b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr span { color: var(--muted); font-size: 11px; }

/* ─── connectors ─── */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.ccard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ccard.connected { border-color: rgba(52,211,153,.4); }
.ccard.cdk-import-card { grid-column: 1 / -1; min-width: 0; }
.ccard.mapping_required { opacity: .8; }
.ccard .ch { display: flex; align-items: flex-start; gap: 10px; }
.ccard .ch h3 { font-size: 15px; letter-spacing: -.01em; }
.ccard .ch span { display: block; font-size: 11px; color: var(--muted); }
.cst { margin-left: auto; font-size: 9px; letter-spacing: .12em; border-radius: 5px; padding: 3px 8px; border: 1px solid; white-space: nowrap; flex: none; }
.cst.connected { color: var(--mint); border-color: rgba(52,211,153,.45); }
.cst.available { color: var(--cyan); border-color: rgba(94,234,212,.4); }
.cst.mapping_required { color: var(--muted); border-color: var(--line-2); }
.ccard p { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.feed { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; font-size: 12px; }
.feed b { display: block; font-size: 12.5px; }
.feed .sub { display: block; font-size: 10.5px; color: var(--muted); font-family: "IBM Plex Mono", monospace; }
.feed .last { grid-column: 1 / -1; font-size: 10.5px; color: var(--muted); }
.feed .last i { font-style: normal; color: var(--med); }
.uprow { display: flex; gap: 6px; align-items: center; }
.uprow input[type=month] { background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; font-size: 11px; font-family: "IBM Plex Mono", monospace; color-scheme: dark; }
.upres { grid-column: 1 / -1; border-radius: 8px; padding: 9px 11px; font-size: 11.5px; background: rgba(52,211,153,.07); border: 1px solid rgba(52,211,153,.25); color: var(--ink-2); line-height: 1.5; }
.upres.bad { background: rgba(240,113,113,.07); border-color: rgba(240,113,113,.35); }
.upres b { color: var(--ink); font-family: "IBM Plex Mono", monospace; }
.upres ul { margin: 6px 0 0 16px; color: var(--muted); font-size: 11px; }
.upres b, .upres .link { display: inline; }

/* ─── dashboard ─── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
button.tile:hover { border-color: var(--line-2); }
.tile.hot { border-color: rgba(240,113,113,.35); }
.tile span { font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }
.tile b { font-size: 22px; font-family: "IBM Plex Mono", monospace; letter-spacing: -.01em; }
.tile b.bad { color: var(--crit); } .tile b.ok { color: var(--ok); }
.tile i { font-style: normal; font-size: 11px; color: var(--ink-2); }
.tile i .bad { color: var(--crit); } .tile i .ok { color: var(--ok); }
.dash2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 960px) { .dash2 { grid-template-columns: 1fr; } }
.dash2 .card + .card { margin-top: 0; }
.dfirst { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.dfirst:last-of-type { border-bottom: 0; }
.dfirst:hover { background: rgba(255,255,255,.02); }
.dfirst .d { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.dfirst .t b { display: block; } .dfirst .t span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.dfirst .usd { font-family: "IBM Plex Mono", monospace; font-weight: 600; color: var(--mint); white-space: nowrap; }
.dbar { display: grid; grid-template-columns: 1fr 120px auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.dbar:last-of-type { border-bottom: 0; }
.dbar:hover { background: rgba(255,255,255,.02); }
.dbar .l b { display: block; font-size: 12.5px; } .dbar .l span { display: block; font-size: 10.5px; color: var(--muted); }
.dbar .bar { height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }
.dbar .bar i { display: block; height: 100%; background: var(--crit); border-radius: 4px; }
.dbar .usd { font-family: "IBM Plex Mono", monospace; font-weight: 600; min-width: 64px; text-align: right; }
.dbar .usd.bad { color: var(--crit); } .dbar .usd.ok { color: var(--ok); }
.qlinks { display: grid; gap: 8px; }
.qlinks a { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; }
.qlinks a:hover { border-color: var(--cyan); }
.qlinks b { display: block; font-size: 12.5px; } .qlinks span { display: block; font-size: 11px; color: var(--muted); }
.secret { border: 1px solid rgba(251,191,36,.45); background: rgba(251,191,36,.07); border-radius: 10px; padding: 12px 14px; }
.secret b { display: block; font-size: 10px; letter-spacing: .14em; color: var(--med); }
.secret code { display: block; font-size: 20px; margin: 8px 0; font-family: "IBM Plex Mono", monospace; user-select: all; }
.secret p { font-size: 11.5px; color: var(--ink-2); margin-bottom: 8px; }
#meName { cursor: pointer; } #meName:hover { color: var(--cyan); }
.dex-cite a.person { color: var(--blue); border-color: rgba(91,156,245,.4); font-family: "IBM Plex Sans", sans-serif; font-weight: 600; }
.dex-cite a.source { color: var(--ink-2); border-color: var(--line-2); }
.dex-cite a:hover { border-color: currentColor; }

.scopebar.warn { background: rgba(251,191,36,.07); border-bottom-color: rgba(251,191,36,.35); }
.scopebar.warn .tag { color: var(--med); border-color: rgba(251,191,36,.5); }
.scopebar .btn { margin-left: auto; }
.dhead h1 select { vertical-align: middle; margin-left: 8px; }

/* month by month */
.trend { display: flex; gap: 8px; align-items: flex-end; height: 160px; padding: 6px 4px 0; }
.tcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.tcol b { display: block; width: 100%; max-width: 44px; background: rgba(240,113,113,.45); border-radius: 4px 4px 0 0; }
.tcol.on b { background: var(--crit); }
.tcol span { font: 500 9.5px "IBM Plex Mono", monospace; color: var(--muted); }
.tcol i { font: 10px "IBM Plex Mono", monospace; color: var(--ink-2); font-style: normal; white-space: nowrap; }

/* area intel */
.dexsay { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: flex-start; }
.dexsay .av { width: 34px; height: 34px; border-radius: 10px; background: rgba(94,234,212,.12); color: var(--cyan); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.dexsay p { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }
.dexsay p + p { margin-top: 8px; }
.irate { display: grid; grid-template-columns: 160px 1fr 70px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.irate:last-child { border-bottom: 0; }
.irate.me b { color: var(--mint); }
.irate .bar { height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }
.irate .bar i { display: block; height: 100%; background: var(--line-2); border-radius: 4px; }
.irate.me .bar i { background: var(--mint); }
.irate .usd { font-family: "IBM Plex Mono", monospace; text-align: right; }
.irate small { display: block; font-size: 10px; color: var(--muted); }
.iitem { display: grid; grid-template-columns: 8px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: flex-start; }
.iitem:last-child { border-bottom: 0; }
.iitem .d { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--line-2); }
.iitem.drives .d { background: var(--mint); } .iitem.hinders .d { background: var(--crit); } .iitem.new .d { background: var(--cyan); }
.iitem .t b { display: block; } .iitem .t span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.iitem .usd { font-family: "IBM Plex Mono", monospace; white-space: nowrap; color: var(--ink); }
.iitem .usd.bad { color: var(--crit); } .iitem .usd.ok { color: var(--ok); }
.iitem a.src { font-size: 10.5px; color: var(--cyan); }
.comps { display: flex; flex-wrap: wrap; gap: 6px; }
.comps .cc { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 6px 4px 11px; font-size: 12px; background: var(--panel-2); }
.comps .cc span { color: var(--muted); font-size: 10.5px; }
.comps .cc button { color: var(--muted); font-size: 12px; padding: 0 5px; border-radius: 999px; }
.comps .cc button:hover { color: var(--crit); }
.irow { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.irow input { flex: 1; background: var(--bg); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 12px; }
.prog { height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.prog i { display: block; height: 100%; background: var(--cyan); border-radius: 3px; transition: width .4s; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { font-size: 10.5px; letter-spacing: .06em; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; color: var(--muted); font-family: "IBM Plex Mono", monospace; }
.days button.on { color: var(--ink); border-color: var(--cyan); }

/* credits */
.cbar { height: 8px; background: rgba(255,255,255,.06); border-radius: 4px; overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--mint); border-radius: 4px; }
.dex-credits { font-size: 10px; color: var(--muted); font-family: "IBM Plex Mono", monospace; margin-top: 6px; letter-spacing: .04em; }

/* DEX working state */
.dex-m.pending { border-color: rgba(94,234,212,.35); }
.dex-m .pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); margin-left: 8px; vertical-align: middle; animation: dexpulse 1.2s ease-in-out infinite; }
@keyframes dexpulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.prog i.indef { width: 35%; animation: indef 1.4s ease-in-out infinite; }
@keyframes indef { 0% { margin-left: 0; } 50% { margin-left: 65%; } 100% { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .dex-m .pulse, .prog i.indef { animation: none; } }

/* the demo's loading screen: a skeleton of the dashboard with a real percentage */
.loadbar { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.loadbar .prog.big { flex: 1; height: 12px; border-radius: 6px; }
.loadbar .prog.big i { background: linear-gradient(90deg, var(--cyan), var(--mint)); transition: width .8s ease; }
.loadbar b { font-family: "IBM Plex Mono", monospace; font-size: 18px; min-width: 52px; text-align: right; }
.skel { opacity: .55; pointer-events: none; }
.sk span, .sk b, .sk i, .sk h4, .sk .bar { display: block; background: rgba(255,255,255,.06); border-radius: 6px; color: transparent !important; animation: skpulse 1.6s ease-in-out infinite; }
.tile.sk span { height: 10px; width: 55%; } .tile.sk b { height: 26px; width: 40%; margin: 6px 0; } .tile.sk i { height: 10px; width: 70%; }
.card.sk h4 { height: 10px; width: 30%; margin-bottom: 14px; }
.dfirst.sk .t b { height: 12px; width: 60%; } .dfirst.sk .t span { height: 10px; width: 85%; margin-top: 6px; } .dfirst.sk .usd { height: 12px; width: 48px; } .dfirst.sk .d { background: rgba(255,255,255,.1); }
.dbar.sk .l b { height: 12px; width: 50%; } .dbar.sk .l span { height: 9px; width: 35%; margin-top: 5px; } .dbar.sk .usd { height: 12px; width: 48px; }
@keyframes skpulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sk span, .sk b, .sk i, .sk h4, .sk .bar { animation: none; } }

/* DEX memory and audit forms, scoped to these workflows. */
#memoryForm, #correctionLookup, #correctionSave, #auditPolicy, #auditIdentity {
  display: grid; grid-template-columns: minmax(0,1fr); gap: 10px;
  max-width: 780px; padding: 24px; margin: 16px 0;
}
#memoryForm label, #correctionLookup label, #correctionSave label, #auditPolicy label, #auditIdentity label {
  font-size: 13px; font-weight: 600; margin-top: 8px;
}
#memoryForm input, #memoryForm textarea, #memoryForm select, #correctionLookup input,
#correctionLookup select, #correctionSave input, #correctionSave select,
#auditPolicy input, #auditPolicy select, #auditIdentity input, #auditIdentity select {
  width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line,#ccd6c3);
  border-radius: 6px; background: var(--card,#fff); color: inherit; font: inherit;
}
#auditPolicy select[multiple] { min-height: 120px; }
#memoryForm button, #correctionSave button, #auditPolicy button, #auditIdentity button { justify-self: start; margin-top: 12px; }
#memoryItems .card { padding: 22px; margin: 14px 0; }
#memoryItems p, #correctionEditor p { white-space: pre-wrap; overflow-wrap: anywhere; }
#correctionEditor { padding: 22px; overflow-x: auto; }
#correctionEditor table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; }
#correctionEditor th, #correctionEditor td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line,#ccd6c3); overflow-wrap: anywhere; }
#correctionEditor pre, #view details pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
#dexLog p { white-space: pre-wrap; }
#dexConversation { min-width: 0; max-width: 420px; padding: 12px; }
#memoryError, #auditError, #dexError { color: #a33226; }
.dex-watch-card { margin: 18px 0; padding: 20px; border: 1px solid #9dbb93; border-radius: 10px; background: #edf4e4; color: #234c3c; max-width: 580px; }
.dex-watch-card > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.dex-watch-card > div > span { font-size: 10px; }
.dex-watch-card h3 { margin: 16px 0 8px; font-size: 23px; overflow-wrap: anywhere; }
.dex-watch-card p { font-size: 12px; line-height: 1.7; }
.dex-watch-card a { display: inline-block; margin-top: 10px; color: #234c3c; text-decoration: underline; font-size: 12px; }
.dex-watch-hint { color: #758568; font-size: 12px; line-height: 1.7; }
@media(max-width:700px) { .dex-form { flex-wrap: wrap; } #dexConversation { max-width: 100%; } }
.inventory-intel h3 { font-size: 23px; margin: 0 0 12px; }
.inventory-intel h4 { margin: 22px 0 10px; font-size: 14px; }
.inventory-intel p { margin: 10px 0; }
.inventory-intel table { border-collapse: collapse; min-width: 540px; width: 100%; }
.inventory-intel th, .inventory-intel td { padding: 10px 12px; font-size: 13px; text-align: left; border-bottom: 1px solid var(--line); white-space: normal; }
.inventory-intel details { margin: 12px 0; }
.inventory-intel summary { cursor: pointer; }
.inventory-intel li { margin: 8px 0; overflow-wrap: anywhere; }
#staffTree [data-staff-node][role="button"] { cursor: pointer; }
#staffTree [data-staff-node]:focus-visible { outline: 3px solid var(--green, #244b3c); outline-offset: 4px; }
#reportingLineForm select { display: block; width: 100%; margin: 10px 0 18px; }
#reportingLineStatus { min-height: 1.5em; margin: 12px 0; }

/* Import checks remain readable in feed cards and upload history. */
.import-check { grid-column: 1 / -1; margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; text-align: left; white-space: normal; }
.import-check summary { cursor: pointer; font-weight: 600; }
.import-check p { line-height: 1.6; overflow-wrap: anywhere; }
.import-counts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 16px 0; }
.import-counts dt { font-size: 12px; color: var(--muted); }
.import-counts dd { margin: 4px 0 0; font-size: 22px; font-weight: 600; }
.import-total-scroll { overflow-x: auto; max-width: 100%; }
.import-check table { min-width: 440px; }
.import-check caption { text-align: left; margin-bottom: 8px; font-weight: 600; }
.import-check-unknown { color: var(--muted); font-size: 12px; white-space: normal; }
