:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9e0e8;
  --panel: #ffffff;
  --page: #eef3f7;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --warn: #a15c00;
  --bad: #9f1239;
  --soft: #e3f3f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
}

button:hover {
  border-color: #9eb4c3;
}

.primary {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.primary:hover {
  background: var(--accent-dark);
}

.shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar,
.section-heading,
.split,
.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar {
  margin-bottom: 18px;
}

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

.brand img {
  display: block;
  width: auto;
  height: 34px;
  max-height: 34px;
  flex: 0 0 auto;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.section-heading {
  margin: 6px 0 14px;
}

.nested {
  margin-top: 14px;
}

.section-heading p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 3px;
}

.result-summary {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr 0.85fr;
  background: #102b33;
  color: white;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.result-summary .label {
  color: #a8c4c9;
  display: block;
  margin-bottom: 5px;
}

.result-summary strong {
  font-size: 15px;
  line-height: 1.25;
}

.calculator-layout {
  display: block;
  margin-bottom: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.compact {
  gap: 8px;
}

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

.row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.save-status.saved {
  color: var(--accent);
}

.save-aircraft {
  min-height: 32px;
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 800;
}

.remove {
  min-height: 32px;
  color: var(--bad);
}

.fields {
  display: grid;
  gap: 10px;
}

.aircraft-select-row {
  grid-template-columns: minmax(280px, 520px) minmax(160px, 220px);
  margin-bottom: 10px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
}

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

.four {
  grid-template-columns: 0.8fr repeat(3, 1fr);
}

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

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

.embedded-economics {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.embedded-economics h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

input:focus,
select:focus {
  outline: 2px solid #95d3cb;
  border-color: var(--accent);
}

.instruction {
  border-left: 4px solid var(--accent);
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

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

.instruction span {
  color: var(--muted);
  display: block;
  font-size: 14px;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.aircraft-manager {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 12px;
  background: #fbfdff;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.notes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.note,
.issue {
  border-radius: 8px;
  padding: 10px;
  background: #f7f9fb;
  color: var(--muted);
  font-size: 14px;
}

.issue {
  background: #fff1f2;
  color: var(--bad);
}

.disclaimer {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 14px auto 0;
  max-width: 980px;
  text-align: center;
}

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

pre {
  max-height: 520px;
  overflow: auto;
  background: #111827;
  color: #d1d5db;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1060px) {
  .result-summary {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .shell {
    width: 100%;
    padding: 12px 10px 96px;
  }

  .topbar,
  .split {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    align-items: center;
    flex-direction: row;
  }

  .brand img {
    width: auto;
    height: 28px;
    max-height: 28px;
  }

  .row-title {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions {
    justify-content: stretch;
  }

  .row-actions button {
    flex: 1;
  }

  .topbar button,
  .split button {
    width: 100%;
  }

  .button-row {
    width: 100%;
  }

  .topbar .button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .panel {
    border-radius: 8px;
    padding: 14px;
  }

  .section-heading {
    gap: 8px;
    margin-bottom: 10px;
  }

  .section-heading p {
    font-size: 13px;
  }

  .row-card {
    padding: 14px;
  }

  .row-title strong {
    font-size: 18px;
  }

  .six,
  .four,
  .five,
  .aircraft-select-row,
  .two {
    grid-template-columns: 1fr;
  }

  input,
  select {
    min-height: 46px;
    font-size: 16px;
  }

  .primary {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    min-height: 54px;
    box-shadow: 0 12px 28px rgb(15 118 110 / 24%);
  }

  .aircraft-manager {
    padding: 12px;
  }

  .instruction,
  .note,
  .issue {
    font-size: 15px;
  }

  h1 {
    font-size: 28px;
  }
}

@media (max-width: 420px) {
  .topbar .button-row {
    grid-template-columns: 1fr;
  }

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