/* ==========================================================================
   WorkSoul High-Fidelity Live Product Renderer + Dynamic Scenario Theater
   Built directly on WorkSoul packages/shared-ui/tokens.css (Light + Dark)
   100% Crisp Vector HTML/CSS/SVG — Zero Bitmap Screenshots
   ========================================================================== */

.ws-live-app {
  --ui-bg: #ffffff;
  --ui-subtle: #f7f9f8;
  --ui-panel: #f0f4f1;
  --ui-hover: #eaf0ec;
  --ui-ink: #0f1713;
  --ui-sec: #3f4d45;
  --ui-muted: #68766e;
  --ui-faint: #8c9991;
  --ui-line: #e1e8e3;
  --ui-line-strong: #cbd6ce;
  --ui-brand: #15803d;
  --ui-brand-vivid: #2fb357;
  --ui-brand-soft: #eaf8ee;
  --ui-brand-border: #bbf0cb;
  --ui-warn-bg: #fffbeb;
  --ui-warn-border: #fde68a;
  --ui-warn-ink: #92400e;
  --ui-err-bg: #fef2f2;
  --ui-err-border: #fecaca;
  --ui-err-ink: #b91c1c;
  --ui-blue-bg: #eff6ff;
  --ui-blue-border: #bfdbfe;
  --ui-blue-ink: #1d4ed8;
  --ui-shadow: 0 24px 64px rgba(15, 23, 19, 0.09), 0 2px 8px rgba(15, 23, 19, 0.04);

  background: var(--ui-bg);
  color: var(--ui-ink);
  border-radius: 18px;
  border: 1px solid var(--ui-line-strong);
  box-shadow: var(--ui-shadow);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Noto Sans JP", sans-serif;
  overflow: hidden;
  text-align: left;
  line-height: 1.5;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.ws-live-app.dark {
  --ui-bg: #101418;
  --ui-subtle: #151a20;
  --ui-panel: #1b222a;
  --ui-hover: #222b35;
  --ui-ink: #edf2f7;
  --ui-sec: #c3cfd9;
  --ui-muted: #8b99a8;
  --ui-faint: #647282;
  --ui-line: rgba(255, 255, 255, 0.08);
  --ui-line-strong: rgba(255, 255, 255, 0.14);
  --ui-brand: #4ade80;
  --ui-brand-vivid: #40b25d;
  --ui-brand-soft: rgba(64, 178, 93, 0.14);
  --ui-brand-border: rgba(74, 222, 128, 0.32);
  --ui-warn-bg: rgba(245, 158, 11, 0.12);
  --ui-warn-border: rgba(245, 158, 11, 0.35);
  --ui-warn-ink: #fcd34d;
  --ui-err-bg: rgba(244, 63, 94, 0.14);
  --ui-err-border: rgba(251, 113, 133, 0.35);
  --ui-err-ink: #fda4af;
  --ui-blue-bg: rgba(56, 189, 248, 0.12);
  --ui-blue-border: rgba(56, 189, 248, 0.32);
  --ui-blue-ink: #7dd3fc;
  --ui-shadow: 0 28px 72px rgba(8, 12, 10, 0.28);
}

.ws-live-app svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---------------- App Window Chrome Bar ---------------- */
.wla-chrome {
  height: 42px;
  padding: 0 16px;
  background: var(--ui-subtle);
  border-bottom: 1px solid var(--ui-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wla-chrome-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wla-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ui-ink);
  padding-right: 10px;
  border-right: 1px solid var(--ui-line);
}
.wla-brand-mini span.ico {
  width: 18px;
  height: 18px;
  color: var(--ui-brand-vivid);
  display: inline-flex;
}
.wla-brand-mini span.ico svg { width: 100%; height: 100%; }

.wla-url-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ui-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wla-url-pill b {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ui-brand-vivid);
  display: inline-block;
}

.wla-chrome-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.wla-hint-pill {
  font-size: 11px;
  font-weight: 500;
  color: var(--ui-brand);
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  padding: 2px 9px;
  border-radius: 999px;
}
.wla-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--ui-line);
  background: var(--ui-bg);
  color: var(--ui-sec);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.16s;
}
.wla-theme-btn:hover { border-color: var(--ui-brand); color: var(--ui-ink); }

/* ---------------- App Shell: 64px Authentic Rail + Surface ---------------- */
.wla-shell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 530px;
}
.wla-shell > * { min-width: 0; }

.wla-rail {
  background: var(--ui-subtle);
  border-right: 1px solid var(--ui-line);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}
.wla-rail-top, .wla-rail-bot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.wla-nav-item {
  width: 52px;
  padding: 7px 2px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--ui-muted);
  font-size: 10px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: 0.15s;
}
.wla-nav-item:hover {
  background: var(--ui-hover);
  color: var(--ui-ink);
}
.wla-nav-item.active {
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  font-weight: 600;
}
.wla-nav-item.active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ui-brand-vivid);
}
.wla-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  position: relative;
}
.wla-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--ui-subtle);
}

/* ==========================================================================
   SURFACE 01: WORKSPACE (3-Column Governed Workbench — Zero Empty Gaps!)
   ========================================================================== */
.ws-grid-3 {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 326px;
  min-height: 530px;
}
.ws-grid-3 > * { min-width: 0; }

/* Col 1: Session & Micro-App Tree */
.ws-col-list {
  background: var(--ui-subtle);
  border-right: 1px solid var(--ui-line);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ws-new-btn {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line-strong);
  color: var(--ui-ink);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.ws-new-btn kbd {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ui-faint);
  font-weight: 500;
}
.ws-seg-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 2px;
  border-radius: 7px;
  background: var(--ui-panel);
  font-size: 11px;
  text-align: center;
  color: var(--ui-muted);
}
.ws-seg-3 span { padding: 3px 0; border-radius: 5px; }
.ws-seg-3 span.on { background: var(--ui-bg); color: var(--ui-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }

.ws-sec-lbl {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ui-faint);
  padding: 0 4px;
  display: flex;
  justify-content: space-between;
}
.ws-pin-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ws-pin-chip {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line);
  font-size: 11px;
  color: var(--ui-sec);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ws-pin-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--ui-brand-vivid); }
.ws-pin-chip:nth-child(2) i { background: #0ea5e9; }

.ws-folder-hd {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ui-brand);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
}
.ws-threads {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 8px;
  border-left: 1.5px solid var(--ui-line);
  margin-left: 6px;
}
.ws-th-btn {
  text-align: left;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ui-muted);
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: 0.14s;
}
.ws-th-btn:hover { background: var(--ui-hover); color: var(--ui-ink); }
.ws-th-btn.active {
  background: var(--ui-bg);
  border-color: var(--ui-line);
  color: var(--ui-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Col 2: Conversation Stream (Natural Top-to-Bottom Flow!) */
.ws-col-chat {
  background: var(--ui-bg);
  border-right: 1px solid var(--ui-line);
  display: flex;
  flex-direction: column;
}
.ws-chat-hd {
  height: 40px;
  padding: 0 16px;
  border-bottom: 1px solid var(--ui-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}
.ws-chat-hd-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-chat-hd-title i { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-brand-vivid); flex-shrink: 0; }
.ws-chat-hd-tags { display: flex; gap: 6px; font-size: 11px; font-weight: 500; color: var(--ui-muted); flex-shrink: 0; }
.ws-chat-hd-tags span { padding: 2px 8px; border-radius: 5px; background: var(--ui-subtle); border: 1px solid var(--ui-line); }

.ws-chat-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.ws-msg-user {
  align-self: flex-end;
  max-width: 90%;
  padding: 9px 13px;
  border-radius: 12px 12px 3px 12px;
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-ink);
  font-size: 12px;
  line-height: 1.55;
}
.ws-trace-card {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ws-trace-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--ui-sec);
}
.ws-trace-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ws-trace-left b { width: 6px; height: 6px; border-radius: 50%; background: var(--ui-brand-vivid); flex-shrink: 0; }
.ws-trace-row.warn .ws-trace-left b { background: #f59e0b; }
.ws-trace-ms { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--ui-faint); flex-shrink: 0; }

.ws-ai-points {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--ui-sec);
  line-height: 1.58;
}
.ws-ai-points div strong { color: var(--ui-ink); font-weight: 600; }
.ws-code-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ui-panel);
  color: var(--ui-brand);
}

.ws-cite-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}
.ws-cite-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--ui-blue-bg);
  border: 1px solid var(--ui-blue-border);
  color: var(--ui-blue-ink);
  font-size: 11px;
  font-weight: 500;
}
.ws-cite-pill.exp {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
  color: var(--ui-brand);
}

.ws-composer {
  margin: 0 14px 12px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-line-strong);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ws-comp-scope {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
}
.ws-comp-scope span {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line);
  color: var(--ui-sec);
  font-weight: 500;
}
.ws-comp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--ui-faint);
}
.ws-comp-foot > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ws-comp-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--ui-brand);
  font-weight: 600;
}

/* Col 3: Right Governed Sandbox / Multi-System Stage */
.ws-col-stage {
  background: var(--ui-subtle);
  display: flex;
  flex-direction: column;
}
.ws-stage-tabs {
  height: 40px;
  padding: 0 10px;
  border-bottom: 1px solid var(--ui-line);
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
}
.ws-st-sub {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ui-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.ws-st-sub.active {
  background: var(--ui-bg);
  border-color: var(--ui-line);
  color: var(--ui-ink);
  font-weight: 600;
}
.ws-stage-inner {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.ws-vault-bar {
  padding: 6px 10px;
  border-radius: 7px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ui-muted);
}
.ws-vault-badge {
  font-family: var(--sans);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  font-weight: 600;
  white-space: nowrap;
}

.ws-mes-card {
  background: var(--ui-bg);
  border: 1px solid var(--ui-line-strong);
  border-radius: 11px;
  padding: 13px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}
.ws-mes-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.ws-mes-top h5 { font-size: 12.5px; font-weight: 700; color: var(--ui-ink); margin-bottom: 2px; }
.ws-mes-top small { font-size: 10.5px; color: var(--ui-muted); display: block; }
.ws-load-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--ui-panel);
  color: var(--ui-sec);
  white-space: nowrap;
}
.ws-slot-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
}
.ws-slot-box {
  padding: 8px 9px;
  border-radius: 7px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-line);
  font-size: 11px;
  color: var(--ui-muted);
}
.ws-slot-box span { display: block; font-size: 9.5px; margin-bottom: 2px; }
.ws-slot-box.old strong { text-decoration: line-through; font-weight: 500; }
.ws-slot-box.new {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-vivid);
  color: var(--ui-brand);
}
.ws-slot-box.new strong { font-weight: 700; }

.ws-target-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px dashed var(--ui-line);
  font-size: 11px;
  color: var(--ui-muted);
}
.ws-red-lock {
  padding: 5px 10px;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 0 2px #ef4444, 0 0 12px rgba(239, 68, 68, 0.35);
}
.ws-red-lock.done {
  background: #15803d;
  box-shadow: 0 0 0 2px #4ade80;
}

.ws-r2-gate {
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--ui-warn-bg);
  border: 1px solid var(--ui-warn-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-r2-gate.approved {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-border);
}
.ws-r2-gate p {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ui-warn-ink);
}
.ws-r2-gate.approved p { color: var(--ui-brand); }
.ws-r2-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: 7px;
  border: none;
  background: #15803d;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s;
}
.ws-r2-btn:hover { background: #166534; }

/* ==========================================================================
   SURFACES 02–06: SHARED INNER WORKSPACE LAYOUT
   ========================================================================== */
.wla-page {
  padding: 20px 24px;
  background: var(--ui-bg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wla-page-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ui-line);
  flex-wrap: wrap;
}
.wla-page-hd h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ui-ink);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.wla-status-chip {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  border: 1px solid var(--ui-brand-border);
}
.wla-page-hd p { font-size: 12.5px; color: var(--ui-muted); }
.wla-primary-act {
  padding: 7px 14px;
  border-radius: 8px;
  background: #15803d;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* 02 PROJECTS: 4 KPIs + 2 Milestone Cards + Real Date-Column Gantt */
.pj-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  background: var(--ui-subtle);
  overflow: hidden;
}
.pj-kpi-cell {
  padding: 11px 14px;
  border-right: 1px solid var(--ui-line);
}
.pj-kpi-cell:last-child { border-right: none; }
.pj-kpi-cell span { display: block; font-size: 11px; color: var(--ui-muted); margin-bottom: 2px; }
.pj-kpi-cell strong { font-size: 15px; font-weight: 700; color: var(--ui-ink); }
.pj-kpi-cell.ok strong { color: var(--ui-brand); }
.pj-kpi-cell.err strong { color: var(--ui-err-ink); }

.pj-ms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pj-ms-card {
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--ui-line);
  background: var(--ui-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.pj-ms-card strong { font-size: 12.5px; color: var(--ui-ink); display: block; }
.pj-ms-card small { font-size: 11px; color: var(--ui-muted); }

.pj-gantt-box {
  border: 1px solid var(--ui-line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--ui-bg);
}
.pj-gantt-hd, .pj-gantt-row {
  display: grid;
  grid-template-columns: 260px 64px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--ui-line);
}
.pj-gantt-row:last-child { border-bottom: none; }
.pj-gantt-hd {
  background: var(--ui-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-muted);
  height: 34px;
}
.pj-gantt-hd > div, .pj-gantt-row > div { padding: 8px 12px; }
.pj-dates {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
}
.pj-dates b {
  color: var(--ui-brand);
  background: var(--ui-brand-soft);
  border-radius: 4px;
  padding: 1px 4px;
}
.pj-task-cell strong { display: block; font-size: 12px; color: var(--ui-ink); margin-bottom: 3px; }
.pj-dep-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ui-warn-bg);
  border: 1px solid var(--ui-warn-border);
  color: var(--ui-warn-ink);
}
.pj-owner { font-size: 11.5px; color: var(--ui-muted); text-align: center; border-left: 1px solid var(--ui-line); border-right: 1px solid var(--ui-line); height: 100%; display: flex; align-items: center; justify-content: center; }
.pj-timeline-cell { position: relative; background-image: linear-gradient(to right, var(--ui-line) 1px, transparent 1px); background-size: 12.5% 100%; }
.pj-gbar {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  white-space: nowrap;
}
.pj-gbar.green { width: 68%; margin-left: 18%; background: var(--ui-brand-soft); border: 1px solid var(--ui-brand-vivid); color: var(--ui-brand); }
.pj-gbar.done { width: 52%; margin-left: 4%; background: var(--ui-blue-bg); border: 1px solid var(--ui-blue-border); color: var(--ui-blue-ink); }
.pj-gbar.blocked { width: 46%; margin-left: 8%; background: var(--ui-err-bg); border: 1px solid var(--ui-err-border); color: var(--ui-err-ink); }

/* 03 APPS: Left Plaza Grid + Right SHA-256 Security Contract Inspector */
.ap-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 16px;
}
.ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ap-card {
  padding: 13px 14px;
  border-radius: 11px;
  background: var(--ui-subtle);
  border: 1.5px solid var(--ui-line);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 9px;
  transition: 0.16s;
}
.ap-card:hover { border-color: var(--ui-line-strong); }
.ap-card.active {
  background: var(--ui-bg);
  border-color: var(--ui-brand-vivid);
  box-shadow: 0 6px 18px rgba(21, 128, 61, 0.08);
}
.ap-card-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ap-type-tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--ui-brand-soft); color: var(--ui-brand); }
.ap-type-tag.blue { background: var(--ui-blue-bg); color: var(--ui-blue-ink); }
.ap-type-tag.amber { background: var(--ui-warn-bg); color: var(--ui-warn-ink); }
.ap-ver { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--ui-faint); }
.ap-card h5 { font-size: 13px; font-weight: 700; color: var(--ui-ink); margin-bottom: 3px; }
.ap-card p { font-size: 11.5px; color: var(--ui-muted); line-height: 1.48; }
.ap-card-ft { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; border-top: 1px solid var(--ui-line); font-size: 11px; color: var(--ui-muted); }
.ap-go { font-weight: 600; color: var(--ui-brand); }

.ap-inspector {
  padding: 15px;
  border-radius: 12px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-line);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.ap-inspector h6 { font-size: 11px; font-weight: 700; color: var(--ui-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ap-ins-box { padding: 10px; border-radius: 8px; background: var(--ui-bg); border: 1px solid var(--ui-line); font-size: 11.5px; }
.ap-ins-box small { display: block; font-size: 10px; color: var(--ui-faint); margin-bottom: 3px; }
.ap-hash { font-family: "JetBrains Mono", monospace; font-size: 10.5px; color: var(--ui-brand); word-break: break-all; }

/* 04 KNOWLEDGE: Left 7 VFS Sources + Right Vault Cards */
.kb-split {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 16px;
}
.kb-src-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
  border-radius: 11px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-line);
}
.kb-src-btn {
  padding: 7px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ui-sec);
  font-size: 11.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
}
.kb-src-btn:hover { background: var(--ui-hover); }
.kb-src-btn.active {
  background: var(--ui-brand-soft);
  color: var(--ui-brand);
  font-weight: 600;
}
.kb-vault-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* 05 AGENTS: 3x2 Rich Digital Staff Grid */
.ag-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ag-card {
  padding: 13px 14px;
  border-radius: 11px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.ag-hd { display: flex; align-items: center; gap: 9px; }
.ag-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ui-brand-soft);
  border: 1px solid var(--ui-brand-border);
  color: var(--ui-brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ag-hd h5 { font-size: 12.5px; font-weight: 700; color: var(--ui-ink); line-height: 1.3; }
.ag-card p { font-size: 11.5px; color: var(--ui-muted); line-height: 1.48; }

/* 06 TEAM MEMORY: 3-Column Project Switcher + Confirmed Summary + Lineage */
.tm-grid-3 {
  display: grid;
  grid-template-columns: 186px 1.1fr 0.95fr;
  gap: 14px;
}
.tm-proj-list { display: flex; flex-direction: column; gap: 6px; }
.tm-proj-btn {
  text-align: left;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid var(--ui-line);
  background: var(--ui-subtle);
  cursor: pointer;
}
.tm-proj-btn.active {
  background: var(--ui-brand-soft);
  border-color: var(--ui-brand-vivid);
}
.tm-proj-btn small { display: block; font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--ui-faint); margin-bottom: 2px; }
.tm-proj-btn strong { font-size: 12px; color: var(--ui-ink); display: block; line-height: 1.35; }

.tm-sum-card {
  padding: 15px 16px;
  border-radius: 11px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-brand-border);
}
.tm-sum-card h5 { font-size: 13.5px; font-weight: 700; color: var(--ui-ink); margin-bottom: 10px; }
.tm-sum-card ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.tm-sum-card li { font-size: 12px; color: var(--ui-sec); padding-left: 14px; position: relative; line-height: 1.52; }
.tm-sum-card li::before { content: "•"; position: absolute; left: 1px; color: var(--ui-brand-vivid); font-weight: 700; }

.tm-trace-list {
  padding: 14px;
  border-radius: 11px;
  background: var(--ui-subtle);
  border: 1px solid var(--ui-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tm-trace-item { padding-left: 11px; border-left: 2px solid var(--ui-brand-vivid); }
.tm-trace-item strong { display: block; font-size: 12px; color: var(--ui-ink); }
.tm-trace-item span { font-size: 11px; color: var(--ui-muted); }

/* ==========================================================================
   DYNAMIC EXPANDABLE SCENARIO THEATER (4-Step Interactive + Auto-Progress)
   ========================================================================== */
.scen-theater-stack {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.scen-theater {
  background: #ffffff;
  border: 1px solid rgba(20, 23, 21, 0.09);
  border-radius: 26px;
  padding: 30px 32px;
  box-shadow: 0 14px 40px rgba(20, 23, 21, 0.04);
}
.st-top-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(20, 23, 21, 0.075);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.st-tag-line {
  font-size: 12px;
  font-weight: 600;
  color: #154d2e;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 6px;
}
.st-top-head h3 {
  font-family: "Newsreader", "Noto Serif SC", Georgia, serif;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 500;
  color: #141715;
  line-height: 1.28;
}
.st-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.st-kpi-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: #e8f4ec;
  color: #154d2e;
  font-size: 12px;
  font-weight: 600;
}
.st-play-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(20, 23, 21, 0.14);
  background: #f7f6f1;
  color: #3f4742;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.st-play-toggle:hover { border-color: #154d2e; color: #154d2e; }

.st-body-grid {
  display: grid;
  grid-template-columns: 0.94fr 1.06fr;
  gap: 26px;
  align-items: stretch;
}
.st-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-step {
  border-radius: 16px;
  border: 1px solid rgba(20, 23, 21, 0.08);
  background: #f9f8f4;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}
.st-step:hover { border-color: rgba(21, 77, 46, 0.28); }
.st-step.active {
  background: #ffffff;
  border-color: #40b25d;
  box-shadow: 0 10px 28px rgba(21, 77, 46, 0.08);
}
.st-step-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.st-step-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.st-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eeece4;
  color: #5c635e;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.st-step.active .st-step-num {
  background: #154d2e;
  color: #ffffff;
}
.st-step-hd strong {
  font-size: 14.5px;
  font-weight: 600;
  color: #141715;
}
.st-step-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eeece4;
  color: #5c635e;
  white-space: nowrap;
}
.st-step.active .st-step-badge {
  background: #e8f4ec;
  color: #15803d;
  font-weight: 600;
}
.st-step-detail {
  display: none;
  padding: 10px 0 4px 34px;
  font-size: 13.5px;
  color: #555e58;
  line-height: 1.62;
}
.st-step.active .st-step-detail {
  display: block;
  animation: stSlideDown 0.24s ease;
}
.st-progress-track {
  display: none;
  height: 3px;
  background: #edf2ee;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
.st-step.active.playing .st-progress-track { display: block; }
.st-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #15803d, #4ade80);
  animation: stFillBar 4.8s linear forwards;
}

@keyframes stFillBar {
  from { width: 0%; }
  to { width: 100%; }
}
@keyframes stSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Right Dynamic Artifact Stage */
.st-live-panel {
  border-radius: 18px;
  background: #f5f7f6;
  border: 1px solid #dce4de;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  animation: stSlideDown 0.24s ease;
}
.st-lp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e1e8e3;
}
.st-lp-sys {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  color: #154d2e;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.st-lp-sys::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fb357;
}
.st-lp-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d5dfd8;
  color: #15803d;
}
.st-lp-card {
  background: #ffffff;
  border: 1px solid #e1e8e3;
  border-radius: 13px;
  padding: 15px 16px;
  box-shadow: 0 6px 20px rgba(15, 23, 19, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-lp-card h5 {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f1713;
}
.st-kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.st-kv {
  padding: 9px 11px;
  border-radius: 9px;
  background: #f8faf9;
  border: 1px solid #e6ece8;
}
.st-kv span { display: block; font-size: 10.5px; color: #6c7971; margin-bottom: 2px; }
.st-kv strong { font-size: 12.5px; color: #0f1713; font-weight: 600; }
.st-kv.highlight {
  background: #eaf8ee;
  border-color: #bbf0cb;
}
.st-kv.highlight strong { color: #15803d; }

.st-lp-note {
  padding: 9px 12px;
  border-radius: 9px;
  background: #f0f7f2;
  border-left: 3px solid #2fb357;
  font-size: 12px;
  color: #2c3a32;
}
.st-lp-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: #68766e;
}
.st-open-live {
  border: none;
  background: transparent;
  color: #154d2e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.st-open-live:hover { text-decoration: underline; }

@media (max-width: 980px) {
  .wla-shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .wla-rail { flex-direction: row; padding: 8px; border-right: none; border-bottom: 1px solid var(--ui-line); }
  .wla-rail-top { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .wla-rail-bot, .wla-nav-item.active::before { display: none; }
  .ws-grid-3, .ap-split, .kb-split, .tm-grid-3, .st-body-grid { grid-template-columns: minmax(0, 1fr); }
  .ws-col-list, .ws-col-chat { border-right: none; border-bottom: 1px solid var(--ui-line); }
  .pj-kpi-strip, .ap-grid, .kb-vault-grid, .ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-gantt-hd { display: none; }
  .pj-gantt-row { grid-template-columns: minmax(0, 1fr); }
  .pj-owner { border: none; justify-content: flex-start; padding-top: 0 !important; }
  .pj-gbar.green, .pj-gbar.done, .pj-gbar.blocked { width: 100%; margin-left: 0; }
}
@media (max-width: 600px) {
  .wla-url-pill, .wla-hint-pill { display: none; }
  .pj-kpi-strip, .pj-ms-grid, .ap-grid, .kb-vault-grid, .ag-grid, .st-kv-grid { grid-template-columns: minmax(0, 1fr); }
  .scen-theater { padding: 20px 16px; border-radius: 20px; }
  .st-step-hd { flex-direction: column; align-items: flex-start; gap: 6px; }
  .st-step-badge { margin-left: 34px; }
  .st-step-detail { padding-left: 0; }
}
