/* ============================================================
   RF Lab — Feed horns
   Page-only styles on the site's tokens, in the helix page's look.
   ============================================================ */

.hn-page [hidden] { display: none !important; }
.hn-section { padding-top: .25rem; }

.hnl {
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: clamp(1rem, 2.4vw, 1.6rem);
  align-items: start;
}

/* ---- Controls ---- */
.hn__controls {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: grid;
  align-items: start;
  gap: .7rem;
  padding: 0 .3rem .3rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.hf { margin: 0; padding: .85rem .95rem .95rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: grid; gap: .6rem; min-width: 0; }
.hf legend, .hf--more summary {
  float: left;
  width: 100%;
  padding: 0;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--signal);
}
.hf__field { display: grid; gap: .28rem; min-width: 0; }
.hf__label { font-size: .8rem; color: var(--muted); }
.hf__input { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-2); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.hf__input:focus-within { border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 20%, transparent); }
.hf__input input, .hf__input select { background: transparent; border: 0; color: var(--text); font: inherit; font-family: var(--font-mono); font-size: .93rem; padding: .52rem .6rem; min-width: 0; outline: none; }
.hf__input input { flex: 1; width: 100%; }
.hf__input input::placeholder { color: var(--muted-2); font-family: var(--font-sans); font-size: .85rem; }
.hf__input select { border-left: 1px solid var(--line); cursor: pointer; }
.hf__input .hf__select--wide { flex: 1; border-left: 0; font-family: var(--font-sans); font-size: .9rem; }
.hf__input select option { background: var(--panel); color: var(--text); }
.hf__unit { display: flex; align-items: center; padding: 0 .6rem; border-left: 1px solid var(--line); color: var(--muted-2); font-family: var(--font-mono); font-size: .78rem; }
.hf__hint { margin: 0; font-family: var(--font-mono); font-size: .74rem; line-height: 1.5; color: var(--muted-2); }
.hf__hint b { color: var(--text); font-weight: 700; }
.hf__chips { display: flex; flex-wrap: wrap; gap: .32rem; }
.hf__chips button { font-family: var(--font-mono); font-size: .7rem; padding: .28rem .48rem; border-radius: 7px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.hf__chips button:hover { border-color: var(--signal); color: var(--text); }
.hf__chips button[aria-pressed="true"] { border-color: var(--signal); background: var(--signal); color: #04130d; font-weight: 700; }
.hf--more { display: block; }
.hf--more summary { float: none; cursor: pointer; list-style: none; color: var(--muted); }
.hf--more summary::-webkit-details-marker { display: none; }
.hf--more summary::before { content: "+ "; color: var(--signal); }
.hf--more[open] summary::before { content: "\2212 "; }
.hf--more > .hf__field { margin-top: .65rem; }

.hseg { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); }
.hseg label { position: relative; flex: 1; }
.hseg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.hseg span { display: block; padding: .4rem .5rem; border-radius: 7px; text-align: center; white-space: nowrap; font-size: .83rem; color: var(--muted); transition: background .15s, color .15s; }
.hseg input:checked + span { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--signal) 45%, transparent); }
.hseg input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 1px; }
.hseg--sm span { padding: .26rem .65rem; font-size: .76rem; }

/* ---- Results ---- */
.hn__out { display: grid; gap: 1rem; min-width: 0; }
.hstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .55rem; }
.hstat { min-width: 0; padding: .75rem .85rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.hstat__k { display: block; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.hstat__v { display: block; margin-top: .22rem; font-size: 1.32rem; font-weight: 700; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hstat__v small { margin-left: .18rem; font-size: .7rem; font-weight: 600; color: var(--muted); }
.hstat__s { display: block; margin-top: .18rem; font-size: .72rem; color: var(--muted); }
.hstat--key { border-color: color-mix(in srgb, var(--signal) 28%, var(--line)); }
.hstat--key .hstat__v { color: var(--signal); }

.hwarn { list-style: none; margin: 0; padding: 0; display: grid; gap: .42rem; }
.hwarn:empty { display: none; }
.hwarn li { display: flex; gap: .65rem; align-items: baseline; padding: .55rem .8rem; border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 10px; background: color-mix(in srgb, var(--cyan) 5%, transparent); color: #c2ccd8; font-size: .85rem; line-height: 1.45; }
.hwarn__tag { flex: none; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.hwarn .is-caution { border-left-color: var(--amber); background: rgba(255, 180, 84, .06); }
.hwarn .is-caution .hwarn__tag { color: var(--amber); }
.hwarn .is-danger { border-left-color: var(--red); background: rgba(255, 93, 108, .07); }
.hwarn .is-danger .hwarn__tag { color: var(--red); }
.herror { margin: 0; padding: .75rem .9rem; border: 1px solid color-mix(in srgb, var(--red) 55%, transparent); border-radius: 10px; background: rgba(255, 93, 108, .08); color: var(--text); font-size: .9rem; }

.hpanel { margin: 0; min-width: 0; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.hpanel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .4rem 1rem; margin-bottom: .75rem; }
.hpanel__head h2 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.hpanel__sub { font-size: .76rem; color: var(--muted-2); }

/* Build list */
.hkv { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .45rem 1.1rem; margin: 0; font-size: .88rem; }
.hkv dt { color: var(--muted); }
.hkv dd { margin: 0; color: var(--text); }
.hkv dd b { font-family: var(--font-mono); color: var(--signal); }
.hkv dd small { display: block; color: var(--muted-2); font-size: .76rem; line-height: 1.45; }
.hkv--tight { grid-template-columns: max-content 1fr; font-size: .84rem; }

.hmore summary { cursor: pointer; font-weight: 700; }
.hprose { margin-top: .8rem; font-size: .92rem; }

@media (max-width: 980px) {
  .hnl { grid-template-columns: 1fr; }
  .hn__controls { position: static; max-height: none; overflow: visible; padding: 0; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}
@media (max-width: 640px) {
  .hstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hpanel { padding: .9rem .85rem 1rem; }
  .hkv { grid-template-columns: 1fr; gap: .15rem; }
  .hkv dd { margin-bottom: .45rem; }
}


.hf__use { margin-left: .35rem; font-family: var(--font-mono); font-size: .66rem; padding: .12rem .42rem; border-radius: 6px; border: 1px solid var(--signal); background: transparent; color: var(--signal); cursor: pointer; }
.hf__use:hover { background: var(--signal); color: #04130d; }
.hf__hint a { color: var(--cyan); }

/* ---- Form bits ---- */
.hn-chips button { min-width: 3.4rem; font-size: .74rem; padding: .32rem .5rem; }
.hn-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }

/* ---- Panels ---- */
.hnsplit { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1rem 1.4rem; align-items: start; }
.hnsplit--seams { margin-top: 1rem; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
.hndraw svg { display: block; width: 100%; height: auto; overflow: visible; }
.hndraw--chart { margin-top: .9rem; max-width: 760px; }
.hndraw--xsec { max-width: 380px; }
.hndraw--bend { max-width: 440px; }
.hn-band { margin: .9rem 0 .2rem; max-width: 640px; }
.hn-band svg { display: block; width: 100%; height: auto; overflow: visible; }
.hn-h { margin: 0 0 .5rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hn-elen, .hn-asbuilt { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.hn-elen__row { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.hn-elen__row .hf__field { flex: 1 1 140px; max-width: 220px; }
.hn-elen__eq { padding-bottom: .55rem; color: var(--muted-2); font-family: var(--font-mono); }
.hn-key { margin-top: .4rem; }
.hn-measured { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.hn-tol p { margin: 0 0 .7rem; }
.eftable td.hn-ok { color: var(--signal); }
.eftable td.hn-fair { color: var(--amber); }
.eftable td.hn-bad { color: var(--red); font-weight: 700; }

/* ---- Drawings ---- */
.hn-wall { fill: color-mix(in srgb, var(--cyan) 5%, transparent); stroke: var(--text); stroke-width: 2.2; }
.hn-e { stroke: var(--amber); stroke-width: 2; fill: none; }
.hn-arrowhead { fill: var(--amber); }
.hn-iarrow { fill: var(--violet); }
.hn-i { stroke: var(--violet); stroke-width: 1.6; }
.hn-seamok { fill: var(--signal); }
.hn-seambad { fill: var(--red); }
.ed-text--ok { fill: var(--signal); }
.hn-bandok { fill: color-mix(in srgb, var(--signal) 22%, transparent); stroke: color-mix(in srgb, var(--signal) 60%, transparent); }
.hn-cut { stroke: var(--muted-2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.hn-now { fill: var(--amber); stroke: var(--bg); stroke-width: 2; }
.hn-air { fill: color-mix(in srgb, var(--cyan) 6%, transparent); }
.hn-airline { stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.hn-wallline { stroke: var(--text); stroke-width: 2.4; }
.hn-short { stroke: var(--text); stroke-width: 5; }
.hn-probe { fill: #d9894a; }
.hn-conn { fill: var(--panel-2); stroke: var(--amber); stroke-width: 1.4; }
.hn-flow { stroke: var(--cyan); stroke-width: 2; fill: none; }
.hn-centre { fill: none; stroke: var(--muted-2); stroke-width: 1; stroke-dasharray: 6 4; }
.hn-mitre { stroke: var(--violet); stroke-width: 1.4; stroke-dasharray: 4 3; }
.hn-cutoff { fill: color-mix(in srgb, var(--red) 14%, transparent); stroke: none; }
.hn-plate { stroke: var(--signal); stroke-width: 3; }
.hc-line.hn-c1 { stroke: var(--cyan); }
.hc-line.hn-c2 { stroke: var(--amber); stroke-dasharray: 5 3; }
.hc-line.hn-c3 { stroke: var(--muted-2); stroke-dasharray: 4 3; }
.hn-sw--plain { background: var(--muted-2); margin-left: .6rem; }

/* ---- Charts (as on the NVIS page) ---- */
.hc-axis { stroke: var(--line-2); stroke-width: 1; }
.hc-grid { stroke: var(--line); stroke-width: 1; }
.hc-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.hc-now { stroke: var(--text); stroke-width: 1.2; stroke-dasharray: 4 3; }
.hc-comp { fill: color-mix(in srgb, var(--signal) 10%, transparent); }
.hc-text { fill: var(--muted-2); font-family: var(--font-mono); font-size: 10px; }
.hc-text--now { fill: var(--text); }
.eb-two { stroke: color-mix(in srgb, var(--amber) 55%, transparent); stroke-width: 1; stroke-dasharray: 3 3; }
.ed-dim { stroke: var(--muted-2); stroke-width: 1; fill: none; }
.ed-text { fill: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.ed-text--key { fill: var(--text); font-weight: 700; }
.ed-text--hot { fill: var(--red); }
.nv-key { margin: .45rem 0 0; font-size: .74rem; color: var(--muted-2); line-height: 1.7; }
.nv-sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 .3rem 0 .1rem; background: var(--cyan); }
.nv-sw--end { background: var(--amber); margin-left: .6rem; }
.nv-sw--cone { height: 9px; background: color-mix(in srgb, var(--signal) 22%, transparent); margin-left: .6rem; }
.nvsteps { margin: 1rem 0 0; padding-left: 1.25rem; display: grid; gap: .4rem; font-size: .86rem; color: #c2ccd8; }
.nvsteps b { color: var(--text); }

/* ---- Tables (as on the NVIS page) ---- */
.eftable { overflow-x: auto; margin-top: .6rem; }
.eftable table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.eftable th, .eftable td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.eftable th { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; white-space: nowrap; }
.eftable td { color: #c2ccd8; }
.eftable td.num, .eftable th.num { font-family: var(--font-mono); white-space: nowrap; }
.eftable tr.is-picked td { background: color-mix(in srgb, var(--signal) 7%, transparent); }
.eftable tr.is-picked td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.eftable .eftable__use { display: inline-block; margin-left: .4rem; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--signal); }
.eftable .eftable__note { display: block; margin-top: .25rem; font-size: .78rem; color: var(--muted-2); line-height: 1.45; min-width: 10rem; }

@media (max-width: 760px) {
  .hnsplit, .hnsplit--seams { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .eftable th, .eftable td { padding: .45rem .38rem; }
  .hn-pair { grid-template-columns: 1fr; }
}
