:root {
  color-scheme: light;
  --page: #f8f3ea;
  --surface: #fffdf8;
  --surface-soft: #f6f0e7;
  --ink: #14282d;
  --muted: #526266;
  --faint: #68777a;
  --line: rgb(20 40 45 / 14%);
  --line-strong: rgb(20 40 45 / 28%);
  --pine: #8a5f2a;
  --pine-strong: #6d471f;
  --pine-soft: rgb(138 95 42 / 11%);
  --data-pine: #0b4d3f;
  --amber: #a75f0b;
  --amber-soft: #fff6e8;
  --coral: #c34831;
  --coral-soft: #fff1ed;
  --success: #187247;
  --shadow: 0 10px 28px rgb(20 35 31 / 7%);
  --radius: 6px;
  --topbar-height: 64px;
  --planner-frame-width: 1460px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
}

h2 {
  font-size: 18px;
}

small {
  color: var(--muted);
}

svg {
  flex: 0 0 auto;
}

.site-masthead {
  position: relative;
  z-index: 1001;
  background: var(--page);
  color: var(--ink);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--planner-frame-width);
  min-height: 69px;
  margin-inline: auto;
  padding: 1.1rem 22px;
  border-bottom: 1px solid var(--line);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: inherit;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-nav a {
  padding-block: 0.25rem;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--pine);
}

.site-brand:focus-visible,
.site-nav a:focus-visible {
  outline: 3px solid rgb(183 138 68 / 24%);
  outline-offset: 4px;
}

.topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: grid;
  grid-template-columns: minmax(290px, 1fr) auto minmax(290px, 1fr);
  align-items: stretch;
  min-height: var(--topbar-height);
  padding: 0 max(22px, calc((100% - var(--planner-frame-width)) / 2 + 22px));
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 248 / 96%);
  backdrop-filter: blur(10px);
}

.brand-lockup,
.topbar-actions,
.profile-status,
.button,
.text-button,
.section-heading,
.scenario-heading,
.surface-heading,
.view-actions,
.safety-notice,
.data-disclosure,
.provider-disclosure,
.privacy-note,
.limits-summary li,
.limits-summary summary,
.departure-controls summary,
.profile-editor summary {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-lockup > strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.primary-nav {
  display: flex;
  align-items: stretch;
  gap: 22px;
}

.primary-nav button {
  position: relative;
  min-width: 60px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
}

.primary-nav button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: transparent;
  content: "";
}

.primary-nav button:hover,
.primary-nav button.active {
  color: var(--ink);
}

.primary-nav button.active::after {
  background: var(--pine);
}

.topbar-actions {
  justify-content: flex-end;
  gap: 12px;
}

.header-download {
  flex: 0 0 auto;
}

.profile-status {
  min-width: 170px;
  gap: 9px;
}

.profile-status > span:last-child {
  display: grid;
}

.profile-status strong {
  overflow: hidden;
  max-width: 190px;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.profile-status small {
  overflow: hidden;
  max-width: 190px;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-mark {
  position: relative;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-soft);
}

.status-mark::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  content: "";
}

body.has-profile .status-mark::after {
  background: var(--success);
}

.button,
.text-button,
.icon-button {
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button {
  padding: 10px 14px;
  border: 1px solid transparent;
}

.button svg,
.text-button svg,
.icon-button svg,
.data-disclosure svg,
.provider-disclosure svg,
.privacy-note svg,
.limits-summary svg,
.safety-notice svg,
.departure-controls svg,
.profile-editor summary svg,
.search-input svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

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

.button-primary:hover {
  border-color: var(--pine-strong);
  background: var(--pine-strong);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--pine);
  color: var(--pine);
}

.text-button {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--pine);
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--pine);
  color: var(--pine);
}

.button:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible,
.primary-nav button:focus-visible,
label[for]:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(183 138 68 / 24%);
  outline-offset: 2px;
}

.button[disabled],
.icon-button[disabled],
button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  min-height: calc(100vh - var(--topbar-height));
}

.app-view {
  width: 100%;
}

.plan-layout {
  display: grid;
  grid-template-columns: minmax(320px, 340px) minmax(620px, 720px) 400px;
  justify-content: center;
  align-items: start;
  min-height: calc(100vh - var(--topbar-height));
}

.setup-rail,
.result-rail {
  position: sticky;
  top: var(--topbar-height);
  overflow-y: auto;
  max-height: calc(100vh - var(--topbar-height));
  background: var(--surface);
  scrollbar-width: thin;
}

.setup-rail {
  border-right: 1px solid var(--line);
}

.result-rail {
  border-left: 1px solid var(--line);
}

.rail-section,
.result-rail > section,
.result-rail > details {
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.setup-state h1 {
  max-width: 260px;
  font-size: 28px;
}

.setup-state > p,
.profile-summary > p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.setup-state.profile-ready {
  border-left: 4px solid var(--pine);
  background: var(--pine-soft);
}

.setup-state.profile-ready .section-kicker {
  color: var(--pine);
}

.setup-state.profile-ready h1 {
  max-width: none;
  font-size: 32px;
}

.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 15px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.onboarding-steps span {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 32px;
  padding: 6px 4px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.onboarding-steps span:last-child {
  border-right: 0;
}

.onboarding-steps span.completed {
  background: var(--pine-soft);
  color: var(--pine);
}

.onboarding-steps span.active {
  box-shadow: inset 0 -2px var(--pine);
  color: var(--ink);
}

body.has-profile .onboarding-steps {
  display: none;
}

.stacked-actions {
  display: grid;
  gap: 8px;
}

.data-disclosure {
  display: block;
  margin: 18px -22px -22px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 64%);
  color: var(--muted);
}

.data-disclosure > summary {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  cursor: pointer;
  list-style: none;
}

.data-disclosure > summary::-webkit-details-marker,
.model-method > summary::-webkit-details-marker,
.segment-surface > summary::-webkit-details-marker {
  display: none;
}

.data-disclosure > summary > svg:first-child {
  width: 19px;
  height: 19px;
  color: var(--success);
}

.data-disclosure > summary > svg:last-child {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.data-disclosure[open] > summary > svg:last-child,
.model-method[open] > summary svg,
.segment-surface[open] > summary .surface-summary-meta svg {
  transform: rotate(180deg);
}

.data-disclosure summary strong,
.data-disclosure summary small {
  display: block;
}

.data-disclosure summary strong {
  color: var(--ink);
  font-size: 12px;
}

.data-disclosure summary small {
  margin-top: 1px;
  font-size: 11px;
}

.disclosure-body {
  padding: 11px 0 13px 29px;
  border-top: 1px solid var(--line);
}

.disclosure-body p {
  font-size: 12px;
  line-height: 1.45;
}

.disclosure-action {
  width: 100%;
  margin-top: 10px;
}

.data-disclosure .text-button {
  min-height: 34px;
  margin-top: 5px;
  padding: 4px 0;
  font-size: 12px;
}

.section-heading,
.scenario-heading,
.surface-heading {
  justify-content: space-between;
  gap: 16px;
}

.profile-summary h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.profile-weight-basis {
  margin-top: 14px;
  padding-left: 10px;
  border-left: 2px solid var(--amber);
}

.profile-weight-basis strong {
  font-size: 12px;
}

.profile-weight-basis p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.aircraft-scope-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.aircraft-scope-note svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--pine);
}

.aircraft-scope-note strong {
  color: var(--ink);
}

.fixed-assumptions h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
}

.fixed-assumptions .profile-facts {
  margin-top: 12px;
  padding: 0;
}

.fixed-assumption-note {
  margin-top: 12px;
  padding-left: 10px;
  border-left: 2px solid var(--amber);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.profile-editor {
  padding: 0;
}

.profile-editor > summary {
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.profile-editor > summary::-webkit-details-marker,
.departure-controls > summary::-webkit-details-marker {
  display: none;
}

.profile-editor[open] > summary svg,
.departure-controls[open] > summary > svg:last-child {
  transform: rotate(180deg);
}

.profile-facts,
.summary-list {
  display: grid;
}

.profile-facts {
  padding: 0 20px 12px;
}

.weight-assumption {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  padding: 13px 20px;
  border-top: 1px solid #ead4b7;
  border-bottom: 1px solid #ead4b7;
  background: var(--amber-soft);
  color: #57350c;
}

.weight-assumption > svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--amber);
}

.weight-assumption strong {
  font-size: 12px;
}

.weight-assumption p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.profile-facts div,
.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.profile-facts div:last-child,
.summary-list div:last-child {
  border-bottom: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.assumption-grid {
  display: grid;
  gap: 11px;
  padding: 4px 20px 20px;
}

label > span:first-child,
.scenario-field > label,
.mode-selector legend {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}

input:hover,
select:hover {
  border-color: #94a49e;
}

input:focus,
select:focus {
  border-color: var(--pine);
  outline: none;
  box-shadow: 0 0 0 3px rgb(183 138 68 / 16%);
}

.input-with-unit {
  position: relative;
  display: block;
}

.input-with-unit input {
  padding-right: 52px;
}

.input-with-unit em {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--faint);
  font-size: 11px;
  font-style: normal;
  pointer-events: none;
  transform: translateY(-50%);
}

.full-width {
  width: 100%;
}

.plan-workspace {
  min-width: 0;
  background: var(--page);
}

.scenario-surface,
.terrain-profile-card {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.scenario-heading {
  margin-bottom: 17px;
}

.scenario-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
}

.estimate-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(110px, 0.7fr) minmax(270px, 1.7fr);
  gap: 14px;
  align-items: start;
}

.field-help {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.35;
}

.search-input {
  position: relative;
  display: block;
}

.search-input svg {
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
}

.search-input input {
  padding-left: 35px;
  font-weight: 750;
  text-transform: uppercase;
}

.mode-selector {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

.mode-tabs button {
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.mode-tabs button:last-child {
  border-right: 0;
}

.mode-tabs button.active {
  background: var(--pine);
  color: #fff;
}

.mode-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding-top: 3px;
}

.airport-mode {
  grid-template-columns: minmax(170px, 1.2fr) repeat(3, minmax(0, 1fr));
}

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

.weather-button {
  width: 100%;
}

.forecast-density-altitude {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--pine);
  border-radius: 5px;
  background: var(--pine-soft);
}

.forecast-density-altitude > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.forecast-density-altitude span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.forecast-density-altitude strong {
  color: var(--pine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.forecast-density-altitude small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.forecast-density-altitude[data-state="loading"] strong {
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
}

.forecast-density-altitude[data-state="provisional"] {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.forecast-density-altitude[data-state="provisional"] strong {
  color: var(--amber);
}

.departure-controls {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.departure-controls > summary {
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  list-style: none;
}

.departure-controls > summary > span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.summary-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.clearance-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 14px;
}

.path-assumptions-controls {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 2px;
  border-top: 1px solid var(--line);
}

.path-assumptions-controls > summary {
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  padding-top: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}

.path-assumptions-controls > summary::-webkit-details-marker {
  display: none;
}

.path-assumptions-controls > summary > span:first-child,
.path-assumptions-summary-meta {
  display: flex;
  align-items: center;
}

.path-assumptions-controls > summary > span:first-child {
  gap: 7px;
  white-space: nowrap;
}

.path-assumptions-controls > summary > span:first-child svg,
.path-assumptions-summary-meta > svg {
  width: 16px;
  height: 16px;
}

.path-assumptions-controls > summary > span:first-child svg {
  color: var(--pine);
}

.path-assumptions-summary-meta {
  min-width: 0;
  gap: 8px;
  color: var(--muted);
}

.path-assumptions-summary {
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-align: right;
}

.path-assumptions-summary-meta > svg {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.path-assumptions-controls[open] > summary .path-assumptions-summary-meta > svg {
  transform: rotate(180deg);
}

.path-assumptions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 10px;
}

.provider-disclosure {
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.provider-disclosure svg {
  margin-top: 1px;
  color: var(--pine);
}

.map-surface {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.rail-map-surface .airport-map {
  height: clamp(260px, 36vh, 320px);
}

.airport-map {
  position: relative;
  width: 100%;
  height: 280px;
  background: #e9edeb;
}

.airport-map.map-fallback::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  content: "Map unavailable. Airport and terrain profile remain usable.";
  text-align: center;
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-attribution {
  font-size: 9px;
}

.map-popup {
  display: grid;
  gap: 2px;
}

.terrain-profile-card {
  min-width: 0;
  scroll-margin-top: calc(var(--topbar-height) + 8px);
}

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

.terrain-profile-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.terrain-profile-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.terrain-profile-header p.warning {
  color: var(--coral);
  font-weight: 700;
}

.terrain-chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 24px;
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.terrain-chart-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.terrain-legend-swatch {
  display: inline-block;
  flex: 0 0 32px;
  width: 32px;
  height: 0;
  border-top: 2px solid;
}

.terrain-legend-swatch.corridor-high {
  border-color: #9d5c2c;
}

.terrain-legend-swatch.centerline-terrain {
  border-color: #b8875f;
  border-top-width: 1.6px;
  border-top-style: dashed;
}

.terrain-legend-swatch.required-gradient {
  border-color: var(--amber);
  border-top-style: dashed;
}

.terrain-legend-swatch.aircraft-climb {
  border-color: var(--data-pine);
  border-top-width: 3px;
}

.terrain-profile-header > span,
.view-status,
.surface-heading > span {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: 12px;
  font-weight: 750;
}

.profile-chart,
.chart {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.profile-chart {
  min-height: 240px;
  aspect-ratio: 52 / 21;
}

.chart {
  min-height: 390px;
  border-top: 1px solid var(--line);
}

.profile-chart svg,
.chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.empty-chart {
  display: grid;
  place-items: center;
  min-height: inherit;
  padding: 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.profile-view-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-view-facts div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.profile-view-facts div:last-child {
  border-right: 0;
}

.profile-view-facts dd {
  margin-top: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 500;
  text-align: left;
}

.terrain-safety-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.terrain-assumptions {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.terrain-assumptions > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 30px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.terrain-assumptions > summary::-webkit-details-marker {
  display: none;
}

.terrain-assumptions > summary svg {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
}

.terrain-assumptions[open] > summary svg {
  transform: rotate(180deg);
}

.terrain-assumptions > p {
  padding: 2px 0 7px;
  line-height: 1.45;
}

.safety-notice {
  align-items: flex-start;
  gap: 10px;
  background: var(--amber-soft);
  color: #57350c;
}

.safety-notice svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--amber);
}

.safety-notice p {
  font-size: 13px;
  line-height: 1.4;
}

.result-section {
  padding-top: 24px !important;
}

.result-panel > div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.result-panel > div > strong {
  display: block;
  margin-top: 4px;
  color: var(--pine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 50px;
  font-weight: 500;
  line-height: 1;
}

.result-panel dl {
  display: grid;
  margin-top: 20px;
}

.result-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.result-panel dl div:first-child dd {
  color: var(--pine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.estimate-message,
.weather-message {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.estimate-message.warning,
.weather-message.warning {
  padding-left: 9px;
  border-left: 2px solid var(--coral);
  color: var(--coral);
  font-weight: 700;
}

.result-context h2 {
  font-size: 14px;
}

.result-context .weather-message {
  margin-top: 8px;
}

.weather-facts {
  display: grid;
  margin-top: 11px;
  border-top: 1px solid var(--line);
}

.weather-facts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.weather-facts dt {
  font-size: 11px;
}

.weather-facts dd {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.raw-weather-reports {
  margin-top: 13px;
  border-top: 1px solid var(--line);
}

.raw-weather-report {
  border-bottom: 1px solid var(--line);
}

.raw-weather-report summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}

.raw-weather-report summary::-webkit-details-marker {
  display: none;
}

.raw-weather-report summary small {
  overflow: hidden;
  font-size: 10px;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raw-weather-report summary svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.raw-weather-report[open] summary svg {
  transform: rotate(180deg);
}

.raw-weather-report code {
  display: block;
  max-height: 180px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.weather-reference-note {
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.limits-summary ul {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
}

.limits-summary li {
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.limits-summary li svg {
  margin-top: 1px;
  color: var(--success);
}

.limits-summary > summary {
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  list-style: none;
}

.limits-summary > summary::-webkit-details-marker {
  display: none;
}

.limits-summary > summary svg {
  transition: transform 160ms ease;
}

.limits-summary[open] > summary svg {
  transform: rotate(180deg);
}

.model-view,
.method-view {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 40px;
}

.method-view {
  max-width: 1040px;
}

.method-scope {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.9fr);
  gap: 48px;
  align-items: start;
  padding: 26px 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.method-scope h2,
.method-timeline h2,
.method-boundaries h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
}

.method-scope p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.method-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.method-stats div {
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.method-stats div:last-child {
  grid-column: 1 / -1;
}

.method-stats dd {
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
  text-align: left;
}

.method-timeline {
  margin: 30px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.method-timeline li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.method-timeline > li > span {
  color: var(--pine);
  font-size: 12px;
  font-weight: 800;
}

.method-timeline p {
  max-width: 760px;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.65;
}

.method-timeline code {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 10px;
  border-left: 2px solid var(--pine);
  background: var(--pine-soft);
  color: var(--pine-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  white-space: normal;
}

.method-boundaries {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid #ead4b7;
  border-radius: var(--radius);
  background: var(--amber-soft);
}

.method-boundaries ul {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: #57350c;
  font-size: 13px;
  line-height: 1.55;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.view-header h1 {
  font-size: 34px;
}

.view-header p {
  max-width: 650px;
  margin-top: 7px;
  color: var(--muted);
}

.view-status {
  padding: 6px 9px;
  border: 1px solid #ead4b7;
  border-radius: 4px;
  background: var(--amber-soft);
}

.quality-surface,
.model-chart-surface,
.diagnostic-surface,
.planning-table-surface,
.segment-surface,
.log-library,
.log-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.metric-strip div {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

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

.metric-strip dd {
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
  text-align: left;
}

.model-chart-surface,
.segment-surface {
  margin-top: 18px;
  overflow: hidden;
}

.model-support-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(520px, 1.15fr);
  gap: 18px;
  margin-top: 18px;
}

.diagnostic-surface,
.planning-table-surface {
  min-width: 0;
  overflow: hidden;
}

.diagnostic-surface .surface-heading,
.planning-table-surface .surface-heading {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.diagnostic-chart {
  display: grid;
  min-height: 310px;
  overflow: hidden;
  background: var(--surface);
}

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

.zero-line {
  stroke: var(--coral);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
}

.diagnostic-dot {
  fill: var(--data-pine);
  stroke: #fff;
  stroke-width: 1.5;
}

.planning-table {
  min-width: 620px;
}

.model-chart-surface .surface-heading,
.segment-surface .surface-heading,
.log-library .surface-heading {
  padding: 16px 18px;
}

.segment-surface > summary {
  cursor: pointer;
  list-style: none;
}

.surface-summary-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.surface-summary-meta svg {
  width: 16px;
  height: 16px;
  transition: transform 160ms ease;
}

.surface-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
}

.surface-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  scrollbar-color: var(--line-strong) transparent;
}

table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

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

.positive {
  color: var(--success);
  font-weight: 750;
}

.warning-text {
  color: var(--amber);
  font-weight: 750;
}

.model-limit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #ead4b7;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: #57350c;
  font-size: 12px;
}

.model-limit svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.model-method {
  margin-top: 22px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.model-method > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 58px;
  cursor: pointer;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 500;
  list-style: none;
}

.model-method > summary svg {
  width: 17px;
  height: 17px;
  transition: transform 160ms ease;
}

.model-method-body {
  padding-bottom: 16px;
}

.model-method-intro,
.model-method-steps p,
.model-method-note {
  color: var(--muted);
  font-size: 13px;
}

.model-method-intro {
  max-width: 690px;
}

.model-method-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.model-method-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.model-method-steps li:first-child {
  padding-left: 0;
}

.model-method-steps li:last-child {
  padding-right: 0;
  border-right: 0;
}

.model-method-steps li > span {
  color: var(--pine);
  font-size: 12px;
  font-weight: 800;
}

.model-method-steps strong {
  display: block;
  font-size: 14px;
}

.model-method-steps p {
  margin-top: 5px;
  line-height: 1.5;
}

.model-method-note {
  margin-top: 13px;
  padding-left: 10px;
  border-left: 2px solid var(--amber);
}

.view-actions {
  gap: 12px;
}

.danger-button {
  color: var(--coral);
}

.logs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.6fr);
  gap: 18px;
  align-items: start;
}

.log-library,
.log-summary {
  padding: 0;
  overflow: hidden;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 170px;
  margin: 0 18px 18px;
  padding: 25px;
  border: 1px dashed #91a69e;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--pine);
  background: var(--pine-soft);
}

.drop-zone > svg {
  width: 30px;
  height: 30px;
  margin-bottom: 8px;
  color: var(--pine);
  stroke-width: 1.5;
}

.drop-zone > span {
  font-size: 14px;
  font-weight: 750;
}

.drop-zone > small {
  margin-top: 3px;
  font-size: 12px;
}

.error-box {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 12px);
  right: 16px;
  width: min(420px, calc(100% - 32px));
  padding: 13px 46px 13px 14px;
  border: 1px solid #edb8ab;
  border-radius: var(--radius);
  background: var(--coral-soft);
  color: #7b2b1e;
  box-shadow: var(--shadow);
}

.error-box .icon-button {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
}

.error-box p {
  margin-top: 3px;
  font-size: 12px;
}

.file-list {
  border-top: 1px solid var(--line);
}

.empty-row {
  padding: 28px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.file-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

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

.file-row > div {
  min-width: 0;
}

.file-row strong,
.file-row small {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.file-row strong {
  font-size: 13px;
}

.file-row small {
  margin-top: 2px;
  font-size: 12px;
}

.file-row em {
  color: var(--success);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.file-row-error em {
  color: var(--coral);
}

.file-check {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success);
}

.file-check::after {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 4px;
  height: 7px;
  border: solid white;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.file-check.error {
  background: var(--coral);
}

.file-check.error::after {
  top: 7px;
  left: 4px;
  width: 8px;
  height: 2px;
  border: 0;
  background: #fff;
  transform: none;
}

.log-summary {
  padding: 18px;
}

.log-summary h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.log-summary .summary-list {
  margin-top: 13px;
}

.privacy-note {
  align-items: flex-start;
  gap: 10px;
  margin: 16px -18px -18px;
  padding: 15px 18px;
  border-top: 1px solid var(--line);
  background: var(--pine-soft);
}

.privacy-note > svg {
  width: 21px;
  height: 21px;
  color: var(--success);
}

.privacy-note strong {
  font-size: 12px;
}

.privacy-note p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

/* Inline SVG chart system */
.axis {
  stroke: #53635d;
  stroke-width: 1.2;
}

.grid-line {
  stroke: #e4e9e7;
  stroke-width: 1;
}

.chart-label {
  fill: #68756f;
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 12px;
}

.chart-dot,
.source-window {
  fill: var(--data-pine);
  opacity: 0.75;
}

.chart-dot-muted,
.source-window-excluded {
  fill: #9ba6a2;
  opacity: 0.35;
}

.fit-line {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2.4;
}

.typical-line,
.clearance-line {
  fill: none;
  stroke: var(--data-pine);
  stroke-width: 2.6;
}

.band-line {
  fill: none;
  stroke: #7f8b87;
  stroke-width: 1.2;
  stroke-dasharray: 5 5;
}

.terrain-fill {
  fill: #dfe6e2;
  opacity: 0.8;
}

.terrain-line {
  fill: none;
  stroke: #9d5c2c;
  stroke-width: 2;
}

.terrain-centerline {
  fill: none;
  stroke: #b8875f;
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
}

.required-gradient-line {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-dasharray: 7 4;
}

.clearance-warning-dot {
  fill: var(--coral);
}

@media (max-width: 1400px) {
  .topbar {
    grid-template-columns: minmax(250px, 1fr) auto minmax(230px, 1fr);
  }

  .profile-status {
    min-width: 0;
  }
}

@media (max-width: 1339px) {
  :root {
    --planner-frame-width: 1080px;
  }

  .plan-layout {
    grid-template-columns: minmax(300px, 320px) minmax(600px, 760px);
    justify-content: center;
  }

  .result-rail {
    position: static;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .result-rail > section,
  .result-rail > details {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .result-rail > :last-child {
    border-right: 0;
  }

  .safety-notice {
    grid-column: 1 / -1;
    border-right: 0 !important;
    border-bottom: 1px solid #ead4b7 !important;
  }

  .result-panel > div > strong {
    font-size: 43px;
  }
}

@media (max-width: 960px) {
  :root {
    --planner-frame-width: 100%;
  }

  .plan-layout {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  body.has-profile .setup-state {
    padding-top: 0;
  }

  body.has-profile .setup-state > h1,
  body.has-profile .setup-state > p,
  body.has-profile .setup-state > .onboarding-steps,
  body.has-profile .setup-state > .stacked-actions {
    display: none;
  }

  body.has-profile .setup-state > .data-disclosure {
    margin-top: 0;
    border-top: 0;
  }

  body.has-profile .fixed-profile-intro {
    padding-top: 22px;
  }

  body.has-profile .fixed-profile-intro > h1,
  body.has-profile .fixed-profile-intro > p {
    display: block;
  }

  body.has-profile .fixed-profile-intro > .stacked-actions {
    display: grid;
  }

  .setup-rail,
  .result-rail {
    position: static;
    grid-column: 1;
    max-height: none;
    border: 0;
  }

  .setup-rail {
    grid-row: 1;
    border-bottom: 1px solid var(--line);
  }

  .plan-workspace {
    grid-row: 2;
  }

  .result-rail {
    grid-row: 3;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 920px) {
  :root {
    --topbar-height: 108px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-rows: 58px 50px;
    padding: 0 14px;
  }

  .brand-lockup {
    grid-column: 1;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
  }

  .primary-nav button {
    min-height: 50px;
  }

  .model-view,
  .method-view {
    width: min(100% - 28px, 760px);
    padding-top: 24px;
  }

  .method-scope {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .model-support-grid {
    grid-template-columns: 1fr;
  }

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

  .metric-strip div:nth-child(3) {
    border-right: 0;
  }

  .metric-strip div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 48rem) {
  .site-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 106px;
  }

  body {
    font-size: 14px;
  }

  .topbar {
    grid-template-rows: 56px 50px;
    padding: 0 10px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .profile-status small {
    display: none;
  }

  .brand-lockup > strong {
    max-width: min(44vw, 220px);
  }

  .profile-status {
    min-width: 0;
  }

  .profile-status strong {
    max-width: 130px;
    font-size: 12px;
  }

  .primary-nav button {
    border-right: 1px solid var(--line);
  }

  .primary-nav button:last-child {
    border-right: 0;
  }

  .result-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .safety-notice {
    grid-column: 1 / -1;
  }

  .result-section,
  .result-context {
    grid-column: 1 / -1;
    min-width: 0;
    padding: 16px !important;
    border-right: 0;
  }

  .result-context {
    border-top: 1px solid var(--line);
    border-right: 0 !important;
  }

  .limits-summary {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .result-panel > div > strong {
    font-size: 40px;
  }

  .result-panel dl {
    margin-top: 13px;
  }

  .result-panel dl div {
    display: block;
    padding: 7px 0;
  }

  .result-panel dl dd {
    margin-top: 2px;
    text-align: left;
  }

  .scenario-surface,
  .terrain-profile-card {
    padding: 18px 14px;
  }

  .scenario-heading {
    align-items: flex-start;
  }

  .scenario-heading h2 {
    font-size: 20px;
  }

  .estimate-form {
    grid-template-columns: 1fr 0.8fr;
  }

  .mode-selector {
    grid-column: 1 / -1;
  }

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

  .weather-button {
    min-height: 44px;
  }

  .forecast-density-altitude {
    grid-template-columns: 1fr;
  }

  .summary-hint {
    display: none;
  }

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

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

  .path-assumptions-controls > summary {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .path-assumptions-summary-meta {
    width: 100%;
    padding-left: 23px;
  }

  .path-assumptions-summary {
    flex: 1 1 auto;
    text-align: left;
  }

  .airport-map {
    min-height: 240px;
    height: 240px;
  }

  .rail-map-surface .airport-map {
    min-height: 240px;
    height: 240px;
  }

  .terrain-profile-header {
    display: block;
  }

  .terrain-profile-header > span {
    display: block;
    margin-top: 5px;
  }

  .terrain-chart-legend {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    margin-top: 2px;
  }

  .profile-chart,
  .chart,
  .diagnostic-chart {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: var(--line-strong) transparent;
  }

  .profile-chart {
    min-height: 280px;
    aspect-ratio: auto;
  }

  .profile-chart svg,
  .chart svg,
  .diagnostic-chart svg {
    width: 720px;
    max-width: none;
    height: 280px;
  }

  .profile-chart .chart-label {
    font-size: 16px;
  }

  .profile-chart .chart-axis-title-x {
    display: none;
  }

  .chart,
  .chart svg {
    min-height: 360px;
    height: 360px;
  }

  .diagnostic-chart,
  .diagnostic-chart svg {
    min-height: 300px;
    height: 300px;
  }

  .profile-view-facts {
    grid-template-columns: 1fr;
  }

  .profile-view-facts div {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-view-facts div:last-child {
    border-bottom: 0;
  }

  .profile-view-facts dd {
    margin-top: 0;
    font-size: 16px;
    text-align: right;
  }

  .profile-view-facts div:last-child {
    display: block;
  }

  .profile-view-facts div:last-child dd {
    margin-top: 4px;
    text-align: left;
  }

  .view-header,
  .logs-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-header h1 {
    font-size: 29px;
  }

  .view-actions {
    width: 100%;
    justify-content: space-between;
  }

  .button,
  .icon-button,
  input,
  select {
    min-height: 44px;
  }

  .icon-button {
    width: 44px;
  }

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

  .metric-strip div,
  .metric-strip div:nth-child(3) {
    border-right: 1px solid var(--line);
    border-top: 1px solid var(--line);
  }

  .metric-strip div:nth-child(1),
  .metric-strip div:nth-child(2) {
    border-top: 0;
  }

  .metric-strip div:nth-child(even) {
    border-right: 0;
  }

  .metric-strip div:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .surface-heading.split-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .model-method-steps {
    grid-template-columns: 1fr;
  }

  .model-method-steps li,
  .model-method-steps li:first-child,
  .model-method-steps li:last-child {
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .model-method-steps li:last-child {
    border-bottom: 0;
  }

  .drop-zone {
    margin: 0 14px 14px;
  }

  .footer-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px;
  }
}

@media (max-width: 30rem) {
  .site-header-inner {
    padding-inline: 1rem;
  }
}

@media (max-width: 390px) {
  .profile-status strong {
    max-width: 105px;
  }

  .result-rail {
    grid-template-columns: 1fr;
  }

  .result-section,
  .result-context {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .estimate-form,
  .mode-fields,
  .manual-mode,
  .clearance-form,
  .path-assumptions-grid {
    grid-template-columns: 1fr;
  }

  .airport-field,
  .weight-field,
  .mode-selector {
    grid-column: 1;
  }

  .mode-tabs button {
    min-height: 42px;
    padding: 6px 4px;
    font-size: 11px;
  }

}

@media (max-width: 360px) {
  .profile-status strong {
    max-width: 82px;
  }
}
