/* ---- AERMOD module (R-540) --------------------------------------------------------------------------------------------
   STYLE-GUIDE.md: a reading comes out louder than anything around it; one surface and one title plate per section, no frames inside;
   label and value on a shared grid with right-aligned values; one primary action per section. The screen's colour state always carries
   fill, ring and glow. Individual background/border properties only, never the shorthand, on anything a state class colours. */
.am-banner { display: block; margin: 0 0 14px; padding: 9px 14px; border-radius: 8px; font-family: var(--font-display); letter-spacing: .1em; text-transform: uppercase; font-size: 13px; font-weight: 700; text-align: center;
  background-color: #b3261e; color: #fff; box-shadow: 0 0 0 1px #ff8a80, 0 0 14px rgba(179, 38, 30, .55); }
.am-banner.ok { background-color: #0d6b4f; box-shadow: 0 0 0 1px #5fd6ad, 0 0 10px rgba(13, 107, 79, .35); }
.am-sec { position: relative; margin: 22px 0 0; padding: 22px 16px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.am-plate { position: absolute; top: -10px; left: 14px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--ink-dim); font-family: var(--font-display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.am-sec h4 { margin: 14px 0 6px; font-family: var(--font-display); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); font-weight: 600; }
.am-kvs { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; align-items: baseline; max-width: 560px; }
.am-kvs > span:nth-child(odd) { color: var(--ink-dim); font-size: 12.5px; }
.am-kvs > span:nth-child(even), .am-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.am-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.am-table th { text-align: left; color: var(--ink-dim); font-weight: 500; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.am-table th.r, .am-table td.r { text-align: right; }
.am-table td { padding: 3px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.am-scroll { overflow-x: auto; }
.am-big { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Fields are the shell's fields (styles.css: input, select, textarea): the same fill, line and ink as every other Ops form, in either theme. Steve,
   9 Nov 2026: "the colour of these fields is unacceptible, use the same style gyude for the rest of teh site". A field's state never paints the field:
   it is the .am-st marker in front of it, carried by fill, ring and glow (STYLE-GUIDE.md protocol 3), red for missing, amber for unchecked. */
.am-cell { width: 92px; max-width: 100%; font-variant-numeric: tabular-nums; text-align: right; }   /* fill, line, ink, radius, padding and size: the shell's */
.am-cell.wide { width: calc(100% - 14px); text-align: left; }
.am-st { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: middle; flex: none; background-color: transparent; }
.am-st.missing { background-color: var(--crit); box-shadow: 0 0 0 2px var(--crit-bg), 0 0 6px var(--crit); }
.am-st.unchecked { background-color: var(--warn); box-shadow: 0 0 0 2px var(--warn-bg), 0 0 6px var(--warn); }
.am-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; background-color: var(--surface-2); color: var(--ink-dim); }
.am-chip.bad { background-color: var(--crit-bg); color: var(--crit); box-shadow: 0 0 0 1px var(--crit), 0 0 6px var(--crit); }
.am-chip.warn { background-color: var(--warn-bg); color: var(--warn); box-shadow: 0 0 0 1px var(--warn), 0 0 6px var(--warn); }
.am-chip.good { background-color: var(--good-bg); color: var(--good); box-shadow: 0 0 0 1px var(--good), 0 0 6px var(--good); }
.am-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.am-row .am-push { margin-left: auto; }
.am-sent { color: var(--ink-dim); font-size: 12.5px; }
.am-file { display: inline-flex; align-items: center; gap: 6px; }
.am-file input[type="file"] { display: none; }
.am-file span { cursor: pointer; }
.am-tick { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.am-tick input { width: auto; flex: none; }
.am-list { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink); }
/* the house note: a 3px rule on the token fill, as LCA's .lca-status. A fault is crit, an empty state (nothing entered yet) is warn */
.am-flag { padding: 4px 8px; border-left-width: 3px; border-left-style: solid; border-left-color: var(--crit); background-color: var(--crit-bg); color: var(--crit); font-size: 12.5px; margin: 3px 0; }
.am-note { padding: 7px 10px; border-left-width: 3px; border-left-style: solid; border-left-color: var(--warn); background-color: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 12.5px; margin: 4px 0 8px; }
.am-prog { height: 8px; border-radius: 4px; background-color: var(--surface-2); overflow: hidden; min-width: 120px; }
.am-prog > i { display: block; height: 100%; background-color: #17788f; }
.am-canvas { width: 100%; max-width: 1200px; height: auto; display: block; background-color: #fff; border: 1px solid var(--line); border-radius: 6px; }
.am-plan-box { background: #fff; border-radius: 6px; margin: 0 0 10px; }
.am-plan-box svg { display: block; width: 100%; height: auto; max-height: 360px; }
.am-planbtn { padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; }
.am-mini { display: block; }
.am-bad-text { color: var(--crit); }
.am-mpop.am-cornpop { max-width: 640px; }
.am-files td { white-space: nowrap; vertical-align: middle; height: 40px; padding-top: 2px; padding-bottom: 2px; }
.am-files .am-fname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.am-files tr.am-dim td { opacity: .55; }
.am-files .am-acts { text-align: right; }
.am-c { text-align: center; }
/* Stack test data (R-670): a row a stack, a column a test occasion; the lit cell is the one the run uses (fill, ring and tick, never colour alone) */
.am-td { border-collapse: separate; border-spacing: 6px; table-layout: fixed; min-width: 100%; }
.am-td th { text-align: left; font-weight: 600; vertical-align: middle; padding: 0; min-width: 118px; }
.am-td thead th:first-child, .am-td tbody th { width: 92px; min-width: 92px; padding: 0 6px; }
.am-td th.am-tdout { width: 104px; min-width: 104px; }
.am-td td { padding: 0; }
.am-tdh, .am-tdc, .am-tdn { display: block; width: 100%; box-sizing: border-box; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background-color: transparent; color: var(--ink); font: inherit; font-size: 13px; line-height: 1.35; min-height: 48px; position: relative; overflow-wrap: anywhere; }
.am-tdh { font-weight: 700; } .am-td small { display: block; font-size: 11.5px; font-weight: 400; color: var(--ink-dim); } .am-tdc b { font-variant-numeric: tabular-nums; }
.am-td button.am-tdh, .am-td button.am-tdc { cursor: pointer; } .am-td button.am-tdh:hover, .am-td button.am-tdc:hover { border-color: var(--ink-dim); }
.am-tdn { border-style: dashed; color: var(--ink-dim); opacity: .7; }
.am-tdc:not(.on) b { font-weight: 500; color: var(--ink-dim); }
.am-tdc.on { background-color: #0b6fb3; border-color: #7fd0ff; color: #fff; box-shadow: 0 0 0 1px #7fd0ff, 0 0 10px rgba(54, 169, 255, .45); } .am-tdc.on small { color: #dff1ff; }
.am-tdc.out.on { background-color: var(--surface-2); border-color: var(--warn); color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.am-tdh.on { border-color: #7fd0ff; box-shadow: 0 0 0 1px #7fd0ff; }
.am-tdtick { float: right; font-weight: 700; } .am-tdsum { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 8px 6px 0; font-size: 13px; }
.am-tdcmp .am-tdon { background-color: rgba(11, 111, 179, .35); color: var(--ink); } .am-tdcmp { table-layout: fixed; } .am-tdcmp th:first-child { width: 34%; }
.am-td th, .am-td td { border: 0; text-transform: none; letter-spacing: 0; }
.am-upg { margin: 0 0 10px; padding-left: 22px; font-size: 14px; line-height: 1.75; }
.am-mpop.am-aprpop { max-width: 860px; } .am-apr { table-layout: fixed; } .am-apr td:first-child { width: 36%; } .am-apr td:nth-child(2) { width: 24%; } .am-apr td:nth-child(3) { padding-left: 18px; overflow-wrap: anywhere; color: var(--ink-dim); }
.am-mpop.am-respop { max-width: 1120px; } .am-res td { padding: 6px 8px; } .am-res .am-resnew td { border-top: 1px solid var(--ink-dim); } .am-res td:last-child { font-size: 11.5px; color: var(--ink-dim); overflow-wrap: anywhere; min-width: 160px; }
.am-runs td:last-child { padding-right: 58px; }   /* clear of the shell's round buttons at the window's edge */
.am-maptools { margin-bottom: 8px; } .am-mapside .btn { margin-left: 0; }
.am-maplay { display: flex; gap: 14px; align-items: flex-start; } .am-mapside { flex: 1 1 0; min-width: 280px; max-height: max(420px, calc(100vh - 150px)); overflow-y: auto; } .am-mapside h4 { margin: 12px 0 6px; } .am-mapside h4:first-child { margin-top: 0; }
.am-mapkv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 13px; margin-bottom: 6px; } .am-mapkv span { color: var(--ink-soft, var(--muted)); } .am-mapkv b { font-weight: 600; font-variant-numeric: tabular-nums; }
.am-maptab { width: 100%; font-size: 12.5px; margin-bottom: 6px; } .am-mappan { cursor: pointer; } .am-mappan:hover td, .am-mappan:focus td { background: rgba(120, 170, 220, .12); }
.am-mapzoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; } .am-mapzoom button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: rgba(8, 16, 26, .82); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; } .am-mapzoom button:hover { background: #0b3a5c; }
.am-mapbox { position: relative; flex: 0 0 auto; width: min(calc(100% - 294px), max(420px, calc(100vh - 150px))); aspect-ratio: 1 / 1; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; } .am-mapbox canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; outline: none; }
.am-mapmsg { position: absolute; left: 12px; top: 10px; padding: 3px 9px; border-radius: 6px; background: rgba(8, 16, 26, .82); color: #fff; font-size: 12.5px; } .am-mapmsg:empty { display: none; }
.am-res .am-where { font-size: 12px; color: var(--ink-dim); }
/* the Runs table: the name and description are typed in their cells and take the room; Delete at the end of the row */
.am-runs .am-acts { text-align: right; white-space: nowrap; }
.am-runs .am-runno { white-space: nowrap; }
.am-runs .am-runname { width: 19%; min-width: 120px; }
.am-runs .am-rundesc { width: 30%; min-width: 150px; }
.am-rundescline { margin: 0 0 4px; overflow-wrap: anywhere; }
.am-sm { padding: 1px 7px; font-size: 11.5px; margin-left: 3px; min-height: 0; line-height: 1.6; }
.am-kept { font-size: 13px; cursor: help; }
.am-kept.good { color: var(--good, #2e9d5b); } .am-kept.warn { color: var(--warn); }
.am-dimtext { color: var(--ink-dim); font-size: 12px; }
.am-msel { position: relative; } .am-msel summary { cursor: pointer; list-style: none; padding: 4px 10px; border: 1px solid var(--line, #444); border-radius: 6px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-msel summary::after { content: " ▾"; color: var(--ink-dim); }
.am-msel-box { margin-top: 4px; max-width: 640px; max-height: 260px; overflow-y: auto; padding: 6px 10px; border: 1px solid var(--line, #444); border-radius: 6px; }
.am-msel-box .am-tick { display: block; margin: 4px 0; white-space: nowrap; }
.am-sources td:first-child { width: 220px; white-space: nowrap; }
.am-need { margin: 2px 0 8px; } .am-need-h { font-size: 12px; font-weight: 700; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .04em; }
.am-ul { margin: 4px 0 8px 18px; padding: 0; } .am-ul li { margin: 2px 0; }
.am-mpop.am-detpop { max-width: 760px; }
.am-roses-box { background: #fff; border-radius: 6px; overflow-x: auto; }
.am-roses-box svg { display: block; width: 100%; min-width: 900px; height: auto; }
.am-rose { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; align-items: end; height: 54px; max-width: 360px; }
.am-rose i { display: block; background-color: #17788f; min-height: 1px; }
.am-rose-l { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; max-width: 360px; font-size: 9px; color: var(--ink-dim); text-align: center; }
.am-link { background: none; border: 0; padding: 0; color: var(--accent-strong); text-decoration: underline; cursor: pointer; font: inherit; }
.am-i { color: var(--ink-dim); cursor: help; margin-left: 4px; font-size: 12px; }
@media (max-width: 600px) {
  .am-kvs { grid-template-columns: 1fr auto; max-width: none; }
  .am-row .am-push { margin-left: 0; }
  .am-sec { padding: 20px 10px 12px; }
}
.am-chip-btn { border: 0; font-family: inherit; cursor: pointer; }
/* The Validation popup. On <body>, outside the panel, so it carries its own variables (STYLE-GUIDE.md). Under .ops-dlg-scrim's z-index. */
.am-pop-scrim { --line: #22344a; --surface: #0e1620; --surface-2: #141d2a; --ink: #eaf6fe; --ink-dim: #9db6cd; --hud: #36d1ff; --hud-line: rgba(54, 209, 255, .5);
  position: fixed; inset: 0; z-index: 90000; display: flex; align-items: center; justify-content: center; padding: 16px; box-sizing: border-box; background: rgba(3, 8, 14, .66); }
.am-pop { display: flex; flex-direction: column; width: 100%; max-width: 620px; max-height: 86vh; max-height: 86dvh; outline: none; color: var(--ink); background: linear-gradient(180deg, rgba(19, 29, 43, .98), rgba(11, 18, 28, .98));
  border: 1px solid var(--hud-line); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55), 0 0 44px rgba(54, 209, 255, .08); }
.am-pop-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--hud-line); font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--hud); }
.am-pop-x { width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
.am-pop-x:hover { background-color: var(--surface-2); }
.am-pop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px 16px; }
.am-pop-body .am-kvs { max-width: none; }
.am-pop-body h4 { margin: 14px 0 6px; font-family: var(--font-display); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); font-weight: 600; }
/* Create MET files: the builder's popup. Drawn inside #am-body, so the fields keep the shell's own colours; only its frame is set here. */
.am-mpop-scrim { position: fixed; inset: 0; z-index: 90000; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; box-sizing: border-box; background: rgba(3, 8, 14, .66); }
.am-mpop { --hud: #36d1ff; --hud-line: rgba(54, 209, 255, .5); display: flex; flex-direction: column; width: 100%; max-width: 1040px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); outline: none;
  background: linear-gradient(180deg, rgba(19, 29, 43, .99), rgba(11, 18, 28, .99)); border: 1px solid var(--hud-line); border-radius: 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55), 0 0 44px rgba(54, 209, 255, .08); }
.am-mpop .am-pop-body h4 { margin: 14px 0 6px; }
@media (max-width: 640px) { .am-mpop-scrim { padding: 8px; } .am-mpop { max-height: calc(100dvh - 16px); } }
/* The MET catalogue's map (R-582): a plain canvas on the house surface. */
.am-catmap { display: block; width: 100%; max-width: 900px; height: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 6px; background-color: var(--surface-2, var(--surface)); }
/* The base map on the project page: the screenshot at its own pixels, scaled to fit; a click marks a point. */
.am-bm-wrap { margin-top: 10px; max-width: 900px; }
.am-bm { display: block; width: 100%; height: auto; cursor: crosshair; border: 1px solid var(--line); border-radius: 6px; background-color: var(--surface-2); }
/* The shell styles only <button class="btn">. The module's file pickers (a <span class="btn"> in a label) and download links (<a class="btn">)
   read as plain text without this: the same look as the shell's buttons, scoped to the module. */
#am-body .am-file .btn, #am-body a.btn { display: inline-block; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; text-decoration: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background-color: var(--surface); color: var(--ink); cursor: pointer; }
#am-body .am-file .btn.primary, #am-body a.btn.primary { background-color: var(--accent); border-color: var(--accent); color: #fff; }
#am-body .am-file .btn.primary:hover, #am-body a.btn.primary:hover { background-color: var(--accent-hover); }
#am-body .am-file .btn.ghost:hover, #am-body a.btn.ghost:hover { background-color: var(--surface-2); }

/* The house on/off switch (styles.css .hy-toggle) inside AERMOD: its state marker in front, a label beside it, row height kept */
.am-tgl-cell { display: inline-flex; align-items: center; gap: 2px; }
.am-toggle { gap: 8px; font-size: 13px; vertical-align: middle; }
.am-toggle .am-tgl-label { color: var(--ink); font-weight: 400; }
.am-row .am-toggle { margin-right: 6px; }

/* R-589: the project's tab bar is the shell's own .hy-tabs / .hy-tab (styles.css); only its place on this page is set here */
.am-tabs { margin: 4px 0 14px; }

/* Add stack: the popup is the house popup (.am-mpop); its fields sit in a plain table */
.am-stackpop { max-width: 760px; }
.am-stackpop .am-table td:first-child { white-space: nowrap; }
