:root {
  --brand-900: #064e3b;
  --brand-800: #065f46;
  --brand-700: #047857;
  --brand-600: #059669;
  --brand-100: #d1fae5;
  --brand-50: #ecfdf5;
  --ink: #17211d;
  --muted: #63716a;
  --line: #dfe5e1;
  --page: #f7f9f8;
  --surface: #fff;
  --warning: #a15c00;
  --warning-soft: #fff4dc;
  --danger: #b3261e;
  --danger-soft: #fce8e6;
  --shadow: 0 1px 2px rgb(20 50 38 / 4%);
  --radius: 8px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-height: 100vh; background: var(--page); }
button, input { font: inherit; }
button { letter-spacing: 0; }
button, label { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgb(5 150 105 / 24%);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.symbol-library { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.boot-screen, .login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f3f7f5;
}
.boot-screen { align-content: center; gap: 22px; }
.brand-logo {
  display: block;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.brand-logo.boot-logo { width: 76px; height: 76px; }
.brand-logo.small { width: 42px; height: 42px; }
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--brand-100);
  border-top-color: var(--brand-700);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.spinner.small { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-card {
  width: min(420px, calc(100% - 32px));
  padding: 42px;
  border: 1px solid rgb(6 95 70 / 12%);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 24px 70px rgb(6 78 59 / 14%);
}
.login-brand, .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-brand div:last-child, .sidebar-brand div:last-child { display: grid; gap: 2px; }
.login-brand strong, .sidebar-brand strong { font-size: 20px; }
.login-brand span, .sidebar-brand span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.6px; }
.login-card h1 { margin: 38px 0 24px; font-size: 30px; letter-spacing: 0; }
.field { display: grid; gap: 8px; margin-bottom: 18px; color: #39443f; font-size: 14px; font-weight: 600; }
.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #c9d2cd;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}
.field input:hover { border-color: #87978f; }
.field input:focus { border-color: var(--brand-700); box-shadow: 0 0 0 1px var(--brand-700); outline: none; }
.code-field { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; }
.code-button { width: 118px; height: 48px; padding: 0 12px; white-space: nowrap; }
.form-error { min-height: 21px; margin: -3px 0 13px; color: var(--danger); font-size: 13px; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 650;
  transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.button:hover:not(:disabled) { box-shadow: 0 3px 10px rgb(6 78 59 / 12%); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button.primary { color: #fff; background: var(--brand-800); }
.button.primary:hover:not(:disabled) { background: var(--brand-900); }
.button.tonal { color: var(--brand-900); background: var(--brand-50); border-color: var(--brand-100); }
.button.full { width: 100%; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 240px;
  flex-direction: column;
  padding: 24px 16px 18px;
  color: #fff;
  background: var(--brand-900);
}
.sidebar-brand { padding: 0 8px 26px; }
.sidebar-brand span { color: rgb(255 255 255 / 66%); }
.main-nav { display: grid; gap: 6px; }
.main-nav button {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: rgb(255 255 255 / 72%);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
}
.main-nav button:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.main-nav button[aria-current="page"] { color: var(--brand-900); background: #fff; box-shadow: 0 4px 18px rgb(0 0 0 / 14%); }
.sidebar-user {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 36px;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid rgb(255 255 255 / 14%);
}
.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-900);
  background: var(--brand-100);
  font-weight: 800;
}
.sidebar-user div { min-width: 0; display: grid; gap: 2px; }
.sidebar-user strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user span:last-child { color: rgb(255 255 255 / 62%); font-size: 11px; }
.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgb(255 255 255 / 72%);
  background: transparent;
  cursor: pointer;
}
.icon-button:hover { color: #fff; background: rgb(255 255 255 / 10%); }
.icon-button.light { flex: 0 0 40px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.icon-button.light:hover { color: var(--brand-800); background: var(--brand-50); }

.workspace { min-height: 100vh; margin-left: 240px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px clamp(22px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(16px);
}
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: flex-end; gap: 10px; }
.project-switcher { display: grid; gap: 4px; color: var(--muted); font-size: 11px; font-weight: 650; }
.project-switcher select {
  width: min(280px, 28vw);
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  font-weight: 650;
}
.project-switcher select:disabled { cursor: default; color: var(--muted); background: var(--page); }
.content { width: min(1280px, 100%); margin: 0 auto; padding: 28px clamp(22px, 4vw, 48px) 56px; }
.view { display: grid; gap: 22px; }
.view-content { display: grid; gap: 22px; }
.view-pending { min-height: 260px; place-items: center; align-content: center; gap: 16px; text-align: center; }
.view-pending > svg { width: 36px; height: 36px; color: var(--brand-700); }
.view-pending > strong { font-size: 19px; }

.surface, .hero-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.surface { padding: 24px; }
.hero-result {
  display: flex;
  min-height: 164px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 30px;
  color: var(--ink);
  background: var(--surface);
}
.hero-content { display: grid; min-width: 0; gap: 9px; }
.hero-content .status-pill { width: fit-content; }
.hero-content h2 { margin: 0; font-size: 28px; letter-spacing: 0; overflow-wrap: anywhere; }
.hero-content p { margin: 0; color: var(--muted); font-size: 14px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 112px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 12px; font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-card small { display: block; margin-top: 8px; color: var(--muted); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--brand-900);
  background: var(--brand-100);
  font-size: 12px;
  font-weight: 750;
}
.status-pill.warning { color: var(--warning); background: var(--warning-soft); }
.status-pill.danger { color: var(--danger); background: var(--danger-soft); }

.path-segments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: #eef2f0;
}
.path-segments button {
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 650;
}
.path-segments button[aria-checked="true"] { color: var(--brand-900); background: #fff; box-shadow: 0 2px 8px rgb(30 70 53 / 10%); }
.path-segments button:disabled { cursor: not-allowed; opacity: .55; }
.path-summary, .selected-path-panel { display: grid; gap: 8px; margin: 18px 0; color: var(--muted); line-height: 1.6; }
.path-summary strong, .selected-path-panel strong { color: var(--ink); font-size: 17px; }
.selected-path-panel { grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fafcfb; }
.path-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--muted); font-size: 13px; text-align: right; }

.project-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.progress-step { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 6px 20px; border-right: 1px solid var(--line); }
.progress-step:first-child { padding-left: 0; }
.progress-step:last-child { border-right: 0; }
.progress-step > span { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 50%; color: var(--muted); background: #edf1ef; font-size: 13px; font-weight: 750; }
.progress-step.done > span { color: #fff; background: var(--brand-700); }
.progress-step svg { width: 17px; height: 17px; }
.progress-step div { display: grid; gap: 3px; }
.progress-step small { color: var(--muted); }

.projects-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 2px 0 4px; }
.projects-header h2 { margin: 0 0 14px; font-size: 22px; }
.project-filters { display: flex; gap: 4px; }
.project-filters button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 650; }
.project-filters button[aria-selected="true"] { color: var(--brand-900); background: var(--brand-50); }
.project-list { display: grid; gap: 10px; }
.project-row {
  display: grid;
  width: 100%;
  min-height: 90px;
  grid-template-columns: 44px minmax(180px, 1fr) minmax(150px, .55fr) auto 22px;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
}
.project-row:hover { border-color: #b9c8c1; }
.project-row.selected { border-color: var(--brand-600); box-shadow: inset 3px 0 0 var(--brand-700); }
.project-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 7px; color: var(--brand-800); background: var(--brand-50); }
.project-icon.large { width: 52px; height: 52px; }
.project-main, .project-meta { display: grid; min-width: 0; gap: 5px; }
.project-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-main small, .project-meta small { color: var(--muted); }
.project-main .project-missing { color: var(--warning); }
.project-meta { text-align: right; }
.project-meta strong { font-size: 13px; }
.project-chevron { color: var(--muted); }
.project-empty { display: grid; min-height: 280px; place-items: center; align-content: center; gap: 16px; border: 1px dashed #c5d0ca; border-radius: var(--radius); color: var(--muted); background: #fff; }
.project-empty > strong { color: var(--ink); font-size: 18px; }

.selection-actions { display: flex; gap: 10px; margin-top: 18px; }
.selection-actions #feedback-action-slot { display: contents; }
.surplus-control { display: grid; gap: 12px; margin-top: 18px; padding: 18px; border-radius: 7px; background: var(--brand-50); }
.surplus-control div { display: flex; justify-content: space-between; gap: 16px; }
.surplus-control output { color: var(--brand-900); font-weight: 750; }
.surplus-control input { width: 100%; accent-color: var(--brand-700); }

.parameter-table { min-width: 0; overflow-x: auto; }
.parameter-head, .parameter-row {
  display: grid;
  min-width: 880px;
  grid-template-columns: 1.35fr 1fr 42px 1fr .8fr;
  gap: 18px;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.parameter-head { padding-top: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.parameter-row:last-child { border-bottom: 0; }
.parameter-name { display: grid; gap: 4px; }
.parameter-name span, .parameter-value span { color: var(--muted); font-size: 12px; }
.parameter-value { display: grid; gap: 5px; }
.parameter-value strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.parameter-arrow { color: var(--brand-700); text-align: center; }
.parameter-change { font-size: 13px; font-weight: 750; }
.parameter-change.adjusted { color: var(--brand-700); }
.parameter-evidence summary { color: var(--brand-800); cursor: pointer; font-size: 13px; font-weight: 650; }
.parameter-evidence div { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.missing-parameters, .missing-block { padding: 16px; border-radius: 7px; color: var(--warning); background: var(--warning-soft); }

.outcome-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.outcome-card { min-height: 170px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: #fafcfb; }
.outcome-card > span { color: var(--muted); font-size: 13px; }
.outcome-card > strong { display: block; margin: 12px 0 8px; font-size: 22px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.change-badge { display: inline-flex; min-height: 27px; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; }
.change-badge.improved { color: var(--brand-900); background: var(--brand-100); }
.change-badge.worsened { color: var(--danger); background: var(--danger-soft); }
.change-badge.unchanged, .change-badge.unavailable { color: var(--muted); background: #e9eeeb; }
.outcome-baseline { display: grid; gap: 4px; margin-top: 14px; color: var(--muted); font-size: 12px; }

.scenario-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 -4px 20px; padding: 0 4px 3px; }
.scenario-tabs button { flex: 0 0 auto; min-height: 40px; padding: 0 15px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-weight: 650; }
.scenario-tabs button[aria-selected="true"] { color: var(--brand-800); border-bottom-color: var(--brand-700); }
.scenario-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.scenario-header h3 { margin: 0; font-size: 19px; }
.scenario-header p { margin: 8px 0 0; color: var(--muted); line-height: 1.65; }
.scenario-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.scenario-metric { min-height: 92px; padding: 15px; border-radius: 7px; background: var(--page); }
.scenario-metric span { color: var(--muted); font-size: 12px; }
.scenario-metric strong { display: block; margin-top: 10px; font-size: 17px; overflow-wrap: anywhere; }
.candidate-list { display: grid; gap: 9px; margin-top: 18px; }
.candidate-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 7px; }
.candidate-row div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 14px; color: var(--muted); font-size: 12px; }

.history-analysis-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.analysis-stat { padding: 16px; border-radius: 7px; background: var(--page); }
.analysis-stat span { color: var(--muted); font-size: 12px; }
.analysis-stat strong { display: block; margin-top: 8px; font-size: 17px; overflow-wrap: anywhere; }
.analysis-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.analysis-columns.single { grid-template-columns: 1fr; }
.feature-list { display: grid; gap: 10px; margin-top: 12px; }
.feature-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.analysis-notes { margin: 12px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }

.learning-grid, .admin-learning-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.learning-card {
  display: grid;
  min-height: 96px;
  align-content: start;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafcfb;
}
.learning-card span { color: var(--muted); font-size: 12px; }
.learning-card strong { font-size: 15px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.admin-version-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.admin-list-section {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.admin-list-section.full { grid-column: 1 / -1; }
.admin-list-row {
  display: grid;
  grid-template-columns: minmax(70px, .5fr) minmax(0, 1fr) minmax(120px, .7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.admin-list-row:last-child { border-bottom: 0; }
.admin-list-row span, .admin-list-row small { color: var(--muted); font-size: 12px; }
.admin-list-row strong { overflow-wrap: anywhere; }
.button.small { min-height: 32px; padding: 0 12px; font-size: 12px; }

.confidence-components { display: grid; gap: 15px; }
.confidence-row { display: grid; grid-template-columns: 130px minmax(100px, 1fr) 76px; gap: 14px; align-items: center; }
.confidence-row > span:last-child { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.confidence-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e5ebe8; }
.confidence-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand-600); }
.details-panel { margin-top: 18px; border-top: 1px solid var(--line); }
.details-panel summary { padding: 16px 0 0; color: var(--brand-800); cursor: pointer; font-weight: 650; }
.details-panel ul { margin: 13px 0 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }

.upload-surface { display: grid; justify-items: start; }
.upload-surface .section-heading { width: 100%; }
.dropzone {
  display: grid;
  width: 100%;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px;
  border: 2px dashed #b9c9c1;
  border-radius: 8px;
  color: var(--muted);
  background: #fafcfb;
  cursor: pointer;
  text-align: center;
  transition: border .18s ease, background .18s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand-600); background: var(--brand-50); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone svg { width: 32px; height: 32px; color: var(--brand-700); }
.dropzone strong { color: var(--ink); font-size: 17px; overflow-wrap: anywhere; }
.dropzone span { font-size: 12px; }
.upload-surface > .button { margin-top: 16px; }
.upload-progress { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--brand-800); }
.intake-stats { display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); }
.intake-stats strong { color: var(--ink); }
.major-data-block { margin-top: 22px; }
.major-data-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.major-data-heading h3 { margin: 0; font-size: 16px; }
.major-data-list { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.major-data-row { display: grid; grid-template-columns: minmax(130px, .7fr) minmax(240px, .9fr) minmax(220px, 1.4fr); align-items: center; gap: 18px; min-height: 62px; padding: 10px 14px; background: #fff; }
.major-data-row + .major-data-row { margin-top: 1px; }
.major-data-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.field-state { padding: 2px 7px; border-radius: 999px; color: var(--brand-800); background: #e8f4ef; font-size: 11px; font-style: normal; white-space: nowrap; }
.field-state.warning { color: #8a5a00; background: #fff2d4; }
.major-data-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.major-data-input input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid #c9d2cd; border-radius: 6px; color: var(--ink); background: #fff; }
.major-data-input input:focus { border-color: var(--brand-700); outline: 2px solid rgb(5 150 105 / 18%); }
.major-data-input em { color: var(--muted); font-size: 12px; font-style: normal; white-space: nowrap; }
.major-data-row > .source-link { min-width: 0; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.project-data-value { font-variant-numeric: tabular-nums; }
.project-data-source { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.confirm-intake-button { margin-top: 18px; }
.missing-block { margin-top: 18px; }
.missing-block h3 { margin: 0 0 8px; font-size: 15px; }
.supplement-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid #ead8b2; border-radius: 6px; background: #ead8b2; }
.supplement-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); align-items: center; gap: 20px; padding: 14px; color: var(--ink); background: #fffaf0; }
.supplement-row > span:first-child { display: grid; gap: 4px; min-width: 0; }
.supplement-row small { overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.supplement-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.supplement-input input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid #c9d2cd; border-radius: 6px; background: #fff; }
.supplement-input input:focus { border-color: var(--brand-700); outline: 2px solid rgb(5 150 105 / 18%); }
.supplement-input em { color: var(--muted); font-size: 12px; font-style: normal; white-space: nowrap; }
#apply-supplements-button { margin-top: 14px; }
.file-list, .version-list { display: grid; gap: 10px; }
.file-group { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.file-group summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; cursor: pointer; }
.file-group summary span { color: var(--muted); font-size: 12px; text-align: right; }
.file-group-rows { display: grid; gap: 8px; padding: 0 14px 14px; }
.file-group-more { margin: 0 14px 14px; }
.file-row, .version-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; }
.file-row div, .version-row div { display: grid; gap: 5px; min-width: 0; }
.file-row strong, .version-row strong { overflow-wrap: anywhere; }
.file-row span, .version-row span { color: var(--muted); font-size: 12px; }
.evidence-list { display: grid; gap: 0; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.evidence-title { margin-bottom: 7px; font-size: 13px; }
.evidence-row { display: grid; grid-template-columns: minmax(100px, .55fr) minmax(0, 1.45fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.evidence-row strong { font-size: 13px; overflow-wrap: anywhere; }
.evidence-row span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.empty-state { padding: 28px 16px; color: var(--muted); text-align: center; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: 6px;
  color: #fff;
  background: #25312b;
  box-shadow: 0 8px 28px rgb(0 0 0 / 22%);
  font-size: 14px;
}
.mobile-nav { display: none; }

.app-dialog {
  width: min(620px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
}
.app-dialog::backdrop { background: rgb(12 22 18 / 42%); }
.dialog-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 60px rgb(0 0 0 / 22%);
}
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0; font-size: 20px; }
.dialog-heading .icon-button { font-size: 22px; line-height: 1; }
.dialog-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-summary span {
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef2f0;
  font-size: 12px;
  font-weight: 650;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.empty-state.compact { padding: 12px; text-align: left; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenario-metrics, .history-analysis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-grid, .admin-learning-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 72px; padding: 10px 14px; }
  .topbar h1 { font-size: 20px; }
  .topbar p { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { gap: 7px; }
  .project-switcher > span { display: none; }
  .project-switcher select { width: min(145px, 38vw); height: 40px; }
  .content { padding: 18px 14px 34px; }
  .view { gap: 14px; }
  .view-content { gap: 14px; }
  .surface { padding: 18px; }
  .supplement-row { grid-template-columns: 1fr; gap: 10px; }
  .major-data-row { grid-template-columns: minmax(120px, .7fr) minmax(210px, 1fr); gap: 10px; }
  .major-data-row > .source-link { grid-column: 1 / -1; }
  .hero-result { min-height: 170px; align-items: flex-start; flex-direction: column; padding: 22px 20px; }
  .hero-content h2 { font-size: 24px; }
  .hero-content p { font-size: 14px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 108px; padding: 15px; }
  .metric-card strong { font-size: 19px; }
  .section-heading { margin-bottom: 16px; }
  .path-segments { grid-template-columns: repeat(3, minmax(92px, 1fr)); overflow-x: auto; }
  .selected-path-panel { grid-template-columns: 1fr; }
  .path-facts { justify-content: flex-start; text-align: left; }
  .next-action { align-items: flex-start; flex-direction: column; }
  .selection-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .selection-actions #feedback-action-slot { display: block; grid-column: 1 / -1; }
  .selection-actions #feedback-action-slot .button { width: 100%; }
  .outcome-grid { grid-template-columns: 1fr; }
  .scenario-header { flex-direction: column; }
  .scenario-metrics, .history-analysis-grid { grid-template-columns: 1fr 1fr; }
  .analysis-columns { grid-template-columns: 1fr; }
  .learning-grid, .admin-learning-grid, .admin-version-list { grid-template-columns: 1fr 1fr; }
  .learning-card:last-child { grid-column: 1 / -1; }
  .admin-list-row { grid-template-columns: minmax(0, 1fr) auto; }
  .admin-list-row small { grid-column: 1; }
  .admin-list-row .button { grid-column: 2; grid-row: 1 / 3; }
  .project-progress { grid-template-columns: 1fr; }
  .progress-step { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .progress-step:last-child { border-bottom: 0; }
  .projects-header { align-items: flex-start; }
  .projects-header .button { min-width: 42px; padding: 0 12px; }
  .project-row { grid-template-columns: 40px minmax(0, 1fr) auto 18px; gap: 12px; padding: 15px; }
  .project-meta { display: none; }
  .project-row .status-pill { grid-column: 2; width: fit-content; }
  .project-chevron { grid-column: 4; grid-row: 1 / 3; }
  .confidence-row { grid-template-columns: 94px minmax(80px, 1fr) 65px; gap: 8px; font-size: 13px; }
  .dropzone { min-height: 190px; }
  .file-row, .version-row, .candidate-row { align-items: flex-start; flex-direction: column; }
  .candidate-row div { justify-content: flex-start; }
  .scenario-tabs { display: grid; grid-template-columns: 1fr; gap: 0; overflow: visible; margin: 0 0 18px; padding: 0; }
  .scenario-tabs button { width: 100%; min-height: 44px; padding: 10px 4px; text-align: left; }
  .mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 5px 6px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -6px 22px rgb(25 50 38 / 8%);
    backdrop-filter: blur(14px);
  }
  .mobile-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    cursor: pointer;
  }
  .mobile-nav button[aria-current="page"] { color: var(--brand-800); background: var(--brand-50); font-weight: 750; }
  .mobile-nav svg { width: 21px; height: 21px; }
  .toast { right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .dialog-card { padding: 20px; }
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 430px) {
  .major-data-heading { align-items: stretch; flex-direction: column; }
  .major-data-row { grid-template-columns: 1fr; }
  .major-data-row > .source-link { grid-column: auto; }
  .login-card { padding: 30px 22px; }
  .metric-grid, .scenario-metrics, .history-analysis-grid, .learning-grid, .admin-learning-grid, .admin-version-list { grid-template-columns: 1fr; }
  .learning-card:last-child { grid-column: auto; }
  .project-switcher select { width: 124px; }
  .project-filters button { padding: 0 10px; }
  .projects-header .button span { display: none; }
  .parameter-table { overflow: visible; }
  .parameter-head { display: none; }
  .parameter-row {
    min-width: 0;
    grid-template-columns: 1fr 30px 1fr;
    gap: 10px;
    padding: 18px 0;
  }
  .parameter-name { grid-column: 1 / -1; }
  .parameter-change, .parameter-evidence { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
