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

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

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

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

/* ---- Drawings ---- */
.efdraw svg { display: block; width: 100%; height: auto; overflow: visible; }
.ed-ground { stroke: color-mix(in srgb, var(--signal) 30%, var(--line-2)); stroke-width: 1.5; }
.ed-grass { stroke: color-mix(in srgb, var(--signal) 22%, transparent); stroke-width: 1; }
.ed-mast { fill: color-mix(in srgb, var(--muted-2) 55%, transparent); }
.ed-box { fill: var(--panel-2); stroke: var(--amber); stroke-width: 1.4; }
.ed-boxtext { fill: var(--amber); font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; text-anchor: middle; }
.ed-coax { fill: none; stroke: #6b7785; stroke-width: 2.6; stroke-linecap: round; }
.ed-coax--cp { stroke: var(--violet); }
.ed-coax--away { stroke-dasharray: 5 5; }
.ed-choke { fill: var(--bg-2); stroke: var(--violet); stroke-width: 2; }
.ed-wire { fill: none; stroke: #d9894a; stroke-width: 2.4; stroke-linecap: round; }
.ed-wire--ext { stroke: var(--cyan); }
.ed-coil { fill: none; stroke: var(--amber); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ed-coilglow { fill: color-mix(in srgb, var(--amber) 18%, transparent); stroke: none; }
.ed-ins { fill: var(--bg); stroke: var(--text); stroke-width: 1.4; }
.ed-joint { fill: var(--cyan); }
.ed-rope { fill: none; stroke: var(--muted-2); stroke-width: 1.2; stroke-dasharray: 3 3; }
.ed-stake { stroke: var(--muted); stroke-width: 2; }
.ed-dim { stroke: var(--muted-2); stroke-width: 1; fill: none; }
.ed-lead { stroke: color-mix(in srgb, var(--amber) 65%, transparent); 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--coil { fill: var(--amber); font-weight: 700; }
.ed-text--ext { fill: var(--cyan); }
.ed-text--cp { fill: var(--violet); }
.ed-text--hot { fill: var(--red); }
.ed-form { fill: color-mix(in srgb, var(--muted-2) 30%, var(--panel-2)); stroke: var(--line-2); stroke-width: 1; }
.ed-hole { fill: var(--bg); stroke: var(--line-2); }
.ed-turn { fill: none; stroke: #d9894a; stroke-width: 2.6; stroke-linecap: round; }
.ed-turn--back { stroke: #7a5236; stroke-width: 2; }
.ed-core { fill: #2a3138; stroke: #48525c; stroke-width: 1.2; }
.ed-sec { stroke: #d9894a; stroke-width: 2.4; stroke-linecap: round; }
.ed-pri { stroke: var(--amber); stroke-width: 2.4; stroke-linecap: round; }
.ed-term { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 1; }
.ed-cap { stroke: var(--cyan); stroke-width: 2; fill: none; }

.efsplit { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(220px, 1fr); gap: 1rem 1.4rem; align-items: center; }
.efsplit--xf { align-items: start; grid-template-columns: minmax(0, 1.1fr) minmax(220px, 1fr); }
.efsplit--cp { align-items: start; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin-top: .4rem; }
.eftable .eftable__note { display: block; margin-top: .25rem; font-size: .78rem; color: var(--muted-2); line-height: 1.45; min-width: 10rem; }
.efcp__why p { margin: 0 0 .7rem; }
.efdraw--sweep { max-width: 460px; }
.efcp__h { margin: 1.1rem 0 .5rem; font-size: .95rem; }
.efcp__note { margin-top: .6rem; }
.efcp__key { margin: .3rem 0 0; font-size: .74rem; color: var(--muted-2); line-height: 1.5; }
.efcp__sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 .3rem 0 .1rem; background: var(--cyan); }
.efcp__sw--base { background: var(--violet); margin-left: .6rem; }
.es-line { fill: none; stroke: var(--cyan); stroke-width: 1.9; stroke-linejoin: round; }
.es-line--base { stroke: var(--violet); }
.es-mark { stroke: var(--signal); stroke-width: 1.2; }
.es-mark--orig { stroke: var(--muted-2); stroke-dasharray: 3 3; }
.es-mark-t { fill: var(--signal); }
.es-mark--orig-t { fill: var(--muted-2); }
.eftable td.is-good { color: var(--signal); }
.eftable td.is-tuner-lite { color: var(--amber); }
.eftable td.is-tuner { color: var(--muted-2); }
.efsteps { margin: 1rem 0 0; padding-left: 1.25rem; display: grid; gap: .4rem; font-size: .86rem; color: #c2ccd8; }
.efsteps b { color: var(--text); }

/* ---- SWR by band ---- */
.efbands__group + .efbands__group { margin-top: 1.1rem; }
.efbands__title { margin: 0 0 .55rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.efbands__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; }
.efband { padding: .55rem .6rem .4rem; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); min-width: 0; }
.efband__head { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; }
.efband__name { font-weight: 700; font-size: .95rem; }
.efband__tag { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .06em; text-transform: uppercase; padding: .12rem .38rem; border-radius: 6px; white-space: nowrap; }
.efband__tag--good { color: #04130d; background: var(--signal); }
.efband__tag--tuner-lite { color: #1b1203; background: var(--amber); }
.efband__tag--tuner { color: var(--muted); border: 1px solid var(--line-2); }
.efband__sub { display: block; margin-top: .1rem; font-family: var(--font-mono); font-size: .66rem; color: var(--muted-2); }
.efband svg { display: block; width: 100%; height: auto; margin-top: .25rem; }
.eb-band { fill: color-mix(in srgb, var(--signal) 12%, transparent); }
.eb-axis { stroke: var(--line-2); stroke-width: 1; }
.eb-two { stroke: color-mix(in srgb, var(--amber) 55%, transparent); stroke-width: 1; stroke-dasharray: 3 3; }
.eb-curve { fill: none; stroke: var(--cyan); stroke-width: 1.8; stroke-linejoin: round; }
.eb-curve--alt { stroke: color-mix(in srgb, var(--text) 30%, transparent); stroke-width: 1.2; }
.eb-dip { stroke: var(--text); stroke-width: 1; stroke-dasharray: 2 2; }
.eb-text { fill: var(--muted-2); font-family: var(--font-mono); font-size: 9px; }

/* ---- Parts to print ---- */
.efprint__pick { max-width: 360px; margin-bottom: .8rem; }
.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); }

/* ---- Wire table ---- */
.eftable { overflow-x: auto; }
.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 { 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-top: .2rem; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; color: var(--signal); }

@media (max-width: 1100px) {
  .efbands__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .efsplit, .efsplit--xf, .efsplit--cp, .hprint { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .eftable th, .eftable td { padding: .45rem .38rem; }
}
