:root {
  --bg: #03080f;
  --text: #edf6ff;
  --muted: #91a5ba;
  --cyan: #63d9ff;
  --green: #57d66f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.app-shell,
.app-shell * { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  letter-spacing: 0;
}

.app-shell button,
.app-shell input,
.app-shell textarea,
.app-shell select { font: inherit; }

.app-shell button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 360px;
  width: 100%;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  color: var(--text);
  background: radial-gradient(circle at 50% 40%, #102746 0%, #07111d 38%, var(--bg) 72%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  isolation: isolate;
}

.app-data { display: none; }

.sidebar,
.conversation-panel {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(14, 26, 40, 0.96), rgba(7, 15, 25, 0.96));
  border-color: rgba(153, 197, 255, 0.16);
  border-style: solid;
  box-shadow: var(--shadow);
}

.sidebar {
  border-width: 0 1px 0 0;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.conversation-panel {
  border-width: 0 0 0 1px;
  padding: 24px;
}

.brand-row { display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(99, 217, 255, 0.7); border-radius: 50%; color: var(--cyan); box-shadow: 0 0 24px rgba(99, 217, 255, 0.22); }

.app-shell h1,
.app-shell h2,
.app-shell h3,
.app-shell p { margin: 0; }
.app-shell h1 { font-size: 18px; line-height: 1.1; }
.brand-row p, .muted, label, .panel-heading p, .topic-meta { color: var(--muted); font-size: 12px; }

.sidebar-section { display: grid; gap: 8px; }
.section-header { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; }
.section-header strong { color: var(--green); font-size: 22px; }

.session-input,
.file-select,
.app-shell input,
.app-shell textarea {
  width: 100%;
  color: var(--text);
  background: rgba(6, 13, 22, 0.78);
  border: 1px solid rgba(137, 181, 233, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 8px;
  align-items: center;
}

.file-row button {
  min-width: 54px;
  height: 42px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1;
}

.hidden-input { display: none; }

.app-shell textarea { resize: vertical; line-height: 1.45; }
.app-shell input:focus,
.app-shell textarea:focus,
.app-shell select:focus,
.app-shell button:focus-visible { border-color: rgba(99, 217, 255, 0.9); box-shadow: 0 0 0 3px rgba(99, 217, 255, 0.12); }

.meter { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: inherit; transition: width 0.24s ease; }

.topic-nav { display: grid; gap: 8px; }
.topic-link { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 10px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; text-align: left; }
.topic-link.active, .topic-link:hover { background: rgba(84, 133, 192, 0.17); border-color: rgba(132, 183, 245, 0.18); }
.topic-link.not-recommended { opacity: 0.62; }
.topic-link.not-recommended:hover { background: rgba(84, 133, 192, 0.12); border-color: rgba(132, 183, 245, 0.14); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 14px currentColor; }
.status-name { font-size: 11px; color: var(--muted); }
.sidebar-actions { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 2px; }
.sidebar-actions .toolbar-button { width: 100%; min-width: 0; height: 34px; min-height: 34px; padding: 0; display: grid; place-items: center; }
.toolbar-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.action-divider { display: none; }

.app-shell button { color: var(--text); border: 1px solid rgba(137, 181, 233, 0.22); background: linear-gradient(180deg, rgba(39, 72, 112, 0.9), rgba(18, 39, 67, 0.9)); border-radius: 8px; padding: 9px 12px; }
.app-shell button:hover { border-color: rgba(99, 217, 255, 0.6); }
.app-shell button:disabled { opacity: 0.45; cursor: default; }
.app-shell button.danger { color: #ffb8b2; background: rgba(91, 27, 27, 0.34); }
.app-shell button.ghost { background: rgba(255, 255, 255, 0.05); }

.workspace {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 18px;
  background: radial-gradient(circle at 50% 46%, rgba(49, 126, 206, 0.2), rgba(3, 8, 15, 0.74) 58%, rgba(3, 8, 15, 0.96));
}

.topbar { display: flex; gap: 14px; align-items: center; min-height: 46px; }
.breadcrumb { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 13px; flex: 1; overflow: hidden; }
.breadcrumb-link { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 7px; color: #cfe3f8; background: transparent; border-color: transparent; }
.breadcrumb-link:not(:disabled):hover { color: var(--cyan); background: rgba(99, 217, 255, 0.08); }
.breadcrumb-separator { color: rgba(145, 165, 186, 0.7); }
.suggestion { color: #a7f5b7; font-size: 13px; max-width: 360px; text-align: right; background: rgba(87, 214, 111, 0.1); border-color: rgba(87, 214, 111, 0.28); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion:hover { border-color: rgba(87, 214, 111, 0.55); background: rgba(87, 214, 111, 0.16); }
.suggestion:disabled { color: var(--muted); background: rgba(255, 255, 255, 0.04); }

.orbital-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(116, 170, 238, 0.16);
  background: radial-gradient(circle at center, rgba(34, 130, 240, 0.17), rgba(2, 9, 17, 0.22) 46%, rgba(3, 8, 15, 0.62));
}

.radar-grid,
.radar-grid::before,
.radar-grid::after { position: absolute; inset: 0; content: ""; pointer-events: none; }
.radar-grid { background: radial-gradient(circle at center, transparent 0 15%, rgba(88, 158, 245, 0.18) 15.2% 15.5%, transparent 15.8% 27%, rgba(88, 158, 245, 0.14) 27.2% 27.5%, transparent 27.8% 39%, rgba(88, 158, 245, 0.1) 39.2% 39.5%, transparent 39.8%), linear-gradient(90deg, transparent 49.9%, rgba(99, 217, 255, 0.06) 50%, transparent 50.1%), linear-gradient(0deg, transparent 49.9%, rgba(99, 217, 255, 0.06) 50%, transparent 50.1%); }
.radar-grid::before { background-image: radial-gradient(#4ea8ff 1px, transparent 1px); background-size: 54px 54px; opacity: 0.16; }
.radar-grid::after { background: conic-gradient(from 20deg, transparent, rgba(99, 217, 255, 0.12), transparent 22%); animation: sweep 12s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }

.connection-layer,
.graph-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.connection-line { stroke: rgba(179, 217, 255, 0.6); stroke-width: 1.3; }
.node { position: absolute; transform: translate(-50%, -50%); border: 1px solid rgba(143, 206, 255, 0.62); background: radial-gradient(circle at 45% 34%, rgba(109, 205, 255, 0.98), rgba(34, 112, 210, 0.82) 45%, rgba(8, 32, 62, 0.92) 72%); color: white; border-radius: 50%; display: grid; place-items: center; text-align: center; box-shadow: 0 0 30px rgba(64, 157, 255, 0.55), inset 0 0 28px rgba(255, 255, 255, 0.16); transition: left 0.22s ease, top 0.22s ease, transform 0.16s ease; }
.node:hover { transform: translate(-50%, -50%) scale(1.04); }
.node.center { width: clamp(138px, 22vmin, 188px); height: clamp(138px, 22vmin, 188px); font-size: clamp(18px, 2.6vmin, 24px); font-weight: 800; padding: 24px; }
.node.child { width: clamp(92px, 14.5vmin, 126px); height: clamp(92px, 14.5vmin, 126px); padding: 14px; font-size: clamp(11px, 1.6vmin, 14px); }
.node.parent { width: 92px; height: 92px; padding: 12px; font-size: 12px; background: radial-gradient(circle at 45% 34%, rgba(125, 211, 252, 0.98), rgba(37, 99, 235, 0.82) 48%, rgba(8, 32, 62, 0.92) 74%); }
.node.child.muted,
.node.not-recommended { opacity: 0.56; filter: grayscale(0.35); }
.node.selected { opacity: 1; filter: none; border-color: rgba(167, 245, 183, 0.95); box-shadow: 0 0 34px rgba(87, 214, 111, 0.72), inset 0 0 28px rgba(255, 255, 255, 0.18); }
.node.selected .node-status { color: #d8ffdf; }
.node.complete { border-color: rgba(87, 214, 111, 0.88); box-shadow: 0 0 36px rgba(87, 214, 111, 0.56), inset 0 0 28px rgba(255, 255, 255, 0.18); }
.node-title { display: block; line-height: 1.15; }
.node-status { display: block; margin-top: 6px; color: rgba(255, 255, 255, 0.76); font-size: 11px; font-weight: 500; }

.panel-heading { display: grid; gap: 8px; margin-bottom: 18px; }
.panel-heading h2 { font-size: 26px; }
.panel-heading p:last-child { line-height: 1.55; color: #bfd1e2; font-size: 14px; }
.status-label { display: block; margin-bottom: 7px; }
.status-summary { display: flex; align-items: center; gap: 8px; min-height: 38px; margin-bottom: 18px; padding: 9px 11px; color: var(--text); background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(137, 181, 233, 0.18); border-radius: 8px; }
.status-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin-top: 4px; padding-top: 4px; }
.status-action { min-height: 38px; }
.status-action.ready { border-color: rgba(87, 214, 111, 0.36); }
.status-action.blocked { color: #ffb8b2; border-color: rgba(243, 107, 97, 0.34); background: rgba(91, 27, 27, 0.28); }
.status-action.next { color: #a7f5b7; border-color: rgba(87, 214, 111, 0.38); background: rgba(87, 214, 111, 0.12); }
.status-action.report { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #d8f3ff; border-color: rgba(99, 217, 255, 0.46); background: rgba(99, 217, 255, 0.12); font-weight: 700; }
.status-action.report svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.status-action-reason { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.35; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 20px 0; border-bottom: 1px solid rgba(137, 181, 233, 0.18); }
.tab { border-radius: 8px 8px 0 0; background: transparent; border-color: transparent; color: var(--muted); }
.tab.active { color: var(--cyan); border-color: rgba(99, 217, 255, 0.22); background: rgba(99, 217, 255, 0.08); }
.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 14px; }
.child-topic-list { display: grid; gap: 8px; }
.panel-topic-link { background: rgba(8, 18, 30, 0.66); border-color: rgba(137, 181, 233, 0.17); }
.panel-topic-link:hover { background: rgba(84, 133, 192, 0.17); border-color: rgba(132, 183, 245, 0.22); }

.question-card,
.evidence-card { border: 1px solid rgba(137, 181, 233, 0.17); background: rgba(9, 20, 33, 0.74); border-radius: 8px; padding: 14px; display: grid; gap: 10px; }
.question-card label { color: var(--text); font-size: 14px; line-height: 1.35; }
.option-question-label { color: var(--text); font-size: 14px; line-height: 1.35; }
.option-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.option-button { min-height: 52px; padding: 9px 34px 9px 10px; color: var(--muted); background: rgba(255, 255, 255, 0.04); display: grid; gap: 3px; align-content: start; text-align: left; position: relative; }
.option-button strong { color: var(--text); font-size: 13px; font-weight: 650; }
.option-button span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.option-button[aria-pressed="true"] { color: var(--text); border-color: rgba(99, 217, 255, 0.95); background: linear-gradient(180deg, rgba(29, 105, 145, 0.58), rgba(16, 63, 104, 0.74)); box-shadow: 0 0 0 2px rgba(99, 217, 255, 0.18), inset 0 0 0 1px rgba(214, 244, 255, 0.08); }
.option-button[aria-pressed="true"]::after { content: ""; position: absolute; top: 8px; right: 9px; width: 18px; height: 18px; border-radius: 999px; background: #63d9ff; }
.option-button[aria-pressed="true"]::before { content: ""; position: absolute; top: 12px; right: 15px; width: 5px; height: 9px; border: solid #061421; border-width: 0 2px 2px 0; transform: rotate(45deg); z-index: 1; }
.option-button[aria-pressed="true"] span { color: #cfe3f8; }
.evidence-form { display: grid; gap: 9px; }
.evidence-list { display: grid; gap: 10px; margin-top: 4px; }
.evidence-card h3 { font-size: 15px; }
.evidence-card p { color: #bdd0df; line-height: 1.45; font-size: 13px; white-space: pre-wrap; }
.evidence-card button { justify-self: start; padding: 7px 10px; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 230px minmax(360px, 1fr); height: auto; min-height: 100vh; overflow: visible; }
  .workspace { min-height: 640px; }
  .conversation-panel { grid-column: 1 / -1; border-width: 1px 0 0; max-height: 70vh; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar, .conversation-panel { border-width: 0 0 1px; max-height: none; }
  .workspace { padding: 10px; min-height: 560px; }
  .topbar { flex-wrap: wrap; }
  .suggestion { text-align: left; max-width: none; }
}










.status-dot.not-discussed { background: #91a5ba; color: #91a5ba; }
.status-dot.in-progress { background: #e9c84d; color: #e9c84d; }
.status-dot.ready { background: #57d66f; color: #57d66f; }
.status-dot.blocked { background: #f36b61; color: #f36b61; }
.startup-error { max-width: 720px; margin: 48px auto; padding: 28px; font-family: system-ui, sans-serif; line-height: 1.5; color: #17202a; }
.startup-error pre { padding: 14px; background: #f2f4f7; overflow: auto; }
.startup-error-detail { color: #667085; }

.app-shell .node {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  padding: 0;
}

.app-shell .node.center {
  width: clamp(138px, 22vmin, 188px);
  height: auto;
  padding: 24px;
}

.app-shell .node.child {
  width: clamp(92px, 14.5vmin, 126px);
  height: auto;
  padding: 14px;
}

.app-shell .node.parent {
  width: 92px;
  height: auto;
  padding: 12px;
}
