:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --paper: #ffffff;
  --paper-soft: #fafafa;
  --ink: #1f1f1f;
  --muted: #666666;
  --line: #dedede;
  --line-strong: #b8b8b8;
  --teal: #ef3102;
  --teal-soft: #fff0eb;
  --green: #1f7a4f;
  --amber: #b35c00;
  --amber-soft: #fff3df;
  --red: #ef3102;
  --red-soft: #ffe4df;
  --black: #222222;
  --blue: #222222;
  --shadow: 0 18px 50px rgba(34, 34, 34, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(239, 49, 2, 0.08), transparent 320px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

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

.topbar__actions,
.section-title,
.panel-title,
.pipeline-strip,
.metric-card__title,
.icon-button,
.icon-only,
.toggle-row {
  display: flex;
  align-items: center;
}

.topbar__actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-switch {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.language-switch svg {
  width: 16px;
  height: 16px;
}

.language-switch select {
  width: auto;
  min-width: 48px;
  height: 36px;
  padding: 0 22px 0 2px;
  border: 0;
  background-color: transparent;
  font-weight: 750;
}

.icon-button {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  min-height: 40px;
  padding: 0 14px;
  gap: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 750;
}

.icon-button svg,
.section-title svg,
.pipeline-strip svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.icon-button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.icon-button.primary:hover {
  border-color: var(--black);
  background: var(--black);
}

.icon-only {
  width: 38px;
  height: 38px;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.icon-button.ghost:hover,
.icon-only:hover,
.segment:hover,
.gpu-chip:hover {
  border-color: var(--teal);
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.controls-panel,
.result-panel,
.wide-panel,
.notes-panel,
.assumptions-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.controls-panel {
  position: sticky;
  top: 91px;
  max-height: calc(100vh - 115px);
  overflow: auto;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.segmented.compact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.segment {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  min-height: 38px;
  padding: 0 10px;
  font-weight: 800;
}

.segment.active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--teal);
  box-shadow: 0 8px 22px rgba(35, 48, 43, 0.08);
}

.form-section {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

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

.section-title {
  gap: 8px;
  margin-bottom: 14px;
}

.section-title svg {
  color: var(--teal);
}

.field-grid {
  display: grid;
  gap: 12px;
}

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

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

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.field:last-child,
.field-grid .field {
  margin-bottom: 0;
}

.field span,
.toggle-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

input,
select {
  min-height: 40px;
}

textarea {
  min-height: 116px;
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(239, 49, 2, 0.12);
}

.toggle-row {
  margin-top: 12px;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.build-only {
  display: none;
}

.llm-document-only {
  display: none;
}

body[data-mode="build"] .build-only {
  display: block;
}

body[data-mode="build"] .evaluate-only {
  display: none;
}

body[data-doc-mode="llm"] .llm-document-only {
  display: block;
}

.gpu-picker,
.gpu-selection {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gpu-dropdown-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.gpu-chip {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gpu-chip input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--teal);
}

.gpu-chip span {
  font-size: 13px;
  font-weight: 800;
}

.gpu-chip button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px;
}

.gpu-spec-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
  background: var(--paper-soft);
}

.gpu-spec-card:empty {
  display: none;
}

.gpu-spec-card__label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.gpu-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.gpu-stat {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #fff;
}

.gpu-stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 5px;
}

.gpu-stat strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.gpu-stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.gpu-lookup {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
}

.inline-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inline-status[data-tone="success"] {
  color: var(--green);
}

.inline-status[data-tone="error"] {
  color: var(--red);
}

.result-panel {
  padding: 22px;
  min-width: 0;
}

.result-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-hero h2 {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0;
}

.pipeline-strip {
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.pipeline-strip span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  background: var(--paper-soft);
}

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

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--paper-soft);
  min-height: 118px;
}

.metric-card__title {
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.metric-card__value {
  margin: 10px 0 3px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
  font-weight: 900;
}

.metric-card__note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.metric-card.good {
  border-color: rgba(239, 49, 2, 0.28);
  background: var(--teal-soft);
}

.metric-card.warn {
  border-color: rgba(179, 92, 0, 0.34);
  background: var(--amber-soft);
}

.metric-card.bad {
  border-color: rgba(239, 49, 2, 0.32);
  background: var(--red-soft);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.wide-panel,
.notes-panel,
.assumptions-panel {
  box-shadow: none;
}

.wide-panel,
.notes-panel {
  min-height: 260px;
}

.panel-title {
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

#primaryOutput,
#warningsOutput,
.assumption-list {
  padding: 16px;
}

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

.limit-row {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) 82px;
  gap: 12px;
  align-items: center;
}

.limit-name {
  font-size: 13px;
  font-weight: 850;
}

.limit-bar {
  height: 12px;
  background: #edf1ee;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.limit-bar span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: 999px;
  background: var(--teal);
}

.limit-row.bottleneck .limit-bar span {
  background: var(--red);
}

.limit-value {
  text-align: right;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.empty-state,
.warning-list,
.assumption-list,
.formula-list {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.warning-list li {
  border-left: 3px solid var(--amber);
  padding: 8px 10px;
  background: var(--amber-soft);
  color: #5f4514;
  border-radius: 0 6px 6px 0;
}

.warning-list li.critical {
  border-left-color: var(--red);
  background: var(--red-soft);
  color: #751a12;
}

.assumptions-panel {
  margin-top: 14px;
}

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

.assumption-pill {
  border: 1px solid var(--line);
  background: var(--paper-soft);
  border-radius: 6px;
  padding: 10px;
  min-height: 56px;
}

.assumption-pill strong {
  display: block;
  color: var(--ink);
  margin-bottom: 3px;
}

.candidate-table-wrap {
  overflow: auto;
}

.candidate-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  font-size: 13px;
}

.candidate-table th,
.candidate-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.candidate-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.candidate-table tr.recommended {
  background: var(--teal-soft);
}

.table-main {
  display: block;
  font-weight: 900;
}

.table-sub {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.table-sub.warn-text {
  color: #8a4c00;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.warn {
  background: var(--amber-soft);
  color: #6f4b0f;
}

.formula-list {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.document-dialog {
  width: min(1180px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(29, 37, 39, 0.24);
}

.help-dialog {
  width: min(1240px, calc(100vw - 32px));
  max-height: min(900px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(29, 37, 39, 0.24);
}

.request-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(840px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(29, 37, 39, 0.24);
}

.document-dialog::backdrop {
  background: rgba(29, 37, 39, 0.48);
}

.help-dialog::backdrop {
  background: rgba(29, 37, 39, 0.48);
}

.request-dialog::backdrop {
  background: rgba(29, 37, 39, 0.48);
}

.document-dialog[open],
.help-dialog[open],
.request-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.document-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

.help-dialog__header {
  background:
    linear-gradient(90deg, rgba(239, 49, 2, 0.12), transparent 62%),
    var(--paper-soft);
}

.request-dialog__header {
  background:
    linear-gradient(90deg, rgba(239, 49, 2, 0.12), transparent 62%),
    var(--paper-soft);
}

.document-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.document-controls {
  border-right: 1px solid var(--line);
  padding: 14px;
  overflow: auto;
  background: #fff;
}

.helper-text {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.document-actions {
  display: grid;
  grid-template-columns: 1fr 86px 120px;
  gap: 8px;
  padding: 14px 4px 4px;
}

.document-preview-shell {
  min-width: 0;
  overflow: auto;
  background: #eef2ef;
}

.document-preview {
  width: min(760px, calc(100% - 32px));
  min-height: 860px;
  margin: 16px auto 24px;
  padding: 42px 48px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #202827;
  box-shadow: 0 12px 32px rgba(29, 37, 39, 0.12);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

.document-preview:empty::before {
  content: attr(data-empty-text);
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.document-preview h1 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.18;
}

.document-preview h2 {
  margin: 26px 0 8px;
  font-size: 19px;
}

.document-preview h3 {
  margin: 18px 0 6px;
  font-size: 16px;
}

.document-preview p {
  margin: 0 0 10px;
}

.document-preview ul {
  margin: 6px 0 14px 22px;
  padding: 0;
}

.document-preview li {
  margin: 4px 0;
}

.document-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
}

.document-preview th,
.document-preview td {
  border: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
}

.document-preview th {
  background: var(--paper-soft);
}

.document-preview .doc-muted {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
}

.document-preview .doc-callout {
  margin: 16px 0;
  border-left: 4px solid var(--teal);
  background: var(--teal-soft);
  padding: 12px 14px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.document-preview .doc-warning {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.document-preview.loading {
  opacity: 0.64;
}

.request-content {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: #fff;
}

.request-summary {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
  overflow: hidden;
}

.request-summary .panel-title {
  background: #fff;
}

.request-summary pre {
  max-height: 220px;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.request-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.request-actions .inline-status {
  line-height: 1.35;
}

.help-content {
  min-height: 0;
  overflow: auto;
  padding: 22px;
  background: #fff;
}

.help-intro,
.help-case,
.help-notes {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}

.help-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  padding: 22px;
  margin-bottom: 16px;
}

.help-intro h3,
.help-case h3,
.help-notes h3 {
  font-size: 22px;
  line-height: 1.18;
  margin-bottom: 10px;
}

.help-intro p,
.help-case p,
.help-shot figcaption,
.help-note-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.help-intro p,
.help-case p {
  margin-bottom: 10px;
}

.help-intro__aside {
  display: grid;
  gap: 8px;
  align-content: start;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.help-intro__aside strong,
.help-note-grid strong {
  font-size: 14px;
}

.help-intro__aside span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.help-case {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  gap: 18px;
  padding: 18px;
  margin-bottom: 16px;
  align-items: start;
}

.help-case__text {
  min-width: 0;
}

.help-kicker {
  margin-bottom: 6px;
  color: var(--teal) !important;
  font-size: 12px !important;
  font-weight: 900;
  text-transform: uppercase;
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.help-shot {
  margin: 0;
  min-width: 0;
}

.help-shot img {
  display: block;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(29, 37, 39, 0.12);
}

.help-shot figcaption {
  margin-top: 8px;
  font-size: 12px;
}

.help-notes {
  padding: 18px;
}

.help-note-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.help-note-grid div {
  display: grid;
  gap: 6px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

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

  .controls-panel {
    position: static;
    max-height: none;
  }

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

  .help-case,
  .help-intro {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 780px) {
  .topbar__content,
  .result-hero,
  .topbar__actions {
    align-items: stretch;
  }

  .topbar__content,
  .result-hero {
    flex-direction: column;
  }

  .app-shell {
    padding: 14px;
    gap: 14px;
  }

  .topbar__content,
  .result-panel {
    padding: 16px;
  }

  .metrics-grid,
  .assumption-list,
  .field-grid.two,
  .field-grid.three,
  .gpu-picker,
  .gpu-selection,
  .gpu-dropdown-row,
  .gpu-stat-grid {
    grid-template-columns: 1fr;
  }

  .limit-row {
    grid-template-columns: 1fr 76px;
  }

  .limit-bar {
    grid-column: 1 / -1;
    order: 3;
  }

  .pipeline-strip {
    justify-content: flex-start;
  }

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

  .document-controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .document-actions {
    grid-template-columns: 1fr;
  }

  .request-actions {
    grid-template-columns: 1fr;
  }

  .document-preview {
    width: calc(100% - 20px);
    min-height: 640px;
    padding: 26px 22px;
  }

  .help-content {
    padding: 14px;
  }

  .help-intro,
  .help-case,
  .help-notes {
    padding: 14px;
  }

  .help-note-grid {
    grid-template-columns: 1fr;
  }
}

/* Technical portal integration, 29 September 2026. */
.portal-nav, .sizing-scope { max-width: 1440px; margin: 0 auto; padding: 14px 24px; }
.portal-nav { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 14px; background: #fff; }
.portal-nav a, .sizing-scope a { color: #a72804; text-underline-offset: 3px; }
.portal-nav a:focus-visible, .sizing-scope a:focus-visible { outline: 2px solid #ef3102; outline-offset: 4px; }
.sizing-scope { font-size: 15px; line-height: 1.55; }
.sizing-scope p { margin: 4px 0; }
@media (max-width: 780px) {
 .portal-nav, .sizing-scope { padding: 12px 16px; }
 .topbar { position: static; }
 .topbar__content, .topbar__actions, .controls-panel, .result-panel { min-width: 0; }
}

.content-grid > *, .wide-panel, #primaryOutput { min-width: 0; }
@media (max-width: 780px) {
 .panel-title { flex-wrap: wrap; gap: 8px; }
 .document-dialog__header > div { min-width: 0; }
 .document-preview { overflow-wrap: anywhere; }
 .document-preview th, .document-preview td { overflow-wrap: anywhere; }
}
