/* Airplane studio page frame */
main,
body > footer {
  width: min(100% - 2 * var(--size-gutter), var(--size-page));
  margin-inline: auto;
}
main {
  padding-block: var(--space-6) var(--space-4);
}

footer {
  max-width: 1256px;
  margin: 0 auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-7));
}
.actions,
.resource-actions,
.step-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
footer > a {
  font-size: var(--text-xs);
  text-decoration: none;
}
footer > a:hover,
.source-link:hover {
  text-decoration: underline;
}
.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(var(--space-4), 4vw, var(--space-8));
  align-items: center;
}
.eyebrow,
.format,
.plate-bottom {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-text-success);
}
.inspiration {
  margin: var(--space-3) 0 var(--space-1);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  font-size: var(--text-md);
}
.hero-copy > .actions {
  margin-top: var(--space-5);
}
.model,
.view-tabs button,
.text-button,
.saved-button {
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.text-button:hover,
.saved-button:hover {
  background: var(--color-surface-sunken);
}
.specimen {
  position: relative;
  min-height: 246px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-surface-caution);
  background-image: radial-gradient(color-mix(in srgb, var(--color-surface-inverse) 17%, transparent) 0.8px, transparent 0.8px);
  background-size: 14px 14px;
}
.specimen:before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--color-border-strong) 15%, transparent);
  border-radius: var(--radius-md);
  z-index: -1;
}
.format,
.plate-bottom {
  position: absolute;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  color: var(--color-text-muted);
  gap: var(--space-2);
  z-index: 1;
}
.format {
  top: 20px;
}
.plate-bottom {
  bottom: 18px;
  font-size: var(--text-xs);
}
#aircraft {
  width: 86%;
  margin: var(--space-5) 0 var(--space-4);
}
#aircraft svg,
.model img,
.work-main svg[viewBox='0 0 388 198'] {
  display: block;
  width: 100%;
}
.models {
  padding: clamp(var(--space-6), 5vw, var(--space-8)) 0;
}
.models h2 {
  font-size: var(--text-lg);
  
  margin-bottom: var(--space-3);
}
.model-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}
.model {
  padding: var(--space-2) var(--space-3);
  display: grid;
  grid-template-columns: minmax(40px, 35%) 1fr;
  text-align: left;
  align-items: center;
  background: var(--color-surface);
  gap: var(--space-2);
  min-height: 68px;
}
.model img {
  height: 44px;
  object-fit: contain;
}
.model b,
.model small {
  display: block;
}
.model b {
  font-size: var(--text-xs);
  line-height: 1.2;
}
.model small {
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.section-title {
  margin-bottom: var(--space-4);
}
.section-title p,
.collection > div > p {
  margin-top: var(--space-1);
}
.workbench {
  scroll-margin-top: var(--space-4);
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(250px, 0.85fr);
  gap: var(--space-4);
  align-items: start;
}
.work-main,
.settings,
.resource-grid article,
.collection {
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.work-main {
  overflow: hidden;
  min-width: 0;
}
.view-tabs {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-rule);
}
.view-tabs button {
  border-color: transparent;
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}
#diagrams {
  padding: var(--space-4) var(--space-4) var(--space-2);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-rule);
}
#fold-figure svg {
  height: clamp(170px, 23vw, 270px);
  width: 100%;
}
.legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.legend > span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.chip {
  width: 13px;
  height: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.face {
  background: var(--color-surface-caution);
}
.reverse {
  background: var(--color-surface-sunken);
}
.move {
  background: var(--color-action);
}
.dash {
  width: 16px;
  border-top: 2px dashed var(--color-border-strong);
}
#three {
  min-height: 300px;
  background: var(--color-surface-sunken);
  padding: var(--space-1);
}
#step-details,
#flight-note,
.settings,
.resource-grid article,
.collection {
  padding: clamp(var(--space-4), 2.4vw, var(--space-5));
}
#step-details > .eyebrow {
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}
#instruction,
#trial,
.resource-grid article > p:not(.eyebrow) {
  margin-top: var(--space-2);
  max-width: 65ch;
}
.step-progress {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--size-target), 1fr));
  gap: var(--space-1);
}
.step-progress button {
  min-height: var(--size-target);
  border: 0;
  position: relative;
  padding: 0;
  background: transparent;
}
/* The visible bar sits inside a full-height touch target. */
.step-progress button:before {
  content: '';
  position: absolute;
  inset: calc(50% - 3px) 1px;
  background: var(--color-surface-sunken);
  border: var(--line-hair) solid var(--color-rule);
  border-radius: var(--radius-sm);
}
.step-progress button.done:before {
  background: var(--color-border);
}
/* The current step is thicker as well as darker. */
.step-progress button[aria-current='step']:before {
  inset: calc(50% - 6px) 1px;
  background: var(--color-selected);
  border-color: var(--color-selected);
}
.step-nav {
  margin-top: var(--space-3);
}
.step-nav .button {
  min-height: var(--size-target);
  padding: var(--space-2) var(--space-3);
}
.settings {
  display: grid;
  align-content: start;
  gap: 0;
}
.settings h3 {
  margin-bottom: var(--space-4);
}
.settings label,
#share-fallback label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  margin: var(--space-3) 0 var(--space-1);
}
.settings select,
.collection input[type='url'] {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-height: var(--size-target);
  padding: var(--space-1) var(--space-2);
  width: 100%;
}
.settings input[type='range'] {
  accent-color: var(--color-text-success);
  width: 100%;
  cursor: pointer;
  min-height: var(--size-target);
  margin: 1px 0;
}
.settings output {
  font-size: var(--text-xs);
  color: var(--color-text-success);
}
.hint {
  font-size: var(--text-xs);
}
.settings .button {
  margin-top: var(--space-4);
}
.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0 var(--space-4);
}
.resource-grid h2,
.collection h2 {
  font-size: var(--text-xl);
}
.resource-actions {
  margin-top: var(--space-4);
  gap: var(--space-2);
}
.text-button,
.saved-button {
  padding: var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  background: var(--color-surface);
}
.source-link {
  display: inline-block;
  margin-top: var(--space-3);
  color: var(--color-text-success);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}
.collection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.collection > div:first-child {
  max-width: 60ch;
}
.collection p {
  font-size: var(--text-xs);
}
#saved-builds,
#share-fallback {
  width: 100%;
}
#saved-builds:empty {
  display: none;
}
.saved-button {
  margin: var(--space-1) var(--space-1) 0 0;
}
.collection .actions {
  gap: var(--space-1);
}
.collection .actions .button {
  font-size: var(--text-xs);
}
#notice {
  position: fixed;
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  text-align: center;
  box-shadow: 0 5px 25px var(--color-shadow);
  padding: var(--space-2) var(--space-4);
  max-width: min(90vw, 600px);
  width: max-content;
  font-size: var(--text-xs);
}
#notice:empty {
  display: none;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-5) var(--space-6);
  gap: var(--space-3);
}
@media (max-width: 760px) {
  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .models {
    padding: var(--space-5) 0;
  }
  .work-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(210px, 1fr);
  }
  .intro {
    gap: var(--space-4);
  }
  .specimen {
    min-height: 225px;
  }
  .hero-copy .actions {
    gap: var(--space-2);
  }
  .resource-grid {
    margin-top: var(--space-4);
  }
}
@media (max-width: 620px) {
  .intro,
  .work-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }
  .intro {
    gap: var(--space-4);
  }
  .specimen {
    min-height: 190px;
  }
  .specimen #aircraft {
    width: min(85%, 395px);
  }
  .model-grid {
    gap: var(--space-1);
  }
  .model {
    padding: var(--space-2);
    min-height: 62px;
    gap: var(--space-1);
  }
  .model b {
    font-size: var(--text-xs);
  }
  .model small {
    font-size: var(--text-xs);
  }
  .work-main,
  #diagrams,
  .settings {
    min-width: 0;
  }
  #fold-figure svg {
    height: auto;
  }
  .resource-grid {
    gap: var(--space-3);
  }
  .work-grid {
    gap: var(--space-3);
  }
  .section-title p {
    font-size: var(--text-xs);
  }
}

.aircraft-guide {
  margin: var(--space-7) 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.field-card {
  margin: 0;
  color: var(--color-text);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-lg);
}

.field-card > img,
.field-paper,
.field-diagram {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 470 / 245;
  object-fit: contain;
}

.field-card > img,
.field-paper {
  background: var(--color-surface-caution);
}

.field-diagram {
  background: var(--color-surface-sunken);
}

.field-card svg {
  display: block;
  width: 100%;
  height: 100%;
}

.field-card figcaption {
  padding: var(--space-4);
}

.field-card figcaption h3 {
  font-size: var(--text-md);
  margin: 0 0 var(--space-2);
}

.field-card figcaption p {
  margin: 0 0 var(--space-2);
}

.field-card a,
.field-credit a {
  color: var(--color-text-link);
  text-underline-offset: 0.2em;
}

.field-credit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

@media (max-width: 720px) {
  .field-grid {
    grid-template-columns: 1fr;
  }
}
