:root {
  --navy: #232a3a;
  --ink: #19202f;
  --muted: #51586c;
  --line: #e6d7c8;
  --line-strong: #747c94;
  --sheet: #ffffff;
  --background: #faf4ed;
  --input: #efe4d9;
  --input-border: #926f52;
  --calc-green: #efe3d8;
  --result-peach: #f2e7dd;
  --blue-header: #383f50;
  --green: #575f74;
  --green-soft: #ebded1;
  --yellow-soft: #efe4d9;
  --red-soft: #f3d2d8;
  --danger: #673d4c;
  --warning: #584230;
  --success: #3c4355;
  --shadow: 0 18px 50px rgba(25, 32, 47, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.35;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  max-width: 100%;
  min-height: 38px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  padding: 0 14px;
  line-height: 1.15;
  white-space: normal;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 38px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 700;
  line-height: 1.15;
  padding: 0 14px;
  text-align: center;
  text-decoration: none;
}

button:hover {
  filter: brightness(1.07);
}

.button-link:hover {
  filter: brightness(1.07);
}

button:disabled {
  border-color: #8891aa;
  background: #ede1d5;
  color: #5c6479;
  cursor: not-allowed;
  filter: none;
}

.ghost-button {
  background: #ffffff;
  color: var(--navy);
}

.app-shell {
  width: min(1680px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(35, 42, 58, 0.12);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: var(--shadow);
  padding: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-lockup > div {
  min-width: 0;
}

.venture-name-field {
  display: grid;
  gap: 5px;
  width: min(420px, 100%);
  margin-top: 10px;
}

.venture-name-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.venture-name-field input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
  outline: none;
  padding: 6px 10px;
}

.venture-name-field input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(35, 42, 58, 0.12);
}

.brand-logo {
  width: 170px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 12px;
}

.help-tip {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: #363c4e;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
  flex: 0 0 auto;
}

.help-tip:focus-visible {
  outline: 2px solid #363c4e;
  outline-offset: 2px;
}

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

h1 {
  font-size: 26px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 18px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.file-action-stack {
  display: grid;
  gap: 8px;
  min-width: min(270px, 100%);
}

.file-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.file-action-row button {
  width: 100%;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.summary-grid article,
.chart-panel,
.model-panel,
.assumptions-panel,
.guide-panel,
.placeholder-panel,
.prioritization-panel {
  border: 1px solid rgba(35, 42, 58, 0.12);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: 0 10px 30px rgba(25, 32, 47, 0.08);
}

.summary-grid article {
  padding: 14px 16px;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-grid strong {
  display: block;
  min-height: 28px;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.chart-panel,
.model-panel,
.placeholder-panel,
.prioritization-panel {
  margin-top: 16px;
  overflow: hidden;
}

.placeholder-content {
  padding: 20px 16px;
}

.placeholder-content p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.prioritization-content {
  padding: 0;
}

.prioritization-table-wrap {
  max-height: none;
}

.prioritization-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.prioritization-table th,
.prioritization-table td {
  border: 1px solid var(--line);
  padding: 9px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.prioritization-table th {
  background: #f9f2ea;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
}

.priority-head-title,
.priority-head-note {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.priority-head-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.22;
}

.prioritization-table tbody tr:nth-child(even) td {
  background: #fcf7f0;
}

.priority-name-cell {
  font-weight: 800;
  line-height: 1.2;
}

.priority-number-cell {
  text-align: center;
  font-weight: 900;
  white-space: nowrap;
}

.priority-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--input);
  color: var(--ink);
  font-weight: 900;
  padding: 4px 6px;
  text-align: center;
}

.priority-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(35, 42, 58, 0.12);
  outline: none;
}

.priority-control-title {
  align-items: center;
}

.competition-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.section-title .competition-control > span {
  color: var(--green);
  overflow-wrap: anywhere;
}

.company-priority-value {
  color: var(--navy);
}

.cluster-table th:first-child,
.cluster-table td:first-child {
  width: 90px;
}

.cluster-table th:last-child,
.cluster-table td:last-child {
  width: 170px;
}

.cluster-number-cell {
  font-size: 18px;
}

.cluster-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.cluster-list li {
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.empty-priority-cell {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.section-title > * {
  min-width: 0;
}

.section-title span {
  color: var(--muted);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.chart {
  min-height: 280px;
  overflow-x: auto;
  padding: 12px 16px 18px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-empty {
  display: flex;
  min-height: 240px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.table-wrap {
  overflow: auto;
  max-height: 72vh;
}

.model-table,
.assumptions-table,
.guide-table {
  width: 100%;
  border-collapse: collapse;
}

.model-table {
  min-width: 3720px;
  table-layout: fixed;
  font-size: 12px;
}

.model-table th,
.model-table td,
.assumptions-table th,
.assumptions-table td,
.guide-table th,
.guide-table td {
  border: 1px solid var(--line);
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
}

.model-table th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f9f2ea;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  padding: 6px;
  white-space: normal;
}

.model-table thead tr:first-child th {
  height: 34px;
}

.model-table thead tr:nth-child(2) th {
  top: 34px;
  height: 38px;
}

.model-table thead tr:nth-child(3) th {
  top: 72px;
  height: 86px;
  font-size: 11px;
}

.model-table td {
  height: 44px;
  background: #ffffff;
  padding: 4px;
  overflow: hidden;
}

.model-table tbody tr:nth-child(even) td {
  background: #fcf7f0;
}

.model-table .sticky-col {
  position: sticky;
  z-index: 5;
}

.model-table th.sticky-col {
  z-index: 8;
}

.model-table .col-pain {
  left: 0;
  width: 170px;
}

.model-table .col-company {
  left: 170px;
  width: 190px;
}

.model-table .col-notes {
  left: 360px;
  width: 230px;
}

.model-table td.sticky-col,
.model-table th.sticky-col {
  background: #ffffff;
  box-shadow: 1px 0 0 var(--line);
}

.model-table tbody tr:nth-child(even) td.sticky-col {
  background: #fcf7f0;
}

.group-head {
  background: var(--blue-header) !important;
  color: #ffffff !important;
  font-size: 12px;
}

.weight-head {
  background: #f9f3eb !important;
  color: var(--ink) !important;
  font-style: italic;
  font-weight: 700 !important;
}

.result-head {
  background: var(--result-peach) !important;
}

.score-head {
  background: var(--calc-green) !important;
}

.company-header-content {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-width: 0;
}

.same-company-control {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: 100%;
  min-width: 0;
}

.switch-label {
  display: inline-grid;
  grid-template-columns: 34px minmax(0, auto);
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
}

.switch-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ede1d5;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(25, 32, 47, 0.28);
  transition: transform 0.16s ease;
}

.switch-label input:checked + .switch-track {
  border-color: var(--navy);
  background: var(--navy);
}

.switch-label input:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch-label input:focus-visible + .switch-track {
  box-shadow: 0 0 0 2px rgba(35, 42, 58, 0.18);
}

.go-button {
  width: 52px;
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.model-input,
.weight-input,
.factor-input,
.gate-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--input);
  color: var(--ink);
  outline: none;
}

.model-input:focus,
.weight-input:focus,
.factor-input:focus,
.gate-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(35, 42, 58, 0.12);
}

.text-input {
  height: 32px;
  padding: 5px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-input {
  height: 44px;
  padding: 5px 7px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  resize: vertical;
}

.score-input {
  height: 34px;
  padding: 4px 6px;
  text-align: center;
  font-weight: 800;
}

.weight-input {
  height: 26px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 4px;
}

.calc-cell,
.probability-cell,
.priority-cell,
.bottleneck-cell {
  text-align: center;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.bar-cell {
  position: relative;
  min-height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background:
    linear-gradient(90deg, var(--bar-color) 0 var(--pct), transparent var(--pct)),
    #faf3ec;
  isolation: isolate;
}

.bar-cell span {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-width: 0;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.badge-high {
  background: #ebded1;
  color: var(--success);
}

.badge-medium {
  background: #efe4d9;
  color: var(--warning);
}

.badge-low {
  background: #f3d2d8;
  color: var(--danger);
}

.assumptions-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.7fr);
  gap: 16px;
  margin-top: 16px;
}

.assumptions-panel,
.guide-panel {
  overflow: hidden;
}

.assumptions-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.assumption-table-block {
  min-width: 0;
}

.assumption-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  margin-bottom: 8px;
  min-width: 0;
}

.assumption-table-title h3 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.assumption-table-title label {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.assumption-table-title label span {
  flex: 0 0 auto;
}

.profile-select {
  flex: 1 1 180px;
  width: 100%;
  max-width: 260px;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  padding: 5px 8px;
  text-overflow: ellipsis;
}

.profile-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(35, 42, 58, 0.12);
  outline: none;
}

.assumptions-table,
.guide-table {
  table-layout: fixed;
  font-size: 13px;
}

.assumptions-table caption {
  caption-side: top;
  padding: 0 0 8px;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.assumptions-table th,
.guide-table th {
  background: #f9f2ea;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.18;
  padding: 8px;
  text-align: left;
}

.assumptions-table td,
.guide-table td {
  line-height: 1.2;
  padding: 8px;
}

.factor-input,
.gate-input {
  height: 32px;
  padding: 4px 7px;
  text-align: right;
  font-weight: 800;
  min-width: 0;
}

.suggested {
  color: var(--muted);
  text-align: right;
  font-weight: 800;
}

.guide-panel .guide-table {
  border-left: 0;
  border-right: 0;
}

.guide-panel .guide-table th:first-child,
.guide-panel .guide-table td:first-child {
  width: 70px;
  text-align: center;
}

.guide-panel .guide-table th:nth-child(2),
.guide-panel .guide-table td:nth-child(2) {
  width: 120px;
}

.score-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 900;
}

.weight-warning {
  color: var(--danger) !important;
}

.pmf-shell {
  width: min(1540px, calc(100vw - 32px));
}

.pmf-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.pmf-summary-grid article,
.pmf-panel {
  border: 1px solid rgba(35, 42, 58, 0.12);
  border-radius: 8px;
  background: var(--sheet);
  box-shadow: 0 10px 30px rgba(25, 32, 47, 0.08);
}

.pmf-summary-grid article {
  padding: 14px 16px;
  min-width: 0;
}

.pmf-summary-grid span,
.pmf-mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.pmf-summary-grid strong,
.pmf-mini-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.pmf-panel {
  margin-top: 16px;
  overflow: hidden;
}

.pmf-tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pmf-tab-button.active {
  background: var(--navy);
  color: #ffffff;
}

.pmf-tab-panel[hidden] {
  display: none;
}

.pmf-panel-body {
  padding: 16px;
}

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

.pmf-wide-field {
  grid-column: 1 / -1;
}

.pmf-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
}

.pmf-field > span {
  min-height: 30px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pmf-field small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pmf-field input,
.pmf-field select,
.pmf-field textarea,
.pmf-table input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
  font-weight: 800;
  padding: 6px 8px;
}

.pmf-field textarea {
  resize: vertical;
}

.pmf-field-disabled {
  background: #fcf7f0;
}

.pmf-field-disabled > span,
.pmf-field-disabled small {
  color: var(--muted);
}

.pmf-optional-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  padding: 2px 6px;
  text-transform: uppercase;
  vertical-align: middle;
}

.pmf-relevance-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
}

.pmf-relevance-label input {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: var(--navy);
  padding: 0;
}

.pmf-field input:focus,
.pmf-field select:focus,
.pmf-field textarea:focus,
.pmf-table input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(35, 42, 58, 0.12);
  outline: none;
}

.pmf-saved-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.pmf-saved-select {
  flex: 1 1 360px;
}

.pmf-action-row {
  display: flex;
  flex: 2 1 520px;
  flex-wrap: wrap;
  gap: 10px;
}

.pmf-dimension-list {
  display: grid;
  gap: 12px;
}

.pmf-dimension-row {
  min-width: 0;
}

.pmf-dimension-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  min-width: 0;
}

.pmf-dimension-heading strong,
.pmf-dimension-heading span {
  overflow-wrap: anywhere;
}

.pmf-dimension-heading strong {
  font-size: 13px;
}

.pmf-dimension-heading span {
  color: var(--muted);
  font-weight: 900;
}

.pmf-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f5ece3;
}

.pmf-progress div {
  height: 100%;
  min-width: 2px;
}

.pmf-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.pmf-output-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fef9f4;
}

.pmf-output-block h3,
.pmf-two-col h3,
.pmf-form-section h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.pmf-output-block p {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.pmf-output-block ul {
  margin: 0;
  padding-left: 18px;
}

.pmf-output-block li {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.pmf-muted,
.pmf-method-note {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pmf-method-note {
  margin: 10px 0;
  font-size: 12px;
}

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

.pmf-chip-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  padding: 8px;
  text-align: center;
  overflow-wrap: anywhere;
}

.pmf-chip-grid strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.pmf-two-col {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.pmf-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}

.pmf-table th,
.pmf-table td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.pmf-table th {
  background: #f9f2ea;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.pmf-table td:last-child {
  width: 150px;
}

.pmf-dimension-forms {
  display: grid;
  gap: 12px;
}

.pmf-dimension-forms details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fef9f4;
  overflow: hidden;
}

.pmf-dimension-forms summary {
  padding: 12px 14px;
  background: #f9f2ea;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.pmf-dimension-forms details > div {
  padding: 14px;
}

.pmf-form-section {
  margin-bottom: 16px;
}

.pmf-mini-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.pmf-mini-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.scenario-intro,
.scenario-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.scenario-intro h3 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 18px;
}

.scenario-intro p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.scenario-benchmark-select {
  justify-self: end;
  width: min(100%, 280px);
}

.scenario-baseline-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.scenario-baseline-grid article,
.scenario-summary-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fef9f4;
  padding: 12px;
}

.scenario-baseline-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.scenario-baseline-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.scenario-radar-panel,
.scenario-benchmark-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.scenario-radar-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 360px;
}

.scenario-benchmark-panel h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 14px;
}

.scenario-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 10px;
}

.scenario-control-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.scenario-control-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fef9f4;
  padding: 10px;
}

.scenario-control-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.scenario-control-card div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.scenario-control-card button {
  min-height: 30px;
  padding: 0 6px;
  font-size: 11px;
}

.scenario-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.scenario-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.scenario-table th,
.scenario-table td {
  width: 260px;
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.scenario-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f9f2ea;
}

.scenario-category-col {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 280px !important;
  background: #fcf7f0;
  color: var(--ink);
  font-weight: 900;
}

.scenario-table thead .scenario-category-col {
  z-index: 4;
}

.scenario-group-row th {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--navy);
  color: #ffffff;
  font-size: 12px;
  letter-spacing: 0;
  text-align: left;
}

.scenario-column-header {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.scenario-column-header input,
.scenario-select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input);
  color: var(--ink);
  font-weight: 800;
  padding: 5px 7px;
}

.scenario-column-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.scenario-column-actions button {
  position: relative;
  z-index: 6;
  min-height: 30px;
  padding: 0 6px;
  font-size: 11px;
}

.scenario-display-toggle {
  justify-content: start;
}

.scenario-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.scenario-summary-card {
  border-top: 4px solid var(--scenario-color);
}

.scenario-summary-card h3 {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 16px;
}

.scenario-summary-card p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.scenario-score-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.scenario-score-list div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

.scenario-score-list span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.scenario-score-list strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.scenario-score-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 1050px) {
  .app-header,
  .brand-lockup {
    align-items: flex-start;
  }

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

  .header-actions {
    justify-content: flex-start;
  }

  .summary-grid,
  .pmf-summary-grid,
  .pmf-form-grid,
  .pmf-metric-grid,
  .pmf-output-grid,
  .pmf-two-col,
  .pmf-mini-grid,
  .scenario-intro,
  .scenario-top-layout,
  .scenario-baseline-grid,
  .scenario-summary-grid,
  .assumptions-layout,
  .assumptions-body {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 20px, 1680px);
    padding-top: 10px;
  }

  .brand-lockup {
    flex-direction: column;
    gap: 12px;
  }

  .brand-logo {
    width: 142px;
  }

  h1 {
    font-size: 22px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .section-title span {
    white-space: normal;
  }

  .assumption-table-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .assumption-table-title label {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .profile-select {
    width: 100%;
  }

  .priority-control-title,
  .competition-control {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .pmf-shell {
    width: min(100vw - 20px, 1540px);
  }

  .pmf-panel-body {
    padding: 12px;
  }

  .pmf-chip-grid {
    grid-template-columns: 1fr;
  }

  .pmf-action-row button {
    width: 100%;
  }

  .scenario-column-actions,
  .scenario-score-list {
    grid-template-columns: 1fr;
  }
}
