:root {
  --ink: #171a1d;
  --muted: #656863;
  --panel: #f7f4ed;
  --panel-soft: #f0ece3;
  --line: #d2ccc0;
  --line-strong: #aaa397;
  --accent: #d8772f;
  --accent-strong: #9f4e1d;
  --signal: #2e765c;
  --scene: #f3f0e8;
  --type-micro: 0.66rem;
  --type-caption: 0.72rem;
  --type-ui: 0.8rem;
  --type-value: 0.84rem;
  --type-read: 0.9rem;
  --type-heading: 0.98rem;
  --shadow-subtle: 0 10px 24px rgba(15, 23, 42, 0.06);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--scene);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.case-home {
  position: fixed;
  z-index: 30;
  top: 14px;
  left: 18px;
  padding: 7px 10px;
  border: 1px solid rgba(23, 26, 29, 0.2);
  background: rgba(243, 240, 232, 0.9);
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

button {
  min-height: 34px;
  border: 1px solid #b8c2cc;
  border-radius: 3px;
  background: #f8fafc;
  color: #1f2937;
  font: inherit;
  font-size: var(--type-ui);
  font-weight: 720;
  padding: 0 12px;
  box-shadow: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px var(--inspector-width, 410px);
  grid-template-rows: minmax(0, 1fr) var(--review-height, 228px);
  grid-template-areas:
    "viewer resizer inspector"
    "review resizer inspector";
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
}

.app-shell.is-review-collapsed {
  --review-height: 42px;
}

.split-resizer {
  grid-area: resizer;
  position: relative;
  z-index: 6;
  min-width: 8px;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  background: #eef2f6;
  cursor: col-resize;
  touch-action: none;
}

.split-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 46px;
  border-left: 1px solid #94a3b8;
  border-right: 1px solid #94a3b8;
  transform: translate(-50%, -50%);
}

.app-shell.is-resizing,
.app-shell.is-resizing * {
  cursor: col-resize;
  user-select: none;
}

.viewer-section {
  grid-area: viewer;
  position: relative;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(20, 121, 168, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 121, 168, 0.065) 1px, transparent 1px),
    var(--scene);
  background-size: 32px 32px;
}

.viewer {
  position: absolute;
  inset: 0;
}

.viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.selection-callout {
  position: absolute;
  z-index: 5;
  min-width: 54px;
  border: 1px solid #b7791f;
  border-left: 4px solid #f5b700;
  border-radius: 2px;
  background: #fffdf2;
  color: #5f3b00;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  font-weight: 820;
  line-height: 1;
  padding: 6px 8px;
  pointer-events: none;
  transform: translate(12px, -50%);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.14);
}

.selection-callout::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -12px;
  width: 10px;
  border-top: 2px solid #f5b700;
  transform: translateY(-50%);
}

.selection-callout[hidden] {
  display: none !important;
}

.top-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.top-bar > div {
  min-width: 0;
  max-width: 292px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid #1479a8;
  background: #ffffff;
  padding: 8px 10px;
  box-shadow: var(--shadow-subtle);
}

.top-bar button {
  flex: 0 0 auto;
  pointer-events: auto;
  white-space: nowrap;
}

.view-toolbar {
  position: absolute;
  top: 94px;
  left: 16px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: auto;
}

.mode-toolbar {
  position: absolute;
  top: 136px;
  left: 16px;
  z-index: 3;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.view-toolbar button {
  min-height: 32px;
  border-color: #b8c2cc;
  background: #ffffff;
  color: #263242;
  font-size: var(--type-ui);
  font-weight: 650;
  padding: 0 10px;
  box-shadow: none;
}

.view-toolbar button.is-active,
.mode-toolbar button.is-active {
  border-color: #1479a8;
  background: #e0f2fe;
  color: #0f172a;
}

.mode-toolbar button {
  min-height: 32px;
  border-color: #b8c2cc;
  background: #ffffff;
  color: #263242;
  font-size: var(--type-ui);
  font-weight: 720;
  padding: 0 10px;
}

.axis-gizmo {
  position: absolute;
  right: 18px;
  top: 94px;
  z-index: 2;
  width: 92px;
  height: 92px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: none;
  overflow: hidden;
  pointer-events: none;
}

.axis-gizmo::after {
  position: absolute;
  left: 7px;
  bottom: 5px;
  content: "GLOBAL";
  color: #64748b;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  font-weight: 750;
  letter-spacing: 0;
}

.grid-label,
.scale-label {
  position: absolute;
  right: 18px;
  top: 192px;
  z-index: 2;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 560;
  padding: 6px 9px;
  pointer-events: none;
  box-shadow: none;
}

.scale-label {
  top: 228px;
}

.axis-gizmo canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.view-context,
.legend-panel {
  position: absolute;
  z-index: 2;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: none;
}

.view-context {
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
}

.view-context div {
  min-width: 0;
  background: #f8fafc;
  padding: 7px 10px;
}

.view-context span,
.legend-note {
  display: block;
  color: var(--muted);
  font-size: var(--type-micro);
  font-weight: 700;
  text-transform: uppercase;
}

.view-context strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-value);
  font-weight: 650;
}

.app-shell[data-workspace="results"] .view-context {
  display: none;
}

.legend-panel {
  left: 16px;
  bottom: 90px;
  width: min(236px, calc(100% - 32px));
  padding: 10px;
}

.legend-panel[hidden],
.legend-row[hidden] {
  display: none !important;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #263242;
  font-size: var(--type-ui);
  font-weight: 620;
  line-height: 1.35;
  margin-top: 7px;
}

.legend-swatch {
  width: 28px;
  height: 8px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08);
}

.legend-swatch.tension {
  background: #dc263f;
}

.legend-swatch.compression {
  background: #0057b8;
}

.legend-swatch.low-force {
  background: #9aa6b2;
}

.legend-swatch.load-arrow {
  background: #ff8a00;
}

.legend-note {
  margin: 10px 0 0;
  text-transform: none;
  line-height: 1.35;
  font-size: var(--type-caption);
  font-weight: 420;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: var(--type-micro);
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  max-width: 280px;
  color: var(--ink);
  font-size: clamp(1.22rem, 1.45vw, 1.38rem);
  font-weight: 820;
}

.viewer-model-badge {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  color: #334155;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  font-weight: 680;
  line-height: 1.25;
}

h2 {
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 780;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.state-badge {
  flex: 0 0 auto;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #f1f5f9;
  color: #475569;
  font-size: var(--type-caption);
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1;
  padding: 6px 8px;
  text-transform: uppercase;
}

.info-panel {
  grid-area: inspector;
  display: grid;
  align-content: start;
  gap: 20px;
  border-left: 0;
  background: #f8fafc;
  padding: 22px;
  overflow-y: auto;
  box-shadow: none;
}

.info-panel section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.info-panel section:last-child {
  border-bottom: 0;
}

.state-primary {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 0.7fr;
  margin-top: 16px;
  border: 1px solid #b8c2cc;
  border-radius: 3px;
  overflow: hidden;
  background: #ffffff;
}

.state-primary div {
  min-width: 0;
  border-right: 1px solid #d8e0e8;
  padding: 11px 12px;
}

.state-primary div:last-child {
  border-right: 0;
}

.state-primary span,
.state-details dt {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.state-primary strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #111827;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-heading);
  font-weight: 820;
}

.state-details {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  border-top: 1px solid var(--line);
}

.state-details div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}

.state-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #263242;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-value);
  font-weight: 720;
}

.member-grid,
.summary-grid,
.context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin: 18px 0 0;
}

.member-grid div,
.summary-grid div,
.context-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 12px;
  background: var(--panel-soft);
}

dt {
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 760;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-heading);
  font-weight: 760;
}

.interpretation {
  margin: 18px 0 0;
  border-left: 3px solid #94a3b8;
  color: #2d3748;
  font-size: var(--type-read);
  line-height: 1.55;
  padding-left: 12px;
}

.display-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.display-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-soft);
  color: #263242;
  font-size: var(--type-read);
  font-weight: 720;
  padding: 7px 10px;
}

.display-options input {
  width: 15px;
  height: 15px;
  accent-color: #475569;
}

.status-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.status-list div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.status-list p {
  margin: 0;
  color: #344054;
  font-size: var(--type-read);
  line-height: 1.45;
}

.status-list strong {
  color: var(--ink);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #aebac7;
  margin-top: 4px;
}

.info-panel {
  gap: 0;
  padding: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 14px 16px 12px;
}

.workflow-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  position: sticky;
  top: 0;
  z-index: 12;
  border-bottom: 1px solid #d8e0e8;
  background: #ffffff;
}

.workflow-step {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 62px;
  border: 0;
  border-right: 1px solid #edf1f5;
  border-radius: 0;
  background: #ffffff;
  padding: 10px 8px;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.workflow-step:last-child {
  border-right: 0;
}

.workflow-step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: var(--type-caption);
  font-weight: 820;
  line-height: 1;
}

.workflow-step strong {
  overflow-wrap: anywhere;
  color: #475569;
  font-size: var(--type-caption);
  font-weight: 760;
  line-height: 1.2;
}

.workflow-step:hover {
  background: #f8fafc;
}

.workflow-step:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #1479a8;
  outline-offset: -2px;
}

.workflow-step.is-active {
  background: #f8fbff;
  box-shadow: inset 0 -2px 0 #1479a8;
}

.workflow-step.is-active span {
  border-color: #1479a8;
  background: #1479a8;
  color: #ffffff;
}

.workflow-step.is-active strong {
  color: #0f172a;
}

[data-workspace-view][hidden] {
  display: none !important;
}

.workspace-alert {
  margin: 0;
  border-bottom: 1px solid #fecaca;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #d8e0e8;
  background: #f8fbff;
}

.kpi-strip div {
  min-width: 0;
  border-right: 1px solid #d8e0e8;
  padding: 10px 12px;
}

.kpi-strip div:last-child {
  border-right: 0;
}

.kpi-strip span {
  display: block;
  color: #64748b;
  font-size: var(--type-micro);
  font-weight: 820;
  line-height: 1;
  text-transform: uppercase;
}

.kpi-strip strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-value);
  font-weight: 820;
  line-height: 1.2;
}

.panel-kicker {
  margin: 0 0 4px;
  color: #475569;
  font-size: var(--type-micro);
  font-weight: 820;
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.panel-header h2 {
  color: #111827;
  font-size: var(--type-heading);
  font-weight: 780;
  line-height: 1.2;
}

.info-panel .property-section {
  border-bottom: 1px solid #d8e0e8;
  background: #ffffff;
  padding: 0;
}

.section-bar {
  border-bottom: 1px solid #d8e0e8;
  border-left: 3px solid #1479a8;
  background: #f8fafc;
  color: #1e293b;
  font-size: var(--type-caption);
  font-weight: 820;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 7px 16px;
  text-transform: uppercase;
}

.result-strip {
  display: grid;
  grid-template-columns: 0.85fr 1.25fr;
  border-bottom: 1px solid #d8e0e8;
  background: #ffffff;
}

.result-strip div {
  min-width: 0;
  border-right: 1px solid #d8e0e8;
  padding: 9px 12px;
}

.result-strip div:last-child {
  border-right: 0;
}

.result-strip span {
  display: block;
  color: #64748b;
  font-size: var(--type-micro);
  font-weight: 820;
  line-height: 1;
  text-transform: uppercase;
}

.result-strip strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: #111827;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-read);
  font-weight: 820;
  line-height: 1.2;
}

.property-list {
  display: grid;
  margin: 0;
}

.property-list div {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-width: 0;
  border-bottom: 1px solid #edf1f5;
  padding: 7px 16px;
}

.property-list div:last-child {
  border-bottom: 0;
}

.property-list dt {
  color: #64748b;
  font-size: var(--type-caption);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.property-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-size: var(--type-ui);
  font-weight: 640;
  line-height: 1.35;
}

.selection-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #d8e0e8;
  background: #ffffff;
  padding: 10px 16px;
}

.selection-summary strong {
  overflow-wrap: anywhere;
  color: #111827;
  font-size: var(--type-heading);
  font-weight: 780;
  line-height: 1.25;
}

.selection-summary span {
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #f8fafc;
  color: #475569;
  font-size: var(--type-caption);
  font-weight: 780;
  line-height: 1;
  padding: 5px 7px;
  text-transform: uppercase;
}

.panel-note {
  margin: 0;
  border-top: 1px solid #edf1f5;
  background: #f8fafc;
  color: #475569;
  font-size: var(--type-ui);
  line-height: 1.45;
  padding: 8px 16px;
}

.compact-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  background: #ffffff;
  color: #263242;
  font-size: var(--type-value);
  font-weight: 700;
  line-height: 1.3;
  padding: 9px 16px;
}

.toggle-grid {
  display: grid;
  gap: 0;
}

.compact-toggle.is-disabled {
  color: #94a3b8;
}

.compact-toggle.is-disabled input {
  accent-color: #94a3b8;
}

.control-row,
.boundary-toolbar {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #edf1f5;
  background: #ffffff;
  padding: 8px 16px;
}

.control-row label,
.boundary-toolbar label {
  color: #64748b;
  font-size: var(--type-caption);
  font-weight: 760;
}

select {
  width: 100%;
  min-height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: var(--type-value);
  font-weight: 650;
  padding: 0 8px;
}

.solver-form {
  border-bottom: 1px solid #d8e0e8;
  background: #ffffff;
  padding: 11px 16px 12px;
}

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

.solver-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #64748b;
  font-size: var(--type-caption);
  font-weight: 760;
}

.solver-field input,
.solver-field select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: var(--type-value);
  font-weight: 650;
  padding: 0 8px;
}

.solver-field input:focus,
.solver-field select:focus {
  border-color: #1479a8;
  outline: 2px solid rgba(20, 121, 168, 0.16);
  outline-offset: 0;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 35px;
  align-items: stretch;
}

.input-with-unit input {
  border-radius: 3px 0 0 3px;
}

.input-with-unit small {
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-left: 0;
  border-radius: 0 3px 3px 0;
  background: #f8fafc;
  color: #64748b;
  font-size: var(--type-micro);
  font-weight: 800;
}

.solve-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid #d8e0e8;
  background: #ffffff;
  padding: 12px 16px;
}

.solve-command-row span {
  display: block;
  color: #64748b;
  font-size: var(--type-micro);
  font-weight: 820;
  text-transform: uppercase;
}

.solve-command-row strong {
  display: block;
  margin-top: 5px;
}

.solve-command-row button {
  border-color: #006b75;
  background: #006b75;
  color: #ffffff;
}

.solve-command-row button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.solve-status {
  color: #475569;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  font-weight: 760;
}

.solve-console[data-state="solving"] .solve-status {
  color: #0369a1;
}

.solve-console[data-state="success"] .solve-status {
  color: #15803d;
}

.solve-console[data-state="error"] .solve-status,
.solve-console[data-state="invalid"] .solve-status {
  color: #b91c1c;
}

.solve-error {
  margin: 8px 0 0;
  border-left: 3px solid #b91c1c;
  background: #fef2f2;
  color: #991b1b;
  font-size: var(--type-caption);
  line-height: 1.4;
  padding: 7px 9px;
}

.solve-error[hidden] {
  display: none;
}

.support-table {
  display: grid;
  background: #ffffff;
}

.support-row {
  display: grid;
  grid-template-columns: 56px repeat(6, minmax(0, 1fr));
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid #edf1f5;
  padding: 0 16px;
}

.support-row:last-child {
  border-bottom: 0;
}

.support-row strong {
  color: #111827;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-value);
  font-weight: 780;
}

.support-row label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #475569;
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  font-weight: 650;
}

.support-row input {
  width: 13px;
  height: 13px;
  accent-color: #1479a8;
}

.support-row input:disabled {
  opacity: 0.62;
}

.support-row label.is-rotational {
  color: #7c3aed;
}

.compact-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #475569;
}

.scope-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.scope-list li {
  position: relative;
  border-bottom: 1px solid #edf1f5;
  color: #475569;
  font-size: var(--type-ui);
  line-height: 1.35;
  padding: 7px 16px 7px 30px;
}

.scope-list li:last-child {
  border-bottom: 0;
}

.scope-list li::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #94a3b8;
}

.reference-register {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-register li {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid #edf1f5;
  padding: 8px 16px;
}

.reference-register li:last-child {
  border-bottom: 0;
}

.reference-register strong {
  color: #0f5f9c;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  line-height: 1.4;
}

.reference-register a {
  color: #0f5f9c;
  font-size: var(--type-ui);
  font-weight: 720;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-color: #93c5fd;
  text-underline-offset: 2px;
}

.reference-register a:hover {
  color: #0b4f82;
  text-decoration-color: currentColor;
}

.reference-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}

.reference-links small {
  flex-basis: 100%;
}

.reference-register small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: var(--type-caption);
  line-height: 1.35;
}

.result-review-panel {
  grid-area: review;
  min-width: 0;
  min-height: 0;
  border-top: 1px solid #aebac7;
  background: #ffffff;
  overflow: hidden;
}

.result-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 42px;
  border-bottom: 1px solid #d8e0e8;
  background: #f1f5f9;
  padding: 0 10px 0 14px;
}

.result-review-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.result-review-title > strong {
  color: #111827;
  font-size: var(--type-ui);
  font-weight: 820;
  text-transform: uppercase;
}

#review-case-badge {
  overflow: hidden;
  color: #475569;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-envelope-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(108px, auto));
  align-self: stretch;
  margin-left: auto;
  border-left: 1px solid #d8e0e8;
}

.review-envelope-summary > div {
  display: grid;
  align-content: center;
  min-width: 0;
  border-right: 1px solid #d8e0e8;
  padding: 0 12px;
}

.review-envelope-summary span {
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 780;
  line-height: 1;
  text-transform: uppercase;
}

.review-envelope-summary strong {
  margin-top: 3px;
  overflow: hidden;
  color: #0f172a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-micro);
  font-weight: 760;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  border-color: #aebac7;
  background: #ffffff;
  padding: 0;
}

.icon-button span {
  color: #334155;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.app-shell.is-review-collapsed .result-review-header {
  border-bottom: 0;
}

.app-shell.is-review-collapsed .result-review-body {
  display: none;
}

.result-review-body {
  display: grid;
  grid-template-rows: 35px minmax(0, 1fr);
  height: calc(100% - 42px);
  min-height: 0;
}

.result-review-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  border-bottom: 1px solid #d8e0e8;
  background: #f8fafc;
}

.result-review-tabs button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid #d8e0e8;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: var(--type-caption);
  font-weight: 780;
  padding: 0 16px;
  box-shadow: none;
}

.result-review-tabs button:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.result-review-tabs button.is-active {
  background: #ffffff;
  color: #0f5f9c;
  box-shadow: inset 0 -2px 0 #1479a8;
}

.result-review-tabs button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid #1479a8;
  outline-offset: -2px;
}

.review-module {
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  background: #ffffff;
  overflow: hidden;
}

.review-module[hidden] {
  display: none !important;
}

.review-module > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid #edf1f5;
  padding: 8px 10px 7px;
}

.review-module h3 {
  margin: 0;
  color: #1e293b;
  font-size: var(--type-ui);
  font-weight: 790;
  line-height: 1.2;
}

.review-module p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: var(--type-micro);
  line-height: 1.25;
}

.review-module > header > strong {
  flex: 0 0 auto;
  color: #0f5f9c;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  font-weight: 800;
  white-space: nowrap;
}

.member-force-chart {
  display: grid;
  align-content: start;
  gap: 3px;
  height: calc(100% - 48px);
  padding: 7px 10px;
  overflow-y: auto;
}

.member-force-row {
  display: grid;
  grid-template-columns: minmax(58px, 0.65fr) 10px minmax(94px, auto) minmax(72px, 0.8fr);
  gap: 9px;
  align-items: center;
  min-height: 22px;
}

.member-force-id,
.case-direction-button {
  min-width: 0;
  min-height: 18px;
  border: 0;
  background: transparent;
  color: #0f5f9c;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-micro);
  font-weight: 720;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: #bfdbfe;
  text-underline-offset: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-force-id:hover,
.case-direction-button:hover {
  color: #0b4f82;
  text-decoration-color: currentColor;
}

.member-force-marker {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.member-force-marker.is-tension {
  background: #dc263f;
}

.member-force-marker.is-compression {
  background: #0057b8;
}

.member-force-value {
  color: #0f172a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-caption);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.member-force-state {
  font-size: var(--type-micro);
  font-weight: 720;
  text-align: left;
  white-space: nowrap;
}

.member-force-state.is-tension {
  color: #a9142c;
}

.member-force-state.is-compression {
  color: #00478f;
}

.case-table-wrap {
  height: calc(100% - 48px);
  overflow: auto;
}

.case-comparison-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.case-comparison-table th,
.case-comparison-table td {
  height: 24px;
  border-bottom: 1px solid #edf1f5;
  color: #334155;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", ui-monospace, monospace;
  font-size: var(--type-micro);
  font-weight: 620;
  padding: 3px 7px;
  text-align: right;
  white-space: nowrap;
}

.case-comparison-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-weight: 780;
}

.case-comparison-table th:first-child,
.case-comparison-table td:first-child {
  text-align: left;
}

.case-comparison-table tbody tr.is-active {
  background: #e8f5f6;
  box-shadow: inset 3px 0 0 #008892;
}

.case-comparison-table tbody tr:hover {
  background: #f1f5f9;
}

@media (max-width: 1040px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  .split-resizer {
    display: none;
  }

  .result-review-panel {
    flex: 0 0 auto;
    overflow: visible;
  }

  .result-review-body {
    grid-template-rows: 35px minmax(220px, auto);
    height: auto;
  }

  .review-module {
    min-height: 220px;
  }

  .viewer-section {
    min-height: 100svh;
  }

  .top-bar {
    top: 12px;
    left: 12px;
    right: 12px;
    gap: 12px;
  }

  .top-bar > div {
    max-width: calc(100% - 108px);
    padding: 8px 10px;
  }

  .top-bar h1 {
    max-width: 245px;
    font-size: 1.08rem;
  }

  .viewer-model-badge {
    font-size: 0.68rem;
  }

  .view-toolbar {
    top: 92px;
    left: 12px;
    right: 96px;
    gap: 6px;
  }

  .view-toolbar button {
    min-height: 30px;
    font-size: var(--type-caption);
    padding: 0 8px;
  }

  .mode-toolbar {
    top: 128px;
    left: 12px;
    right: 112px;
    gap: 6px;
  }

  .mode-toolbar button {
    min-height: 30px;
    flex: 1 1 0;
    min-width: 0;
    font-size: var(--type-caption);
    padding: 0 7px;
  }

  .grid-label,
  .scale-label {
    display: none;
  }

  .axis-gizmo {
    right: 12px;
    top: 92px;
    width: 74px;
    height: 74px;
  }

  .view-context {
    display: none;
  }

  .state-primary {
    grid-template-columns: 1fr;
  }

  .state-primary div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .state-primary div:last-child {
    border-bottom: 0;
  }

  .panel-header {
    padding: 12px 14px 10px;
  }

  .info-panel {
    background: #ffffff;
  }

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

  .workflow-step {
    padding: 8px 6px;
  }

  .workflow-step span {
    width: 20px;
    height: 20px;
  }

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

  .kpi-strip div {
    border-bottom: 1px solid #d8e0e8;
    padding: 9px 14px;
  }

  .kpi-strip div:nth-child(2n) {
    border-right: 0;
  }

  .kpi-strip div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

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

  .result-strip div {
    border-bottom: 0;
  }

  .result-strip div:last-child {
    border-bottom: 0;
  }

  .property-list div {
    grid-template-columns: 94px minmax(0, 1fr);
    padding: 7px 14px;
  }

  .solver-form {
    padding: 10px 14px 11px;
  }

  .selection-summary {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 9px 14px;
  }

  .selection-summary span {
    width: fit-content;
  }

  .legend-panel {
    display: none;
  }

  .info-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -14px 34px rgba(17, 24, 39, 0.06);
  }
}

@media (max-width: 720px) {
  .review-envelope-summary {
    display: none;
  }
}

@media (max-width: 430px) {
  .viewer-section {
    min-height: 100svh;
  }

  .member-grid,
  .summary-grid,
  .context-grid {
    grid-template-columns: 1fr;
  }

  button {
    padding: 0 10px;
  }

  .top-bar > div {
    max-width: calc(100% - 96px);
  }

  .view-toolbar {
    right: 82px;
  }

  .view-toolbar button {
    padding: 0 6px;
  }

  .mode-toolbar {
    right: 96px;
  }
}
