/* GM Den generic-demo design. System fonts only: no remote or bundled assets. */
:root {
  --ink: #17191d;
  --ink-2: #4a4f58;
  --canvas: #f3f0ea;
  --paper: #ffffff;
  --line: #d9d4ca;
  --side: #121418;
  --side-2: #1c1f25;
  --side-ink: #e9e7e2;
  --side-mute: #a7abb3;
  --action: #2646c4;
  --action-ink: #ffffff;
  --mia: #b8321f;
  --risk: #8a5a00;
  --cpl: #1c7248;
  --ins: #4a3aa7;
  --mia-bg: #fbe9e5;
  --risk-bg: #fbf0d4;
  --cpl-bg: #e0f1e8;
  --ins-bg: #ebe8fa;
  --focus: #ffb703;
  --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 8px;
  --drawer-w: 460px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--canvas); color: var(--ink);
  font: 400 16px/1.5 var(--body);
}
h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 500 12px var(--mono); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; opacity: .75; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }
.sidebar :focus-visible, .sample-bar :focus-visible { box-shadow: 0 0 0 5px #000; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--paper); padding: 10px 14px; border-radius: var(--r); font-weight: 600; }
.skip:focus { top: 8px; }

/* ---------- sample data bar ---------- */
.sample-bar {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: #ffd24a; color: #1d1700; border-bottom: 2px solid #1d1700;
}
.sample-bar__text { font-size: 14px; line-height: 1.35; }
.sample-bar__text strong { font: 700 15px var(--display); letter-spacing: .12em; background: #1d1700; color: #ffd24a; padding: 2px 8px; border-radius: 4px; margin-right: 6px; }
.sample-bar__actions { display: flex; gap: 8px; }
.sample-bar .btn--ghost { border-color: #1d1700; color: #1d1700; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border-radius: var(--r);
  border: 1.5px solid var(--ink); background: var(--paper); font-weight: 600; line-height: 1.2;
}
.btn--sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn--primary:hover { background: #1b37a0; }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: rgba(0, 0, 0, .07); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  min-width: 44px; min-height: 44px; display: inline-grid; place-items: center;
  border: 1.5px solid var(--line); border-radius: var(--r); background: var(--paper); font-size: 20px; line-height: 1;
}
.icon-btn[aria-disabled="true"] { opacity: .4; cursor: default; }
.icon-btn__bars, .icon-btn__bars::before, .icon-btn__bars::after { display: block; width: 20px; height: 2px; background: currentColor; position: relative; }
.icon-btn__bars::before, .icon-btn__bars::after { content: ""; position: absolute; left: 0; }
.icon-btn__bars::before { top: -6px; } .icon-btn__bars::after { top: 6px; }

/* ---------- layout ---------- */
.app { flex: 1; min-height: 0; display: grid; grid-template-columns: 272px minmax(0, 1fr); grid-template-rows: 1fr; }
.topbar { display: none; }
.scrim { display: none; }

.sidebar {
  background: var(--side); color: var(--side-ink); overflow-y: auto;
  display: flex; flex-direction: column; padding: 18px 14px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 6px; }
.brand__mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: #f3f0ea; color: var(--ink); font: 700 20px var(--display); letter-spacing: .04em; }
.brand__name { font: 600 28px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.brand__name b { color: #ffb703; font-weight: 700; }
.school { padding: 2px 6px 14px; font-size: 13px; color: var(--side-mute); border-bottom: 1px solid #2c3037; margin-bottom: 10px; }
.sidebar__groups { flex: 1; }
.navgroup { padding: 10px 0 6px; }
.navgroup__title { display: flex; align-items: center; gap: 10px; font: 700 22px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; padding: 4px 6px; }
.navgroup__tile { width: 14px; height: 14px; border-radius: 4px; background: var(--tone); }
.navgroup--mia { --tone: #ef6a55; } .navgroup--risk { --tone: #f2b632; } .navgroup--cpl { --tone: #4cc38a; } .navgroup--ins { --tone: #9d93ef; }
.navgroup__gloss { font-size: 13px; color: var(--side-mute); padding: 0 6px 6px 30px; }
.nav__item {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 12px 6px 30px; background: transparent; border: 0; border-left: 4px solid transparent; border-radius: 0 var(--r) var(--r) 0;
  color: var(--side-ink); text-align: left; font-size: 16px;
}
.nav__item:hover { background: var(--side-2); }
.nav__item.is-current { background: #262a32; border-left-color: var(--tone); font-weight: 600; }
.nav__count { min-width: 30px; text-align: center; padding: 1px 8px; border-radius: 999px; background: #2e333b; font: 500 14px var(--mono); }
.is-current .nav__count { background: var(--tone); color: #121418; }
.sidebar__foot { padding: 14px 4px 0; border-top: 1px solid #2c3037; margin-top: 8px; }
.sidebar__foot .btn--primary { background: #ffb703; border-color: #ffb703; color: #121418; }
.sidebar__foot .btn--primary:hover { background: #ffc633; }
.fine { font-size: 13px; line-height: 1.4; color: var(--ink-2); margin-top: 6px; }
.sidebar .fine { color: var(--side-mute); text-align: center; }

.workbench { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.workbench:has(.drawer:not([hidden])) { grid-template-columns: minmax(0, 1fr) var(--drawer-w); }
.board { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 22px 28px 0; }
.board__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 14px; }
.eyebrow { font: 600 13px/1.3 var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
h1 { font: 700 46px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; margin: 4px 0 6px; outline-offset: 4px; }
.board__desc { max-width: 62ch; color: var(--ink-2); font-size: 16px; }
.board__stats { display: flex; gap: 10px; }
.stat { display: grid; justify-items: center; min-width: 84px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--paper); }
.stat b { font: 700 34px/1 var(--display); }
.stat span { font-size: 13px; color: var(--ink-2); }
.stat--lead { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat--lead span { color: #d6d3cc; }

.toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 0 12px; }
.search { flex: 1 1 280px; max-width: 460px; }
.search input { width: 100%; min-height: 46px; padding: 8px 14px; border: 1.5px solid var(--ink-2); border-radius: var(--r); background: var(--paper); }
.toolbar__count { font-size: 14px; color: var(--ink-2); }

.list-region { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 4px 28px 0; overscroll-behavior: contain; scrollbar-gutter: stable; }
.list-region:focus-visible { outline-offset: -3px; }
.rows { display: grid; gap: 10px; }

/* ---------- worklist rows ---------- */
.row__btn {
  width: 100%; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(0, 1.5fr) 180px 112px; align-items: center; gap: 8px 22px;
  padding: 12px 16px; text-align: left; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r);
  border-left: 6px solid var(--mia);
}
.row__btn:hover { border-color: var(--ink-2); border-left-color: var(--mia); }
.row__btn[aria-current="true"] { background: #eef1fd; border-color: var(--action); border-left-color: var(--action); box-shadow: 0 0 0 1px var(--action); }
.row--cleared .row__btn { background: #f1f4f1; border-left-color: var(--cpl); }
.row--cleared .row__name { color: var(--ink-2); }
.row__name { display: block; font: 700 25px/1.1 var(--display); letter-spacing: .02em; }
.row__meta { display: block; font-size: 14px; color: var(--ink-2); }
.row__whylabel { display: block; font: 600 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.row__why { font-size: 15px; line-height: 1.4; min-width: 0; overflow-wrap: anywhere; }
.row__att { display: grid; gap: 4px; }
.row__attlabel { font-size: 12px; color: var(--ink-2); }
.row__status { justify-self: end; }

.strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.wk { display: block; height: 22px; border-radius: 3px; background: var(--ink); }
.wk--ok { background: var(--cpl); }
.wk--low { background: #e0a020; }
.wk--zero { background: transparent; border: 2px solid var(--mia); }
.wk--nodata { background: repeating-linear-gradient(135deg, #fff 0 4px, #c9c4ba 4px 6px); border: 1px dashed #8d887d; }
.wk--now { outline: 2px solid var(--ink); outline-offset: 1px; }
.strip--big { gap: 6px; }
.strip--big .wk { height: auto; min-height: 58px; display: grid; place-items: center; align-content: center; padding: 6px 0; }
.strip--big .wk__n { font: 700 24px/1 var(--display); color: #fff; }
.strip--big .wk--zero .wk__n, .strip--big .wk--nodata .wk__n { color: var(--ink); }
.strip--big .wk--low .wk__n { color: #1d1700; }
.strip--big .wk__d { font-size: 10px; color: #fff; letter-spacing: 0; }
.strip--big .wk--zero .wk__d, .strip--big .wk--nodata .wk__d { color: var(--ink-2); }
.strip--big .wk--low .wk__d { color: #1d1700; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1.5px solid currentColor; white-space: nowrap; }
.badge--none { color: var(--mia); background: var(--mia-bg); }
.badge--cleared { color: #fff; background: var(--cpl); border-color: var(--cpl); }
.badge--followup { color: #5b3d00; background: var(--risk-bg); }
.badge--voicemail { color: var(--ins); background: var(--ins-bg); }
.badge--noanswer { color: #3d424a; background: #e8e6e1; }

.empty { padding: 28px; border: 1.5px dashed var(--ink-2); border-radius: var(--r); color: var(--ink-2); }

/* ---------- insights ---------- */
.panel { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r); padding: 22px; max-width: 820px; }
.panel h2 { font: 700 30px/1.1 var(--display); text-transform: uppercase; margin: 4px 0 8px; }
.illus { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; background: var(--ins-bg); color: var(--ins); border-radius: 4px; }
.muted { color: var(--ink-2); font-size: 15px; }
.bars { display: grid; gap: 12px; margin: 18px 0; }
.bars li { display: grid; grid-template-columns: minmax(120px, 230px) 1fr 34px; gap: 12px; align-items: center; }
.bars__track { height: 18px; background: #ece8df; border-radius: 4px; overflow: hidden; }
.bars__fill { display: block; height: 100%; background: var(--ins); }
.layers { display: grid; gap: 6px; padding: 12px 14px; background: #f7f5f0; border-left: 4px solid var(--ins); border-radius: 0 var(--r) var(--r) 0; font-size: 15px; }
.tablewrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; min-width: 420px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
thead th { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }

/* ---------- drawer ---------- */
.drawer { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); border-left: 2px solid var(--ink); }
.drawer:focus { outline: none; }
.drawer__sample { flex: none; padding: 5px 16px; background: #ffd24a; color: #1d1700; font-size: 13px; line-height: 1.3; border-bottom: 1.5px solid #1d1700; }
.drawer__sample strong { font: 700 13px var(--display); letter-spacing: .12em; margin-right: 6px; }
.drawer__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-bottom: 1.5px solid var(--line); background: #faf8f4; }
.pager { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pager__pos { font: 600 14px var(--body); min-width: 0; }
.drawer__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 40px; display: grid; gap: 14px; align-content: start; overscroll-behavior: contain; }
.d-head h2 { font: 700 40px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; margin: 4px 0; overflow-wrap: anywhere; }
.d-sub { color: var(--ink-2); font-size: 15px; }
.d-status { margin-top: 8px; }
.d-card { border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; display: grid; gap: 8px; }
.d-card h3 { font: 700 21px/1.1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.d-card--decide { border: 2px solid var(--action); background: #f5f7ff; }
.d-next { font-size: 18px; font-weight: 600; line-height: 1.35; }
.d-alert { font-size: 16px; }
.tag { justify-self: start; margin-top: 4px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tag--observed { background: #e8e6e1; color: #2a2d33; }
.tag--config { background: var(--risk-bg); color: #5b3d00; }
.tag--derived { background: var(--ins-bg); color: var(--ins); }
.tag--suggest { background: #dfe6fd; color: #1b2f87; }
.outcomes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 4px; }
.out.is-on { color: #fff; border-color: var(--ink); background: var(--ink); }
.out--cleared.is-on { background: var(--cpl); border-color: var(--cpl); }
.out.is-on::before { content: "\2713"; }
.notes { display: grid; gap: 4px; font-weight: 600; }
.notes textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--ink-2); border-radius: var(--r); resize: vertical; min-height: 84px; font-weight: 400; background: var(--paper); }
.demo-note { padding: 8px 12px; background: #fff3c4; border-left: 4px solid #1d1700; border-radius: 0 6px 6px 0; font-size: 14px; line-height: 1.4; }
.ev { display: grid; gap: 8px; }
.ev li { display: grid; grid-template-columns: 56px 1fr; gap: 0 10px; font-size: 15px; }
.ev__date { grid-row: span 2; font: 600 13px var(--mono); color: var(--ink-2); padding-top: 2px; }
.ev__src { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 15px; }
.kv dt { color: var(--ink-2); } .kv dd { overflow-wrap: anywhere; }

/* ---------- modals, toast ---------- */
.modal { border: 2px solid var(--ink); border-radius: 12px; padding: 0; max-width: min(560px, calc(100vw - 24px)); width: 100%; background: var(--paper); color: var(--ink); }
.modal::backdrop { background: rgba(18, 20, 24, .66); }
.modal__box { padding: 24px; display: grid; gap: 12px; margin: 0; }
.modal h2 { font: 700 36px/1.05 var(--display); text-transform: uppercase; }
.checks { display: grid; gap: 8px; }
.checks li { padding: 8px 12px; background: #f7f5f0; border-left: 4px solid var(--action); border-radius: 0 6px 6px 0; font-size: 15px; }
.modal__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translate(-50%, 20px); max-width: min(520px, calc(100vw - 24px));
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }


/* Stacked rows whenever the drawer takes space beside the list */
.app.has-drawer .row__btn { grid-template-columns: minmax(0, 1fr) auto; }
.app.has-drawer .row__who { grid-column: 1; grid-row: 1; }
.app.has-drawer .row__status { grid-column: 2; grid-row: 1; align-self: start; }
.app.has-drawer .row__why { grid-column: 1 / -1; grid-row: 2; }
.app.has-drawer .row__att { grid-column: 1 / -1; grid-row: 3; }
.app.has-drawer .row__att .strip { max-width: 260px; }
.app.has-drawer h1 { font-size: 38px; }
.app.has-drawer .board__desc { font-size: 15px; }

/* ---------- tablet / narrow desktop ---------- */
@media (max-width: 1280px) {
  :root { --drawer-w: 400px; }
  .row__btn { grid-template-columns: minmax(150px, 1fr) minmax(0, 1.2fr) 150px; }
  .row__status { grid-column: 3; grid-row: 1; }
  .row__att { grid-column: 3; grid-row: 2; }
  .row__who { grid-column: 1; grid-row: 1 / span 2; }
  .row__why { grid-column: 2; grid-row: 1 / span 2; }
  h1 { font-size: 40px; }
}

/* ---------- mobile: list, then full-screen detail ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--side); color: var(--side-ink); }
  .topbar .icon-btn { background: var(--side-2); border-color: #3a3f48; color: var(--side-ink); }
  .topbar__title { flex: 1; min-width: 0; font: 700 24px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .btn--primary { background: #ffb703; border-color: #ffb703; color: #121418; min-height: 44px; }
  .sidebar {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(320px, 86vw);
    transform: translateX(-102%); visibility: hidden; transition: transform .2s, visibility 0s .2s;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .2s; }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); }
  .scrim:not([hidden]) { display: block; }
  .workbench, .workbench:has(.drawer:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .board { padding: 14px 12px 0; }
  .board__head { display: grid; gap: 10px; padding-bottom: 8px; }
  h1 { font-size: 34px; }
  .board__desc { font-size: 15px; }
  .board__stats { gap: 8px; }
  .stat { flex: 1; min-width: 0; padding: 6px 8px; }
  .toolbar { padding: 4px 0 10px; gap: 6px; }
  .search { max-width: none; flex-basis: 100%; }
  .row__btn { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 12px; min-height: 44px; }
  .row__who { grid-column: 1; grid-row: 1; }
  .row__status { grid-column: 2; grid-row: 1; align-self: start; }
  .row__why { grid-column: 1 / -1; grid-row: 2; }
  .row__att { grid-column: 1 / -1; grid-row: 3; }
  .row__name { font-size: 26px; }
  .drawer { position: fixed; inset: 0; z-index: 50; border-left: 0; }
  .drawer__scroll { padding: 14px 14px 56px; }
  .d-head h2 { font-size: 36px; }
  .bars li { grid-template-columns: minmax(0, 1fr) 34px; }
  .bars__track { grid-column: 1 / -1; grid-row: 2; }
  .bars li b { grid-column: 2; grid-row: 1; }
  .panel { padding: 16px; }
  .sample-bar { padding: 6px 12px; }
  .sample-bar__text { font-size: 13px; }
}
@media (max-width: 420px) {
  .strip--big .wk__d { font-size: 9px; }
  .kv { grid-template-columns: 1fr; }
  .sample-bar__actions { width: 100%; }
  .sample-bar__actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .wk, .btn, .badge, .row__btn { border: 1px solid CanvasText; }
}
