/* ============================================================
   Office Hub — ACG Platform design system (locked tokens)
   Editorial-professional ops tool. Calm by default, dense on demand.
   ============================================================ */

:root {
  /* Surfaces */
  --canvas:#FAF8F5;
  --surface:#FFFFFF;
  --surface-2:#F6F3EE;      /* faint warm tint for inset areas */
  --surface-3:#F0ECE4;      /* slightly deeper warm */
  --line:#ECE7DE;
  --line-strong:#DDD6CA;
  /* legacy aliases used in JS */
  --bg:var(--canvas);
  --line-2:var(--line-strong);

  /* Text */
  --ink:#1A1A1A;
  --ink-2:#6B6B6B;
  --ink-3:#9A958C;
  --ink-4:#B8B2A8;

  /* Location accents (active one is set on .app via --accent) */
  --nwdc:#2563EB; --nwdc-soft:#EAF0FE; --nwdc-ink:#1B47B4;
  --bcdc:#DB7C2E; --bcdc-soft:#FBEEDF; --bcdc-ink:#A85816;
  --accent:#2563EB; --accent-soft:#EAF0FE; --accent-ink:#1B47B4; --accent-deep:#1D4FD0;

  /* Status — real signals only */
  --red:#DC2626;   --red-soft:#FBE9E9;
  --green:#16A34A; --green-soft:#E7F4EC;
  --amber:#D97706; --amber-soft:#FBF0DF;
  /* legacy aliases */
  --rose:var(--red); --rose-soft:var(--red-soft);
  --grn:var(--green); --grn-soft:var(--green-soft);
  --warm:var(--amber); --warm-soft:var(--amber-soft);

  /* GroupMe — light blue, distinct from NWDC indigo */
  --gm:#1DA1E6; --gm-soft:#E6F4FC;

  /* Role / area chip colors (brightened, never brown) */
  --c-front:#37A6DE; --c-clinical:#0FA89C; --c-billing:#5BA177;
  --c-admin:#7E5BE0; --c-supply:#E0922E;

  --radius:10px; --radius-sm:6px; --radius-xs:5px;
  --shadow-card:0 1px 2px rgba(26,26,26,.04),0 1px 0 rgba(26,26,26,.02);
  --shadow-m:0 6px 18px -8px rgba(26,26,26,.16),0 2px 6px rgba(26,26,26,.05);
  --shadow-pop:0 24px 60px -20px rgba(26,26,26,.28),0 4px 14px rgba(26,26,26,.08);

  --hero:"Fraunces",Georgia,serif;
  --mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
  --ui:"Inter",system-ui,-apple-system,sans-serif;
  --font-sans:var(--ui); --font-mono:var(--mono);

  --pad:24px; --row-pad:14px; --gap:11px;
}

[data-density="compact"] { --pad:16px; --row-pad:10px; --gap:8px; }
[data-density="comfy"]   { --pad:30px; --row-pad:18px; --gap:15px; }

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%;
  background: var(--canvas); color: var(--ink);
  font-family: var(--ui); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
#root { height: 100%; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; border: 3px solid var(--canvas); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ---- signature atoms ---- */
.eyebrow {
  font-family: var(--mono); text-transform: uppercase;
  letter-spacing: .14em; font-size: 10.5px; color: var(--ink-3); font-weight: 500;
}
.hero-num {
  font-family: var(--hero); font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; color: var(--ink);
}
.serif { font-family: var(--hero); font-weight: 400; letter-spacing: -.01em; }
.mono { font-family: var(--mono); }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 340px;
  height: 100%; background: var(--canvas);
}
.app[data-rail="closed"] { grid-template-columns: 236px minmax(0, 1fr) 50px; }
@media (max-width: 1180px) {
  .app { grid-template-columns: 72px minmax(0,1fr) 320px; }
  .app[data-rail="closed"] { grid-template-columns: 72px minmax(0,1fr) 50px; }
}
@media (max-width: 900px)  {
  .app, .app[data-rail="closed"] { grid-template-columns: 72px minmax(0,1fr); }
  .rail, .rail-mini { display: none; }
}

/* collapsed rail strip */
.rail-mini {
  border-left: 1px solid var(--line); background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 14px 0; min-height: 0;
}
.mini-expand {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  display: grid; place-items: center; transform: rotate(90deg);
  transition: background .12s, color .12s, border-color .12s;
}
.mini-expand:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }
.mini-gm { position: relative; width: 26px; height: 26px; border-radius: 8px; background: var(--gm); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.mini-gm .gm-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 2px var(--surface-2); }
.rail-mini .vlabel { writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.mini-unread { margin-top: auto; font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: var(--gm-soft); color: var(--gm); min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 20px; display: grid; place-items: center; }

/* collapse button in rail header */
.rail-head { position: relative; }
.rail-head-top { display: flex; align-items: center; gap: 8px; }
.rail-head-top .rail-tabs { flex: 1; }
.rail-collapse {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-3);
  display: grid; place-items: center; transform: rotate(-90deg);
  transition: background .12s, color .12s, border-color .12s;
}
.rail-collapse:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }

/* ---------- Sidebar ---------- */
.side {
  border-right: 1px solid var(--line); background: var(--surface-2);
  display: flex; flex-direction: column; min-height: 0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px 16px; }
.brand-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; background: #0E2A4E; box-shadow: 0 1px 3px rgba(14,42,78,.25); }
.brand-name { font-weight: 600; font-size: 14.5px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }

.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-glyph { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600; font-family: var(--mono);
  background: var(--red); color: #fff;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 20px;
  display: grid; place-items: center;
}
.nav-label { white-space: nowrap; }

.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); }
.lead-link { display: flex; align-items: center; gap: 9px; padding: 9px 10px; margin-bottom: 8px; border-radius: var(--radius-sm);
  background: #0E2A4E; color: #fff; text-decoration: none; transition: filter .12s; }
.lead-link:hover { filter: brightness(1.12); }
.lead-lock { width: 24px; height: 24px; border-radius: 7px; background: rgba(255,255,255,.14); display: grid; place-items: center; flex: none; }
.lead-link b { font-size: 12.5px; font-weight: 600; color: #fff; display: block; line-height: 1.2; }
.lead-link small { font-size: 10.5px; color: #9FB8D6; font-family: var(--mono); letter-spacing: 0.02em; }
.gm-status {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); font-size: 12px;
}
.gm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px var(--green-soft); }
.gm-status.off .gm-dot { background: var(--ink-4); box-shadow: 0 0 0 3px var(--surface-3); }
.gm-status b { color: var(--ink); font-weight: 600; }
.gm-status small { color: var(--ink-3); display: block; font-size: 11px; }

.me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; }
.me .name { font-size: 13px; font-weight: 600; }
.me .role { font-size: 11px; color: var(--ink-3); }

@media (max-width: 1180px) {
  .brand-name, .brand-sub, .nav-label, .nav-badge, .side-foot .txt, .me .meta { display: none; }
  .brand { justify-content: center; padding: 18px 0; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .gm-status { justify-content: center; padding: 9px 0; }
  .me { justify-content: center; }
}

/* ---------- Main column ---------- */
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 30px 16px; border-bottom: 1px solid var(--line); background: var(--canvas);
}
.topbar .title-wrap h1 {
  margin: 0; font-family: var(--hero); font-weight: 400; font-size: 27px;
  letter-spacing: -0.02em; color: var(--ink); line-height: 1.05;
}
.topbar .title-wrap .date { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; display: flex; align-items: center; gap: 9px; }
.weather-chip { color: var(--ink-2); font-family: var(--mono); font-size: 11.5px; }
.topbar .spacer { flex: 1; }

/* location segmented control */
.loc-toggle { display: flex; gap: 3px; background: var(--surface-3); padding: 3px; border-radius: 20px; }
.loc-seg {
  border: none; background: none; padding: 6px 13px; border-radius: 20px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 7px;
  transition: all .14s;
}
.loc-seg .ld { width: 7px; height: 7px; border-radius: 50%; }
.loc-seg.active { color: #fff; }
.loc-seg.active.nwdc { background: var(--nwdc); }
.loc-seg.active.bcdc { background: var(--bcdc); }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 20px; width: 200px; color: var(--ink-3); font-size: 13px;
}
.search input { border: none; background: none; outline: none; width: 100%; color: var(--ink); font-size: 13px; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--canvas); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.scroll { overflow-y: auto; min-height: 0; flex: 1; padding: 22px 30px 80px; }

/* ---------- Metric strip ---------- */
.metrics { display: flex; gap: 0; margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.metric { flex: 1; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: none; }
.metric .m-val { font-family: var(--hero); font-weight: 400; font-size: 34px; line-height: 1; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.01em; }
.metric .m-val.attn { color: var(--red); }
.metric .m-val.good { color: var(--green); }
.metric .m-sub { font-size: 11.5px; color: var(--ink-3); }

/* ---------- Quick add ---------- */
.quickadd {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 6px 6px 6px 16px; margin-bottom: 22px;
  display: flex; align-items: center; gap: 10px;
  transition: box-shadow .15s, border-color .15s;
}
.quickadd.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.quickadd input.qa-title { border: none; outline: none; background: none; flex: 1; font-size: 14.5px; color: var(--ink); padding: 11px 0; }
.qa-controls { display: flex; align-items: center; gap: 6px; }
.qa-meta-btn {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 20px; padding: 6px 11px; font-size: 12.5px; color: var(--ink-2);
}
.qa-meta-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.qa-meta-btn.set { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.qa-add {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); height: 38px; padding: 0 16px; font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; gap: 6px; transition: background .12s, transform .06s;
}
.qa-add:hover { background: var(--accent-deep); }
.qa-add:active { transform: scale(0.97); }
.qa-add:disabled { background: var(--line-strong); color: var(--ink-4); cursor: default; }

/* popover */
.pop {
  position: absolute; z-index: 40; margin-top: 8px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 6px; min-width: 200px;
}
.pop-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-xs);
  font-size: 13px; color: var(--ink); cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.pop-row:hover { background: var(--surface-3); }
.pop-row.sel { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.pop-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); padding: 8px 10px 4px; font-weight: 500; }

/* ---------- Filters ---------- */
.filters { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); border-radius: 20px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 7px; transition: all .12s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .ct { font-size: 11px; opacity: 0.7; font-family: var(--mono); }
.filters .grow { flex: 1; }
.sortbtn { font-size: 12px; color: var(--ink-3); background: none; border: none; display: flex; gap: 6px; align-items: center; }
.sortbtn:hover { color: var(--ink); }

/* ---------- Section ---------- */
.sec-head { display: flex; align-items: center; gap: 11px; margin: 26px 2px 12px; }
.sec-head:first-child { margin-top: 4px; }
.sec-head h2 { margin: 0; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.sec-head .ct { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.sec-head .line { flex: 1; height: 1px; background: var(--line); }
.sec-head.attn h2 { color: var(--red); }

/* ---------- Task card ---------- */
.task {
  display: flex; align-items: flex-start; gap: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--row-pad) 16px; margin-bottom: var(--gap);
  box-shadow: var(--shadow-card);
  transition: border-color .14s, box-shadow .14s, opacity .25s, transform .14s; position: relative;
}
.task:hover { border-color: var(--line-strong); }
.task.urgent { border-left: 3px solid var(--red); }
.task.due { border-left: 3px solid var(--amber); }
.task.done { background: var(--surface-2); opacity: 0.62; box-shadow: none; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-3); }

.check {
  width: 21px; height: 21px; border-radius: var(--radius-xs); flex: none; margin-top: 1px;
  border: 1.8px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; transition: all .14s;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--green); border-color: var(--green); }
.check svg { opacity: 0; transform: scale(0.6); transition: all .14s; }
.check.on svg { opacity: 1; transform: scale(1); }

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.task-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.meta-bit { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.meta-bit.who { color: var(--ink-2); font-weight: 500; }
.meta-bit.time { font-family: var(--mono); font-size: 11px; }
.meta-bit.overdue { color: var(--red); font-weight: 600; }
.dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); flex: none; }

/* role chip — 9px identity square */
.rolechip { width: 9px; height: 9px; border-radius: 3px; flex: none; }

/* category tag — mono uppercase, seasoning */
.tag {
  font-family: var(--mono); font-size: 9.5px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 3px 8px; border-radius: 20px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}

.task-right { display: flex; align-items: center; gap: 10px; margin-top: 1px; }
.cmt { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-3); }
.cmt:hover { color: var(--ink); }

.gm-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--gm-soft); color: var(--gm); padding: 3px 8px 3px 6px; border-radius: 20px;
}
.gm-badge .g { width: 12px; height: 12px; border-radius: 4px; background: var(--gm); color: #fff; display: grid; place-items: center; font-size: 8px; font-family: var(--ui); font-weight: 700; }

.empty { text-align: center; color: var(--ink-3); padding: 48px 20px; font-size: 13.5px; }
.empty .big { font-family: var(--hero); font-size: 18px; color: var(--ink-2); font-weight: 400; margin-bottom: 6px; }

/* ---------- Right rail ---------- */
.rail { border-left: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; min-height: 0; }
.rail-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); }
.rail-tabs { display: flex; gap: 4px; background: var(--surface-3); padding: 3px; border-radius: 20px; }
.rail-tab { flex: 1; border: none; background: none; padding: 7px; border-radius: 20px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.rail-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.rail-sub { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: var(--ink-3); }

.feed { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; }
.feed-day { text-align: center; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-4); margin: 8px 0 12px; text-transform: uppercase; }

.msg { display: flex; gap: 10px; padding: 7px 0; position: relative; }
.msg-body { flex: 1; min-width: 0; }
.msg-top { display: flex; align-items: center; gap: 7px; }
.msg-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.msg-time { font-size: 10px; color: var(--ink-4); font-family: var(--mono); }
.msg-text { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 3px; word-wrap: break-word; }
.msg-src { margin-left: auto; }

/* GroupMe-style photo attachment */
.msg-image { display: flex; align-items: center; gap: 10px; margin-top: 7px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); max-width: 230px; }
.msg-image-thumb { width: 46px; height: 46px; border-radius: var(--radius-xs); background: linear-gradient(135deg, var(--gm-soft), var(--surface-3)); display: grid; place-items: center; color: var(--gm); flex: none; }
.msg-image-cap { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); line-height: 1.3; }

/* GroupMe-style heart like */
.like-btn { position: absolute; top: 4px; right: 0; display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 3px 8px 3px 6px; color: var(--ink-4); opacity: 0; transition: opacity .12s, color .12s, border-color .12s; }
.msg:hover .like-btn { opacity: 1; }
.like-btn.has { opacity: 1; }
.like-btn:hover { color: var(--gm); border-color: color-mix(in srgb, var(--gm) 40%, white); }
.like-btn.liked { color: var(--gm); border-color: color-mix(in srgb, var(--gm) 35%, white); background: var(--gm-soft); }
.like-ct { font-family: var(--mono); font-size: 10.5px; font-weight: 500; }

.evt { display: flex; align-items: center; gap: 9px; padding: 7px 11px; margin: 3px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 12px; color: var(--ink-2); }
.evt .ic { width: 18px; height: 18px; border-radius: var(--radius-xs); display: grid; place-items: center; flex: none; }
.evt b { color: var(--ink); font-weight: 600; }
.evt .evt-time { margin-left: auto; font-size: 10px; color: var(--ink-4); font-family: var(--mono); flex: none; }

.composer { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--surface-2); }
.composer-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color .15s, box-shadow .15s; }
.composer-box.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-box textarea { width: 100%; border: none; outline: none; resize: none; background: none; font-size: 13px; color: var(--ink); line-height: 1.45; max-height: 90px; }
.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.gm-toggle { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.send-btn { margin-left: auto; background: var(--accent); color: #fff; border: none; width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; transition: background .12s, transform .06s; }
.send-btn:hover { background: var(--accent-deep); }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { background: var(--line-strong); cursor: default; }

/* switch */
.switch { width: 34px; height: 20px; border-radius: 20px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; border: none; padding: 0; }
.switch.on { background: var(--gm); }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: var(--shadow-card); }
.switch.on .knob { left: 16px; }

/* avatar — muted, warm */
.avatar { border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 600; letter-spacing: -0.01em; font-size: 11px; width: 28px; height: 28px; user-select: none; }
.avatar.lg { width: 34px; height: 34px; font-size: 12.5px; }
.avatar.sm { width: 21px; height: 21px; font-size: 9px; }

/* toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--radius-sm); font-size: 13px; box-shadow: var(--shadow-pop); display: flex; align-items: center; gap: 10px; animation: toastIn .26s cubic-bezier(.2,.8,.2,1); }
.toast .gm-chip { background: var(--gm); color: #fff; font-family: var(--mono); font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.task.enter { animation: pop .22s ease both; }

/* ---------- Org / Team view ---------- */
.org-wrap { max-width: 1000px; }
.org-intro { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.org-intro p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); max-width: 560px; line-height: 1.55; }
.tier-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; display: flex; align-items: center; gap: 9px; }
.tier-label .line { flex: 1; height: 1px; background: var(--line); }

.org-top { display: flex; gap: var(--gap); margin-bottom: 10px; }
.owner-card {
  flex: 1; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-card);
}
.owner-card .who { font-weight: 600; font-size: 14px; }
.owner-card .role { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.ops-card { border-left: 3px solid oklch(0.6 0.12 265); }
.owner-card.own { border-left: 3px solid oklch(0.55 0.1 250); }

.org-stem { height: 18px; width: 2px; background: var(--line-strong); margin: 0 auto; }

.dept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 1180px) { .dept-grid { grid-template-columns: repeat(2, 1fr); } }
.dept-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px 13px; box-shadow: var(--shadow-card); cursor: pointer;
  transition: border-color .14s, box-shadow .14s, transform .12s; text-align: left;
  display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--dept);
}
.dept-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-m); transform: translateY(-1px); }
.dept-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dept-name { font-family: var(--hero); font-size: 18px; font-weight: 400; letter-spacing: -0.01em; }
.dept-count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.dept-source { display: flex; align-items: center; gap: 9px; padding: 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.dept-source .src-meta { min-width: 0; }
.dept-source .src-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.dept-source .src-label { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dept); margin-top: 2px; }
.dept-foot { display: flex; align-items: center; gap: 8px; }
.dept-members { display: flex; }
.dept-members .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.dept-members .avatar:first-child { margin-left: 0; }
.dept-badge { font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 7px; border-radius: 20px; display: inline-flex; align-items: center; gap: 4px; }
.dept-badge.remote { background: var(--gm-soft); color: var(--gm); }
.dept-badge.shared { background: oklch(0.95 0.03 265); color: oklch(0.45 0.12 265); }
.dept-badge.cover { background: var(--amber-soft); color: var(--amber); }
.dept-open { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--ink-4); display: flex; align-items: center; gap: 4px; }
.dept-card:hover .dept-open { color: var(--dept); }

.escalation { margin-top: 26px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.escalation h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; }
.escalation p { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-3); }
.ladder { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.rung { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 6px 13px 6px 7px; }
.rung .num { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 10px; display: grid; place-items: center; flex: none; }
.rung .rl { font-size: 12.5px; font-weight: 500; }
.rung .rs { font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.ladder .arrow { color: var(--ink-4); margin: 0 9px; transform: rotate(-90deg); }

/* office mismatch banner */
.office-note { display: flex; align-items: center; gap: 9px; background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 22%, white); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 18px; font-size: 12.5px; }
.office-note b { color: color-mix(in srgb, var(--amber) 80%, black); font-weight: 700; }

/* BCDC partial roster prompt */
.org-pending { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 13px 16px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.org-pending b { color: var(--ink); font-weight: 600; }
.org-pending svg { color: var(--ink-3); margin-top: 2px; flex: none; }

/* routing hint in quick-add */
.quickadd-wrap { margin-bottom: 22px; }
.quickadd-wrap .quickadd { margin-bottom: 0; }
.route-hint { display: flex; align-items: center; gap: 7px; padding: 9px 4px 0; font-size: 12px; color: var(--ink-2); }
.route-hint b { color: var(--ink); font-weight: 600; }
.route-hint .arrow { color: var(--dept, var(--accent)); }

/* escalation line on attention tasks */
.esc-line { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.esc-line .hot { color: var(--red); }
.esc-line b { color: var(--ink-2); font-weight: 500; }

/* ---------- View toggle (cards / table) ---------- */
.view-toggle { display: flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: 9px; }
.view-seg { border: none; background: none; padding: 5px 9px; border-radius: 7px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.view-seg.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }

/* ---------- Dense task table ("sheet" view) ---------- */
.tbl { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.tbl-head, .tr {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 132px 144px 128px 100px 52px;
  align-items: center;
}
.tbl-head {
  position: sticky; top: 0; z-index: 4;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-strong);
  height: 38px;
}
/* mask so scrolling rows don't peek into the scroll-container's top padding */
.tbl-head::before { content: ""; position: absolute; left: -1px; right: -1px; top: -26px; height: 26px; background: var(--canvas); }
.th {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; background: none; border: none; padding: 0 10px; height: 100%; text-align: left;
}
.th:not(.th-check):not(.th-gm):hover { color: var(--ink); }
.th.sorted { color: var(--ink); }
.th.asc svg { transform: rotate(180deg); }
.th-check { padding: 0; }
.th-gm { justify-content: center; padding: 0; }

.tbl-body { }
.tr { height: 40px; border-bottom: 1px solid var(--line); position: relative; transition: background .1s; }
.tbl-body .tr:nth-of-type(even) { background: var(--surface-2); }
.tr:last-child { border-bottom: none; }
.tr:hover { background: var(--surface-3); }
.tr.flag { box-shadow: inset 3px 0 0 var(--red); }
.tr.done { opacity: 0.55; }
.tr.done .td-task { text-decoration: line-through; color: var(--ink-3); }

.td { padding: 0 10px; min-width: 0; font-size: 13px; color: var(--ink); display: flex; align-items: center; }
.td-check { padding: 0; justify-content: center; }
.td-task { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 40px; }
.td-owner { gap: 7px; color: var(--ink-2); font-size: 12.5px; }
.td-owner .ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-due { font-size: 11.5px; color: var(--ink-2); }
.td-due.od { color: var(--red); font-weight: 600; }
.td-gm { justify-content: center; padding: 0 6px; }
.check.sm { width: 18px; height: 18px; border-radius: 5px; }

.stpill { font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.stpill.st-red { background: var(--red-soft); color: var(--red); }
.stpill.st-amber { background: var(--amber-soft); color: var(--amber); }
.stpill.st-green { background: var(--green-soft); color: var(--green); }
.stpill.st-open { background: var(--surface-3); color: var(--ink-2); }
.tbl-empty { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* clickable task title + comment/ask button */
.task-link { background: none; border: none; padding: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.task-link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.td-task { display: flex; align-items: center; gap: 8px; }
.td-task .task-link { flex: 1; min-width: 0; }
.file-pip { flex: none; display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 20px; padding: 2px 7px 2px 6px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); cursor: pointer; }
.file-pip:hover { border-color: var(--line-strong); color: var(--ink); }
.cmt-btn { background: none; border: none; cursor: pointer; padding: 2px 6px; border-radius: 20px; }
.cmt-btn:hover { background: var(--surface-3); color: var(--ink); }

/* Drive link chip */
.drive-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 9px 4px 7px; }
.drive-ic { display: grid; place-items: center; flex: none; }
.drive-name { font-size: 12px; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.drive-name:hover { color: var(--accent-ink); text-decoration: underline; }
.drive-x { flex: none; border: none; background: none; color: var(--ink-4); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }
.drive-x:hover { color: var(--red); }

/* attach field */
.attach-field { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  padding: 18px 14px; text-align: center; cursor: pointer; transition: border-color .14s, background .14s; }
.dropzone:hover { border-color: var(--accent); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { cursor: default; opacity: .8; }
.dz-ic { color: var(--accent-ink); }
.dz-main { font-size: 13px; font-weight: 600; color: var(--ink); }
.dz-sub { font-size: 11px; color: var(--ink-3); }
.attach-or { display: flex; align-items: center; gap: 10px; color: var(--ink-4); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--mono); }
.attach-or::before, .attach-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.attach-err { font-size: 12px; color: var(--red); }
.drive-name.as-link { border: none; background: none; cursor: pointer; padding: 0; font-family: inherit; }
.drive-size { color: var(--ink-4); }
.attach-row { display: flex; align-items: center; gap: 8px; }
.attach-ic { color: var(--ink-3); flex: none; }
.attach-input { flex: 1; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-xs); padding: 8px 10px; font-size: 13px; outline: none; }
.attach-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.attach-input.title { font-size: 12.5px; }
.attach-actions { display: flex; align-items: center; gap: 8px; }
.attach-detect { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10.5px; color: var(--green); }
.attach-detect.warn { color: var(--amber); }
.attach-cancel { border: none; background: none; color: var(--ink-3); font-size: 12.5px; }
.attach-cancel:hover { color: var(--ink); }
.attach-add { border: none; background: var(--accent); color: #fff; border-radius: var(--radius-xs); padding: 7px 14px; font-size: 12.5px; font-weight: 600; }
.attach-add:disabled { background: var(--line-strong); color: var(--ink-4); }

/* drawer sections */
.drawer-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface); border-radius: 20px;
  padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.link-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.files-empty { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.file-list { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }

/* task thread drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(26,26,26,.20); z-index: 60; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: 410px; max-width: 92vw; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-pop); z-index: 61; display: flex; flex-direction: column; animation: drawerIn .24s cubic-bezier(.2,.8,.2,1); }
@keyframes drawerIn { from { transform: translateX(24px); opacity: .5; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 13px; border-bottom: 1px solid var(--line); }
.drawer-x { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: grid; place-items: center; color: var(--ink-3); }
.drawer-x:hover { background: var(--surface-3); color: var(--ink); }
.drawer-head-actions { display: flex; align-items: center; gap: 8px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-title { font-family: var(--hero); font-weight: 400; font-size: 19px; margin: 0 0 12px; line-height: 1.3; letter-spacing: -0.01em; }
.drawer-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.thread { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.thread-empty { color: var(--ink-3); font-size: 13px; padding: 16px 0; line-height: 1.5; }
.drawer-composer { border-top: 1px solid var(--line); padding: 12px 16px 14px; background: var(--surface-2); }
.drawer-composer .composer-box textarea { max-height: 120px; }

@media (max-width: 1180px) {
  .tbl:not(.tbl-lead) .tbl-head, .tbl:not(.tbl-lead) .tr { grid-template-columns: 34px minmax(0, 1fr) 120px 120px 92px 44px; }
  .tbl:not(.tbl-lead) .td-dept, .tbl:not(.tbl-lead) .th:nth-child(4) { display: none; }
}

/* ---------- Leadership (private) board ---------- */
.lead-app { display: flex; flex-direction: column; height: 100%; background: var(--canvas); }
.lead-top { display: flex; align-items: center; gap: 14px; padding: 16px 30px; background: #0E2A4E; color: #fff; }
.lead-brand-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.lead-title h1 { margin: 0; font-family: var(--hero); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; color: #fff; line-height: 1; }
.lead-sub { display: flex; align-items: center; gap: 9px; margin-top: 5px; font-size: 12px; color: #9FB8D6; font-family: var(--mono); }
.lead-private-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(255,255,255,.14); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; }
.lead-top .avatar-stack .avatar { box-shadow: 0 0 0 2px #0E2A4E; }
.lead-exit { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: rgba(255,255,255,.12); color: #fff; border: none; text-decoration: none; transition: background .12s; }
.lead-exit:hover { background: rgba(255,255,255,.22); }

.lead-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 24px 30px 80px; max-width: 1180px; width: 100%; margin: 0 auto; }
.lead-cat { border: 1px solid var(--line); background: var(--surface-2); border-radius: 20px; padding: 7px 11px; font-size: 12.5px; color: var(--ink-2); }
.lead-foot { margin-top: 22px; font-size: 11.5px; color: var(--ink-4); line-height: 1.5; max-width: 620px; }

/* ---- Leadership quick-add (From / For) ---- */
.quickadd.col { flex-direction: column; align-items: stretch; gap: 11px; }
.quickadd.col .qa-title { padding: 4px 2px; }
.quickadd.col .qa-controls { flex-wrap: wrap; }
.qa-lbl { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-right: 1px; }
.qa-sep { width: 1px; height: 20px; background: var(--line-strong); margin: 0 4px; }
.qa-meta-btn.ghost { color: var(--ink-3); }
.quickadd.col .qa-add { margin-left: auto; }

/* ---- Leadership table: For (assignees) + From (requester) ---- */
.tbl-lead .tbl-head, .tbl-lead .tr {
  grid-template-columns: 34px minmax(0, 1fr) 118px 110px 122px 96px 84px 46px;
}
.for-stack { display: flex; }
.for-stack .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.for-stack .avatar:first-child { margin-left: 0; }
.tbl-body .tr:nth-of-type(even) .for-stack .avatar { box-shadow: 0 0 0 2px var(--surface-2); }
.td-from { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink-2); }
.td-from .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Completed folder ---- */
.completed-sec { margin-top: 18px; }
.completed-head { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; color: var(--ink-2); font-size: 13px; font-weight: 600; transition: background .12s; }
.completed-head:hover { background: var(--surface-3); }
.completed-head svg { transition: transform .15s; color: var(--ink-3); }
.completed-head.open svg { transform: rotate(180deg); }
.completed-head .ch-ct { font-family: var(--mono); font-size: 11px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-3); padding: 1px 8px; border-radius: 20px; }
.completed-head .ch-hint { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--ink-4); }
.completed-body { margin-top: 10px; }
.completed-body .tr { opacity: .72; }

/* ---- Drawer: For/From meta + edit panel ---- */
.drawer-meta .meta-bit.who { gap: 6px; }
.drawer-meta .mb-lbl { font-family: var(--mono); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); }
.drawer-meta .for-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.drawer-meta .mb-names { color: var(--ink-2); font-size: 12px; }
.thread-participants { display: flex; margin-left: auto; }
.thread-participants .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.thread-participants .avatar:first-child { margin-left: 0; }

.drawer-edit { display: flex; flex-direction: column; gap: 7px; }
.de-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-top: 8px; }
.de-input { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; color: var(--ink);
  background: var(--surface); outline: none; }
.de-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.de-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.de-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.de-save { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm); padding: 9px 15px; font-size: 13px; font-weight: 600; }
.de-save:hover { background: var(--accent-deep); }
.de-cancel { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px; font-weight: 500; }
.de-cancel:hover { color: var(--ink); }
.de-del { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--red-soft); color: var(--red);
  border-radius: var(--radius-sm); padding: 9px 13px; font-size: 12.5px; font-weight: 600; }
.de-del:hover { background: var(--red-soft); }
.de-del.yes { background: var(--red); color: #fff; border-color: var(--red); margin-left: 8px; }
.de-confirm { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); }

/* lock screen */
.lock-screen { height: 100%; display: grid; place-items: center; background: radial-gradient(120% 120% at 50% 0%, #14365E 0%, #0E2A4E 55%, #0A2038 100%); padding: 24px; }
.lock-card { background: var(--surface); border-radius: 18px; padding: 36px 34px 28px; width: 360px; max-width: 100%;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.lock-logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: 14px; }
.lock-lockicon { position: absolute; top: 58px; right: 130px; width: 30px; height: 30px; border-radius: 50%; background: var(--gm);
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.25); border: 2px solid var(--surface); }
.lock-card h1 { margin: 6px 0 6px; font-family: var(--hero); font-weight: 400; font-size: 23px; letter-spacing: -0.01em; }
.lock-card p { margin: 0 0 20px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* who-tiles (per-person sign-in) */
.who-tiles { display: flex; gap: 10px; width: 100%; margin-bottom: 16px; }
.who-tile { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px;
  border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 12px; color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  transition: border-color .12s, background .12s; }
.who-tile:hover { border-color: var(--line-strong); }
.who-tile.sel { border-color: var(--gm); background: var(--gm-soft); color: var(--gm); }
.hint-toggle { margin-top: 14px; background: none; border: none; color: var(--ink-3); font-size: 11.5px; text-decoration: underline; }
.hint-toggle:hover { color: var(--ink); }
.hint-box { margin-top: 10px; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; text-align: left; }
.hint-box b { color: var(--ink); }
.hint-note { font-family: var(--ui); font-size: 11px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

/* signed-in chip in header */
.signed-as { display: flex; align-items: center; gap: 9px; }
.signed-as .sa-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; }
.signed-as .sa-label { font-size: 10px; color: #9FB8D6; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.pin-input { width: 100%; text-align: center; font-family: var(--mono); font-size: 26px; letter-spacing: 0.5em;
  padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.pin-input:focus { border-color: var(--gm); box-shadow: 0 0 0 3px var(--gm-soft); }
.pin-input.err { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.pin-input.email { letter-spacing: 0; font-family: var(--ui); font-size: 15px; text-align: left; }
.login-note { margin-top: 16px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.due-input { border: 1px solid var(--line); background: var(--surface-2); border-radius: 20px; padding: 7px 12px; font-size: 12.5px; color: var(--ink-2); width: 130px; outline: none; }
.due-input:focus { border-color: var(--accent); }
.board-empty { text-align: center; padding: 56px 20px; }
.board-empty .be-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 16px; }
.board-empty .be-title { font-family: var(--hero); font-weight: 400; font-size: 20px; color: var(--ink); margin-bottom: 6px; }
.board-empty .be-sub { font-size: 13px; color: var(--ink-3); max-width: 380px; margin: 0 auto; line-height: 1.5; }

/* ---- ACG logo row ---- */
.acg-logos { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 22px; }
.acg-logos img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; background: #0E2A4E;
  box-shadow: 0 2px 10px rgba(10,28,55,.28); }
.acg-logos.sm { margin: 0; gap: 9px; }
.acg-logos.sm img { width: 38px; height: 38px; box-shadow: 0 1px 4px rgba(10,28,55,.2); }

/* ---- Launcher ---- */
.launcher { height: 100%; display: flex; flex-direction: column; background: var(--canvas); }
.launch-top { display: flex; align-items: center; gap: 14px; padding: 16px 30px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.launch-top .signed-as .sa-name { color: var(--ink); }
.launch-top .signed-as .sa-label { color: var(--ink-3); }
.launch-top .lead-exit { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.launch-top .lead-exit:hover { background: var(--surface-3); color: var(--ink); }
.launch-body { flex: 1; overflow-y: auto; padding: 48px 30px 60px; max-width: 1040px; width: 100%; margin: 0 auto; }
.launch-head { margin-bottom: 34px; }
.launch-head h1 { font-family: var(--hero); font-weight: 400; font-size: 38px; letter-spacing: -0.02em; margin: 8px 0 10px; }
.launch-head p { font-size: 14.5px; color: var(--ink-2); max-width: 480px; margin: 0; line-height: 1.55; }
.lead-quote { font-family: var(--hero); font-weight: 400; font-size: 17px; line-height: 1.5; color: var(--ink-2);
  max-width: 540px; margin: 0; font-style: italic; letter-spacing: -0.005em;
  transition: opacity .45s ease, transform .45s ease; min-height: 52px; }
.lead-quote.in { opacity: 1; transform: translateY(0); }
.lead-quote.out { opacity: 0; transform: translateY(6px); }

.app-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 920px) { .app-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .app-grid { grid-template-columns: 1fr; } }
.app-card {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px 16px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 11px; cursor: pointer; min-height: 184px;
  border-top: 3px solid var(--accent); transition: border-color .14s, box-shadow .16s, transform .12s;
}
.app-card:hover:not(.locked) { box-shadow: var(--shadow-pop); transform: translateY(-3px); }
.app-card.locked { cursor: default; opacity: 0.62; }
.app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.app-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.app-name { font-family: var(--hero); font-size: 21px; font-weight: 400; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.app-name svg { color: var(--ink-4); }
.app-desc { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin: 0; flex: 1; }
.app-foot { display: flex; align-items: center; }
.app-open { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.app-card:hover:not(.locked) .app-open svg { transform: translateX(3px); transition: transform .14s; }
.app-soon, .app-locked { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); display: flex; align-items: center; gap: 6px; }
.launch-note { margin-top: 30px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* back button on board */
.lead-back { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); transform: rotate(90deg); flex: none; }
.lead-back:hover { border-color: var(--line-strong); color: var(--ink); background: var(--surface-2); }

/* login card spacing tweak when using logo row */
.lock-card.acg { padding-top: 30px; }
.lock-card.acg h1 { font-family: var(--hero); font-weight: 400; letter-spacing: -0.01em; }
.pin-err { color: var(--red); font-size: 12px; margin-top: 8px; }
.pin-go { margin-top: 16px; width: 100%; background: #0E2A4E; color: #fff; border: none; border-radius: 11px; height: 44px;
  font-size: 14px; font-weight: 600; transition: filter .12s; }
.pin-go:hover { filter: brightness(1.15); }
.pin-go:disabled { background: var(--line-2); color: var(--ink-4); }
.lock-back { margin-top: 16px; font-size: 12px; color: var(--ink-3); text-decoration: none; }
.lock-back:hover { color: var(--ink); }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)} }
.lock-card.shake { animation: shake .5s; }

/* ============================================================
   Org Chart view
   ============================================================ */
.orgc-scroll { max-width: 1080px; }
.oc-office-toggle { display: flex; gap: 3px; background: rgba(255,255,255,.14); padding: 3px; border-radius: 20px; }
.oc-office { border: none; background: none; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 600;
  padding: 6px 14px; border-radius: 20px; font-family: var(--mono); letter-spacing: 0.04em; }
.oc-office.active { background: #fff; color: #0E2A4E; }

/* triangle logo cluster — NWDC on top, BDC + Lab below */
.oc-head-logos { display: flex; align-items: center; gap: 8px; flex: none; }
.oc-head-logos img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #0E2A4E; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.logo-tri { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.logo-tri img { border-radius: 50%; object-fit: cover; background: #0E2A4E; box-shadow: 0 3px 12px rgba(10,28,55,.25); }
.logo-tri .lt-top { width: 64px; height: 64px; }
.logo-tri .lt-row { display: flex; gap: 12px; }
.logo-tri .lt-row img { width: 54px; height: 54px; }

.oc-hero { display: flex; align-items: center; gap: 26px; padding: 8px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.oc-hero-text h2 { font-family: var(--hero); font-weight: 400; font-size: 27px; letter-spacing: -0.02em; margin: 6px 0 8px; }
.oc-hero-text p { font-size: 13.5px; color: var(--ink-2); max-width: 560px; margin: 0; line-height: 1.55; }

.oc-tier-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); text-align: center; margin: 22px 0 12px; }
.oc-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.oc-stem { width: 2px; height: 22px; background: var(--line-strong); margin: 0 auto; }
.oc-bus { height: 2px; background: var(--line-strong); margin: 0 auto 18px; max-width: 1000px; border-radius: 2px; }

.oc-person { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 18px; box-shadow: var(--shadow-card); min-width: 230px; }
.oc-person.own { border-top: 3px solid oklch(0.55 0.1 250); }
.oc-person.ops { border-top: 3px solid oklch(0.6 0.12 265); }
.ocp-name { font-weight: 600; font-size: 14px; }
.ocp-role { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }

.oc-dept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 920px) { .oc-dept-grid { grid-template-columns: repeat(2, 1fr); } }
.oc-dept { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 15px 13px; box-shadow: var(--shadow-card); border-top: 3px solid var(--dh);
  display: flex; flex-direction: column; gap: 11px; }
.ocd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ocd-name { font-family: var(--hero); font-size: 18px; font-weight: 400; letter-spacing: -0.01em; }
.ocd-tags { display: flex; gap: 5px; }
.ocd-flag { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; font-weight: 500; }
.ocd-flag.shared { background: var(--accent-soft); color: var(--accent-ink); }
.ocd-flag.remote { background: var(--gm-soft); color: var(--gm); }
.ocd-source { display: flex; align-items: center; gap: 9px; padding: 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.ocd-source.empty { color: var(--ink-4); font-size: 12px; font-family: var(--mono); justify-content: center; padding: 12px 8px; }
.ocd-src-name { font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.ocd-src-label { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dh); margin-top: 2px; }
.ocd-members { display: flex; flex-direction: column; gap: 7px; }
.ocd-member { display: flex; align-items: center; gap: 8px; line-height: 1.2; }
.ocdm-name { font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.oc-note { margin-top: 16px; font-size: 12px; color: var(--ink-3); font-style: italic; text-align: center; }
.oc-legend { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.ocl-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-3); }
.ocl-dot { width: 10px; height: 10px; border-radius: 50%; }
.ocl-dot.own { background: oklch(0.55 0.1 250); }
.ocl-dot.ops { background: oklch(0.6 0.12 265); }
.ocl-dot.src { background: oklch(0.6 0.12 168); }
.ocl-dot.mem { background: var(--ink-4); }
.ocl-flag-legend { font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-ink); }

@media (max-width: 680px) {
  .oc-hero { flex-direction: column; text-align: center; gap: 16px; }
  .oc-dept-grid { grid-template-columns: 1fr; }
  .oc-person { min-width: 0; width: 100%; }
}

/* ---------- ACG corporate tree ---------- */
.acg-grid { display: grid; gap: 14px; }
.acg-grid.practices { grid-template-columns: repeat(3, 1fr); }
.acg-grid.shared { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 920px) { .acg-grid.practices, .acg-grid.shared { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .acg-grid.practices, .acg-grid.shared { grid-template-columns: 1fr; } }

.acg-node {
  text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--nh); border-radius: var(--radius); padding: 15px 16px 13px;
  box-shadow: var(--shadow-card); cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .14s, box-shadow .14s, transform .12s;
}
.acg-node:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); border-color: var(--nh); }
.acg-node.open { box-shadow: 0 0 0 2px var(--nh); }
.acg-node-kind { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--nh); }
.acg-node-name { font-family: var(--hero); font-size: 19px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.15; }
.acg-node-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.acg-node-count { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.acg-node-open { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--nh); }

/* popup */
.oc-modal-scrim { position: fixed; inset: 0; background: rgba(26,26,26,.42); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 80; padding: 20px; animation: ocfade .18s ease; }
@keyframes ocfade { from { opacity: 0; } to { opacity: 1; } }
.oc-modal { width: min(440px, 96vw); max-height: 86vh; overflow: auto; background: var(--surface);
  border-radius: var(--radius); border-top: 4px solid var(--nh); box-shadow: var(--shadow-pop);
  animation: ocpop .22s cubic-bezier(.2,.8,.2,1); }
@keyframes ocpop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.oc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 18px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.oc-modal-kind { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--nh); }
.oc-modal-head h3 { margin: 4px 0 0; font-family: var(--hero); font-weight: 400; font-size: 21px; letter-spacing: -0.01em; }
.oc-modal-x { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; width: 30px; height: 30px;
  display: grid; place-items: center; color: var(--ink-2); flex: none; }
.oc-modal-x:hover { color: var(--ink); border-color: var(--line-strong); }
.oc-modal-body { padding: 8px 18px 16px; }
.oc-modal-group { margin-top: 12px; }
.oc-modal-glabel { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin: 4px 0 8px; }
.oc-modal-person { display: flex; align-items: center; gap: 11px; padding: 7px 0; }
.omp-name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.omp-role { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.oc-modal-jump { width: calc(100% - 36px); margin: 0 18px 18px; padding: 11px; border: none; border-radius: var(--radius-sm);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.oc-modal-jump:hover { background: #000; }

/* ============================================================
   Mobile (phones / narrow front-desk tablets)
   ============================================================ */
@media (max-width: 680px) {
  /* Login */
  .lock-screen { padding: 16px; }
  .lock-card { width: 100%; max-width: 100%; padding: 26px 20px; }
  .acg-logos { gap: 11px; margin-bottom: 18px; }
  .acg-logos img { width: 46px; height: 46px; }
  .lock-card.acg h1 { font-size: 24px; }
  .pin-input.email { font-size: 16px; }   /* 16px avoids iOS zoom-on-focus */

  /* Launcher */
  .launch-top { padding: 12px 16px; gap: 10px; }
  .launch-top .acg-logos.sm img { width: 32px; height: 32px; }
  .launch-top .signed-as .sa-label { display: none; }
  .launch-body { padding: 28px 16px 48px; }
  .launch-head { margin-bottom: 24px; }
  .launch-head .eyebrow { font-size: 9.5px; }
  .launch-head h1 { font-size: 28px; margin: 6px 0 8px; }
  .lead-quote { font-size: 15px; min-height: 64px; }
  .app-grid { gap: 13px; }
  .app-card { min-height: 0; padding: 17px 17px 15px; }
  .launch-note { margin-top: 22px; }

  /* Board header — let it wrap cleanly */
  .lead-top { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .lead-title h1 { font-size: 18px; }
  .lead-sub { font-size: 11px; }
  .lead-brand-logo { width: 34px; height: 34px; }
  .signed-as .sa-label { display: none; }
  .lead-scroll { padding: 16px 16px 64px; }

  /* Metrics: 3 across but compact */
  .lead-app .metrics { margin-bottom: 16px; }
  .lead-app .metric { padding: 12px 12px; }
  .lead-app .metric .m-val { font-size: 26px; }
  .lead-app .metric .m-sub { display: none; }

  /* Quick add: stack title over controls */
  .quickadd { flex-wrap: wrap; padding: 10px; gap: 8px; }
  .quickadd .qa-title { flex: 1 1 100%; padding: 6px 4px; font-size: 16px; }
  .quickadd .qa-controls { flex: 1 1 100%; flex-wrap: wrap; gap: 6px; }
  .quickadd .due-input { width: 100%; }
  .quickadd .qa-add { flex: 1 1 100%; justify-content: center; }

  /* Filters: horizontal scroll instead of wrap */
  .lead-app .filters { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; scrollbar-width: none; }
  .lead-app .filters::-webkit-scrollbar { display: none; }
  .lead-app .filters .chip { flex: none; }

  /* Sheet table: horizontal scroll, keep columns usable */
  .tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-head, .tr { grid-template-columns: 34px minmax(190px, 1fr) 116px 104px 84px 44px; min-width: 580px; }
  .tbl-lead .tbl-head, .tbl-lead .tr { grid-template-columns: 34px minmax(180px, 1fr) 104px 100px 110px 88px 78px 44px; min-width: 720px; }
  .tbl-head::before { display: none; }

  /* Drawer becomes a bottom sheet feel — full width */
  .drawer { width: 100%; max-width: 100%; }

  /* Footer copy breathing room */
  .lead-foot { margin-top: 18px; }
}

/* Fine-tune very small phones */
@media (max-width: 380px) {
  .acg-logos img { width: 42px; height: 42px; }
  .launch-head h1 { font-size: 25px; }
  .lead-app .metric .m-val { font-size: 22px; }
}
