:root {
  color-scheme: dark;
  --ink: #f6f4ef;
  --muted: #9da7b5;
  --line: rgba(255,255,255,.1);
  --panel: rgba(17,23,32,.8);
  --panel-strong: #151d29;
  --green: #67e5a3;
  --blue: #77a9ff;
  --amber: #f6bd60;
  --red: #ff7d82;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #090d13; color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 15% 0%, rgba(48,111,103,.22), transparent 35%), radial-gradient(circle at 90% 15%, rgba(57,89,153,.18), transparent 32%), linear-gradient(180deg, #0b1018, #080b10 72%); }
.shell { position: relative; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 72px; }
[hidden] { display: none !important; }
.gate-card { width: min(470px, 100%); margin: 12vh auto 0; padding: 36px; border: 1px solid var(--line); border-radius: 28px; background: rgba(15,21,30,.88); box-shadow: 0 28px 90px rgba(0,0,0,.35); backdrop-filter: blur(20px); }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; margin-bottom: 30px; color: #07110d; background: var(--green); font-weight: 800; }
.brand-mark.denied { background: rgba(255,125,130,.18); color: var(--red); }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: .72rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 1.35rem; letter-spacing: -.025em; }
.muted { color: var(--muted); line-height: 1.65; }
.sign-in-form { display: grid; gap: 16px; margin: 28px 0 12px; }
label { display: grid; gap: 8px; color: #c6ced8; font-size: .82rem; font-weight: 650; }
input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: #0b1119; color: var(--ink); }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(103,229,163,.12); }
.primary-button, .secondary-button, .quiet-button { border-radius: 12px; border: 1px solid transparent; padding: 12px 16px; color: var(--ink); }
.primary-button { background: var(--green); color: #06100c; font-weight: 800; }
.secondary-button { width: 100%; background: transparent; border-color: var(--line); }
.quiet-button { background: rgba(255,255,255,.04); border-color: var(--line); }
.form-message { min-height: 1.2em; color: var(--red); font-size: .85rem; }
.dashboard { display: grid; gap: 22px; }
.workspace-nav { display: flex; gap: 6px; width: fit-content; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.workspace-nav-button { padding: 9px 15px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 750; }
.workspace-nav-button.active { background: rgba(103,229,163,.12); color: var(--green); }
#roadmapDashboard, .registry-dashboard { display: grid; gap: 22px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 10px 4px 20px; }
.topbar h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.account-actions { display: flex; align-items: center; gap: 10px; }
.role-badge { padding: 8px 11px; border: 1px solid rgba(103,229,163,.25); border-radius: 999px; background: rgba(103,229,163,.08); color: var(--green); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) repeat(2, minmax(130px, .7fr)); gap: 14px; }
.overview-card, .metric-card, .blockers-panel, .roadmap-section, .registry-hero, .registry-section { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 18px 60px rgba(0,0,0,.18); backdrop-filter: blur(18px); }
.overview-card { grid-row: span 2; padding: 28px; border-radius: var(--radius); }
.overview-primary { background: linear-gradient(145deg, rgba(20,40,39,.95), rgba(17,24,35,.92)); }
.overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hero-percent { color: var(--green); font-size: 2.7rem; letter-spacing: -.06em; }
.progress-track { height: 8px; margin: 30px 0 22px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.progress-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #91f1c0); transition: width .35s ease; }
.current-position { margin-bottom: 6px; font-size: 1.05rem; font-weight: 700; }
.role-notice { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.metric-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 128px; padding: 20px; border-radius: 18px; }
.metric-card span { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .11em; }
.metric-card strong { font-size: 2.2rem; }
.blocker-card strong { color: var(--red); }
.blockers-panel { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 24px 28px; border-radius: var(--radius); border-color: rgba(255,125,130,.25); }
.blockers-panel .eyebrow { color: var(--red); }
.blockers-panel ul { margin: 0; padding-left: 18px; color: #ffd4d5; }
.roadmap-section { padding: 26px; border-radius: var(--radius); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.roadmap-tree { display: grid; gap: 12px; }
details { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
details[open] { background: rgba(255,255,255,.04); }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.node-summary { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; align-items: center; gap: 18px; padding: 18px; }
.node-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.node-code { color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.node-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-progress { color: var(--muted); font-size: .78rem; }
.chevron { color: var(--muted); transition: transform .2s ease; }
details[open] > summary .chevron { transform: rotate(90deg); }
.node-body { padding: 0 16px 16px 34px; }
.objective { margin: 0 0 14px; color: #bdc6d2; line-height: 1.55; }
.phase-list, .stage-list { display: grid; gap: 10px; }
.stage-card { margin-top: 10px; }
.stage-body { display: grid; grid-template-columns: minmax(0,1fr) minmax(200px,.55fr); gap: 18px; padding: 0 18px 20px; }
.stage-meta { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.18); }
.meta-label { color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.meta-value { color: #d8dee7; font-size: .86rem; line-height: 1.5; }
.status-pill { justify-self: start; padding: 6px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.status-completed { color: var(--green); background: rgba(103,229,163,.1); }
.status-in_progress { color: var(--blue); background: rgba(119,169,255,.12); }
.status-planned { color: #bbc3ce; background: rgba(187,195,206,.1); }
.status-blocked { color: var(--red); background: rgba(255,125,130,.12); }
.status-backlog, .status-cancelled { color: #bbc3ce; background: rgba(187,195,206,.1); }
.registry-hero, .registry-section { padding: 26px; border-radius: var(--radius); }
.registry-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.registry-intro { margin: 10px 0 0; }
.read-only-badge { flex: 0 0 auto; padding: 7px 10px; border: 1px solid rgba(119,169,255,.25); border-radius: 999px; color: var(--blue); background: rgba(119,169,255,.1); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.read-only-badge.editable-badge { color: var(--green); border-color: rgba(103,229,163,.25); background: rgba(103,229,163,.08); }
.registry-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.registry-metric { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px; border-radius: 14px; background: rgba(0,0,0,.18); }
.registry-metric span, .section-count { color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.registry-metric strong { font-size: 1.65rem; }
.registry-metric.critical strong { color: var(--red); }
.section-count { margin: 0; }
.registry-empty { padding: 52px 20px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; color: var(--muted); }
.registry-empty strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 1.05rem; }
.registry-empty p { margin: 0; }
.work-registry-list { display: grid; gap: 10px; }
.work-item.archived { opacity: .68; }
.work-item-summary { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; align-items: center; gap: 12px; padding: 17px 18px; }
.work-item-identity { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.work-item-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item-number { flex: 0 0 auto; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.type-pill, .priority-pill { padding: 6px 9px; border-radius: 999px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.type-pill { color: var(--blue); background: rgba(119,169,255,.11); }
.priority-pill { color: var(--amber); background: rgba(246,189,96,.11); }
.priority-critical { color: var(--red); background: rgba(255,125,130,.12); }
.priority-low { color: var(--muted); background: rgba(187,195,206,.08); }
.work-item-body { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(260px,.75fr); gap: 20px; padding: 0 18px 20px; }
.work-description { margin: 0; color: #cbd2dc; line-height: 1.6; white-space: pre-wrap; }
.work-item-meta { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 15px; border-radius: 12px; background: rgba(0,0,0,.18); }
.registry-heading-actions { display: flex; align-items: center; gap: 14px; }
.work-item-form-panel { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(0,0,0,.18); }
.work-item-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.work-item-form .span-2 { grid-column: 1 / -1; }
.work-item-form textarea { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: #0b1119; color: var(--ink); resize: vertical; font-family: inherit; }
.work-item-form select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: #0b1119; color: var(--ink); }
.work-item-form textarea:focus, .work-item-form select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(103,229,163,.12); }
.form-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.form-actions .primary-button { width: auto; padding: 12px 22px; }
.form-message.success { color: var(--green); }
.form-message.authorization { color: var(--amber); }
button[disabled] { opacity: .55; cursor: not-allowed; }
.work-item-controls { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 18px; }
.work-item-controls .quiet-button, .work-item-controls .secondary-button { width: auto; padding: 9px 14px; font-size: .85rem; }
.work-item-controls .secondary-button { border-color: rgba(255,125,130,.3); color: var(--red); }
.work-item-edit-form { padding: 0 18px 20px; }
.work-item-edit-form .work-item-form { margin-top: 0; }
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-card { grid-column: 1 / -1; grid-row: auto; }
  .stage-body, .blockers-panel { grid-template-columns: 1fr; }
  .registry-metrics { grid-template-columns: repeat(2, 1fr); }
  .work-item-body { grid-template-columns: 1fr; }
  .work-item-summary { grid-template-columns: minmax(0,1fr) auto; }
}
@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 16px; }
  .gate-card, .roadmap-section, .overview-card { padding: 22px; }
  .topbar { align-items: flex-start; }
  .account-actions { flex-direction: column; align-items: flex-end; }
  .node-summary { grid-template-columns: minmax(0,1fr) auto; }
  .node-progress { display: none; }
  .node-body { padding-left: 12px; }
  .registry-hero, .registry-section { padding: 20px; }
  .registry-heading { display: grid; }
  .work-item-summary { align-items: start; }
  .work-item-identity { display: grid; gap: 4px; }
  .work-item-meta { grid-template-columns: 1fr; }
}
