/* 보이는 사무실 — 픽셀/게임풍 스타일 (시스템 폰트, 외부 리소스 없음) */
:root {
  --bg: #14162b;
  --panel: #1f2340;
  --panel2: #272c52;
  --ink: #f2f4ff;
  --muted: #a9b0d6;
  --line: #0b0c18;
  --accent: #ffd34e;
  --c-typing: #4aa3ff;
  --c-papers: #f2c94c;
  --c-rejected: #ff6b6b;
  --c-corridor: #ff9f4a;
  --c-external: #b48cff;
  --c-active: #5fd68f;
  --c-done: #a3adba;
  --s0: #6aa9ff; --s1: #ffd166; --s2: #c49bff; --s3: #ff9f6b; --s4: #5fd68f; --s5: #9fb0c0;
  --px: 3px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "D2Coding", monospace;
  --tabh: 60px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 12px 12px;
  padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 16px);
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
small { color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.px { box-shadow: 0 0 0 var(--px) var(--line); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; background: #101226; border-bottom: var(--px) solid var(--line); box-shadow: 0 3px 0 #2d3366;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.brand-text { min-width: 0; }
.brand h1 { font-size: 18px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 좁은 화면: 기준일을 다음 줄로 */
@media (max-width: 479px) {
  .brand .sub .sep { display: none; }
  .brand .sub .sub-date { display: block; }
  .brand .sub > span { overflow: hidden; text-overflow: ellipsis; }
}
.logo {
  flex: none; width: 30px; height: 30px; image-rendering: pixelated;
  background:
    linear-gradient(var(--accent), var(--accent)) 6px 6px / 18px 6px no-repeat,
    linear-gradient(#6aa9ff, #6aa9ff) 6px 15px / 8px 9px no-repeat,
    linear-gradient(#5fd68f, #5fd68f) 16px 15px / 8px 9px no-repeat,
    #2b3060;
  box-shadow: 0 0 0 3px var(--line);
}
.demo-badge {
  flex: none; background: var(--accent); color: #1a1400; font-weight: 800; font-size: 12px; padding: 5px 8px;
  box-shadow: 0 0 0 2px var(--line), 3px 3px 0 var(--line); white-space: nowrap;
}

/* ---------- tabs: 모바일 하단 / 데스크톱 상단 ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #101226; border-top: var(--px) solid var(--line);
  box-shadow: 0 -3px 0 #2d3366; padding-bottom: env(safe-area-inset-bottom);
}
[role="tablist"] { display: grid; grid-template-columns: repeat(8, 1fr); max-width: 1280px; margin: 0 auto; }
[role="tab"] {
  background: none; border: 0; height: var(--tabh); padding: 4px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); min-width: 0;
}
.ticon { font-size: 15px; line-height: 1; }
.tlabel { font-size: 11px; white-space: nowrap; letter-spacing: -.04em; }
[role="tab"][aria-selected="true"] { color: var(--ink); background: var(--panel2); box-shadow: inset 0 -4px 0 var(--accent); }
[role="tab"][aria-selected="true"] .ticon { color: var(--accent); }

main { max-width: 1280px; margin: 0 auto; padding: 14px 12px; }
.view-head { margin: 4px 0 12px; }
.view-head h2 { font-size: 20px; }
.view-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: 8px; vertical-align: 2px; box-shadow: 2px 2px 0 var(--line); }
.view-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- common blocks ---------- */
.card, .panel {
  background: var(--panel); padding: 14px; margin: 0 0 14px; box-shadow: 0 0 0 var(--px) var(--line), 5px 5px 0 var(--line);
}
.card h3, .panel h3 { font-size: 15px; margin-bottom: 10px; }
.card h3 small { font-size: 12px; margin-left: 4px; }
.grid2 { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--panel2); padding: 8px 6px; text-align: center; box-shadow: 0 0 0 2px var(--line), 3px 3px 0 var(--line); }
.kpi b { display: block; font-family: var(--mono); font-size: 22px; line-height: 1.1; }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi.warn b { color: var(--c-papers); }
.kpi.danger b { color: var(--c-rejected); }
.btn {
  background: var(--panel2); border: 0; padding: 8px 14px; min-height: 44px; box-shadow: 0 0 0 2px var(--line), 3px 3px 0 var(--line); font-weight: 700;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 2px var(--line), 1px 1px 0 var(--line); }
.btn.on { background: var(--accent); color: #1a1400; }
.btn.primary { background: var(--accent); color: #1a1400; }
.empty { color: var(--muted); font-size: 12px; padding: 4px; }

.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 6px; color: #10121f; box-shadow: 0 0 0 2px var(--line); white-space: nowrap; }
.badge.st-typing { background: var(--c-typing); } .badge.st-papers { background: var(--c-papers); }
.badge.st-rejected { background: var(--c-rejected); } .badge.st-corridor { background: var(--c-corridor); }
.badge.st-external { background: var(--c-external); } .badge.st-active { background: var(--c-active); }
.badge.st-done { background: var(--c-done); }
.pill { display: inline-block; font-size: 12px; padding: 1px 7px; background: var(--panel2); box-shadow: 0 0 0 2px var(--line); white-space: nowrap; }
.pill-red, .risk-pill-high { background: #5a1f2b; color: #ffd0d0; }
.risk-pill-mid { background: #4f4214; color: #ffeaa6; }
.risk-pill-low { background: #1f4a33; color: #c8f7da; }
.risk-pill-none { background: #3a3f4a; }
.days { font-family: var(--mono); font-size: 13px; }
.days.hot { color: var(--c-rejected); }
.warn { color: var(--c-corridor); font-weight: 700; }
.ok { color: var(--c-active); }

/* ---------- office floor ---------- */
.floor {
  display: grid; gap: 10px; padding: 10px; background: #2a2440;
  box-shadow: 0 0 0 var(--px) var(--line), 6px 6px 0 var(--line);
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "ext" "r0" "r1" "r2" "cor" "r3" "r4" "arc";
  background-image: linear-gradient(45deg, rgba(0,0,0,.18) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.18) 75%), linear-gradient(45deg, rgba(0,0,0,.18) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.18) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.room {
  position: relative; background: #3b4a6b; min-width: 0;
  box-shadow: 0 0 0 var(--px) var(--line), inset 0 6px 0 #56688f;
  background-image: linear-gradient(rgba(0,0,0,.12) 2px, transparent 2px), linear-gradient(90deg, rgba(0,0,0,.12) 2px, transparent 2px);
  background-size: 18px 18px;
}
.room-sign { display: flex; padding: 8px 8px 0; }
.room-sign span {
  background: #f5e6c4; color: #3a2a12; font-weight: 800; font-size: 13px; padding: 2px 8px; box-shadow: 0 0 0 2px var(--line), 3px 3px 0 rgba(0,0,0,.4);
}
.room-floor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; }
.team { background: rgba(0,0,0,.18); padding: 6px; min-width: 0; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.team-label { font-size: 12px; font-weight: 700; color: #dfe6ff; margin-bottom: 4px; }
.desk-area { display: flex; align-items: flex-end; gap: 6px; min-height: 40px; }
.desks { display: flex; gap: 3px; flex-wrap: wrap; }
.desk {
  position: relative; width: 22px; height: 14px; margin-top: 14px; background: #a0703f;
  box-shadow: 0 0 0 2px var(--line), inset 0 3px 0 #c8925a;
}
.monitor { position: absolute; left: 5px; top: -11px; width: 12px; height: 9px; background: #1d2a44; box-shadow: 0 0 0 2px var(--line), inset 0 0 0 2px #2c3d63; }
.monitor::after { content: ""; position: absolute; left: 3px; top: 2px; width: 6px; height: 2px; background: #7cf5c2; animation: blink 1.6s steps(2) infinite; }
.stack {
  position: relative; margin-left: auto; background: none; border: 0; padding: 0 2px; display: flex; flex-direction: column; align-items: center;
  min-width: 44px; min-height: 44px; justify-content: flex-end;
}
.sheets { display: flex; flex-direction: column-reverse; align-items: center; }
.sheets i { display: block; width: 26px; height: 5px; background: #fffbe8; box-shadow: 0 0 0 1px #6b5a2a; margin-top: 1px; }
.sheets i:nth-child(even) { transform: translateX(2px); }
.sheets i:nth-child(3n) { transform: translateX(-2px); }
.stack-count { margin-top: 3px; font-size: 10px; font-weight: 800; background: var(--c-papers); color: #241a00; padding: 0 4px; box-shadow: 0 0 0 2px var(--line); white-space: nowrap; }
.folders { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; min-height: 8px; }

.folder {
  position: relative; background: none; border: 0; padding: 12px 2px 0; width: 44px; min-height: 52px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.fbody { display: block; width: 30px; height: 28px; }
.sprite { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.ftag { font-family: var(--mono); font-size: 10px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); padding: 0 3px; margin-top: 1px; white-space: nowrap; }
.folder.risk-high .fbody { filter: drop-shadow(0 0 0 #ff4d4d) drop-shadow(2px 0 0 #ff4d4d) drop-shadow(-2px 0 0 #ff4d4d) drop-shadow(0 2px 0 #ff4d4d); }
.folder:hover .fbody, .folder:focus-visible .fbody { transform: translateY(-3px); }
.folder.st-typing .fbody { animation: type-bob .5s steps(2) infinite; }
.folder.st-active .fbody { animation: walk 2.4s steps(6) infinite alternate; }
.folder.st-corridor .fbody { animation: wait-sway 1.8s steps(2) infinite; }
.folder.st-external .fbody { animation: wait-sway 2.2s steps(2) infinite; }
.bubble {
  position: absolute; top: -4px; left: 50%; transform: translateX(-30%); background: var(--c-rejected); color: #10121f; font-size: 10px; font-weight: 800;
  padding: 1px 4px; white-space: nowrap; box-shadow: 0 0 0 2px var(--line); animation: pop 1.2s steps(2) infinite; z-index: 1;
}
.bubble::after { content: ""; position: absolute; left: 4px; bottom: -6px; border: 3px solid transparent; border-top-color: var(--c-rejected); }
.typing-dots { position: absolute; top: 0; right: 2px; display: flex; gap: 2px; }
.typing-dots i { width: 4px; height: 4px; background: var(--c-typing); box-shadow: 0 0 0 1px var(--line); animation: dots 1s steps(1) infinite; }
.typing-dots i:nth-child(2) { animation-delay: .2s; } .typing-dots i:nth-child(3) { animation-delay: .4s; }

.corridor {
  background: #6b6152; min-width: 0; box-shadow: 0 0 0 var(--px) var(--line);
  background-image: repeating-linear-gradient(90deg, #756a59 0 20px, #635a4c 20px 40px);
}
.cor-title { padding: 8px 10px 0; font-weight: 800; font-size: 14px; }
.cor-title small { display: block; font-size: 11px; color: #e8dcc8; }
.lanes { display: grid; gap: 8px; padding: 8px; grid-template-columns: minmax(0, 1fr); }
.lane { background: rgba(0,0,0,.2); padding: 6px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.3); }
.lane.hot { box-shadow: inset 0 0 0 2px var(--c-corridor); background: rgba(255,120,40,.12); }
.lane-sign { font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lane-sign small { color: #f1e6d5; margin-left: auto; }
.warn-tag { background: var(--c-rejected); color: #10121f; font-weight: 800; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 2px var(--line); animation: pop 1.4s steps(2) infinite; }
.lane-q { display: flex; flex-wrap: wrap; gap: 2px; }

.ext {
  min-width: 0; background: #3a2c55; box-shadow: 0 0 0 var(--px) var(--line); position: relative;
  background-image: repeating-linear-gradient(0deg, transparent 0 22px, rgba(0,0,0,.18) 22px 24px);
}
.ext-sign { padding: 8px 10px; font-weight: 800; background: #5a3f8a; box-shadow: 0 3px 0 var(--line); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ext-sign small { color: #e3d4ff; font-size: 11px; }
.ext-q { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
.ext-slot { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.2); padding: 2px 4px 4px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.3); }
.ext-org { font-size: 10px; color: #e3d4ff; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; overflow-wrap: anywhere; }
.ext-slot.multi { box-shadow: inset 0 0 0 2px var(--c-corridor); }
.multi-tag { font-style: normal; font-weight: 800; color: #ffc08a; }
.ext-counter { height: 10px; margin: 0 8px 8px; background: #8a6a3d; box-shadow: 0 0 0 2px var(--line), inset 0 3px 0 #b48a52; }

.archive { background-color: #3d3b46; }
.cabinet { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; padding: 10px; }
.drawer { width: 40px; height: 34px; background: #7d8794; box-shadow: 0 0 0 2px var(--line), inset 0 0 0 3px #959fac; position: relative; }
.drawer::after { content: ""; position: absolute; left: 14px; top: 14px; width: 12px; height: 4px; background: #2b2f38; }

.legend { margin-top: 18px; background: var(--panel); padding: 12px; box-shadow: 0 0 0 var(--px) var(--line), 5px 5px 0 var(--line); }
.legend h3 { font-size: 14px; margin-bottom: 8px; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.legend li { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.legend small { font-size: 11px; }
.lg { flex: none; width: 24px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.lg-stack { flex-direction: column-reverse; }
.lg-stack i { display: block; width: 18px; height: 4px; background: #fffbe8; box-shadow: 0 0 0 1px #6b5a2a; margin-top: 1px; }
.ring { width: 16px; height: 16px; box-shadow: 0 0 0 2px #ff4d4d; }

/* ---------- stage metro ---------- */
.metro { list-style: none; margin: 0 0 14px; padding: 0 0 0 6px; position: relative; }
.metro::before { content: ""; position: absolute; left: 22px; top: 18px; bottom: 18px; width: 8px; background: #6aa9ff; box-shadow: 0 0 0 2px var(--line); }
.station { position: relative; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; }
.st-node { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.st-node::before { content: ""; width: 26px; height: 26px; flex: none; background: #fff; box-shadow: 0 0 0 4px var(--line); }
.st-name { font-weight: 800; }
.st-count { font-family: var(--mono); background: var(--accent); color: #1a1400; padding: 0 6px; box-shadow: 0 0 0 2px var(--line); }
.st-dots { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }
.dot {
  border: 0; min-width: 44px; height: 44px; font-family: var(--mono); font-size: 12px; font-weight: 800; color: #10121f;
  box-shadow: 0 0 0 2px var(--line), 2px 2px 0 var(--line);
}
.dot.sel { outline: 3px solid #fff; outline-offset: 2px; }
.dot.st-typing, .tchip.st-typing { background: var(--c-typing); } .dot.st-papers, .tchip.st-papers { background: var(--c-papers); }
.dot.st-rejected, .tchip.st-rejected { background: var(--c-rejected); } .dot.st-corridor, .tchip.st-corridor { background: var(--c-corridor); }
.dot.st-external, .tchip.st-external { background: var(--c-external); } .dot.st-active, .tchip.st-active { background: var(--c-active); }
.dot.st-done, .tchip.st-done { background: var(--c-done); }
.status-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.stagebar { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; padding: 0; margin: 12px 0; }
.stagebar li { background: #2f355f; text-align: center; font-size: 11px; padding: 6px 0; color: var(--muted); box-shadow: 0 0 0 2px var(--line); }
.stagebar li.past { background: #4f5a99; color: #fff; }
.stagebar li.now { color: #10121f; font-weight: 800; }
.stagebar li.now.st-typing { background: var(--c-typing); } .stagebar li.now.st-papers { background: var(--c-papers); }
.stagebar li.now.st-rejected { background: var(--c-rejected); } .stagebar li.now.st-corridor { background: var(--c-corridor); }
.stagebar li.now.st-external { background: var(--c-external); } .stagebar li.now.st-active { background: var(--c-active); }
.stagebar li.now.st-done, .stagebar li.past:last-child { background: var(--c-done); color: #10121f; }

.evidence, .timeline { list-style: none; padding: 0; margin: 0 0 12px; }
.evidence li, .timeline li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px dashed #3a4170; font-size: 14px; }
.evidence time, .timeline time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.evidence li { padding-left: 8px; border-left: 4px solid transparent; }
.evidence .ev-stage { border-left-color: #6aa9ff; }
.evidence .ev-status { border-left-color: var(--accent); }
.evidence .ev-info { border-left-color: var(--c-corridor); }
.timeline li { font-size: 13px; }

/* ---------- task lists ---------- */
.task-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.task-list.ranked { counter-reset: rk; }
.task-row {
  width: 100%; text-align: left; background: var(--panel2); border: 0; padding: 8px 10px; display: grid; gap: 3px;
  box-shadow: 0 0 0 2px var(--line); min-height: 44px;
}
.task-row:hover { background: #313866; }
.ranked .task-row::before { counter-increment: rk; content: counter(rk); font-family: var(--mono); font-weight: 800; color: var(--accent); font-size: 12px; }
.tr-main { font-weight: 700; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.tr-id { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.tr-sub { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------- bars ---------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: center; }
.bar-label { font-size: 13px; font-weight: 700; line-height: 1.2; }
.bar-label small { display: block; font-size: 11px; }
.bar-track { display: grid; gap: 3px; }
.bar { display: block; height: 18px; min-width: 64px; position: relative; box-shadow: 0 0 0 2px var(--line); }
.bar em { position: absolute; left: 6px; top: 0; font-style: normal; font-size: 11px; font-weight: 800; line-height: 18px; color: #10121f; white-space: nowrap; }
.bar.a { background: var(--c-papers); }
.bar.b { background: var(--c-corridor); }
.bar.sw { display: inline-block; width: 18px; min-width: 0; height: 12px; vertical-align: -1px; margin: 0 4px 0 10px; }
.bar-legend { font-size: 12px; color: var(--muted); }
.bar-empty { font-size: 12px; line-height: 18px; }

/* ---------- AI ---------- */
.ai-banner, .privacy-banner {
  background: #3b2f0b; color: #ffe9a8; padding: 10px 12px; margin-bottom: 12px; font-size: 14px;
  box-shadow: 0 0 0 var(--px) var(--accent);
}
.privacy-banner { background: #10372a; color: #c8f7da; box-shadow: 0 0 0 var(--px) var(--c-active); }
.ai-tag { display: inline-block; font-size: 10px; font-weight: 800; padding: 1px 5px; background: #6b4bd6; color: #fff; box-shadow: 0 0 0 2px var(--line); margin-right: 4px; vertical-align: 1px; }
.ai-note { font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.ai-explain { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ai-explain li { background: var(--panel2); padding: 8px 10px; box-shadow: inset 4px 0 0 #8f74ff; }
.ai-explain p { margin: 4px 0 0; font-size: 14px; }
.md h3 { font-size: 15px; margin: 0 0 8px; color: var(--accent); }
.md h4 { font-size: 14px; margin: 12px 0 4px; }
.md ul { margin: 0; padding-left: 18px; }
.md li { font-size: 14px; margin: 2px 0; }
.md p { margin: 4px 0; }
.ask-form { display: flex; gap: 8px; }
.ask-form input {
  flex: 1; min-width: 0; font: inherit; background: #0f1124; color: var(--ink); border: 0; padding: 8px 10px; min-height: 42px; box-shadow: 0 0 0 2px var(--line), inset 0 0 0 2px #3a4170;
}
.chips, .task-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.qchip { background: #2e2a5c; border: 0; padding: 6px 10px; font-size: 13px; min-height: 44px; box-shadow: 0 0 0 2px var(--line); max-width: 100%; overflow-wrap: anywhere; }
.qchip:hover { background: #3e3880; }
.tchip { border: 0; padding: 4px 8px; font-size: 12px; font-weight: 700; color: #10121f; box-shadow: 0 0 0 2px var(--line); min-height: 44px; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.ask-out { margin-top: 12px; display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.bubble-me { justify-self: end; background: #3b4a8a; padding: 6px 10px; max-width: 85%; min-width: 0; box-shadow: 0 0 0 2px var(--line); font-size: 14px; overflow-wrap: anywhere; }
.bubble-ai { background: var(--panel2); padding: 10px; min-width: 0; box-shadow: 0 0 0 2px var(--line), inset 4px 0 0 #8f74ff; font-size: 14px; overflow-wrap: anywhere; }
.md, .ai-explain p, .card h3, .view-head { overflow-wrap: anywhere; }
.bubble-ai p { margin: 6px 0 0; }
.bubble-ai.miss { box-shadow: 0 0 0 2px var(--line), inset 4px 0 0 var(--c-corridor); }

/* ---------- lead / exec ---------- */
.select-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; font-size: 14px; }
.select-wrap select { font: inherit; background: var(--panel2); color: var(--ink); border: 0; padding: 8px; min-height: 44px; box-shadow: 0 0 0 2px var(--line); flex: 1; min-width: 0; max-width: 280px; }
.stacked { display: flex; height: 26px; box-shadow: 0 0 0 2px var(--line); background: #2f355f; min-width: 0; }
.stacked span { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 800; color: #10121f; min-width: 0; overflow: hidden; }
.stacked span + span { box-shadow: -2px 0 0 var(--line); }
.sg0 { background: var(--s0); } .sg1 { background: var(--s1); } .sg2 { background: var(--s2); } .sg3 { background: var(--s3); } .sg4 { background: var(--s4); } .sg5 { background: var(--s5); }
.stage-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0; margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.stage-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; box-shadow: 0 0 0 1px var(--line); }
.count-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.count-tiles li { background: var(--panel2); padding: 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; box-shadow: 0 0 0 2px var(--line); }
.count-tiles b { font-family: var(--mono); font-size: 20px; }
.privacy-box { background: #10372a; padding: 12px 14px; box-shadow: 0 0 0 var(--px) var(--c-active), 5px 5px 0 var(--line); margin-bottom: 14px; }
.privacy-box h3 { font-size: 15px; color: #c8f7da; }
.privacy-box ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.dept-stack { display: grid; gap: 10px; }
.ds-row { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; align-items: center; }
.ds-label { font-size: 13px; font-weight: 700; line-height: 1.2; }
.ds-label small { display: block; font-size: 11px; }
.donut {
  width: 120px; height: 120px; margin: 4px auto 14px; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--c-active) calc(var(--p) * 1%), #3a2c55 0); box-shadow: 0 0 0 3px var(--line);
}
.donut b { width: 80px; height: 80px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-family: var(--mono); font-size: 22px; box-shadow: 0 0 0 3px var(--line); }
.org-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.org-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px; gap: 8px; align-items: center; font-size: 13px; }
.org-list small { font-size: 10px; }
.org-bar { height: 12px; background: #3a2c55; box-shadow: 0 0 0 2px var(--line); }
.org-bar i { display: block; height: 100%; background: var(--c-active); }
.org-list b { font-family: var(--mono); text-align: right; }

/* ---------- alerts phone ---------- */
.phone {
  max-width: 360px; margin: 0 auto; background: #0c0d1a; padding: 10px 10px 18px;
  box-shadow: 0 0 0 4px #3a3f66, 0 0 0 8px var(--line), 8px 8px 0 8px var(--line);
}
.phone-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); padding: 0 6px 6px; font-family: var(--mono); }
.notch { width: 70px; height: 10px; background: #000; box-shadow: 0 0 0 2px #22253f; }
.phone-head { display: flex; align-items: center; gap: 8px; padding: 8px; background: #1b1e38; margin-bottom: 8px; }
.phone-head small { display: block; font-size: 11px; }
.bot-ava { width: 32px; height: 30px; display: block; }
.notis { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.noti {
  width: 100%; text-align: left; border: 0; background: #f3f4fa; color: #1a1c2c; padding: 10px 12px; display: grid; gap: 2px;
  box-shadow: 0 0 0 2px var(--line), inset 5px 0 0 var(--tone, #888);
}
.noti b { font-size: 14px; }
.noti-time { font-size: 11px; color: #5b6075; font-family: var(--mono); }
.noti-body { font-size: 13px; color: #3c4156; }
.tone-papers { --tone: #d9a521; } .tone-corridor { --tone: #e07b2a; } .tone-external { --tone: #8f5ce0; }
.tone-rejected { --tone: #d64545; } .tone-done { --tone: #3fae6e; }

/* ---------- sheet (dialog) ---------- */
.sheet {
  padding: 0; border: 0; background: transparent; color: var(--ink); width: 100%; max-width: 100%; max-height: 100%; margin: 0;
  position: fixed; inset: auto 0 0 0; top: auto;
}
.sheet::backdrop { background: rgba(5, 6, 15, .7); }
.sheet-inner {
  position: relative; background: var(--panel); max-height: 88vh; max-height: 88dvh; overflow-y: auto; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 0 var(--accent), 0 0 0 var(--px) var(--line);
}
.sheet-close { position: sticky; top: 0; float: right; width: 44px; height: 44px; background: var(--panel2); border: 0; font-size: 18px; box-shadow: 0 0 0 2px var(--line); z-index: 2; }
.sheet-badge { display: inline-block; margin: 0 0 10px; }
.sheet h2 { font-size: 19px; margin: 2px 52px 8px 0; overflow-wrap: anywhere; }
.scope-note { background: #23304f; color: #d6e2ff; font-size: 13px; padding: 8px 10px; margin: 0 0 12px; box-shadow: inset 4px 0 0 #6aa9ff; }
.scope-note b { margin-right: 4px; }
.sheet .scope-note { margin: 12px 0 0; }
.sheet .scope-note:first-child { margin: 0 52px 10px 0; }
.sheet h3 { font-size: 14px; margin: 14px 0 6px; }
.sheet-kicker { margin: 0; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.verify { background: var(--panel2); padding: 10px; box-shadow: 0 0 0 2px var(--line); }
.verify p { margin: 0 0 8px; font-size: 13px; }
.verify-btns { display: flex; gap: 8px; }
.verify-msg { margin: 8px 0 0 !important; color: var(--c-active); min-height: 1em; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.mini-list { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 4px; }
.mini-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }

/* ---------- animations ---------- */
@keyframes type-bob { 0% { transform: translateY(0); } 100% { transform: translateY(-2px); } }
@keyframes walk { 0% { transform: translateX(-4px); } 100% { transform: translateX(6px); } }
@keyframes wait-sway { 0% { transform: rotate(-4deg); } 100% { transform: rotate(4deg); } }
@keyframes pop { 0% { opacity: 1; } 100% { opacity: .55; } }
@keyframes dots { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .15; } }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- responsive ---------- */
@media (min-width: 640px) {
  .floor { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "ext ext" "r0 r1" "cor cor" "r2 r3" "r4 arc"; }
  .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet { max-width: 640px; inset: 0; margin: auto; max-height: 90vh; }
  .sheet-inner { max-height: 90vh; box-shadow: 0 0 0 var(--px) var(--line), 8px 8px 0 var(--line), inset 0 4px 0 var(--accent); }
}
@media (min-width: 1024px) {
  body { padding-bottom: 24px; }
  .tabs { position: sticky; top: 61px; bottom: auto; z-index: 29; border-top: 0; border-bottom: var(--px) solid var(--line); box-shadow: 0 3px 0 #2d3366; }
  [role="tablist"] { display: flex; gap: 4px; padding: 0 12px; }
  [role="tab"] { flex-direction: row; gap: 6px; height: 46px; padding: 0 14px; }
  .tlabel { font-size: 14px; }
  main { padding: 20px 24px; }
  .floor {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 210px;
    grid-template-areas: "r0 r1 r2 ext" "cor cor cor ext" "r3 r4 arc ext";
    padding: 14px; gap: 14px;
  }
  .ext-q { flex-direction: column; align-items: stretch; }
  .ext-slot { flex-direction: row; gap: 6px; }
  .lanes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metro { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 0; gap: 8px; }
  .metro::before { left: 20px; right: 20px; top: 22px; bottom: auto; width: auto; height: 8px; }
  .station { grid-template-columns: minmax(0, 1fr); align-content: start; padding: 8px 0; }
  .st-node { flex-direction: column; align-items: flex-start; gap: 6px; }
  .st-node::before { width: 30px; height: 30px; margin-left: 4px; }
  .phone { margin: 0; }
}
