/* ============================================================
   DATASHEET LIBRARY — every style for /datasheets lives here.

   Sibling of the RF Tools page: dark surface, mono eyebrow labels,
   cards with a dot + mono ID + title, radius 10–14px.

   Nothing global is redefined. The section 5 token names
   (--surface, --border, --text-1, --rf-primary …) are aliased onto
   the site's own surface tokens inside .ds-scope, exactly the way
   tools.css does it inside .tools-scope, so the library follows the
   site if the palette is ever changed. The hex values after each
   comma are the section 5 values, used only as a fallback.

   Every class is prefixed ds- so nothing here can leak into, or be
   broken by, another page.
   ============================================================ */

.ds-scope {
    --surface:      var(--bg-raised, #0c0e14);
    --surface-hi:   var(--bg-inset, #11141c);
    --border:       var(--line, #1f2430);
    --border-hi:    var(--line-strong, #2a2a31);
    --text-1:       var(--fg, #fafafa);
    --text-2:       var(--fg-muted, #a1a1a1);
    --text-3:       var(--fg-subtle, #7c7671);
    --text-4:       var(--fg-faint, #57534e);
    --rf-primary:   var(--accent, #22d3ee);
    --rf-secondary: var(--field, #a78bfa);
    --rf-warn:      var(--hazard, #fbbf24);
    --rf-ok:        var(--verified, #34d399);
    --rf-danger:    var(--fault, #f87171);

    --ds-mono: var(--font-mono, 'JetBrains Mono', ui-monospace, monospace);
    --ds-tint: color-mix(in srgb, var(--rf-primary) 6%, transparent);
    --ds-radius: 12px;
    background: var(--bg);
    color: var(--text-1);
}

.ds-sr, .ds-live {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ds-mono { font-family: var(--ds-mono); }
.ds-muted { color: var(--text-2); font-size: 0.9rem; line-height: 1.55; max-width: 70ch; }

/* ------------------------------------------------------------
   HERO — no photo. Engineers are here for numbers.
   ------------------------------------------------------------ */
.ds-hero {
    position: relative; isolation: isolate; overflow: hidden;
    padding-top: calc(var(--section-y-tight) + 3.5rem);
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
    border-bottom: 1px solid var(--border);
}
.ds-hero::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60rem 26rem at 85% -10%, color-mix(in srgb, var(--rf-primary) 13%, transparent), transparent 62%),
        radial-gradient(40rem 22rem at 5% 110%, color-mix(in srgb, var(--rf-secondary) 9%, transparent), transparent 60%),
        linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 44px,
        linear-gradient(90deg, var(--border) 1px, transparent 1px) 0 0 / 44px 100%;
    -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
    opacity: .55;
}
.ds-hero-lead { max-width: 62ch; color: var(--text-2); }
.ds-body { padding-top: clamp(1.75rem, 4vw, 3rem); }
.ds-stack { display: grid; gap: 1.5rem; }
.ds-stack > * { min-width: 0; }

/* ------------------------------------------------------------
   SEARCH + FILTERS
   ------------------------------------------------------------ */
.ds-filters {
    display: grid; gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.ds-searchbar {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 0.9rem;
    background: var(--surface-hi);
    border: 1px solid var(--border-hi);
    border-radius: 10px;
    transition: border-color .2s, box-shadow .2s;
}
.ds-searchbar:focus-within {
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rf-primary) 16%, transparent);
}
.ds-searchbar svg { width: 20px; height: 20px; flex: none; color: var(--rf-primary); }
.ds-searchbar input {
    flex: 1 1 auto; min-width: 0;
    padding: 0.95rem 0;
    background: transparent; border: 0; outline: 0;
    color: var(--text-1);
    font-family: var(--ds-mono); font-size: 1rem; letter-spacing: 0.02em;
}
.ds-searchbar input::placeholder { color: var(--text-4); }
.ds-searchbar input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); cursor: pointer; }
.ds-kbd {
    flex: none; padding: 0.15rem 0.5rem;
    border: 1px solid var(--border-hi); border-radius: 6px;
    font-family: var(--ds-mono); font-size: 0.7rem; color: var(--text-3);
}

.ds-filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 0.75rem; }
.ds-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; border: 0; padding: 0; margin: 0; }
.ds-label {
    font-family: var(--ds-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--text-3); padding: 0;
}
.ds-label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--text-4); }

.ds-select, .ds-input {
    width: 100%; min-width: 0;
    padding: 0.6rem 0.75rem;
    background: var(--surface-hi);
    border: 1px solid var(--border-hi);
    border-radius: 8px;
    color: var(--text-1);
    font-family: var(--font-ui, Inter, sans-serif); font-size: 0.9rem; line-height: 1.3;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.ds-input.ds-mono, input.ds-input[type="number"] { font-family: var(--ds-mono); }
.ds-select { cursor: pointer; appearance: none; -webkit-appearance: none;
    padding-right: 2rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
    background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
    background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.ds-select option { background: #11141c; color: #fafafa; }
.ds-select:focus, .ds-input:focus {
    border-color: var(--rf-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rf-primary) 16%, transparent);
}
.ds-input::placeholder { color: var(--text-4); }
.ds-input.is-invalid, .ds-select.is-invalid { border-color: var(--rf-danger); }
@media (max-width: 767px) { .ds-select, .ds-input, .ds-searchbar input { font-size: 16px; } }   /* stops iOS zooming on focus */

.ds-range { display: flex; align-items: center; gap: 0.4rem; }
.ds-range span { color: var(--text-4); font-size: 0.75rem; }

.ds-bands { border: 0; padding: 0; margin: 0; min-width: 0; }
.ds-bands legend { margin-bottom: 0.45rem; }
.ds-band-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ds-band { position: relative; cursor: pointer; }
.ds-band input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ds-band span {
    display: inline-block; padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-hi); border-radius: 999px;
    font-family: var(--ds-mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--text-2);
    transition: background .2s, color .2s, border-color .2s;
}
.ds-band:hover span { color: var(--rf-primary); border-color: color-mix(in srgb, var(--rf-primary) 45%, transparent); }
.ds-band input:checked + span { background: var(--rf-primary); border-color: var(--rf-primary); color: var(--bg, #05060a); font-weight: 600; }
.ds-band input:focus-visible + span { outline: 2px solid var(--rf-primary); outline-offset: 2px; }

/* ------------------------------------------------------------
   RESULTS
   ------------------------------------------------------------ */
.ds-results-head {
    display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
    margin: 1.75rem 0 1rem;
}
.ds-count { font-family: var(--ds-mono); font-size: 0.85rem; letter-spacing: 0.08em; color: var(--rf-primary); min-height: 1.2em; }
.ds-hint { font-family: var(--ds-mono); font-size: 0.65rem; letter-spacing: 0.08em; color: var(--text-4); }
@media (hover: none), (max-width: 767px) { .ds-hint { display: none; } }
.ds-reset { margin-left: auto; font-size: 0.8rem; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.ds-reset:hover { color: var(--rf-primary); }
.ds-reset[hidden] { display: none; }

.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr)); gap: 1.1rem; }
.ds-grid.is-loading { opacity: .5; transition: opacity .15s; }
.ds-grid-compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

.ds-card {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--ds-radius);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.ds-card:hover, .ds-card.is-active {
    border-color: color-mix(in srgb, var(--rf-primary) 40%, transparent);
    box-shadow: 0 0 28px color-mix(in srgb, var(--rf-primary) 8%, transparent);
}
.ds-card.is-active { outline: 2px solid var(--rf-primary); outline-offset: 2px; }
.ds-card-link { display: flex; flex-direction: column; flex: 1 1 auto; color: inherit; text-decoration: none; }
.ds-card-link:focus-visible { outline: 2px solid var(--rf-primary); outline-offset: -2px; border-radius: var(--ds-radius); }
.ds-card-head, .ds-panel-head {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--rf-primary) 2.5%, transparent);
    font-family: var(--ds-mono); font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase;
}
.ds-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--rf-primary); box-shadow: 0 0 8px var(--rf-primary); }
.ds-card-mfr { color: var(--rf-primary); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-card-type { color: var(--text-3); font-size: 0.6rem; flex: none; }
.ds-card-body { padding: 1rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1 1 auto; }
.ds-card-model { font-family: var(--ds-mono); font-size: 1.02rem; font-weight: 600; letter-spacing: 0.01em; color: var(--text-1); overflow-wrap: anywhere; line-height: 1.3; }
.ds-card-desc { color: var(--text-2); font-size: 0.82rem; line-height: 1.5; }
.ds-card-stats { display: grid; grid-template-columns: auto auto 1fr; gap: 0.75rem 1.1rem; margin-top: auto; padding-top: 0.2rem; }
.ds-card-stats dt { font-family: var(--ds-mono); font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4); }
.ds-card-stats dd { font-family: var(--ds-mono); font-size: 0.82rem; color: var(--text-1); margin-top: 0.15rem; overflow-wrap: anywhere; }
.ds-card-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.6rem 1rem; border-top: 1px solid var(--border);
}

.ds-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.ds-chip {
    display: inline-block; padding: 0.18rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--rf-primary) 28%, transparent);
    background: var(--ds-tint);
    border-radius: 5px;
    font-family: var(--ds-mono); font-size: 0.64rem; letter-spacing: 0.05em; color: var(--rf-primary);
    white-space: nowrap; text-decoration: none;
}
.ds-chip-empty { color: var(--text-4); border-color: var(--border); background: transparent; }
a.ds-chip-link:hover { background: var(--rf-primary); color: var(--bg, #05060a); }

.ds-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.22rem 0.6rem;
    border: 1px solid var(--border-hi); border-radius: 999px;
    font-family: var(--ds-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--text-2); white-space: nowrap;
}
.ds-badge svg { width: 11px; height: 11px; }
.ds-badge-ok   { color: var(--rf-ok);   border-color: color-mix(in srgb, var(--rf-ok) 40%, transparent);   background: color-mix(in srgb, var(--rf-ok) 8%, transparent); }
.ds-badge-warn { color: var(--rf-warn); border-color: color-mix(in srgb, var(--rf-warn) 40%, transparent); background: color-mix(in srgb, var(--rf-warn) 8%, transparent); }
.ds-badges, .ds-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ds-actions { gap: 0.75rem; }

.ds-card .ds-compare-btn {
    padding: 0.3rem 0.65rem;
    background: transparent; border: 1px solid var(--border-hi); border-radius: 6px;
    font-family: var(--ds-mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2);
    cursor: pointer; transition: color .2s, border-color .2s, background .2s; white-space: nowrap;
}
.ds-card .ds-compare-btn:hover { color: var(--rf-primary); border-color: var(--rf-primary); }
.ds-compare-btn[aria-pressed="true"] { color: var(--rf-primary) !important; border-color: var(--rf-primary) !important; background: var(--ds-tint) !important; }
.ds-compare-btn:focus-visible { outline: 2px solid var(--rf-primary); outline-offset: 2px; }

.ds-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.ds-pager[hidden] { display: none; }
.ds-pager-pos { font-family: var(--ds-mono); font-size: 0.75rem; letter-spacing: 0.08em; color: var(--text-2); }
.ds-pager a[aria-disabled="true"] { opacity: .35; pointer-events: none; }

.ds-empty, .ds-missing {
    padding: 2rem 1.5rem;
    border: 1px dashed var(--border-hi); border-radius: var(--ds-radius);
    color: var(--text-2); font-size: 0.92rem; line-height: 1.6;
}
.ds-empty { text-align: center; }
.ds-empty[hidden] { display: none; }
.ds-empty p + p { margin-top: 0.5rem; }
.ds-empty-title { font-size: 1.15rem; color: var(--text-1); font-weight: 600; }
.ds-missing { padding: 1.1rem 1.25rem; font-size: 0.86rem; }
.ds-loading { font-family: var(--ds-mono); font-size: 0.8rem; color: var(--text-3); padding: 2rem 0; }

.ds-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-top: 3.5rem; }
.ds-note { padding: 1.1rem 1.2rem; border-left: 2px solid var(--rf-secondary); background: color-mix(in srgb, var(--rf-secondary) 5%, transparent); border-radius: 0 8px 8px 0; }
.ds-note p { color: var(--text-2); font-size: 0.86rem; line-height: 1.55; }
.ds-note strong { color: var(--text-1); font-weight: 600; }
.ds-note-id { font-family: var(--ds-mono); font-size: 0.62rem !important; letter-spacing: 0.16em; color: var(--rf-secondary) !important; margin-bottom: 0.5rem; }

/* ------------------------------------------------------------
   MODEL PAGE
   ------------------------------------------------------------ */
.ds-crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; font-family: var(--ds-mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--text-3); }
.ds-crumbs a { color: var(--text-2); text-decoration: none; }
.ds-crumbs a:hover { color: var(--rf-primary); }
.ds-crumbs [aria-current] { color: var(--text-1); overflow-wrap: anywhere; }
.ds-model-title {
    font-family: var(--ds-mono); font-weight: 600;
    font-size: clamp(1.6rem, 5.4vw, 3.25rem); line-height: 1.1; letter-spacing: -0.01em;
    overflow-wrap: anywhere; color: var(--text-1);
}
.ds-callout {
    max-width: 76ch; padding: 0.85rem 1rem;
    border: 1px solid var(--border-hi); border-radius: 8px;
    color: var(--text-2); font-size: 0.88rem; line-height: 1.55;
}
.ds-callout-warn { border-color: color-mix(in srgb, var(--rf-warn) 40%, transparent); background: color-mix(in srgb, var(--rf-warn) 6%, transparent); }

.ds-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--ds-radius); overflow: hidden; scroll-margin-top: 96px; }
.ds-panel-id { color: var(--rf-primary); flex: none; }
.ds-panel-title { color: var(--text-1); flex: 1 1 auto; letter-spacing: 0.08em; }
.ds-panel-meta { color: var(--text-4); font-size: 0.6rem; flex: none; }
.ds-panel-body { padding: 1.15rem; }
.ds-two { display: grid; gap: 1.5rem; }
.ds-two > * { min-width: 0; }
@media (min-width: 900px) { .ds-two { grid-template-columns: 1fr 1fr; align-items: start; } .ds-two-wide { grid-template-columns: 1.3fr 1fr; } }

/* Frequency bar: where this model sits between 600 MHz and 6 GHz. */
.ds-spectrum { padding-top: 0.25rem; }
.ds-spectrum-track { position: relative; height: 16px; border-radius: 4px; background: var(--surface-hi); border: 1px solid var(--border); overflow: hidden; }
.ds-spectrum-seg { position: absolute; top: 0; bottom: 0; background: var(--rf-primary); box-shadow: inset -1px 0 0 var(--surface-hi); opacity: .9; }
.ds-spectrum-scale { position: relative; height: 1.3rem; margin-top: 0.3rem; }
.ds-spectrum-scale span { position: absolute; transform: translateX(-50%); font-family: var(--ds-mono); font-size: 0.6rem; color: var(--text-4); white-space: nowrap; }
.ds-spectrum-scale span::before { content: ''; position: absolute; left: 50%; top: -0.35rem; height: 0.3rem; border-left: 1px solid var(--border-hi); }

/* Values */
.ds-v { font-family: var(--ds-mono); color: var(--text-1); }
.ds-u { font-family: var(--ds-mono); color: var(--text-3); font-size: 0.82em; margin-left: 0.28em; }
.ds-u-tight { margin-left: 0; }
.ds-sub { display: block; margin-top: 0.2rem; font-size: 0.74rem; line-height: 1.45; color: var(--text-3); font-family: var(--font-ui, Inter, sans-serif); }
.ds-np { font-family: var(--ds-mono); font-size: 0.78em; letter-spacing: 0.04em; color: var(--text-4); white-space: nowrap; }
.ds-ref { color: var(--text-3); font-size: 0.82rem; }
.ds-footnote { margin-top: 0.85rem; color: var(--text-3); font-size: 0.78rem; line-height: 1.55; max-width: 84ch; }

/* Band table. On a phone each row becomes its own small card. */
.ds-table-wrap { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.ds-table thead th {
    text-align: left; padding: 0.55rem 0.7rem; white-space: nowrap;
    font-family: var(--ds-mono); font-size: 0.58rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--text-3); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--rf-primary) 2.5%, transparent);
}
.ds-table tbody th, .ds-table tbody td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-weight: 400; }
.ds-table tbody tr:last-child th, .ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody th .ds-v { color: var(--rf-primary); font-weight: 600; white-space: nowrap; }
.ds-table tbody tr:hover { background: var(--ds-tint); }

@media (max-width: 760px) {
    .ds-bandtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .ds-bandtable, .ds-bandtable tbody { display: block; }
    .ds-bandtable tbody tr {
        display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 1rem;
        padding: 0.9rem; margin-bottom: 0.75rem;
        border: 1px solid var(--border); border-radius: 10px; background: var(--surface-hi);
    }
    .ds-bandtable tbody tr:last-child { margin-bottom: 0; }
    .ds-bandtable tbody th, .ds-bandtable tbody td { display: block; padding: 0; border: 0; }
    .ds-bandtable tbody th { grid-column: 1 / -1; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); font-size: 1rem; }
    .ds-bandtable tbody td::before {
        content: attr(data-label); display: block; margin-bottom: 0.15rem;
        font-family: var(--ds-mono); font-size: 0.56rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-4);
    }
}

.ds-rows { display: grid; }
.ds-row { display: grid; grid-template-columns: minmax(7.5rem, 34%) 1fr; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.ds-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ds-row:first-child { padding-top: 0; }
.ds-row dt { font-family: var(--ds-mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); padding-top: 0.2rem; }
.ds-row dd { font-size: 0.9rem; min-width: 0; overflow-wrap: anywhere; color: var(--text-1); }

.ds-portmap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.5rem; }
.ds-portmap li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.55rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-hi); font-family: var(--ds-mono); font-size: 0.78rem; }
.ds-portmap-ports { color: var(--rf-primary); font-weight: 600; white-space: nowrap; }
.ds-portmap-band { color: var(--text-2); text-align: right; }

.ds-figure { margin: 0; }
.ds-figure figcaption { margin-top: 0.5rem; font-family: var(--ds-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--text-3); line-height: 1.5; }
.ds-zoom { display: block; width: 100%; padding: 0; background: #fff; border: 1px solid var(--border-hi); border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.ds-zoom img { display: block; width: 100%; height: auto; }
.ds-zoom:focus-visible { outline: 2px solid var(--rf-primary); outline-offset: 2px; }
.ds-figure-wide .ds-zoom img { max-height: 70vh; object-fit: contain; }
.ds-patterns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }   /* horizontal + vertical, side by side */
@media (min-width: 1000px) { .ds-patterns { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.ds-eirp { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.85rem; margin-top: 1rem; align-items: end; }
.ds-eirp-out {
    display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--rf-primary) 30%, transparent); border-radius: 8px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--rf-primary) 8%, transparent), transparent);
}
.ds-eirp-value { font-family: var(--ds-mono); font-size: 1.35rem; font-weight: 600; color: var(--rf-primary); }
.ds-eirp-out .ds-sub { margin-top: 0; font-family: var(--ds-mono); }

.ds-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ds-related { margin-top: 1rem; }

.ds-fix { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.ds-details { flex: 1 1 320px; min-width: 0; }
.ds-details summary {
    display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; list-style: none;
    padding: 0.45rem 0.9rem; border: 1px solid var(--border-hi); border-radius: 999px;
    font-size: var(--text-xs, 0.8125rem); font-weight: 550; color: var(--text-1);
}
.ds-details summary::-webkit-details-marker { display: none; }
.ds-details summary::before { content: '+'; font-family: var(--ds-mono); color: var(--rf-primary); }
.ds-details[open] summary::before { content: '−'; }
.ds-details summary:hover { border-color: var(--text-3); }
.ds-details summary:focus-visible { outline: 2px solid var(--rf-primary); outline-offset: 2px; }
.ds-details .ds-form { margin-top: 1rem; max-width: 34rem; }

/* ------------------------------------------------------------
   FORMS
   ------------------------------------------------------------ */
.ds-form { display: grid; gap: 1rem; }
.ds-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.ds-form-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ds-form-msg { font-size: 0.86rem; line-height: 1.5; color: var(--text-2); flex: 1 1 240px; }
.ds-form-msg.is-ok  { color: var(--rf-ok); }
.ds-form-msg.is-err { color: var(--rf-danger); }
.ds-form.is-done > :not(.ds-form-foot) { display: none; }
.ds-form.is-done .ds-form-foot .btn { display: none; }
.ds-form.is-done .ds-form-msg { padding: 1rem 1.1rem; border: 1px solid color-mix(in srgb, var(--rf-ok) 40%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--rf-ok) 7%, transparent); font-size: 0.95rem; }
.ds-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.ds-seg { display: flex; flex-wrap: wrap; gap: 0.4rem; flex-direction: row; }
.ds-seg legend { width: 100%; margin-bottom: 0.35rem; }
.ds-seg label { position: relative; cursor: pointer; }
.ds-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ds-seg span { display: inline-block; padding: 0.5rem 1.1rem; border: 1px solid var(--border-hi); border-radius: 8px; font-size: 0.86rem; color: var(--text-2); transition: background .2s, color .2s, border-color .2s; }
.ds-seg input:checked + span { background: var(--rf-primary); border-color: var(--rf-primary); color: var(--bg, #05060a); font-weight: 600; }
.ds-seg input:focus-visible + span { outline: 2px solid var(--rf-primary); outline-offset: 2px; }

.ds-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
    min-height: 8.5rem; padding: 1.25rem; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--border-hi); border-radius: 10px; background: var(--surface-hi);
    transition: border-color .2s, background .2s;
}
.ds-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ds-drop:hover, .ds-drop.is-over, .ds-drop:focus-within { border-color: var(--rf-primary); background: var(--ds-tint); }
.ds-drop.has-file { border-style: solid; border-color: color-mix(in srgb, var(--rf-ok) 55%, transparent); }
.ds-drop.is-invalid { border-color: var(--rf-danger); }
.ds-drop-main { font-size: 0.95rem; color: var(--text-1); overflow-wrap: anywhere; }
.ds-drop-sub { font-family: var(--ds-mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--text-3); }

.ds-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.84rem; line-height: 1.5; color: var(--text-2); cursor: pointer; }
.ds-check input { margin-top: 0.2rem; accent-color: var(--rf-primary); flex: none; width: 1rem; height: 1rem; }
.ds-check.is-invalid span { color: var(--rf-danger); }

.ds-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; color: var(--text-2); font-size: 0.88rem; line-height: 1.55; }
.ds-steps strong { color: var(--text-1); font-weight: 600; }
.ds-steps li::marker { font-family: var(--ds-mono); color: var(--rf-primary); }
.ds-wanted { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.ds-wanted li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.84rem; }
.ds-wanted-n { font-family: var(--ds-mono); font-size: 0.72rem; color: var(--rf-warn); white-space: nowrap; }

/* ------------------------------------------------------------
   MANUFACTURERS
   ------------------------------------------------------------ */
.ds-wordmark { font-family: 'Inter Tight', var(--font-ui, Inter, sans-serif); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-1); font-size: 1.15rem; overflow-wrap: anywhere; }
.ds-wordmark-lg { font-size: clamp(2rem, 6vw, 3.75rem); line-height: 1.05; letter-spacing: 0.05em; }
.ds-mfr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1.1rem; }
.ds-mfr-card {
    display: flex; flex-direction: column; gap: 0.7rem; padding: 1.4rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--ds-radius);
    color: inherit; text-decoration: none; transition: border-color .2s, box-shadow .2s;
}
.ds-mfr-card:hover { border-color: color-mix(in srgb, var(--rf-primary) 40%, transparent); box-shadow: 0 0 28px color-mix(in srgb, var(--rf-primary) 8%, transparent); }
.ds-mfr-card:focus-visible { outline: 2px solid var(--rf-primary); outline-offset: 2px; }
.ds-mfr-desc { color: var(--text-2); font-size: 0.86rem; line-height: 1.55; }
.ds-mfr-count { margin-top: auto; font-family: var(--ds-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--rf-primary); }

/* ------------------------------------------------------------
   COMPARE — tray (every page) and table (compare page)
   ------------------------------------------------------------ */
.ds-tray {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky, 40);
    background: color-mix(in srgb, #0c0e14 92%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid color-mix(in srgb, var(--rf-primary) 35%, transparent);
    padding: 0.7rem 0 calc(0.7rem + env(safe-area-inset-bottom, 0px));
}
.ds-tray[hidden] { display: none; }
.ds-tray-inner { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ds-tray-label { font-family: var(--ds-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--rf-primary); }
.ds-tray-items { display: flex; flex-wrap: wrap; gap: 0.4rem; flex: 1 1 auto; min-width: 0; }
.ds-tray-item { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; padding: 0.25rem 0.3rem 0.25rem 0.6rem; border: 1px solid var(--border-hi); border-radius: 6px; font-family: var(--ds-mono); font-size: 0.7rem; color: var(--text-1); background: var(--surface-hi); }
.ds-tray-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-tray-item button { flex: none; width: 1.4rem; height: 1.4rem; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); cursor: pointer; font-size: 1rem; line-height: 1; }
.ds-tray-item button:hover { color: var(--rf-danger); background: color-mix(in srgb, var(--rf-danger) 12%, transparent); }
.ds-tray-clear { background: none; border: 0; color: var(--text-3); font-size: 0.78rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ds-tray-clear:hover { color: var(--text-1); }
.ds-scope.has-tray { padding-bottom: 4.5rem; }
@media (max-width: 640px) {            /* on a phone the tray is one line: count, Compare, Clear */
    .ds-tray-items { display: none; }
    .ds-tray-label { flex: 1 1 auto; }
}

.ds-compare-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ds-compare-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ds-ctable-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--ds-radius); background: var(--surface); }
.ds-ctable { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.86rem; table-layout: fixed; }
.ds-ctable th, .ds-ctable td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.ds-ctable tr:last-child > * { border-bottom: 0; }
.ds-ctable thead th { background: color-mix(in srgb, var(--rf-primary) 3%, var(--surface)); vertical-align: bottom; }
.ds-ctable th[scope="row"], .ds-ctable thead th:first-child {
    width: 9.5rem; position: sticky; left: 0; z-index: 1; background: var(--surface);
    font-family: var(--ds-mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3);
}
.ds-ctable .ds-cgroup th { position: static; background: color-mix(in srgb, var(--rf-secondary) 6%, var(--surface)); color: var(--rf-secondary); font-family: var(--ds-mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0.45rem 0.85rem; }
.ds-chead-mfr { display: block; font-family: var(--ds-mono); font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rf-primary); font-weight: 500; }
.ds-chead-model { display: block; margin-top: 0.2rem; font-family: var(--ds-mono); font-size: 0.95rem; font-weight: 600; color: var(--text-1); text-decoration: none; }
.ds-chead-model:hover { color: var(--rf-primary); }
.ds-chead-rm { margin-top: 0.5rem; padding: 0; background: none; border: 0; color: var(--text-3); font-size: 0.74rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ds-chead-rm:hover { color: var(--rf-danger); }
.ds-ctable td { font-family: var(--ds-mono); color: var(--text-1); }
.ds-ctable td.is-best { background: color-mix(in srgb, var(--rf-primary) 10%, transparent); box-shadow: inset 2px 0 0 var(--rf-primary); color: var(--rf-primary); font-weight: 600; }
.ds-ctable td .ds-dash { color: var(--text-4); }
@media (max-width: 640px) { .ds-ctable th[scope="row"], .ds-ctable thead th:first-child { width: 6.2rem; } .ds-ctable th, .ds-ctable td { padding: 0.55rem 0.6rem; } }

/* ------------------------------------------------------------
   LIGHTBOX
   ------------------------------------------------------------ */
.ds-lightbox {
    position: fixed; inset: 0; z-index: var(--z-modal, 90);
    display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem 1.5rem;
    background: rgb(3 4 7 / .94); cursor: zoom-out;
}
.ds-lightbox[hidden] { display: none; }
.ds-lightbox figure { margin: 0; max-width: min(1400px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 0.75rem; cursor: default; }
.ds-lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; background: #fff; border-radius: 8px; }
.ds-lightbox figcaption { font-family: var(--ds-mono, monospace); font-size: 0.72rem; color: #a1a1a1; text-align: center; }
.ds-lightbox-close {
    position: absolute; top: 1rem; right: 1rem; width: 2.5rem; height: 2.5rem;
    border: 1px solid #2a2a31; border-radius: 50%; background: #0c0e14; color: #fafafa; font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.ds-lightbox-close:hover, .ds-lightbox-close:focus-visible { border-color: #22d3ee; color: #22d3ee; outline: none; }

/* ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .ds-card, .ds-mfr-card, .ds-band span, .ds-seg span, .ds-drop, .ds-grid.is-loading { transition: none; }
}
@media print {
    .ds-filters, .ds-tray, .ds-actions, .ds-fix, .ds-compare-bar, .ds-pager, .ds-card-foot, #eirp { display: none !important; }
    .ds-panel, .ds-card { break-inside: avoid; border-color: #999; }
}

/* =========================================================
   CONSOLE ONLY (auth/datasheets.php) — added by Muse, not Claude.
   Tabs, inline action forms, small inputs.
   ========================================================= */
.ds-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ds-tab { display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 999px;
    font-family: var(--ds-mono); font-size: 0.78rem; color: var(--text-2); text-decoration: none; }
.ds-tab:hover { color: var(--text-1); border-color: var(--rf-primary); }
.ds-tab.is-active { color: var(--rf-primary); border-color: var(--rf-primary); background: var(--ds-tint); }
.ds-inline-form { display: inline-flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.ds-input-sm { max-width: 16rem; padding: 0.35rem 0.55rem; font-size: 0.82rem; }
textarea.ds-input { min-height: 12rem; resize: vertical; }

/* =========================================================
   ILLUSTRATIVE DIAGRAMS (Muse, Nov 11) — drawn from published
   specs, never from manufacturer PDFs.
   ========================================================= */
.ds-diagram { max-width: 340px; margin: 0 auto; }
.ds-diagram svg { display: block; width: 100%; height: auto; }
.ds-portkey { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.35rem; }
.ds-portkey li { display: flex; align-items: baseline; gap: 0.5rem; font-family: var(--ds-mono); font-size: 0.68rem; color: var(--text-2); }
.ds-portkey-chip { flex: none; width: 0.65rem; height: 0.65rem; border-radius: 2px; transform: translateY(1px); }
.ds-portkey-ports { color: var(--text-1); }
.ds-portkey-band { margin-left: auto; text-align: right; }
.ds-pat-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.ds-pat-tab { appearance: none; cursor: pointer; padding: 0.4rem 0.8rem; border: 1px solid var(--border);
    border-radius: 999px; background: transparent; color: var(--text-2);
    font-family: var(--ds-mono); font-size: 0.75rem; }
.ds-pat-tab:hover { color: var(--text-1); border-color: var(--rf-primary); }
.ds-pat-tab.is-active { color: var(--rf-primary); border-color: var(--rf-primary); background: var(--ds-tint); }
.ds-pat-panel[hidden] { display: none; }

/* ---------- Units switcher ---------- */
.ds-units-wrap { position: relative; display: inline-flex; }
.ds-units-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 19.5rem; padding: 0.75rem 0.9rem 0.9rem; background: var(--surface-hi); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.ds-units-title { margin: 0 0 0.5rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.ds-units-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0; }
.ds-units-label { font-size: 0.85rem; color: var(--text-1); }
.ds-units-opts { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ds-units-opt { appearance: none; border: 0; background: transparent; color: var(--text-2); font-family: var(--ds-mono); font-size: 0.72rem; padding: 0.3rem 0.55rem; cursor: pointer; }
.ds-units-opt + .ds-units-opt { border-left: 1px solid var(--border); }
.ds-units-opt.is-active { background: var(--rf-primary); color: #05060a; font-weight: 600; }
.ds-units-reset { appearance: none; border: 0; background: none; padding: 0.5rem 0 0; color: var(--rf-primary); font-size: 0.8rem; cursor: pointer; }
.ds-units-note { margin: 0.5rem 0 0; font-size: 0.72rem; line-height: 1.5; color: var(--text-2); }
