/* Vector Odyssey interface layer.
 * A single visual system is shared by the idea space and delivery center.
 * Layout rules stay in each workspace stylesheet; this file owns the product
 * language: quiet surfaces, generous spacing, readable type and one accent.
 */
:root {
  --ui-bg: #f7f7f5;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f1f1ef;
  --ui-ink: #202123;
  --ui-muted: #6b6c6f;
  --ui-subtle: #929397;
  --ui-line: #e4e4e1;
  --ui-line-strong: #d2d2ce;
  --ui-accent: #0d8f71;
  --ui-accent-soft: #e8f5f0;
  --ui-danger: #b64943;
  --ui-shadow: 0 14px 38px rgba(32, 33, 35, 0.08);
  --ui-radius: 12px;
  color: var(--ui-ink);
  background: var(--ui-bg);
}

html,
body {
  background: var(--ui-bg);
  color: var(--ui-ink);
  font-family:
    var(--font-sans),
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.topbar {
  height: 68px;
  padding: 0 28px;
  gap: 24px;
  border-bottom: 1px solid var(--ui-line);
  color: var(--ui-ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 10px rgba(32, 33, 35, 0.03);
  backdrop-filter: blur(16px);
}

.brand {
  gap: 11px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid #d7d7d3;
  border-radius: 9px;
  background: #ebe1ce;
  box-shadow: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
}

.brand-mark span {
  display: none;
}

.brand-name {
  color: var(--ui-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.15px;
}

.brand-subtitle {
  gap: 8px;
  color: var(--ui-subtle);
  font-size: 11px;
}

.brand-module {
  color: var(--ui-ink);
  border-color: var(--ui-line);
}

.role-switch {
  width: 224px;
  height: 36px;
  padding: 3px;
  border: 1px solid var(--ui-line);
  border-radius: 9px;
  background: var(--ui-surface-soft);
}

.role-option {
  color: var(--ui-muted);
  border-radius: 7px;
  font-size: 12px;
  transition:
    color 150ms ease,
    background 150ms ease;
}

.role-option.is-active {
  color: var(--ui-ink);
  background: var(--ui-surface);
  box-shadow: 0 1px 4px rgba(32, 33, 35, 0.08);
}

.topbar-center,
.build-context {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.build-context {
  gap: 18px;
}

.build-context-label {
  max-width: 190px;
  overflow: hidden;
  color: var(--ui-subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-nav-link {
  min-width: 118px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  color: var(--ui-muted);
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.workspace-nav-link:hover {
  border-color: var(--ui-line);
  color: var(--ui-ink);
  background: var(--ui-surface-soft);
}

.workspace-nav-link.is-active {
  border-color: #cce4da;
  color: var(--ui-ink);
  background: var(--ui-accent-soft);
}

.workspace-step {
  color: var(--ui-subtle);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.workspace-nav-link.is-active .workspace-step {
  color: var(--ui-accent);
}

.workspace-nav-link strong,
.workspace-nav-link small {
  display: block;
  line-height: 1.2;
}

.workspace-nav-link strong {
  font-size: 12px;
  font-weight: 750;
}

.workspace-nav-link small {
  margin-top: 3px;
  color: var(--ui-subtle);
  font-size: 10px;
}

.workspace-nav-line {
  width: 18px;
  height: 1px;
  background: var(--ui-line-strong);
}

.workspace-nav:has(.workspace-nav-link[hidden]) .workspace-nav-line {
  display: none;
}

.topbar-actions {
  gap: 9px;
}

.service-state,
.topbar .role-label {
  color: var(--ui-muted);
  font-size: 12px;
}

.service-state i {
  background: #c89436;
}

.service-state.is-online i {
  background: var(--ui-accent);
  box-shadow: 0 0 0 3px rgba(13, 143, 113, 0.12);
}

.topbar .button,
.topbar .icon-button {
  min-height: 36px;
  border-radius: 8px;
}

.topbar .button-secondary,
.topbar .icon-button {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
  background: var(--ui-surface);
}

.topbar .button-secondary:hover:not(:disabled),
.topbar .icon-button:hover {
  border-color: #aaa9a4;
  color: var(--ui-ink);
  background: var(--ui-surface-soft);
}

.workspace {
  grid-template-columns: 276px minmax(0, 1fr);
  background: var(--ui-bg);
}

.sidebar {
  border-right: 1px solid var(--ui-line);
  color: var(--ui-ink);
  background: #f1f1ef;
  box-shadow: none;
}

.sidebar-head {
  min-height: 104px;
  padding: 22px 18px 15px;
}

.sidebar h2,
.modal h2 {
  color: var(--ui-ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.25px;
}

.sidebar .eyebrow,
.eyebrow {
  color: var(--ui-subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar .icon-button {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
  background: var(--ui-surface);
}

.sidebar .icon-button:hover {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

.filter-row {
  gap: 6px;
  padding: 0 18px 14px;
}

.filter-chip {
  min-height: 29px;
  padding: 0 10px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  color: var(--ui-muted);
  background: transparent;
  font-size: 11px;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

.requirement-list,
.sidebar-list {
  padding: 0 10px 16px;
}

.requirement-item,
.side-item {
  margin-bottom: 5px;
  padding: 14px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ui-ink);
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.requirement-item:hover,
.side-item:hover {
  border-color: var(--ui-line);
  background: rgba(255, 255, 255, 0.72);
}

.requirement-item.is-active,
.side-item.is-active {
  border-color: #c8ddd5;
  background: var(--ui-surface);
  box-shadow:
    inset 3px 0 var(--ui-accent),
    0 4px 12px rgba(32, 33, 35, 0.04);
}

.requirement-item-title,
.side-title {
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 700;
}

.requirement-item-summary,
.requirement-item-meta,
.side-summary,
.side-item-meta,
.empty-list {
  color: var(--ui-muted);
}

.sidebar-foot {
  border-top-color: var(--ui-line);
  color: var(--ui-muted);
  background: #ececea;
}

.settings-dock {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 110;
  width: 251px;
}

body.auth-locked .settings-dock {
  visibility: hidden;
  pointer-events: none;
}

.settings-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  color: var(--ui-ink);
  background: var(--ui-surface);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(32, 33, 35, 0.08);
  text-align: left;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.settings-trigger:hover,
.settings-trigger[aria-expanded="true"] {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-soft);
}

.settings-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--ui-ink);
  font-size: 12px;
  font-weight: 750;
}

.settings-user {
  min-width: 0;
}

.settings-user strong,
.settings-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-user strong {
  color: var(--ui-ink);
  font-size: 12px;
  font-weight: 700;
}

.settings-user small {
  margin-top: 2px;
  color: var(--ui-subtle);
  font-size: 10px;
}

.settings-gear {
  color: var(--ui-muted);
  font-size: 17px;
  line-height: 1;
  text-align: center;
  transition:
    transform 180ms ease,
    color 180ms ease;
}

.settings-trigger:hover .settings-gear,
.settings-trigger[aria-expanded="true"] .settings-gear {
  color: var(--ui-accent);
  transform: rotate(28deg);
}

.settings-menu {
  position: fixed;
  left: 14px;
  bottom: 76px;
  z-index: 120;
  width: min(276px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  color: var(--ui-ink);
  background: var(--ui-surface);
  box-shadow: 0 20px 56px rgba(32, 33, 35, 0.17);
}

.settings-menu-head,
.settings-section,
.theme-options {
  display: flex;
  align-items: center;
}

.settings-menu-head,
.settings-section {
  justify-content: space-between;
}

.settings-menu-head {
  padding: 2px 2px 12px;
  font-size: 13px;
}

.settings-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  color: var(--ui-muted);
  background: transparent;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.settings-close:hover {
  color: var(--ui-ink);
  background: var(--ui-surface-soft);
}

.settings-section {
  gap: 10px;
  color: var(--ui-muted);
  font-size: 11px;
}

.theme-options {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
  background: var(--ui-surface-soft);
}

.theme-options button {
  min-height: 27px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  color: var(--ui-muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.theme-options button:hover,
.theme-options button.is-active {
  color: var(--ui-ink);
  background: var(--ui-surface);
  box-shadow: 0 1px 3px rgba(32, 33, 35, 0.08);
}

.settings-divider {
  height: 1px;
  margin: 14px 0 10px;
  background: var(--ui-line);
}

.settings-logout {
  width: 100%;
  padding: 8px 2px;
  border: 0;
  color: var(--ui-danger);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.settings-logout:hover {
  color: #d26057;
}

.main-content {
  background: var(--ui-bg);
}

.detail-layout {
  gap: 1px;
  background: var(--ui-line);
}

.conversation-pane,
.spec-pane {
  background: var(--ui-surface);
}

.detail-head,
.spec-head,
.detail-header {
  border-bottom-color: var(--ui-line);
  background: var(--ui-surface);
}

.detail-head h1,
.detail-header h1 {
  color: var(--ui-ink);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.55px;
}

.meta-row,
.build-meta,
.panel-head span {
  color: var(--ui-muted);
}

.status-badge {
  border-color: #c9e4da;
  border-radius: 999px;
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

.conversation-scroll,
.spec-content,
.spec-scroll,
.detail-body {
  background: var(--ui-bg);
}

.conversation-scroll {
  padding: 28px 30px 34px;
}

.message {
  margin-bottom: 22px;
}

.message-label {
  margin-bottom: 8px;
  color: var(--ui-subtle);
  font-size: 11px;
}

.message-body {
  padding: 15px 17px;
  border: 1px solid var(--ui-line);
  border-radius: 12px 12px 12px 4px;
  color: var(--ui-ink);
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
  font-size: 14px;
  line-height: 1.75;
}

.message.student .message-body {
  border-color: #d7e6e0;
  border-radius: 12px 12px 4px 12px;
  color: #135d4e;
  background: #eaf5f1;
  box-shadow: none;
}

.message.teacher .message-body {
  border-color: #e5d3ce;
  background: #fcf6f4;
}

.question-impact,
.notice {
  border-radius: 10px;
  border-left: 3px solid var(--ui-accent);
  color: #385d54;
  background: var(--ui-accent-soft);
  font-size: 12px;
}

.notice.is-error {
  border-left-color: var(--ui-danger);
  color: #773631;
  background: #fbedeb;
}

.composer,
.review-box,
.approval-box {
  padding: 19px 26px;
  border-top-color: var(--ui-line);
  background: var(--ui-surface);
  box-shadow: 0 -6px 22px rgba(32, 33, 35, 0.035);
}

.composer textarea,
.review-box textarea,
.field input,
.field textarea,
.field select,
.admin-create-form input,
.admin-create-form select,
.inline-build-form select {
  border: 1px solid var(--ui-line-strong);
  border-radius: 10px;
  color: var(--ui-ink);
  background: #fcfcfb;
  font-size: 14px;
}

.composer textarea:focus,
.review-box textarea:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.admin-create-form input:focus,
.admin-create-form select:focus,
.inline-build-form select:focus {
  border-color: var(--ui-accent);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(13, 143, 113, 0.13);
}

.button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button-primary {
  border-color: var(--ui-ink);
  color: #fff;
  background: var(--ui-ink);
}

.button-primary:hover:not(:disabled) {
  border-color: #3b3d40;
  background: #3b3d40;
}

.button-secondary {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
  background: var(--ui-surface);
}

.button-secondary:hover:not(:disabled) {
  border-color: #aaa9a4;
  background: var(--ui-surface-soft);
}

.button-danger {
  border-color: #e0b5b0;
  color: var(--ui-danger);
  background: #fff;
}

.progress-track {
  height: 6px;
  border-radius: 99px;
  background: #e5e8e5;
}

.progress-track i {
  border-radius: 99px;
  background: var(--ui-accent);
}

.progress-panel {
  color: var(--ui-ink);
}

.progress-panel .progress-meta strong,
.progress-panel .progress-meta span,
.progress-panel.is-complete .progress-meta strong,
.progress-panel.is-complete .progress-meta span {
  color: var(--ui-ink);
}

.progress-panel.is-complete .pipeline,
.progress-panel.is-complete .pipeline-stage {
  color: var(--ui-muted);
  background: transparent;
}

.progress-panel.is-complete .pipeline-stage.is-done {
  color: var(--ui-ink);
}

.tab-button,
.content-tab {
  color: var(--ui-muted);
  font-size: 13px;
}

.tab-button.is-active,
.content-tab.is-active {
  border-bottom-color: var(--ui-ink);
  color: var(--ui-ink);
}

.spec-section {
  border-bottom-color: var(--ui-line);
}

.spec-section h3,
.panel-head h2,
.panel-head h3,
.result-card h3,
.result-flow h3 {
  color: var(--ui-ink);
  font-size: 14px;
  font-weight: 750;
}

.spec-section p,
.spec-list li,
.positioning,
.facts-list li,
.result-card > p,
.result-list li {
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.7;
}

.spec-list li::before,
.result-list li::before {
  background: var(--ui-accent);
}

.fit-verdict,
.result-card,
.result-flow,
.result-details,
.student-summary,
.student-boundary,
.panel,
.architecture-details,
.progress-panel,
.artifact-group,
.test-layout > .panel {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  background: var(--ui-surface);
  box-shadow: 0 4px 16px rgba(32, 33, 35, 0.035);
}

.fit-verdict {
  border-color: #cae5db;
  background: var(--ui-accent-soft);
}

.fit-symbol {
  border-radius: 8px;
  background: var(--ui-accent);
}

.service-connection-list {
  display: grid;
  gap: 10px;
}

.service-connection {
  padding: 12px 14px;
  border: 1px solid var(--ui-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ui-surface) 86%, var(--ui-accent-soft));
}

.service-connection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-connection p {
  margin: 5px 0 2px;
  color: var(--ui-ink);
  font-size: 13px;
}

.service-connection small {
  display: block;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.55;
}

.service-connection-links {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
}

.service-setup-steps {
  margin: 8px 0 0 18px;
  color: var(--ui-muted);
  font-size: 12px;
  line-height: 1.55;
}

.service-cost-note {
  margin-top: 7px;
}

.diagram-wrap {
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: #fafaf9;
}

/* Workflow canvases are dragged and zoomed; they are not text documents. */
.diagram-wrap .diagram-stage,
.diagram-wrap .diagram-stage * {
  user-select: none;
  -webkit-user-select: none;
}

.diagram-toolbar {
  border-bottom-color: var(--ui-line);
  background: #f4f4f2;
}

.diagram-tool,
.mini-button {
  border-color: var(--ui-line-strong);
  border-radius: 8px;
  color: var(--ui-ink);
  background: var(--ui-surface);
}

.diagram-tool:hover,
.mini-button:hover {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

.diagram-viewport {
  background: #fbfbfa;
}

/* Keep a horizontal workflow legible on narrow screens. Mermaid can compute a
 * one-line graph shorter than the controls around it; a small floor preserves
 * a usable target without changing its scale or layout. */
.diagram-wrap svg {
  min-height: 70px;
}

.modal-backdrop {
  background: rgba(32, 33, 35, 0.38);
  backdrop-filter: blur(9px);
}

.modal {
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  box-shadow: 0 26px 80px rgba(32, 33, 35, 0.18);
}

.modal-head {
  border-bottom: 1px solid var(--ui-line);
  border-radius: 16px 16px 0 0;
  background: var(--ui-surface);
}

.form-stack {
  background: var(--ui-surface);
}

.toast {
  border: 1px solid #4e5552;
  border-radius: 10px;
  background: #292c2b;
  box-shadow: 0 16px 42px rgba(32, 33, 35, 0.18);
}

.chat-home,
.builder-chat-home {
  padding: 9vh 36px 72px;
  background: var(--ui-bg);
}

.chat-home-shell,
.builder-chat-shell {
  width: min(820px, 100%);
  gap: 25px;
}

.chat-home-header {
  gap: 15px;
}

.assistant-avatar {
  width: 44px;
  height: 44px;
  border: 1px solid #d5d9d6;
  border-radius: 12px;
  color: #fff;
  background: var(--ui-ink);
  box-shadow: 0 5px 14px rgba(32, 33, 35, 0.12);
}

.chat-home-header h1 {
  margin: 5px 0 9px;
  color: var(--ui-ink);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 750;
  letter-spacing: -1px;
}

.chat-home-header p:not(.eyebrow),
.home-message p {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.75;
}

.home-message {
  padding: 17px 19px;
  border: 1px solid var(--ui-line);
  border-radius: 12px 12px 12px 4px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow);
}

.home-message-label {
  color: var(--ui-accent);
  font-size: 12px;
  font-weight: 750;
}

.starter-chip {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 999px;
  color: var(--ui-muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.starter-chip:hover {
  border-color: var(--ui-accent);
  color: var(--ui-accent);
  background: var(--ui-accent-soft);
}

.quick-composer,
.builder-chat-composer {
  padding: 16px;
  border: 1px solid var(--ui-line-strong);
  border-radius: 14px;
  background: var(--ui-surface);
  box-shadow: 0 18px 48px rgba(32, 33, 35, 0.09);
}

.quick-composer textarea,
.builder-chat-composer textarea {
  min-height: 116px;
  font-size: 14px;
}

.quick-composer-actions span,
.builder-chat-composer .quick-composer-actions span {
  color: var(--ui-subtle);
  font-size: 12px;
}

.login-screen {
  padding: 18px;
  background: #e9e9e6;
}

.login-shell {
  width: min(1180px, 100%);
  height: min(760px, calc(100vh - 36px));
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 26px 80px rgba(32, 33, 35, 0.14);
}

.login-visual {
  padding: 46px;
  color: #f5f5f2;
  background: #202123;
}

.login-brand,
.login-card-brand {
  gap: 11px;
}

.login-brand > span,
.login-card-brand > span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.login-brand .brand-mark,
.login-card-brand .brand-mark {
  border-color: rgba(255, 255, 255, 0.22);
}

.login-visual-copy {
  max-width: 470px;
  margin-top: 22vh;
}

.login-visual-copy > p {
  color: #7fe1c1;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.login-visual-copy h2 {
  margin: 12px 0 16px;
  color: #f6f6f3;
  font-size: clamp(36px, 4vw, 58px);
  font-weight: 720;
  letter-spacing: -1.5px;
  line-height: 1.08;
}

.login-visual-copy > span {
  color: #b4b8b6;
  font-size: 14px;
  line-height: 1.8;
}

.login-flow {
  gap: 18px;
  margin-top: 28vh;
}

.login-flow li {
  gap: 8px;
  color: #b4b8b6;
}

.login-flow li span {
  color: #7fe1c1;
  font-size: 11px;
}

.login-flow li strong {
  color: #f5f5f2;
  font-size: 12px;
}

.login-panel {
  padding: 54px;
  background: var(--ui-surface);
}

.login-card {
  width: min(380px, 100%);
  margin: auto;
}

.login-card-brand {
  margin-bottom: 88px;
  color: var(--ui-ink);
}

.login-card-brand .brand-mark {
  border-color: #d7d7d3;
}

.login-card .eyebrow {
  color: var(--ui-accent);
}

.login-card h1 {
  margin: 9px 0 8px;
  color: var(--ui-ink);
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.8px;
}

.login-copy {
  color: var(--ui-muted);
  font-size: 14px;
  line-height: 1.7;
}

.login-form {
  gap: 16px;
  margin-top: 30px;
}

.login-card .field > span {
  color: var(--ui-ink);
  font-size: 12px;
  font-weight: 700;
}

.login-card .field input {
  min-height: 46px;
  margin-top: 7px;
  border-radius: 9px;
  background: #fcfcfb;
  font-size: 14px;
}

.login-form .button {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.login-error {
  min-height: 18px;
  color: var(--ui-danger);
  font-size: 12px;
}

.login-foot {
  margin-top: 24px;
  color: var(--ui-subtle);
  font-size: 11px;
}

@media (max-width: 900px) {
  .topbar {
    padding: 0 18px;
  }

  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .login-visual {
    padding: 34px;
  }

  .login-panel {
    padding: 34px;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .topbar {
    height: auto;
    min-height: 66px;
    padding: 10px 14px;
  }

  .workspace {
    display: block;
    height: auto;
  }

  .teacher-workspace,
  .teacher-workspace > .detail-layout {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--ui-line);
  }

  .login-screen {
    padding: 10px;
    background: #e9e9e6;
  }

  .login-shell {
    width: 100%;
    height: auto;
    min-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    min-height: calc(100vh - 20px);
    padding: 30px 24px;
  }

  .login-card-brand {
    margin-bottom: 54px;
  }

  .chat-home,
  .builder-chat-home {
    padding: 42px 18px 52px;
  }
}

/* Conversation lifecycle: the model state stays visible while the request
   runs, and the plan controls remain compact once a revision exists. */
.model-job-head strong {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-waiting-spinner {
  width: 0.85rem;
  height: 0.85rem;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ai-waiting-spin 0.75s linear infinite;
  opacity: 0.78;
}

@keyframes ai-waiting-spin {
  to {
    transform: rotate(360deg);
  }
}

.resource-action {
  position: relative;
  display: inline-flex;
}

.resource-tooltip {
  position: absolute;
  z-index: 4;
  left: 0;
  bottom: calc(100% + 0.55rem);
  width: max-content;
  max-width: 18rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--ui-line-strong);
  border-radius: 0.55rem;
  background: var(--ui-surface);
  color: var(--ui-muted);
  box-shadow: var(--ui-shadow);
  font-size: 0.76rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.25rem);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.resource-action:hover .resource-tooltip,
.resource-action:focus-within .resource-tooltip,
.resource-action > button:hover + .resource-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.plan-version-history {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--ui-line);
  border-radius: 0.8rem;
  background: var(--ui-surface-soft);
}

.plan-version-history > div:first-child {
  display: grid;
  gap: 0.2rem;
}

.plan-version-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.plan-version-controls select {
  min-height: 2.35rem;
  padding: 0 0.55rem;
  border: 1px solid var(--ui-line-strong);
  border-radius: 0.55rem;
  background: var(--ui-surface);
  color: var(--ui-ink);
}

.confirmed-info-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.confirmed-info-list li {
  display: grid;
  gap: 0.16rem;
}

.confirmed-info-list b {
  color: var(--ui-ink);
  font-size: 0.78rem;
}

@media (max-width: 760px) {
  .plan-version-history {
    align-items: stretch;
    flex-direction: column;
  }

  .plan-version-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 560px) {
  .brand-subtitle > span:last-child,
  .service-state,
  .topbar-actions #builderLink,
  .topbar-actions #ideaLink,
  .topbar-actions .role-label {
    display: none;
  }

  .topbar-actions .button {
    padding: 0 11px;
  }

  .chat-home-header h1 {
    font-size: 30px;
    letter-spacing: -0.7px;
  }

  .conversation-scroll,
  .spec-content,
  .spec-scroll,
  .detail-head {
    padding-left: 18px;
    padding-right: 18px;
  }
}

body[data-theme="dark"] {
  --ui-bg: #171717;
  --ui-surface: #212121;
  --ui-surface-soft: #2a2a2a;
  --ui-ink: #f2f2f0;
  --ui-muted: #b2b2af;
  --ui-subtle: #858582;
  --ui-line: #3d3d3a;
  --ui-line-strong: #595955;
  --ui-accent: #68d5b1;
  --ui-accent-soft: #19382f;
  --ui-danger: #e2766d;
  --ui-shadow: 0 14px 38px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

body[data-theme="dark"] .topbar {
  border-bottom-color: #343432;
  color: var(--ui-ink);
  background: rgba(24, 24, 24, 0.94);
}

body[data-theme="dark"] .sidebar {
  border-right-color: #343432;
  color: var(--ui-ink);
  background: #1b1b1b;
}

body[data-theme="dark"] .main-content,
body[data-theme="dark"] .conversation-scroll,
body[data-theme="dark"] .spec-content,
body[data-theme="dark"] .spec-scroll,
body[data-theme="dark"] .detail-body {
  background: var(--ui-bg);
}

body[data-theme="dark"] .conversation-pane,
body[data-theme="dark"] .spec-pane,
body[data-theme="dark"] .detail-head,
body[data-theme="dark"] .spec-head,
body[data-theme="dark"] .composer,
body[data-theme="dark"] .review-box,
body[data-theme="dark"] .approval-box,
body[data-theme="dark"] .home-message,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .result-card,
body[data-theme="dark"] .result-flow,
body[data-theme="dark"] .result-details,
body[data-theme="dark"] .student-summary,
body[data-theme="dark"] .student-boundary,
body[data-theme="dark"] .progress-panel,
body[data-theme="dark"] .artifact-group,
body[data-theme="dark"] .test-layout > .panel,
body[data-theme="dark"] .quick-composer,
body[data-theme="dark"] .builder-chat-composer {
  background: var(--ui-surface);
  color: var(--ui-ink);
}

body[data-theme="dark"] .sidebar-foot,
body[data-theme="dark"] .diagram-toolbar {
  border-color: var(--ui-line);
  background: #1d1d1d;
}

body[data-theme="dark"] .message-body,
body[data-theme="dark"] .field input,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .composer textarea,
body[data-theme="dark"] .review-box textarea,
body[data-theme="dark"] .quick-composer textarea,
body[data-theme="dark"] .builder-chat-composer textarea {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
  background: #292929;
}

body[data-theme="dark"] .message.student .message-body {
  border-color: #285e50;
  color: #a5ebd1;
  background: #19382f;
}

body[data-theme="dark"] .message.teacher .message-body {
  border-color: #5e4843;
  background: #302421;
}

body[data-theme="dark"] .requirement-item:hover,
body[data-theme="dark"] .side-item:hover {
  border-color: var(--ui-line);
  background: #242424;
}

body[data-theme="dark"] .requirement-item.is-active,
body[data-theme="dark"] .side-item.is-active {
  border-color: #3c6b5d;
  background: #252525;
}

body[data-theme="dark"] .diagram-wrap,
body[data-theme="dark"] .diagram-viewport {
  border-color: var(--ui-line);
  background: #1d1d1d;
}

body[data-theme="dark"] .workspace-nav-link.is-active {
  border-color: #396c5c;
  background: #19382f;
}

body[data-theme="dark"] .button-secondary,
body[data-theme="dark"] .topbar .button-secondary,
body[data-theme="dark"] .topbar .icon-button,
body[data-theme="dark"] .sidebar .icon-button,
body[data-theme="dark"] .diagram-tool,
body[data-theme="dark"] .mini-button {
  border-color: var(--ui-line-strong);
  color: var(--ui-ink);
  background: var(--ui-surface);
}

body[data-theme="dark"] .button-primary {
  border-color: #f2f2f0;
  color: #171717;
  background: #f2f2f0;
}

body[data-theme="dark"] .modal-head,
body[data-theme="dark"] .form-stack {
  color: var(--ui-ink);
  background: var(--ui-surface);
}

body[data-theme="dark"] .login-screen {
  background: #101010;
}

body[data-theme="dark"] .login-panel {
  background: var(--ui-surface);
}

body[data-theme="dark"] .login-card h1,
body[data-theme="dark"] .login-card-brand,
body[data-theme="dark"] .login-card .field > span {
  color: var(--ui-ink);
}

/* A quieter, conversation-first shell inspired by modern chat workspaces. */
.topbar {
  height: 56px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  padding: 0 20px;
  border-bottom-color: var(--ui-line);
  background: var(--ui-surface);
  box-shadow: none;
}

.brand {
  gap: 9px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: #f5c84c;
  box-shadow: 0 1px 2px rgba(32, 33, 35, 0.12);
}

.brand-mark img {
  object-fit: cover;
  object-position: center;
}

.brand-name {
  font-size: 14px;
  font-weight: 650;
}

.brand-subtitle {
  display: none;
}

.workspace-nav {
  gap: 2px;
}

.workspace-nav-line,
.workspace-step {
  display: none;
}

.workspace-nav-link {
  min-width: 0;
  gap: 0;
  padding: 7px 11px;
  border-color: transparent;
  border-radius: 8px;
  color: var(--ui-muted);
}

.workspace-nav-link:hover,
.workspace-nav-link.is-active {
  border-color: transparent;
  color: var(--ui-ink);
  background: var(--ui-surface-soft);
}

.workspace-nav-link.is-active {
  box-shadow: none;
}

.workspace-nav-link strong {
  font-size: 12px;
  font-weight: 650;
}

.workspace-nav-link small,
.build-context-label {
  display: none;
}

.workspace {
  height: calc(100vh - 56px);
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  border-right-color: var(--ui-line);
  background: var(--ui-surface-soft);
  box-shadow: none;
}

.sidebar-head {
  min-height: 72px;
  padding: 14px 14px 10px;
}

.sidebar h2,
.modal h2 {
  font-size: 15px;
  letter-spacing: -0.1px;
}

.sidebar .icon-button {
  width: 32px;
  height: 32px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
}

.sidebar .icon-button:hover {
  border-color: transparent;
  background: var(--ui-surface);
}

.filter-row {
  padding: 0 14px 10px;
}

.filter-chip {
  min-height: 28px;
  border-color: transparent;
  background: transparent;
}

.filter-chip:hover,
.filter-chip.is-active {
  border-color: transparent;
  color: var(--ui-ink);
  background: var(--ui-surface);
}

.requirement-list,
.sidebar-list {
  padding: 0 8px 84px;
}

.requirement-item,
.side-item {
  margin-bottom: 1px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.requirement-item:hover,
.side-item:hover,
.requirement-item.is-active,
.side-item.is-active {
  border-color: transparent;
  background: var(--ui-surface);
  box-shadow: none;
}

.sidebar-foot {
  display: none;
}

.settings-dock {
  left: 12px;
  bottom: 12px;
  width: 238px;
}

.settings-trigger {
  border-color: var(--ui-line);
  border-radius: 10px;
  background: var(--ui-surface);
  box-shadow: 0 2px 8px rgba(32, 33, 35, 0.08);
}

.settings-trigger:hover,
.settings-trigger[aria-expanded="true"] {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-soft);
}

.settings-menu {
  left: 12px;
  bottom: 72px;
  z-index: 120;
}

.main-content {
  background: var(--ui-bg);
}

.chat-home,
.builder-chat-home {
  padding: 8vh 24px 88px;
  background: var(--ui-bg);
}

.chat-home-shell,
.builder-chat-shell {
  width: min(760px, 100%);
  gap: 20px;
}

.chat-home-header {
  gap: 12px;
}

.assistant-avatar {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  box-shadow: none;
}

.chat-home-header h1 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.8px;
}

.home-message {
  padding: 15px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--ui-surface);
  box-shadow: none;
}

.quick-composer,
.builder-chat-composer {
  padding: 12px;
  border-color: var(--ui-line-strong);
  border-radius: 17px;
  background: var(--ui-surface);
  box-shadow: 0 8px 28px rgba(32, 33, 35, 0.08);
}

.quick-composer textarea,
.builder-chat-composer textarea {
  min-height: 88px;
  background: transparent;
}

.conversation-scroll {
  padding: 30px max(24px, calc((100% - 760px) / 2)) 120px;
}

.message-body {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message.student .message-body {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--ui-ink);
  background: var(--ui-surface-soft);
}

.composer,
.review-box,
.approval-box {
  padding: 12px 20px;
  border-top-color: var(--ui-line);
  box-shadow: none;
}

@media (max-width: 760px) {
  .topbar {
    height: 56px;
    min-height: 56px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 12px;
  }

  .topbar-center,
  .build-context {
    display: none;
  }

  .workspace {
    height: calc(100vh - 56px);
  }

  .settings-dock {
    left: 10px;
    bottom: 10px;
    width: min(238px, calc(100vw - 20px));
  }

  .settings-menu {
    left: 10px;
    bottom: 70px;
  }

  .chat-home,
  .builder-chat-home {
    padding: 42px 18px 100px;
  }

  .conversation-scroll {
    padding-right: 18px;
    padding-left: 18px;
  }
}
