/* Atmosphere Elevator: an elevator from the ground to 120 km. Scene drawn by art.js (colors from the --ae-* properties
   below, light and dark). Readings and answers on the left; the brief, the elevator panel and the tower + temperature
   profile on the right. */
html {
  --ae-sky0: #bfe3f7; --ae-sky1: #7cc0ea; --ae-sky2: #2f5fa0; --ae-sky3: #142050; --ae-sky4: #04071a; --ae-ozone: #c89cff;
  --ae-grass: #5a9a3f; --ae-soil: #3d6a28; --ae-lobby: #f4f1ea; --ae-line: #1c2a34; --ae-tower: #dfe6eb;
  --ae-car1: #ff9a5c; --ae-car2: #c4581f; --ae-window: #cfe9f7; --ae-graph-bg: #ffffff; --ae-grid: #d4dde4; --ae-curve: #c4410b; --ae-bound: #6a3fc0;
  --ae-label: #10212b; --ae-tag: rgba(255, 255, 255, .9); --ae-air: #2f5fa0;
  --ae-ink: #10212b; --ae-panel-bg1: #f5f8fd; --ae-panel-bg2: #e7eef9; --ae-accent: #2f5fa0; --ae-ok: #13704a; --ae-bad: #b3261e;
  --ae-chip: #ffffff; --ae-chip-on: #dbe6f7;
}
html[data-theme="dark"] {
  --ae-sky0: #2c5878; --ae-sky1: #1f4a74; --ae-sky2: #182f5c; --ae-sky3: #0c143a; --ae-sky4: #02040f;
  --ae-grass: #3f7a2c; --ae-soil: #2a4d1c; --ae-lobby: #b9c2c9; --ae-line: #0b1216; --ae-tower: #aab6bf;
  --ae-graph-bg: #111a21; --ae-grid: #2b3a45; --ae-curve: #ff9a5c; --ae-bound: #c9a2ff;
  --ae-label: #e6eef6; --ae-tag: rgba(10, 16, 22, .85); --ae-air: #9cc7e8;
  --ae-ink: #e6eef6; --ae-panel-bg1: #1b2330; --ae-panel-bg2: #141b26; --ae-accent: #8fb6ef; --ae-ok: #4fd08c; --ae-bad: #ff8a80;
  --ae-chip: #111822; --ae-chip-on: #24365a;
}

.ae { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 10px; color: var(--tlg-text); font-size: 16px; }
.ae input, .ae button { font: inherit; }
.ae-controls { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding: 8px 12px;
  background: linear-gradient(var(--ae-panel-bg1), var(--ae-panel-bg2)); color: var(--ae-ink); border: 3px solid var(--ae-accent); border-radius: 14px; box-shadow: 0 3px 8px rgba(0,0,0,.16); }
.ae-right { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; overflow: auto; }
.ae-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ae-accent); }
.ae-step { display: grid; gap: 4px; }
.ae-step-b { display: grid; gap: 5px; }
.ae-step-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; line-height: 1.2; }
.ae-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ae-accent); color: #fff; font-size: 16px; font-weight: 800; }
html[data-theme="dark"] .ae-n { color: #0d1626; }
.is-done > .ae-step-h .ae-n, .ae-pad.is-done .ae-n { background: var(--ae-ok); }
.ae-mark { margin-left: auto; font-weight: 800; }
.ae-mark.is-ok, .ae-fmark.is-ok { color: var(--ae-ok); }
.ae-mark.is-bad, .ae-fmark.is-bad { color: var(--ae-bad); }

/* readings */
.ae-readings { display: grid; gap: 4px; padding: 6px 10px; border-radius: 10px; background: var(--ae-chip); border: 2px dashed var(--ae-accent); }
.ae-readings p { margin: 0; }
.ae-read-h { font-weight: 700; }
.ae-read-row { display: flex; align-items: center; gap: 8px; }
.ae-thermo { font-size: 22px; width: 64px; text-align: center; }
.ae-schem { font-style: italic; }

/* chips */
.ae-chips { display: grid; gap: 5px; }
.ae-chips--2 { grid-template-columns: 1fr 1fr; }
.ae-chip, .ae-key { position: relative; display: flex; align-items: center; min-height: 44px; min-width: 0; padding: 4px 22px 4px 9px; border: 2px solid #8fa3c4;
  border-radius: 10px; background: var(--ae-chip); color: var(--ae-ink); font-size: 16px; line-height: 1.15; text-align: left; cursor: pointer; }
html[data-theme="dark"] .ae-chip, html[data-theme="dark"] .ae-key { border-color: #4a5a76; }
.ae-chip:hover:not(:disabled), .ae-key:hover:not(:disabled) { border-color: var(--ae-accent); }
.ae-chip:focus-visible, .ae-key:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.ae-chip.is-on, .ae-key.is-on { border-color: var(--ae-accent); background: var(--ae-chip-on); font-weight: 700; box-shadow: inset 0 0 0 1px var(--ae-accent); }
.ae-chip.is-on::before { content: '●'; position: absolute; right: 7px; top: 3px; font-size: 12px; color: var(--ae-accent); }
.ae-chip.is-on:disabled::before { content: ''; }
.ae-chip-m { position: absolute; right: 6px; bottom: 3px; font-weight: 800; }
.ae-chip.is-key, .ae-key.is-key { border-color: var(--ae-ok); box-shadow: inset 0 0 0 2px var(--ae-ok); }
.ae-chip.is-key .ae-chip-m { color: var(--ae-ok); }
.ae-chip.is-wrong, .ae-key.is-wrong { border-color: var(--ae-bad); border-style: dashed; }
.ae-chip.is-wrong .ae-chip-m { color: var(--ae-bad); }
.ae-chip:disabled, .ae-key:disabled { cursor: default; opacity: 1; }

/* numbers */
.ae-num { display: grid; gap: 2px; }
.ae-num-l { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-weight: 700; line-height: 1.2; }
.ae-fmark { font-weight: 800; }
.ae-num-row { display: flex; align-items: center; gap: 6px; }
.ae-num input { flex: 1 1 auto; min-width: 0; font-size: 17px; min-height: 44px; padding: 5px 8px; border: 2px solid #7f8fa8; border-radius: 8px; background: #fff; color: #10212b; }
html[data-theme="dark"] .ae-num input { background: #0c121a; color: #e6eef6; border-color: #5d6f8c; }
.ae-num input:focus-visible { outline: 3px solid var(--tlg-focus, #1a73e8); outline-offset: 2px; }
.ae-unit { flex: none; min-width: 64px; font-weight: 700; }

/* brief, elevator panel, scene */
.ae-brief { flex: none; padding: 6px 12px; border: 2px solid var(--ae-accent); border-radius: 12px; background: var(--ae-panel-bg1); color: var(--ae-ink); }
.ae-brief p { margin: 0; line-height: 1.4; }
.ae-row { flex: none; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 8px; align-items: start; }
.ae-pad { display: grid; gap: 6px; padding: 8px; border: 3px solid var(--ae-accent); border-radius: 12px; background: linear-gradient(#3a4654, #222b35); color: #fff; }
.ae-pad-h { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 800; }
.ae-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ae-key { display: grid; justify-items: center; align-content: center; gap: 0; padding: 2px; min-height: 48px; background: #f4f6f9; color: #10212b; border-color: #9aa6b4; text-align: center; border-radius: 50px; }
html[data-theme="dark"] .ae-key { background: #d9dfe6; color: #10212b; }
html .ae-key.is-on, html[data-theme="dark"] .ae-key.is-on { background: #ffd23f; border-color: #ffb000; color: #10212b; box-shadow: 0 0 10px #ffd23f; }
.ae-key-v { font-weight: 800; line-height: 1.05; }
.ae-key-u { font-size: 16px; line-height: 1; opacity: .75; }
.ae-scene { min-width: 0; border-radius: 12px; overflow: hidden; border: 2px solid var(--ae-line); background: var(--ae-panel-bg1); }
.ae-svg { display: block; width: 100%; height: auto; }
.ae-t { font-family: var(--tlg-font); font-size: 16px; fill: var(--ae-label); font-weight: 700; }
.ae-t-sm { font-size: 16px; }
.ae-svg .ae-t { paint-order: stroke; stroke: var(--ae-tag); stroke-width: 4px; }
.ae-bound { stroke: var(--ae-bound); stroke-width: 2; stroke-dasharray: 7 5; fill: none; }
.ae-bound-t { fill: var(--ae-bound); }
.ae-grid { stroke: var(--ae-grid); stroke-width: 1.5; }
.ae-curve { fill: none; stroke: var(--ae-curve); stroke-width: 3.5; stroke-linejoin: round; }
.ae-curve--schem { stroke-dasharray: 8 6; }
.ae-marker-line { stroke: var(--ae-curve); stroke-width: 1.5; stroke-dasharray: 3 4; }
.ae-marker-dot { fill: var(--ae-graph-bg); stroke: var(--ae-curve); stroke-width: 3.5; }
.ae-about { flex: none; padding: 4px 10px; border: 1px solid var(--tlg-border); border-radius: 8px; }
.ae-about summary { cursor: pointer; min-height: 32px; font-weight: 700; display: flex; align-items: center; }
.ae-about p { margin: 4px 0; }
.ae-ex { border-collapse: collapse; font-size: 16px; }
.ae-ex caption { text-align: left; font-weight: 700; margin-bottom: 4px; }
.ae-ex th, .ae-ex td { padding: 3px 8px; border-bottom: 1px solid var(--tlg-border); text-align: left; }
.ae-aurora { animation: ae-glow 4s ease-in-out infinite alternate; }
@keyframes ae-glow { to { opacity: .55; } }

@media (max-width: 900px) {
  .ae { position: static; grid-template-columns: 1fr; }
  .ae-controls, .ae-right { overflow: visible; }
  .ae-row { grid-template-columns: 1fr; }
  .ae-keys { grid-template-columns: repeat(7, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ae *, .ae *::before { animation: none !important; transition: none !important; }
}
