:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #1d1d1f;
  --muted: rgba(0, 0, 0, 0.56);
  --line: rgba(0, 0, 0, 0.1);
  --teal: #0071e3;
  --teal-soft: rgba(0, 113, 227, 0.1);
  --indigo: #0071e3;
  --indigo-soft: rgba(0, 113, 227, 0.1);
  --green: #0071e3;
  --green-soft: rgba(0, 113, 227, 0.1);
  --amber: #6e6e73;
  --amber-soft: #ededf2;
  --coral: #1d1d1f;
  --coral-soft: #ededf2;
  --shadow: rgba(0, 0, 0, 0.16) 3px 5px 30px 0;
  --shadow-soft: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  background: rgba(0, 0, 0, 0.82);
  border-right: 0;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 9px;
  min-width: 188px;
  padding: 0;
  border-bottom: 0;
  color: #ffffff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #f5f5f7;
  color: #1d1d1f;
  font-weight: 700;
}

.brand strong,
.brand span,
.sidebar-status strong,
.sidebar-status span {
  display: block;
}

.brand span,
.sidebar-status span,
.panel-header p,
.page-summary,
.brief-card p,
.metric-card small,
.metric-card span,
.control small,
.report-preview li,
.report-preview p,
.template-card p {
  color: var(--muted);
}

.brand span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.2;
}

.brand strong {
  color: #ffffff;
  font-size: 14px;
  line-height: 1.1;
}

.nav-list {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-item {
  position: relative;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: auto;
  bottom: 0;
  width: auto;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  background: transparent;
  color: #ffffff;
  font-weight: 400;
}

.nav-item.active::before {
  background: var(--teal);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 600;
}

.sidebar-status {
  margin-top: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2997ff;
  box-shadow: none;
}

.sidebar-status strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.1;
}

.sidebar-status span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  line-height: 1.1;
}

.main {
  min-width: 0;
  padding: 0 0 48px;
}

.topbar {
  position: static;
  top: auto;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 174px;
  margin: 0;
  padding: 48px max(32px, calc((100vw - 1180px) / 2)) 40px;
  background: #f5f5f7;
  border-bottom: 0;
  backdrop-filter: none;
}

.eyebrow {
  margin: 0 0 7px;
  color: rgba(0, 0, 0, 0.48);
  font-size: 13px;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 9px;
  font-size: 48px;
  font-weight: 600;
  line-height: 1.07;
}

.page-summary {
  max-width: 760px;
  margin: 0;
  color: rgba(0, 0, 0, 0.72);
  font-size: 17px;
  line-height: 1.47;
}

h2 {
  margin-bottom: 4px;
  font-size: 17px;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions.inline {
  justify-content: flex-end;
}

.icon-button,
.primary-button,
.segment,
.report-tab {
  border: 1px solid transparent;
  border-radius: 980px;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgba(210, 210, 215, 0.64);
  color: var(--ink);
  font-size: 18px;
  border: 0;
}

.icon-button.compact {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  font-weight: 400;
  white-space: nowrap;
  box-shadow: none;
}

.primary-button.full-width {
  width: 100%;
}

.primary-button.slim {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 14px;
}

.content-page {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
}

.content-page.active {
  display: block;
}

.workspace-brief,
.metric-grid,
.dashboard-grid,
.two-column,
.analysis-grid,
.report-workspace,
.feedback-grid,
.model-card-grid {
  display: grid;
  gap: 16px;
}

.workspace-brief {
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr) minmax(260px, 0.7fr);
  margin-bottom: 20px;
}

.brief-card {
  min-height: 168px;
  padding: 28px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.brief-card.main-brief {
  background: #000000;
  color: #ffffff;
  border-left: 0;
}

.brief-kicker {
  display: block;
  margin-bottom: 10px;
  color: #0066cc;
  font-size: 12px;
  font-weight: 600;
}

.main-brief .brief-kicker {
  color: #2997ff;
}

.brief-card h2 {
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.14;
}

.brief-card p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.55;
}

.main-brief p {
  color: rgba(255, 255, 255, 0.74);
}

.compact-list,
.flow-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(0, 0, 0, 0.8);
  font-size: 13px;
  line-height: 1.75;
}

.flow-list {
  display: grid;
  gap: 6px;
  padding-left: 22px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.metric-card,
.panel {
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 126px;
  padding: 22px 20px;
  border-top: 0;
}

.metric-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
}

.metric-card.accent-green {
  border-top-color: transparent;
}

.metric-card.accent-amber {
  border-top-color: transparent;
}

.metric-card.accent-coral {
  border-top-color: transparent;
}

.dashboard-grid,
.analysis-grid {
  grid-template-columns: minmax(0, 1.36fr) minmax(320px, 0.64fr);
}

.two-column {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.7fr);
}

.report-workspace {
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.08fr) minmax(280px, 0.58fr);
}

.panel {
  padding: 22px;
  overflow: hidden;
}

.wide-panel,
.full-panel {
  grid-column: span 2;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 13px;
}

.panel-header p {
  margin-bottom: 0;
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.chip.healthy {
  color: #0066cc;
  background: rgba(0, 113, 227, 0.1);
}

.chip.warning {
  color: rgba(0, 0, 0, 0.8);
  background: #ededf2;
}

.chip.danger {
  color: rgba(0, 0, 0, 0.8);
  background: #ededf2;
}

.chip.neutral {
  color: #0066cc;
  background: rgba(0, 113, 227, 0.1);
}

.segmented,
.report-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 11px;
  background: #fafafc;
  border: 3px solid rgba(0, 0, 0, 0.04);
}

.segment,
.report-tab {
  min-height: 30px;
  padding: 4px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.segment.active,
.report-tab.active {
  background: var(--surface);
  color: var(--teal);
  box-shadow: none;
}

.chart-wrap {
  position: relative;
  min-height: 342px;
  padding: 14px 18px 34px 44px;
  border-radius: 8px;
  background: #f5f5f7;
  border: 0;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(16, minmax(18px, 1fr));
  grid-auto-rows: 17px;
  gap: 5px;
  width: 100%;
  min-height: 260px;
  align-content: center;
}

.heat-cell {
  border-radius: 5px;
  background: var(--teal-soft);
  border: 0;
}

.axis-label {
  position: absolute;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.x-axis {
  right: 18px;
  bottom: 8px;
}

.y-axis {
  left: 2px;
  top: 46%;
  transform: rotate(-90deg);
}

.run-stack,
.plugin-list,
.solver-toggle-list,
.report-outline,
.sensitivity,
.case-compare {
  display: grid;
  gap: 10px;
}

.run-item,
.plugin-item,
.control,
.solver-toggle,
.report-line,
.feedback-card,
.model-card,
.compare-item {
  border: 0;
  border-radius: 8px;
  background: #f5f5f7;
}

.run-item {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.run-item strong,
.plugin-item strong,
.solver-toggle strong,
.feedback-card strong,
.model-card strong {
  display: block;
}

.run-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0071e3;
}

.plugin-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
}

.waterfall {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 190px;
  padding: 12px 0 4px;
}

.waterfall-bar {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 150px;
}

.bar-body {
  border-radius: 8px 8px 4px 4px;
  background: var(--teal);
  min-height: 24px;
}

.bar-body.loss {
  background: #6e6e73;
}

.bar-body.warn {
  background: #d2d2d7;
}

.waterfall-bar small {
  color: var(--muted);
  font-size: 12px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.control {
  padding: 12px;
}

.control label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-weight: 700;
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.template-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #f5f5f7;
}

.template-visual {
  position: relative;
  height: 72px;
  border-radius: 8px;
  background: #ffffff;
  border: 0;
}

.template-visual span {
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(0, 113, 227, 0.42);
  border-radius: 50%;
}

.template-visual span:nth-child(2) {
  inset: 22px 10px;
  border-color: rgba(0, 0, 0, 0.2);
}

.template-visual span:nth-child(3) {
  inset: 9px 26px;
  border-color: rgba(0, 0, 0, 0.12);
}

.objective-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.objective-list span {
  padding: 7px 9px;
  border-radius: 999px;
  background: var(--indigo-soft);
  color: #0066cc;
  font-size: 12px;
  font-weight: 600;
}

.solver-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d2d2d7;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}

.switch input:checked + span {
  background: var(--teal);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.table-wrap {
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: #f5f5f7;
  font-size: 12px;
}

tr:last-child td {
  border-bottom: 0;
}

.dag {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dag-node {
  position: relative;
  padding: 12px;
  border-radius: 8px;
  border: 0;
  background: #f5f5f7;
}

.dag-node::after {
  content: "";
  position: absolute;
  right: -11px;
  top: 50%;
  width: 10px;
  height: 2px;
  background: var(--line);
}

.dag-node:last-child::after {
  display: none;
}

.dag-node strong {
  display: block;
  margin-bottom: 6px;
}

.pareto {
  width: 100%;
  min-height: 330px;
  border: 0;
  border-radius: 8px;
  background: #f5f5f7;
}

.sensitivity-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.sensitivity-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.sensitivity-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--indigo);
}

.case-compare {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.selected-case {
  display: grid;
  align-content: start;
  gap: 12px;
}

.case-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.case-stats span {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #f5f5f7;
  color: var(--ink);
}

.case-stats strong {
  color: var(--muted);
  font-size: 12px;
}

.compare-item {
  padding: 12px;
}

.compare-item dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

.compare-item dt {
  color: var(--muted);
}

.compare-item dd {
  margin: 0;
  font-weight: 700;
}

.report-tabs {
  display: flex;
  margin-bottom: 12px;
}

.report-outline {
  counter-reset: report;
}

.report-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
}

.report-line::before {
  counter-increment: report;
  content: counter(report);
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.report-preview {
  padding: 14px;
  border-radius: 8px;
  background: #f5f5f7;
  border: 0;
}

.mini-report-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.mini-chart {
  position: relative;
  min-height: 120px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.pareto-mini {
  background: #ffffff;
}

.pareto-mini::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 62px;
  height: 3px;
  border-radius: 999px;
  background: #0071e3;
  transform: rotate(-28deg);
}

.pareto-mini::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 72px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1d1d1f;
  box-shadow:
    34px -22px 0 #0071e3,
    72px -35px 0 #6e6e73,
    104px -48px 0 #0071e3;
}

.heat-mini {
  background: #ffffff;
}

.heat-mini::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 22px;
  width: 18px;
  height: 12px;
  border-radius: 4px;
  background: #edf6ff;
  box-shadow:
    24px 0 0 #bddcff,
    48px 0 0 #2997ff,
    72px 0 0 #0071e3,
    96px 0 0 #d2d2d7,
    0 18px 0 #bddcff,
    24px 18px 0 #2997ff,
    48px 18px 0 #0071e3,
    72px 18px 0 #2997ff,
    96px 18px 0 #f5f5f7,
    0 36px 0 #f5f5f7,
    24px 36px 0 #bddcff,
    48px 36px 0 #2997ff,
    72px 36px 0 #bddcff,
    96px 36px 0 #edf6ff;
}

.report-feedback-panel {
  align-self: start;
}

.feedback-mini-list {
  display: grid;
  gap: 10px;
}

.feedback-mini-list div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #f5f5f7;
}

.feedback-mini-list span {
  color: var(--muted);
  font-size: 13px;
}

.feedback-mini-list em {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: #0066cc;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.report-preview ul {
  margin: 0;
  padding-left: 20px;
}

.feedback-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feedback-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-actions button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #0066cc;
  border-radius: 999px;
  background: var(--surface);
  color: #0066cc;
  cursor: pointer;
}

.model-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.model-card meter {
  width: 100%;
  height: 10px;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.84);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.4;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.toast.success {
  background: rgba(0, 113, 227, 0.94);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.modal-card {
  width: min(560px, 100%);
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  color: rgba(0, 0, 0, 0.72);
  font-size: 13px;
  font-weight: 600;
}

.modal-form input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.modal-form input:focus {
  border-color: #0071e3;
  outline: 3px solid rgba(0, 113, 227, 0.18);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.btn-outline {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid #0071e3;
  border-radius: 980px;
  background: transparent;
  color: #0066cc;
  cursor: pointer;
}

.feedback-actions button.active,
.feedback-actions button:hover {
  background: #0071e3;
  color: #fff;
}

.feedback-status {
  width: fit-content;
}

@media (max-width: 1160px) {
  .sidebar {
    height: auto;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 10px 18px;
  }

  .brand {
    min-height: 34px;
  }

  .nav-list {
    order: 3;
    flex: 0 0 100%;
    padding-top: 2px;
  }

  .sidebar-status {
    margin-left: auto;
  }

  .workspace-brief,
  .report-workspace {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .analysis-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .wide-panel,
  .full-panel {
    grid-column: span 1;
  }

  .dag {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dag-node::after {
    display: none;
  }

  .case-compare,
  .feedback-grid,
  .model-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 0;
    background: rgba(0, 0, 0, 0.88);
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    display: grid;
    width: 100%;
    gap: 2px 8px;
    overflow: visible;
  }

  .nav-item {
    justify-content: flex-start;
    min-height: 38px;
    border-radius: 980px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.06);
  }

  .sidebar-status {
    display: none;
  }

  .main {
    padding: 0 0 32px;
  }

  .topbar {
    position: static;
    margin: 0;
    padding: 34px 16px 28px;
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
  }

  h1 {
    font-size: 36px;
  }

  .content-page {
    padding: 0 14px;
  }

  .metric-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .brief-card h2 {
    font-size: 18px;
  }

  .page-summary {
    font-size: 12px;
  }

  .panel-header {
    flex-direction: column;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .chart-wrap {
    min-height: 300px;
    padding-left: 28px;
  }

  .heatmap {
    grid-template-columns: repeat(8, minmax(18px, 1fr));
    min-height: 210px;
  }

  .waterfall {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }

  .template-card {
    grid-template-columns: 1fr;
  }
}
