:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --line: #dbe3ee;
  --line-strong: #b8c4d6;
  --text: #111827;
  --muted: #64748b;
  --subtle: #94a3b8;
  --teal: #0f8b8d;
  --teal-soft: #dff6f3;
  --indigo: #4f46e5;
  --indigo-soft: #eef2ff;
  --green: #15803d;
  --green-soft: #e9f8ef;
  --amber: #b45309;
  --amber-soft: #fff3d6;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 20px 14px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 4px 8px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.brand p,
.brand strong,
.brand span,
.side-status p,
.side-status strong {
  margin: 0;
}

.brand p {
  color: var(--muted);
  font-size: 13px;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 9px 10px;
}

.nav-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-button.active {
  background: var(--indigo-soft);
  border-color: #c7d2fe;
  color: #312e81;
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef6f7;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.nav-meta {
  color: var(--subtle);
  font-size: 12px;
}

.side-status {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: var(--surface-soft);
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
}

.side-status strong {
  font-size: 13px;
}

.side-status p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.main {
  min-width: 0;
  overflow-x: hidden;
  padding: 18px 24px 34px;
}

.topbar {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: -18px -24px 18px;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-weight: 700;
  font-size: 13px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.project-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.top-select {
  min-width: 220px;
  grid-template-columns: auto minmax(140px, 1fr);
  display: grid;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.top-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.top-select select {
  border: 0;
  padding: 0;
  color: var(--text);
  font-weight: 800;
  background: transparent;
  min-width: 0;
}

.search-field {
  width: 160px;
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 10px;
}

.search-field span {
  color: var(--subtle);
}

.search-field input {
  border: 0;
  padding: 0;
  min-width: 0;
  box-shadow: none;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #243b8f;
  color: #ffffff;
  font-weight: 800;
}

.page-heading {
  min-height: 56px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.project-pill {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 12px;
  display: grid;
  gap: 2px;
}

.project-pill span {
  color: var(--muted);
  font-size: 12px;
}

.project-pill strong {
  font-size: 13px;
}

.content {
  display: grid;
  gap: 16px;
}

.workspace-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 16px;
  align-items: start;
}

.workspace-main {
  display: grid;
  gap: 16px;
}

.gate-rail {
  position: sticky;
  top: 82px;
  display: grid;
  gap: 14px;
}

.gate-rail .panel {
  box-shadow: none;
}

.big-score {
  font-size: 32px;
  line-height: 1;
  font-weight: 850;
  margin: 12px 0 4px;
}

.score-scale {
  height: 8px;
  border-radius: 8px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 8px 0;
}

.score-scale span {
  display: block;
  height: 100%;
  width: 72%;
  background: var(--teal);
}

.purpose-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.purpose-panel strong {
  display: block;
  margin-bottom: 7px;
}

.purpose-panel p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 10px;
}

.thread-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.thread-card {
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  display: grid;
  align-content: space-between;
}

.thread-card strong {
  color: var(--teal);
}

.thread-card span {
  color: var(--muted);
  font-size: 13px;
}

.thread-card small {
  color: var(--subtle);
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-table th,
.activity-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  font-size: 13px;
}

.activity-table th {
  color: var(--muted);
  font-weight: 800;
  background: var(--surface-soft);
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.panel,
.metric,
.task-row,
.model-card,
.claim-row,
.impact-row,
.brief-box,
.kernel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

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

.panel-header p,
.muted {
  color: var(--muted);
  line-height: 1.55;
}

.metric {
  padding: 14px;
  min-height: 112px;
  display: grid;
  align-content: space-between;
}

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

.metric strong {
  font-size: 28px;
  line-height: 1.1;
}

.metric small {
  color: var(--subtle);
}

.thread-image {
  width: 100%;
  min-height: 170px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.stage {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-soft);
}

.stage strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.stage span {
  color: var(--muted);
  font-size: 12px;
}

.tag,
.risk,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tag {
  background: #eef6f7;
  color: #0f766e;
}

.risk.green,
.pill.green {
  color: var(--green);
  background: var(--green-soft);
}

.risk.yellow,
.pill.yellow {
  color: var(--amber);
  background: var(--amber-soft);
}

.risk.red,
.pill.red {
  color: var(--red);
  background: var(--red-soft);
}

.pill.blue {
  color: var(--indigo);
  background: var(--indigo-soft);
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.14);
}

.primary-button,
.secondary-button {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
  border: 1px solid transparent;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
}

.secondary-button {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.brief-box {
  padding: 14px;
}

.brief-box ul,
.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.graph-board {
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  align-items: center;
}

.graph-node {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  min-height: 86px;
}

.graph-node strong {
  display: block;
  margin-bottom: 7px;
}

.graph-node span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.claim-list,
.task-list,
.impact-list,
.activity-list {
  display: grid;
  gap: 9px;
}

.claim-row,
.task-row,
.impact-row {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.claim-row p,
.task-row p,
.impact-row p {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.physics-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
}

.control-stack {
  display: grid;
  gap: 13px;
}

.range-row {
  display: grid;
  gap: 8px;
}

.range-row output {
  color: var(--text);
  font-weight: 800;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--teal);
}

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

.loss-bar {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.loss-bar header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.bar-track {
  height: 10px;
  border-radius: 8px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 8px;
  background: var(--teal);
}

.bar-fill.amber {
  background: var(--amber);
}

.bar-fill.indigo {
  background: var(--indigo);
}

.bar-fill.red {
  background: var(--red);
}

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

.kernel-card,
.model-card {
  padding: 13px;
}

.kernel-card header,
.model-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.kernel-card p,
.model-card p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

.task-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.task-index {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--indigo-soft);
  color: var(--indigo);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.adapter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.adapter {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.adapter strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.adapter span {
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.tab.active {
  border-color: #99f6e4;
  background: var(--teal-soft);
  color: #115e59;
}

.section-stack {
  display: grid;
  gap: 10px;
}

.review-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 160px;
  gap: 16px;
  align-items: start;
}

.donut-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  text-align: center;
}

.donut {
  width: 132px;
  height: 132px;
  margin: 4px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--teal) 0 84%, #e2e8f0 84% 100%);
}

.donut span {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #ffffff;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 26px;
  font-weight: 850;
}

.version-stack {
  display: grid;
  gap: 10px;
}

.version-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.version-card strong {
  display: block;
  margin-bottom: 4px;
}

.review-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 12px;
  align-items: center;
}

.progress-line {
  height: 8px;
  border-radius: 8px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-line span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.export-box {
  min-height: 150px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.notice {
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .topbar {
    margin: -18px -14px 18px;
    padding: 14px;
    align-items: stretch;
    flex-direction: column;
  }

  .project-controls {
    flex-wrap: wrap;
  }

  .side-status {
    display: none;
  }

  .grid.cols-4,
  .stage-strip,
  .adapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .physics-layout {
    grid-template-columns: 1fr;
  }

  .workspace-screen {
    grid-template-columns: 1fr;
  }

  .review-layout {
    grid-template-columns: 1fr;
  }

  .gate-rail {
    position: static;
  }

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

@media (max-width: 760px) {
  .main {
    padding: 18px 14px 28px;
  }

  .sidebar,
  .content,
  .panel,
  .metric,
  .thread-card,
  .purpose-panel {
    min-width: 0;
    max-width: 100%;
  }

  .topbar,
  .panel-header,
  .claim-row,
  .task-row,
  .impact-row,
  .review-section {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-actions {
    justify-content: start;
    flex-wrap: wrap;
  }

  .project-pill {
    min-width: 0;
  }

  .project-controls,
  .top-select,
  .search-field,
  .page-heading {
    width: 100%;
  }

  .top-select {
    min-width: 0;
  }

  .nav-list,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .form-grid,
  .graph-board,
  .result-grid,
  .kernel-grid,
  .stage-strip,
  .adapter-grid {
    grid-template-columns: 1fr;
  }

  .thread-flow {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .metric strong {
    font-size: 24px;
  }
}

/* Apple-inspired visual pass from apple.zip DESIGN.md */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --text: #1d1d1f;
  --muted: rgba(0, 0, 0, 0.66);
  --subtle: rgba(0, 0, 0, 0.48);
  --teal: #0071e3;
  --teal-soft: rgba(0, 113, 227, 0.10);
  --indigo: #0066cc;
  --indigo-soft: rgba(0, 102, 204, 0.10);
  --green: #0071e3;
  --green-soft: rgba(0, 113, 227, 0.10);
  --amber: #6e6e73;
  --amber-soft: rgba(0, 0, 0, 0.06);
  --red: #1d1d1f;
  --red-soft: rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.14) 3px 5px 30px 0px;
  --radius: 12px;
}

body {
  background: #f5f5f7;
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.374px;
  -webkit-font-smoothing: antialiased;
}

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

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

.brand {
  min-height: 48px;
  padding: 0;
  border-bottom: 0;
  color: #ffffff;
  flex: 0 0 auto;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
}

.brand p,
.brand span {
  display: none;
}

.brand strong {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.28px;
}

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

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-button {
  width: auto;
  min-height: 32px;
  grid-template-columns: minmax(0, auto);
  color: rgba(255, 255, 255, 0.78);
  border: 0;
  border-radius: 980px;
  padding: 4px 12px;
  background: transparent;
  font-size: 12px;
  letter-spacing: -0.12px;
  white-space: nowrap;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-icon,
.nav-meta,
.side-status {
  display: none;
}

.main {
  padding: 0 24px 64px;
  background: #f5f5f7;
}

.topbar {
  position: sticky;
  top: 48px;
  z-index: 15;
  margin: 0 -24px 0;
  min-height: 56px;
  padding: 8px 24px;
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.page-heading,
.content {
  width: min(100%, 1180px);
  margin-left: auto;
  margin-right: auto;
}

.page-heading {
  padding: 28px 0 16px;
  min-height: auto;
}

.eyebrow {
  color: rgba(0, 0, 0, 0.48);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.28px;
}

h2 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  font-size: 17px;
  font-weight: 600;
}

.top-select,
.search-field,
.icon-button,
.metric,
.panel,
.purpose-panel,
.thread-card,
.stage,
.claim-row,
.task-row,
.impact-row,
.kernel-card,
.model-card,
.brief-box,
.adapter,
.version-card,
.donut-card {
  border: 0;
  box-shadow: none;
}

.top-select,
.search-field {
  min-height: 36px;
  background: #fafafc;
  border-radius: 11px;
  border: 3px solid rgba(0, 0, 0, 0.04);
  padding: 4px 12px;
}

.top-select {
  min-width: 238px;
}

.top-select select,
.search-field input {
  font-size: 14px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(210, 210, 215, 0.64);
  color: rgba(0, 0, 0, 0.54);
}

.avatar {
  width: 34px;
  height: 34px;
  background: #1d1d1f;
}

.pill,
.tag,
.risk {
  border-radius: 980px;
  min-height: 26px;
  padding: 4px 11px;
}

.pill.blue,
.tag,
.risk.green,
.risk.yellow,
.pill.green,
.pill.yellow {
  color: #0066cc;
  background: rgba(0, 113, 227, 0.10);
}

.risk.red,
.pill.red {
  color: #1d1d1f;
  background: rgba(0, 0, 0, 0.08);
}

.primary-button,
.secondary-button,
.tab {
  border-radius: 980px;
  border: 1px solid #0071e3;
  min-height: 38px;
  padding: 6px 18px;
  font-weight: 400;
}

.primary-button {
  background: #0071e3;
  color: #ffffff;
}

.secondary-button,
.tab {
  background: transparent;
  color: #0066cc;
}

.tab.active {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
}

.metric,
.panel,
.purpose-panel,
.brief-box {
  background: #ffffff;
  border-radius: 18px;
}

.metric {
  min-height: 136px;
  padding: 24px;
}

.metric strong {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.28px;
}

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

.gate-rail {
  top: 124px;
}

.gate-rail .panel {
  background: #000000;
  color: #ffffff;
  border-radius: 18px;
}

.gate-rail .panel p,
.gate-rail .panel .muted,
.gate-rail .panel .loss-bar header {
  color: rgba(255, 255, 255, 0.72);
}

.gate-rail .bar-track {
  background: rgba(255, 255, 255, 0.18);
}

.big-score {
  font-size: 48px;
  font-weight: 600;
}

.score-scale span,
.bar-fill,
.bar-fill.amber,
.bar-fill.indigo,
.bar-fill.red {
  background: #0071e3;
}

.thread-flow {
  gap: 12px;
}

.thread-card,
.stage,
.adapter {
  background: #f5f5f7;
  border-radius: 14px;
}

.thread-card strong {
  color: #1d1d1f;
  font-size: 21px;
  line-height: 1.14;
}

.graph-board {
  border: 0;
  background: #f5f5f7;
  border-radius: 18px;
}

.graph-node,
.claim-row,
.task-row,
.impact-row,
.review-section,
.kernel-card,
.model-card {
  border: 0;
  border-radius: 14px;
  background: #f5f5f7;
}

.kernel-card:hover,
.model-card:hover,
.metric:hover {
  box-shadow: rgba(0, 0, 0, 0.14) 3px 5px 30px 0px;
}

input,
select,
textarea {
  border-color: #d2d2d7;
  border-radius: 8px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0071e3;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.20);
}

.activity-table th {
  background: #f5f5f7;
}

.donut {
  background: conic-gradient(#0071e3 0 84%, #e5e5ea 84% 100%);
}

.donut span {
  color: #0071e3;
}

@media (max-width: 1100px) {
  .sidebar {
    height: auto;
    min-height: 48px;
    align-items: flex-start;
    padding: 8px 14px;
    flex-wrap: wrap;
  }

  .brand {
    min-height: 32px;
  }

  .nav-list {
    flex-basis: 100%;
  }

  .topbar {
    top: 86px;
    margin: 0 -14px 0;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 0 12px 40px;
  }

  .page-heading {
    display: grid;
    padding-top: 20px;
  }

  .metric {
    min-height: 118px;
  }

  .metric strong {
    font-size: 34px;
  }

  .gate-rail .panel {
    background: #ffffff;
    color: #1d1d1f;
  }

  .gate-rail .panel p,
  .gate-rail .panel .muted,
  .gate-rail .panel .loss-bar header {
    color: rgba(0, 0, 0, 0.66);
  }

  .gate-rail .bar-track {
    background: #e5e5ea;
  }
}

@media (max-width: 1100px) {
  .workspace-screen,
  .physics-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .gate-rail {
    position: static;
  }

  .grid.cols-4,
  .thread-flow,
  .stage-strip,
  .adapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    min-height: 92px;
    height: 92px;
    gap: 8px;
    padding: 8px 12px 10px;
    align-items: center;
  }

  .brand {
    flex-basis: 100%;
    min-height: 28px;
  }

  .nav-list {
    flex-basis: auto;
    width: 100%;
    gap: 8px;
    scroll-snap-type: x proximity;
  }

  .nav-button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 12px;
    scroll-snap-align: start;
  }

  .main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    position: static;
    margin-left: -12px;
    margin-right: -12px;
  }

  .project-controls,
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .thread-flow,
  .stage-strip,
  .adapter-grid,
  .kernel-grid,
  .result-grid,
  .graph-board,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .metric,
  .panel,
  .purpose-panel,
  .thread-card,
  .stage,
  .task-row,
  .claim-row,
  .impact-row {
    width: 100%;
  }

  .review-section {
    grid-template-columns: 1fr;
  }

  .brand strong {
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
