/*
 * Download page product finder — inc/class-kvaser-download-finder.php,
 * assets/js/download-finder.js. Only enqueued on the Download template.
 */

.kvaser-dl-finder {
    position: relative;
    /* Above the banner it overlaps, but below the header (z-index 2, earlier
       in the DOM) so its menu dropdowns are never covered by the card. */
    z-index: 1;
    /* Card overlaps the bottom of the dark banner above it. */
    margin-top: -90px;
    padding-bottom: 40px;
}

.kvaser-dl-finder-card {
    background: #fff;
    border-radius: 0 20px 0 20px;
    box-shadow: 0 10px 40px rgba(16, 24, 40, .12);
    padding: 36px 40px 40px;
    margin-bottom: 40px;
}

.kvaser-dl-finder-title {
    margin: 0 0 6px;
    font-size: 28px;
    line-height: 36px;
    color: #1f2937;
}

.kvaser-dl-finder-intro {
    margin: 0 0 24px;
    color: #4b5563;
}

/* ── Search ─────────────────────────────────────────────────────────────── */

.kvaser-dl-search {
    position: relative;
}

.kvaser-dl-finder .kvaser-dl-search-input {
    width: 100%;
    height: 56px;
    padding: 0 20px 0 52px;
    font-size: 17px;
    color: #1f2937;
    background: #f3f4f6 url("../../images/new-homepage/search-icon-black.svg") no-repeat 20px center;
    background-size: 20px;
    border: 1px solid #f3f4f6;
    border-radius: 100px;
    box-shadow: none;
    transition: border-color .2s, background-color .2s;
}

.kvaser-dl-finder .kvaser-dl-search-input:focus {
    background-color: #fff;
    border-color: #1f2937;
    outline: none;
}

.kvaser-dl-finder .kvaser-dl-search-input::placeholder {
    color: #6c717f;
}

.kvaser-dl-search-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 420px;
    overflow-y: auto;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .18);
}

.kvaser-dl-search-list[hidden] {
    display: none;
}

.kvaser-dl-search-group {
    padding: 10px 20px 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6c717f;
}

.kvaser-dl-search-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 20px;
    cursor: pointer;
}

.kvaser-dl-search-opt:hover,
.kvaser-dl-search-opt[aria-selected="true"] {
    background: #f3f4f6;
}

.kvaser-dl-search-opt[aria-selected="true"] {
    box-shadow: inset 3px 0 0 #e4002b;
}

.kvaser-dl-search-thumb {
    flex: 0 0 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e5e6ea;
    border-radius: 8px;
    overflow: hidden;
}

.kvaser-dl-search-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── Download icons (Font Awesome 5, assets/css/base/icons.css) ─────────── */

.kvaser-dl-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 10px;
}

.kvaser-dl-icon--pdf      { color: #c8102e; background: #fdecee; }
.kvaser-dl-icon--windows  { color: #0067b8; background: #e8f1fb; }
.kvaser-dl-icon--linux    { color: #1f2937; background: #fff4d6; }
.kvaser-dl-icon--apple    { color: #1f2937; background: #f3f4f6; }
.kvaser-dl-icon--android  { color: #1e7e34; background: #e7f6ec; }
.kvaser-dl-icon--python   { color: #306998; background: #eaf1f8; }
.kvaser-dl-icon--firmware { color: #6d28d9; background: #f1ebfd; }
.kvaser-dl-icon--archive  { color: #b45309; background: #fdf3e6; }
.kvaser-dl-icon--code     { color: #1f2937; background: #eef0f3; }
.kvaser-dl-icon--canking  { color: #e4002b; background: #fde8ec; }

/* CanKing's crown (download-finder.js iconHtml, --kvaser-dl-mask) takes the
   tile's colour like the Font Awesome icons; sized off the tile's font-size. */
.kvaser-dl-icon-mask {
    display: block;
    width: 1.3em;
    height: 1.3em;
    background: currentColor;
    -webkit-mask: var(--kvaser-dl-mask) center / contain no-repeat;
    mask: var(--kvaser-dl-mask) center / contain no-repeat;
}

.kvaser-dl-search-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kvaser-dl-search-name {
    color: #1f2937;
    font-weight: 500;
}

.kvaser-dl-search-name mark {
    background: none;
    color: #e4002b;
    padding: 0;
}

.kvaser-dl-search-sub {
    font-size: 13px;
    color: #6c717f;
}

.kvaser-dl-search-empty {
    padding: 14px 20px;
    color: #6c717f;
}

/* ── "or" divider ───────────────────────────────────────────────────────── */

.kvaser-dl-or {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0 22px;
    color: #6c717f;
    font-size: 14px;
}

.kvaser-dl-or::before,
.kvaser-dl-or::after {
    content: "";
    flex: 1;
    border-top: 1px solid #e5e6ea;
}

/* ── Step selects + product preview ─────────────────────────────────────── */

.kvaser-dl-steps {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.kvaser-dl-selects {
    flex: 1;
    display: grid;
    /* The kind select only picks a list; the list itself is the main control. */
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
    gap: 16px;
    align-content: center;
}

/* Only the list for the chosen kind is shown (download-finder.js). */
.kvaser-dl-field[hidden] {
    display: none;
}

/* "Clear" sits level with the selects (bottom of the grid row). */
.kvaser-dl-field--clear {
    align-self: end;
    min-width: 80px;
}

.kvaser-dl-finder .kvaser-dl-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 50px;
    margin: 0;
    padding: 0 6px;
    font-size: 15px;
    font-weight: 500;
    color: #4b5563;
    background: none;
    border: 0;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.kvaser-dl-finder .kvaser-dl-clear:hover {
    color: #e4002b;
    background: none;
}

.kvaser-dl-finder .kvaser-dl-clear[hidden] {
    display: none;
}

.kvaser-dl-finder .kvaser-dl-clear:focus-visible {
    outline: 2px solid #e4002b;
    outline-offset: 2px;
}

.kvaser-dl-optional {
    font-weight: 400;
    color: #6c717f;
}

.kvaser-dl-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.kvaser-dl-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.kvaser-dl-finder .kvaser-dl-field select {
    width: 100%;
    height: 50px;
    padding: 0 40px 0 16px;
    font-size: 15px;
    color: #1f2937;
    background: #fff url("../../images/new-image/prb-select.svg") no-repeat right 16px center;
    border: 1px solid #9ca3af;
    border-radius: 8px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.kvaser-dl-finder .kvaser-dl-field select:disabled {
    color: #9ca3af;
    background-color: #f9fafb;
    border-color: #e5e6ea;
    cursor: not-allowed;
}

.kvaser-dl-finder .kvaser-dl-field select:focus-visible {
    outline: 2px solid #e4002b;
    outline-offset: 2px;
}

.kvaser-dl-preview {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    text-align: center;
    background: #f3f4f6;
    border-radius: 12px;
}

.kvaser-dl-preview-img {
    width: 120px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kvaser-dl-preview:not(.has-product) .kvaser-dl-preview-img {
    background: url("../../images/new-homepage/kvaser-red-logo.svg") no-repeat center;
    background-size: 90px;
    opacity: .25;
    filter: grayscale(1);
}

.kvaser-dl-preview-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* A software / development-kit pick has no photo: its icon tile instead. */
.kvaser-dl-preview-img .kvaser-dl-icon {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    font-size: 28px;
    border-radius: 14px;
}

.kvaser-dl-preview-name {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: #1f2937;
}

.kvaser-dl-preview:not(.has-product) .kvaser-dl-preview-name {
    color: #9ca3af;
    font-weight: 400;
}

/* ── Results ────────────────────────────────────────────────────────────── */

.kvaser-dl-results {
    margin-top: 30px;
    scroll-margin-top: 120px;
}

.kvaser-dl-results:focus {
    outline: none;
}

.kvaser-dl-results[hidden] {
    display: none;
}

.kvaser-dl-results-head {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e6ea;
}

.kvaser-dl-results-img {
    width: 96px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Head of a software / development-kit result: the tool's icon tile. */
.kvaser-dl-results-head .kvaser-dl-results-icon {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    font-size: 28px;
    border-radius: 14px;
}

.kvaser-dl-results-title {
    margin: 0 0 4px;
    font-size: 24px;
    line-height: 32px;
    color: #1f2937;
}

.kvaser-dl-results-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin: 0;
    font-size: 14px;
    color: #6c717f;
}

.kvaser-dl-results-sub a {
    color: #e4002b;
    text-decoration: underline;
}

.kvaser-dl-badge {
    padding: 2px 10px;
    border-radius: 100px;
    background: #fde8ec;
    color: #b00020;
    font-size: 12px;
    font-weight: 600;
}

.kvaser-dl-group {
    margin-top: 28px;
}

.kvaser-dl-empty {
    margin: 24px 0 0;
    color: #6c717f;
}

.kvaser-dl-group-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 26px;
    color: #1f2937;
}

.kvaser-dl-group-title span {
    color: #6c717f;
    font-weight: 400;
}

.kvaser-dl-items {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #e5e6ea;
    border-radius: 12px;
    overflow: hidden;
}

.kvaser-dl-item {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 16px 20px;
    background: #fff;
}

.kvaser-dl-item + .kvaser-dl-item {
    border-top: 1px solid #e5e6ea;
}

.kvaser-dl-item:hover {
    background: #f9fafb;
}

.kvaser-dl-item-text {
    flex: 1;
    min-width: 0;
}

.kvaser-dl-item-title {
    color: #1f2937;
    font-weight: 600;
    text-decoration: none;
}

.kvaser-dl-item-title:hover {
    color: #e4002b;
}

.kvaser-dl-item-desc {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 20px;
    color: #4b5563;
}

.kvaser-dl-item-meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6c717f;
}

/* ── Download actions: one row of text links ───────────────────────────── */

.kvaser-dl-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.kvaser-dl-links {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
    font-size: 14px;
    line-height: 20px;
}

/* "Download v1.2.3": red and semibold, no button chrome, own line. */
.kvaser-dl-actions a.kvaser-dl-dl {
    color: #e4002b;
    font-size: 15px;
    line-height: 22px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}

.kvaser-dl-actions a.kvaser-dl-dl:hover {
    color: #b00020;
}

.kvaser-dl-ver {
    font-weight: 400;
}

.kvaser-dl-actions .kvaser-dl-links {
    justify-content: flex-end;
}

.kvaser-dl-links a {
    color: #4b5563;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kvaser-dl-links a:hover {
    color: #e4002b;
}

/* ── Card browser: the selects as cards (download-finder.js) ──────────── */

.kvaser-dl-browse {
    margin-top: 30px;
}

.kvaser-dl-browse[hidden] {
    display: none;
}

.kvaser-dl-browse-title {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6c717f;
}

/* Crumbs on the left, "Back" on the right, above the cards/list. */
.kvaser-dl-browse-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
}

.kvaser-dl-finder .kvaser-dl-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: #e4002b;
    background: none;
    border: 0;
    box-shadow: none;
    cursor: pointer;
}

.kvaser-dl-finder .kvaser-dl-back i {
    font-size: 12px;
}

.kvaser-dl-finder .kvaser-dl-back:hover {
    color: #b00020;
    background: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.kvaser-dl-finder .kvaser-dl-back:focus-visible {
    outline: 2px solid #e4002b;
    outline-offset: 2px;
}

.kvaser-dl-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 14px;
    color: #9ca3af;
}

.kvaser-dl-crumbs i {
    font-size: 10px;
}

.kvaser-dl-finder .kvaser-dl-crumb {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: #e4002b;
    background: none;
    border: 0;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.kvaser-dl-finder .kvaser-dl-crumb:hover {
    color: #b00020;
    background: none;
}

.kvaser-dl-finder .kvaser-dl-crumb:focus-visible {
    outline: 2px solid #e4002b;
    outline-offset: 2px;
}

.kvaser-dl-crumb.is-current {
    color: #1f2937;
    font-weight: 600;
}

.kvaser-dl-tiles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.kvaser-dl-tiles > li {
    margin: 0;
    padding: 0;
}

.kvaser-dl-tiles--kinds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.kvaser-dl-finder .kvaser-dl-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 18px 14px;
    text-align: center;
    color: #1f2937;
    background: #fff;
    border: 1px solid #e5e6ea;
    border-radius: 12px;
    box-shadow: none;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.kvaser-dl-finder .kvaser-dl-tile:hover {
    color: #1f2937;
    background: #fff;
    border-color: #e4002b;
    box-shadow: 0 6px 18px rgba(31, 41, 55, .08);
    transform: translateY(-2px);
}

.kvaser-dl-finder .kvaser-dl-tile:focus-visible {
    outline: 2px solid #e4002b;
    outline-offset: 2px;
}

.kvaser-dl-tile-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 80px;
    font-size: 32px;
    color: #9ca3af;
}

.kvaser-dl-tile-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.kvaser-dl-tile-media .kvaser-dl-icon {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 12px;
}

.kvaser-dl-tile-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kvaser-dl-tile-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
}

.kvaser-dl-tile-sub {
    font-size: 13px;
    line-height: 18px;
    color: #6c717f;
}

.kvaser-dl-tile-count {
    font-size: 13px;
    line-height: 18px;
    color: #9ca3af;
}

/* Kind cards: icon beside the text, with room for a description. */
.kvaser-dl-finder .kvaser-dl-tile--kind {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px;
    text-align: left;
}

.kvaser-dl-tile--kind .kvaser-dl-tile-media {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    font-size: 24px;
    color: #e4002b;
    background: #fde8ec;
    border-radius: 14px;
}

.kvaser-dl-tile--kind .kvaser-dl-tile-title {
    font-size: 18px;
    line-height: 24px;
}

.kvaser-dl-tile--kind .kvaser-dl-tile-count {
    margin-top: 4px;
}

/* Software / development kits: one row per tool, not cards. */
.kvaser-dl-tiles--list {
    display: block;
    border: 1px solid #e5e6ea;
    border-radius: 12px;
    overflow: hidden;
}

.kvaser-dl-tiles--list > li + li {
    border-top: 1px solid #e5e6ea;
}

.kvaser-dl-finder .kvaser-dl-tile--row {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    text-align: left;
    border: 0;
    border-radius: 0;
}

.kvaser-dl-finder .kvaser-dl-tile--row:hover {
    background: #f7f7f8;
    box-shadow: none;
    transform: none;
}

.kvaser-dl-finder .kvaser-dl-tile--row:focus-visible {
    outline-offset: -2px;
}

.kvaser-dl-tile--row .kvaser-dl-tile-media {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.kvaser-dl-tile--row .kvaser-dl-tile-media .kvaser-dl-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
}

.kvaser-dl-tile--row .kvaser-dl-tile-text {
    flex: 1;
    gap: 2px;
}

.kvaser-dl-tile-go {
    flex-shrink: 0;
    font-size: 12px;
    color: #9ca3af;
}

.kvaser-dl-tile--row:hover .kvaser-dl-tile-go {
    color: #e4002b;
}

/* ── Kvaser Marketplace banner (under the results of a CanKing pick) ───── */

.kvaser-dl-market[hidden] {
    display: none;
}

.kvaser-dl-market {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-top: 40px;
    padding: 36px 40px;
    color: #fff;
    background: linear-gradient(120deg, #1f2937 0%, #303232 60%, #4a0d18 100%);
    border-radius: 0 20px 0 20px;
}

.kvaser-dl-market-icon {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    background: #e4002b;
    border-radius: 16px;
}

.kvaser-dl-market-text {
    flex: 1;
    min-width: 0;
}

.kvaser-dl-market-eyebrow {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #fca5b4;
}

.kvaser-dl-market .kvaser-dl-market-title {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 34px;
    color: #fff;
}

.kvaser-dl-market-desc {
    margin: 0;
    max-width: 62ch;
    color: #e5e7eb;
}

.kvaser-dl-finder .kvaser-dl-market-btn {
    flex-shrink: 0;
    margin: 0;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}


/* ── Responsive ─────────────────────────────────────────────────────────── */

@media only screen and (max-width: 991px) {
    .kvaser-dl-steps {
        flex-direction: column;
    }

    .kvaser-dl-preview {
        display: none;
    }

    .kvaser-dl-tiles--kinds {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media only screen and (max-width: 767px) {
    .kvaser-dl-finder {
        margin-top: -50px;
    }

    .kvaser-dl-finder-card {
        padding: 24px 18px 26px;
    }

    .kvaser-dl-finder-title {
        font-size: 22px;
        line-height: 30px;
    }

    .kvaser-dl-selects {
        grid-template-columns: 1fr;
    }

    .kvaser-dl-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .kvaser-dl-finder .kvaser-dl-tile--kind {
        padding: 16px 18px;
    }

    .kvaser-dl-market {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 26px 22px;
    }

    .kvaser-dl-market .kvaser-dl-market-title {
        font-size: 22px;
        line-height: 30px;
    }

    /* No empty row on phones while there is nothing to clear. */
    .kvaser-dl-field--clear:has(.kvaser-dl-clear[hidden]) {
        display: none;
    }

    /* Icon stays beside the title; button drops under the text. */
    .kvaser-dl-item {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px 14px;
        padding: 16px;
    }

    .kvaser-dl-item-text {
        flex: 1 1 calc(100% - 58px);
    }

    .kvaser-dl-item .kvaser-dl-actions {
        flex: 1 1 calc(100% - 58px);
        min-width: 0;
        margin-left: 58px;
        align-items: flex-start;
    }

    .kvaser-dl-item .kvaser-dl-links {
        justify-content: flex-start;
    }

    .kvaser-dl-results-img {
        width: 64px;
        height: 48px;
    }

    .kvaser-dl-results-title {
        font-size: 20px;
        line-height: 28px;
    }
}

/* ── "Most downloaded" row (download-finder.js renderPopular) ──────────── */

.kvaser-dl-popular {
    margin-top: 30px;
}

.kvaser-dl-popular[hidden] {
    display: none;
}

.kvaser-dl-pop-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.kvaser-dl-pop {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 0;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e5e6ea;
    border-radius: 12px;
}

.kvaser-dl-pop:hover {
    border-color: #c9ccd4;
}

.kvaser-dl-pop-text {
    flex: 1;
    min-width: 0;
}

.kvaser-dl-pop .kvaser-dl-actions {
    align-items: flex-start;
    margin-top: 8px;
}

/* ── "Start here" block of a product result ────────────────────────────── */

.kvaser-dl-start .kvaser-dl-items {
    border-color: #1f2937;
}


.kvaser-dl-rest-title {
    margin: 36px 0 -8px;
    padding-top: 24px;
    border-top: 1px solid #e5e6ea;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6c717f;
}

/* A long developer-library group, folded under "Start here". */
.kvaser-dl-fold > summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kvaser-dl-fold > summary::-webkit-details-marker {
    display: none;
}

.kvaser-dl-fold > summary::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid #6c717f;
    border-bottom: 2px solid #6c717f;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}

.kvaser-dl-fold[open] > summary::before {
    transform: rotate(45deg);
}

.kvaser-dl-fold:not([open]) > summary {
    margin-bottom: 0;
}

/* ── Search without a match: where else to look ────────────────────────── */

.kvaser-dl-search-empty {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kvaser-dl-search-empty-title {
    color: #1f2937;
    font-weight: 600;
}

.kvaser-dl-search-help {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.kvaser-dl-search-help a {
    color: #e4002b;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kvaser-dl-search-help a:hover {
    color: #b00020;
}

@media only screen and (max-width: 991px) {
    .kvaser-dl-pop-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 767px) {
    .kvaser-dl-pop-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kvaser-dl-fold > summary::before {
        transition: none;
    }
}

/* ── "All downloads A–Z": plain link list, folded (render_index) ───────── */

.kvaser-dl-index {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e6ea;
}

.kvaser-dl-index > summary {
    cursor: pointer;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
    color: #1f2937;
}

.kvaser-dl-index > summary:hover {
    color: #e4002b;
}

.kvaser-dl-index-title {
    margin: 24px 0 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6c717f;
}

.kvaser-dl-index-list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 3;
    column-gap: 32px;
    font-size: 14px;
    line-height: 20px;
}

.kvaser-dl-index-list li {
    margin: 0;
    padding: 4px 0;
    break-inside: avoid;
}

.kvaser-dl-index-list a {
    color: #4b5563;
    text-decoration: none;
}

.kvaser-dl-index-list a:hover {
    color: #e4002b;
    text-decoration: underline;
}

@media only screen and (max-width: 991px) {
    .kvaser-dl-index-list {
        columns: 2;
    }
}

@media only screen and (max-width: 767px) {
    .kvaser-dl-index-list {
        columns: 1;
    }
}

/* ── PDFs: "View" and "Download" side by side (download-finder.js pdfLinksHtml) ── */

.kvaser-dl-pdf {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px 18px;
}

/* One underline per link, icon included; the version stays with it. */
.kvaser-dl-actions .kvaser-dl-pdf a.kvaser-dl-dl {
    white-space: nowrap;
}

.kvaser-dl-pdf a.kvaser-dl-dl i {
    margin-right: 4px;
    font-size: 13px;
}

/* A datasheet's paper size in front of its View / Download pair. */
.kvaser-dl-paper {
    min-width: 72px;
    font-size: 14px;
    line-height: 22px;
    color: #6c717f;
    text-align: right;
}

.kvaser-dl-pop .kvaser-dl-pdf {
    justify-content: flex-start;
}

@media only screen and (max-width: 767px) {
    .kvaser-dl-item .kvaser-dl-pdf {
        justify-content: flex-start;
    }

    .kvaser-dl-paper {
        text-align: left;
    }
}

/* ── One row per tool, a download link per build (download-finder.js buildsRowHtml) ── */

.kvaser-dl-builds {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.kvaser-dl-actions .kvaser-dl-builds a.kvaser-dl-dl {
    white-space: nowrap;
}

.kvaser-dl-builds a.kvaser-dl-dl i {
    margin-right: 6px;
    font-size: 14px;
}

@media only screen and (max-width: 767px) {
    .kvaser-dl-item .kvaser-dl-builds {
        align-items: flex-start;
    }
}

/* ── "Update the firmware" box of a product result (download-finder.js firmwareHtml) ── */

.kvaser-dl-fw {
    padding: 18px 20px;
    background: #f7f3fe;
    border: 1px solid #ddd0fa;
    border-left: 4px solid #6d28d9;
    border-radius: 12px;
}

.kvaser-dl-fw .kvaser-dl-group-title i {
    margin-right: 8px;
    color: #6d28d9;
}

.kvaser-dl-fw-text {
    margin: -4px 0 12px;
    font-size: 15px;
    line-height: 22px;
    color: #374151;
}

.kvaser-dl-fw .kvaser-dl-items {
    background: #fff;
}
