/* ============================================================
   RF Lab — Helix dish feed
   Page-only styles on the site's tokens, in the Yagi page's look.
   ============================================================ */

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

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

/* ---- Controls ---- */
.hx__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 ---- */
.hx__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); }

/* Drawing and chart */
.hdraw svg, .hchart svg { display: block; width: 100%; height: auto; overflow: visible; }
.hd-refl { fill: var(--muted-2); }
.hd-wire { fill: none; stroke: #d9894a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hd-wire--back { stroke: #7a5236; stroke-width: 2.4; }
.hd-leg { fill: color-mix(in srgb, var(--cyan) 18%, transparent); stroke: color-mix(in srgb, var(--cyan) 55%, transparent); stroke-width: 1; }
.hd-axis { stroke: var(--line-2); stroke-dasharray: 4 5; }
.hd-dim { stroke: var(--muted-2); stroke-width: 1; }
.hd-text { fill: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.hd-text--key { fill: var(--signal); font-weight: 700; }
.hd-focus { fill: var(--bg); stroke: var(--signal); stroke-width: 2.4; }
.hd-feed { fill: var(--amber); }
.hd-arrow { fill: none; stroke: var(--signal); stroke-width: 2; }
.hc-bar { fill: color-mix(in srgb, var(--cyan) 45%, transparent); }
.hc-bar--best { fill: var(--signal); }
.hc-bar--pick { stroke: var(--text); stroke-width: 2; }
.hc-text { fill: var(--muted-2); font-family: var(--font-mono); font-size: 10.5px; }
.hc-val { fill: var(--text); font-family: var(--font-mono); font-size: 10.5px; text-anchor: middle; }
.hc-axis { stroke: var(--line-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; }

/* Scaffold */
.hprint { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(220px, 1fr); gap: 1rem 1.4rem; align-items: start; }
.hprint__view { display: block; width: 100%; height: auto; aspect-ratio: 640 / 520; border: 1px solid var(--line); border-radius: 12px; background: radial-gradient(circle at 50% 40%, var(--panel-2), var(--bg-2)); cursor: grab; touch-action: none; }
.hprint__view:active { cursor: grabbing; }
.hprint__side { display: grid; gap: .9rem; }
.hprint__dl { justify-self: start; }
.hprint__dl:disabled { opacity: .5; cursor: progress; }
.hprint__notes { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; font-size: .8rem; color: var(--muted); }

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

@media (max-width: 980px) {
  .hx { grid-template-columns: 1fr; }
  .hx__controls { position: static; max-height: none; overflow: visible; padding: 0; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
}
@media (max-width: 720px) {
  .hprint { grid-template-columns: 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; }
}
