/* ============================================================================
   Application layout & components
   ========================================================================== */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
a { color: hsl(200 90% 74%); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0 0 10px; }
::selection { background: hsl(200 90% 60% / 0.35); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); background-clip: content-box; }

.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 252px 1fr;
  gap: 14px;
  height: 100vh;
  padding: 14px;
}

/* ------------------------------------------------------------------ sidebar */

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, hsl(196 95% 58%), hsl(268 90% 62%));
  box-shadow: 0 6px 18px hsl(210 90% 50% / 0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}
.brand h1 { font-size: 14.5px; line-height: 1.2; }
.brand small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; letter-spacing: 0.03em; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px;
  color: var(--ink-2); cursor: pointer; border: 1px solid transparent;
  font-size: 13.5px; position: relative;
  transition: background 0.28s var(--ease-soft), color 0.28s var(--ease-soft), border-color 0.28s var(--ease-soft);
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.nav-item.active {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.nav-item.active::before {
  content: ''; position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 9px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nav-item .count.alert { color: var(--crit); font-weight: 650; }

.sidebar-foot { padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 8px; display: grid; gap: 8px; }
.who { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.02em; color: #06121f;
  background: linear-gradient(150deg, hsl(var(--h, 200) 90% 72%), hsl(var(--h, 200) 90% 54%));
}
.sync-chip { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.sync-chip .dot { background: var(--ink-3); }
.sync-chip[data-state="idle"] .dot { background: var(--ok); }
.sync-chip[data-state="busy"] .dot { background: var(--warn); animation: pulse 1s infinite; }
.sync-chip[data-state="error"] .dot { background: var(--crit); }
@keyframes pulse { 50% { opacity: 0.25; } }

/* --------------------------------------------------------------------- main */

.main { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex: none;
}
.topbar h2 { font-size: 19px; }
.topbar .sub { font-size: 12.5px; color: var(--ink-3); }
.spacer { flex: 1; }
.search { position: relative; width: 240px; }
.search .field { padding-left: 32px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); }

.view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 18px 20px 40px; }
.view.enter > * { animation: rise 0.42s var(--ease) both; }
/* Long tables skip layout for off-screen rows. */
.tbl { content-visibility: auto; contain-intrinsic-size: auto 600px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.section-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; }
.section-head:first-child { margin-top: 0; }
.section-head h3 { font-size: 14px; letter-spacing: 0.01em; }
.section-head .hint { font-size: 12px; color: var(--ink-3); }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-variant-numeric: tabular-nums; font-family: 'SF Mono', ui-monospace, monospace; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13.5px; }

.card { padding: 16px 18px; }
.card h4 { font-size: 13px; color: var(--ink-2); font-weight: 550; letter-spacing: 0.02em; }

/* -------------------------------------------------------------------- stats */

.stat { padding: 15px 17px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-3); font-weight: 600; }
.stat .v { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 5px; line-height: 1; }
.stat .d { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.stat.crit .v { color: var(--crit); }
.stat.warn .v { color: var(--warn); }
.stat.ok .v { color: var(--ok); }

/* -------------------------------------------------------------------- table */

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-3); font-weight: 650; padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1); position: sticky; top: 0;
  background: rgba(14, 20, 36, 0.72); backdrop-filter: blur(12px); z-index: 2;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.055); vertical-align: top; }
.tbl tbody tr { transition: background 0.2s var(--ease-soft); cursor: pointer; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.05); }
.tbl .ttitle { font-weight: 520; }
.tbl td.nowrap { white-space: nowrap; }

.sev { --h: 200; }
.sev.p0 { --h: 354; }
.sev.p1 { --h: 26; }
.sev.p2 { --h: 200; }
.sev.p3 { --h: 262; }

.st { --h: 200; }
.st.open { --h: 354; }
.st.ack, .st.progress { --h: 38; }
.st.fixed { --h: 196; }
.st.verified { --h: 150; }
.st.deferred, .st.rejected { --h: 250; }

/* -------------------------------------------------------------------- modal */

.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 7, 14, 0.55);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  display: grid; place-items: center; padding: 24px;
  animation: fade 0.28s var(--ease-soft) both;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(680px, 100%); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column; --glass-tint: 0.1; --glass-blur: 30px;
  animation: pop 0.42s var(--ease) both;
}
.modal.wide { width: min(940px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.09); flex: none; }
.modal-head h3 { font-size: 15.5px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; display: grid; gap: 13px; }
.modal-foot { padding: 13px 18px; border-top: 1px solid rgba(255,255,255,0.09); display: flex; gap: 9px; justify-content: flex-end; flex: none; }

label.lbl { display: grid; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 10px 18px; font-size: 13px; --glass-tint: 0.12; --glass-blur: 24px; animation: toastIn 0.4s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.94); } }

/* --------------------------------------------------------------- comms/feed */

.feed { display: grid; gap: 9px; }
.feed-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 9px 11px; border-radius: 13px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); }
.feed-item .when { font-size: 11px; color: var(--ink-3); }
.feed-item .txt { font-size: 12.8px; line-height: 1.45; }

.comm { padding: 13px 15px; }
.comm .subj { font-size: 13.5px; font-weight: 560; }
.comm .who2 { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.comm .sum { font-size: 12.5px; color: var(--ink-2); margin-top: 7px; line-height: 1.5; }

.chan { --h: 200; }
.chan.email { --h: 210; }
.chan.slack { --h: 300; }
.chan.meeting { --h: 150; }
.chan.drive { --h: 45; }

/* ------------------------------------------------------------------ misc ui */

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); width: fit-content; }
.tab { padding: 6px 14px; border-radius: 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-3); transition: all 0.28s var(--ease); }
.tab:hover { color: var(--ink); }
.tab.on { background: rgba(255,255,255,0.13); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,0.24); }

.kv { display: grid; grid-template-columns: 108px 1fr; gap: 6px 12px; font-size: 12.5px; align-items: baseline; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

.bignote { padding: 14px 16px; border-radius: 15px; background: hsl(38 95% 60% / 0.1); border: 1px solid hsl(38 95% 66% / 0.28); font-size: 12.8px; line-height: 1.55; }
.bignote.crit { background: hsl(354 85% 60% / 0.1); border-color: hsl(354 85% 66% / 0.3); }
.bignote strong { color: var(--ink); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 8px; }
  .sidebar { position: fixed; left: 8px; top: 8px; bottom: 8px; width: 250px; z-index: 50; transform: translateX(-115%); transition: transform 0.42s var(--ease); }
  .sidebar.open { transform: none; }
  .search { width: 150px; }
}
.menu-btn { display: none; }
@media (max-width: 900px) { .menu-btn { display: inline-flex; } }

/* ============================================================================
   Rebuilt views — overview cards, checklist, chat, process
   ========================================================================== */

/* ------------------------------------------------------------ sidebar titles */
.titles { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; margin: 0 -4px; padding-inline: 4px; max-height: 40vh; overflow-y: auto; }
.tlink {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px;
  color: var(--ink-2); font-size: 12.5px; text-decoration: none; border: 1px solid transparent;
  transition: background .25s var(--ease-soft);
}
.tlink:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.tlink.on { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.16); color: var(--ink); }
.tlink i { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ok); }
.tlink[data-h="warn"] i { background: var(--warn); }
.tlink[data-h="critical"] i { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.tlink span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlink em { font-style: normal; font-size: 10.5px; color: var(--ink-3); }

/* -------------------------------------------------------------------- alerts */
.alert {
  padding: 13px 16px; border-radius: 14px; font-size: 12.8px; line-height: 1.55; margin-bottom: 14px;
  background: hsl(354 85% 60% / 0.1); border: 1px solid hsl(354 85% 66% / 0.3); cursor: pointer;
}
.alert.warn { background: hsl(38 95% 60% / 0.1); border-color: hsl(38 95% 66% / 0.28); }
.alert.info { background: hsl(205 90% 60% / 0.09); border-color: hsl(205 90% 66% / 0.24); cursor: default; }
.alert.ok { background: hsl(150 70% 50% / 0.1); border-color: hsl(150 70% 56% / 0.28); cursor: default; }
.alert strong { color: var(--ink); }

/* ------------------------------------------------------------ project cards */
.cards { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.pcard { padding: 15px 16px 14px; display: flex; flex-direction: column; gap: 11px; cursor: pointer; }
.pcard header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pcard h3 { font-size: 16px; letter-spacing: -0.02em; }
.pcard .act {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 11px; border-radius: 12px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.08);
}
.pcard .act-label { font-size: 12.8px; line-height: 1.4; color: var(--ink); }
.pcard footer { display: flex; gap: 7px; }
.pcard[data-h="critical"] { border-color: hsl(354 85% 64% / .42); }
.pcard[data-h="critical"] .act { background: hsl(354 85% 60% / .1); border-color: hsl(354 85% 66% / .26); }
.pcard[data-h="warn"] { border-color: hsl(38 95% 60% / .3); }
.pcard[data-h="done"] { opacity: .62; }

/* stage rail — six segments, the whole status in 120px */
.rail { display: flex; gap: 3px; }
.rail i { flex: 1; height: 4px; border-radius: 9px; background: rgba(255,255,255,.1); }
.rail i.done { background: hsl(150 60% 46% / .65); }
.rail i.now { background: linear-gradient(90deg, hsl(196 95% 60%), hsl(268 88% 66%)); box-shadow: 0 0 10px hsl(200 90% 55% / .5); }

/* ---------------------------------------------------------- project header */
.phead { display: flex; align-items: flex-start; gap: 16px; padding: 16px 18px; margin-bottom: 12px; }
.ptitle { font-size: 22px; letter-spacing: -0.025em; }
.pnext { display: flex; align-items: center; gap: 9px; margin-top: 9px; font-size: 13px; }
.pnext[data-h="critical"] span:last-child { color: hsl(354 85% 76%); }
.pnext[data-h="warn"] span:last-child { color: hsl(38 95% 74%); }
.pstage { display: flex; flex-direction: column; gap: 7px; min-width: 170px; }
.field.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 9px; }

/* progress strip */
.progress { display: flex; gap: 1px; padding: 3px; overflow: hidden; }
.progress .seg {
  flex: var(--w, 0) 1 auto; min-width: 62px; padding: 9px 10px; border-radius: 12px;
  background: hsl(var(--h) 70% 50% / .14); border: 1px solid hsl(var(--h) 70% 60% / .2);
  display: flex; flex-direction: column; gap: 1px;
}
.progress .seg b { font-size: 16px; font-weight: 620; color: hsl(var(--h) 80% 78%); line-height: 1; }
.progress .seg span { font-size: 10px; color: var(--ink-3); letter-spacing: .02em; }
.progress .seg.total { flex: 0 0 auto; background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.09); margin-left: auto; }
.progress .seg.total b { color: var(--ink); }

/* ---------------------------------------------------------------- checklist */
.tabs.sm .tab { padding: 4px 11px; font-size: 12px; }
.tbl.cl td { padding: 7px 12px; vertical-align: middle; }
.tbl.cl .fname { font-family: 'SF Mono', ui-monospace, monospace; font-size: 12.5px; }
.tbl.cl tr.is-rework td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.tag { display: inline-block; font-size: 9.5px; padding: 1px 6px; border-radius: 6px; margin-left: 6px; letter-spacing: .03em; }
.tag.add { background: hsl(38 95% 60% / .16); color: hsl(38 95% 76%); border: 1px solid hsl(38 95% 60% / .28); }
.tag.iss { background: hsl(354 85% 60% / .16); color: hsl(354 85% 78%); border: 1px solid hsl(354 85% 60% / .3); }
.rowstate {
  appearance: none; padding: 4px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 550; cursor: pointer;
  background: hsl(var(--h) 75% 55% / .17); border: 1px solid hsl(var(--h) 75% 62% / .34);
  color: hsl(var(--h) 85% 82%); outline: none;
}
.rowstate option { background: #10182b; color: var(--ink); }

/* --------------------------------------------------------------------- chat */
.chatpane { padding: 14px; }
.thread { max-height: calc(100vh - 330px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.msg { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.msg-head { display: flex; align-items: baseline; gap: 7px; }
.msg-head strong { font-size: 12.5px; }
.msg-text { font-size: 13.2px; line-height: 1.55; margin-top: 2px; }
.msg-linked { font-size: 11px; color: hsl(150 70% 66%); margin-top: 4px; }
.tag-obj, .tag-team {
  font-weight: 600; padding: 1px 5px; border-radius: 6px;
  background: hsl(var(--h) 80% 55% / .18); color: hsl(var(--h) 85% 78%);
}
.tag-person { font-weight: 600; color: hsl(200 90% 78%); }

.composer { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 9px; }
.composer .row { flex-wrap: nowrap; align-items: flex-end; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.chip {
  padding: 3px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 550; cursor: pointer;
  background: hsl(var(--h) 80% 55% / .14); border: 1px solid hsl(var(--h) 80% 60% / .28);
  color: hsl(var(--h) 85% 80%); transition: transform .2s var(--ease);
}
.chip:hover { background: hsl(var(--h) 80% 55% / .24); }
.chip:active { transform: scale(.94); }
.chipsep { width: 1px; height: 16px; background: rgba(255,255,255,.14); margin: 0 4px; }

/* ------------------------------------------------------------------ process */
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stage { position: relative; padding: 15px 15px 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stage .n { font-size: 10px; font-weight: 700; color: var(--ink-3); letter-spacing: .09em; }
.stage h3 { font-size: 15px; }
.stage.gate { border-color: hsl(38 95% 66% / .45); background: rgba(255,220,150,.06); }
.gatetag {
  position: absolute; top: -8px; right: 10px; font-size: 9px; font-weight: 750; letter-spacing: .1em;
  padding: 2px 8px; border-radius: 99px; color: #23140a;
  background: linear-gradient(180deg, hsl(40 95% 62%), hsl(30 92% 52%));
}
.live { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.chip-live {
  font-size: 10.5px; padding: 2px 7px; border-radius: 7px; text-decoration: none; color: var(--ink-2);
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.13);
}
.chip-live:hover { text-decoration: none; background: rgba(255,255,255,.16); }

.states { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stateblock { padding: 13px 14px; display: flex; flex-direction: column; gap: 5px; border-color: hsl(var(--h) 70% 60% / .26); }
.stateblock .n { font-size: 11px; font-weight: 750; color: hsl(var(--h) 85% 74%); }
.stateblock h4 { font-size: 13px; color: var(--ink); }
.stateblock.rework { border-style: dashed; }

/* ------------------------------------------------------------------- misc */
.minitile { padding: 9px 13px; display: flex; align-items: center; gap: 9px; border-radius: 13px; cursor: pointer; }
.minitile b { font-size: 17px; font-weight: 620; }
.minitile .late { font-style: normal; font-size: 11px; color: var(--crit); font-weight: 600; }

.feed { display: grid; gap: 9px; }
.feed-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.feed-item .when { font-size: 11px; color: var(--ink-3); }
.feed-item .txt { font-size: 12.8px; line-height: 1.45; }

.linkrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 11px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); font-size: 12.5px; }
.linkrow svg { width: 15px; height: 15px; flex: none; opacity: .75; }
.linkrow input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink-2); font-size: 12.5px; min-width: 0; }

.kv { display: grid; grid-template-columns: 108px 1fr; gap: 6px 12px; font-size: 12.5px; align-items: baseline; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); width: fit-content; }
.tab { padding: 6px 14px; border-radius: 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-3); transition: all .28s var(--ease); }
.tab:hover { color: var(--ink); }
.tab.on { background: rgba(255,255,255,.13); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.24); }

label.lbl { display: grid; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 10px 18px; font-size: 13px; --glass-tint: .12; --glass-blur: 24px; animation: toastIn .4s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.94); } }

.menu-btn { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; padding: 8px; }
  .sidebar { position: fixed; left: 8px; top: 8px; bottom: 8px; width: 250px; z-index: 50; transform: translateX(-115%); transition: transform .42s var(--ease); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .phead { flex-wrap: wrap; }
}

/* ============================================================================
   At a glance — the screen the app exists for
   ========================================================================== */

.glances { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 13px; }

.glance { padding: 15px 16px 13px; display: flex; flex-direction: column; gap: 11px; }
.glance header { display: flex; align-items: center; gap: 8px; }
.gtitle { font-size: 16.5px; font-weight: 620; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.gtitle:hover { text-decoration: none; color: hsl(200 92% 78%); }
.gtitle.sm { font-size: 13.5px; }
.badge { font-size: 9.5px; font-weight: 650; padding: 2px 6px; border-radius: 6px; letter-spacing: .03em; }
.badge.ok { background: hsl(150 70% 50% / .16); color: hsl(150 70% 74%); border: 1px solid hsl(150 70% 50% / .3); }
.badge.warn { background: hsl(38 95% 60% / .16); color: hsl(38 95% 76%); border: 1px solid hsl(38 95% 60% / .3); }

/* stage stepper — six ticks, current one named */
.stepper { display: flex; align-items: center; gap: 4px; position: relative; padding-bottom: 14px; }
.step { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.step i { display: block; height: 4px; border-radius: 9px; background: rgba(255,255,255,.11); transition: background .4s var(--ease); }
.step.done i { background: hsl(150 60% 46% / .6); }
.step.now i { background: linear-gradient(90deg, hsl(196 95% 62%), hsl(268 88% 68%)); box-shadow: 0 0 10px hsl(200 90% 55% / .5); }
.step.gate i { border: 1px dashed hsl(38 95% 62% / .55); height: 4px; box-sizing: content-box; }
.step.gate.done i { border-style: solid; border-color: hsl(150 60% 50% / .5); }
/* The current stage name sits under its tick and must never truncate — it is
   the one word that says where the title actually is. */
.step em {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-style: normal; font-size: 9.5px; font-weight: 650; letter-spacing: .04em;
  color: hsl(200 92% 80%); text-transform: uppercase; white-space: nowrap;
}
.step:first-child em { left: 0; transform: none; }
.step:last-child em { left: auto; right: 0; transform: none; }

/* the hero: whose court + what to do, and it is a link to the work */
.action {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 13px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  text-decoration: none; transition: background .28s var(--ease), border-color .28s var(--ease), transform .28s var(--ease);
}
.action:hover { text-decoration: none; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.action:active { transform: scale(.99); }
.action .who {
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 7px;
  background: hsl(var(--h) 80% 55% / .2); color: hsl(var(--h) 88% 82%); border: 1px solid hsl(var(--h) 80% 62% / .34);
}
.action .what { flex: 1; font-size: 13px; line-height: 1.35; color: var(--ink); }
.action .arrow { color: var(--ink-3); font-size: 14px; transition: transform .28s var(--ease); }
.action:hover .arrow { transform: translateX(3px); color: var(--ink); }

.glance[data-h="critical"] { border-color: hsl(354 85% 64% / .45); }
.glance[data-h="critical"] .action { background: hsl(354 85% 60% / .12); border-color: hsl(354 85% 66% / .3); }
.glance[data-h="warn"] { border-color: hsl(38 95% 60% / .3); }
.glance[data-h="warn"] .action { background: hsl(38 95% 58% / .1); border-color: hsl(38 95% 64% / .24); }
.glance[data-h="done"] { opacity: .6; }

/* checklist bar — the substance of the project in one strip */
.clbar { display: flex; gap: 2px; height: 7px; border-radius: 9px; overflow: hidden; }
.clbar i { display: block; background: hsl(var(--h) 68% 52%); border-radius: 2px; min-width: 2px; }
.clbar.empty-bar { height: auto; background: none; }

.statline { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.statline b { color: var(--ink); font-weight: 640; }
.statline .sep { opacity: .45; }
.critq { color: hsl(354 88% 76%); font-weight: 600; }
.warnq { color: hsl(38 95% 74%); font-weight: 600; }
.addq { color: hsl(196 90% 76%); font-weight: 600; }

.glance footer { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); padding-top: 2px; }

/* table density */
.glancetbl td { vertical-align: middle; }
.glancetbl tbody tr { cursor: default; }
.glancetbl tr[data-h="critical"] td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
.glancetbl tr[data-h="warn"] td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.what-link { font-size: 12.5px; color: var(--ink); text-decoration: none; }
.what-link:hover { text-decoration: none; color: hsl(200 92% 80%); }
.glancetbl .stepper { padding-bottom: 13px; }

@media (max-width: 640px) { .glances { grid-template-columns: 1fr; } }
