:root {
    --tkv-green: #36A016;
    --tkv-green-dark: #2A7D11;
    --tkv-purple: #A62BA0;
    --tkv-dark: #292C30;
    --tkv-youtube: #ff0000;
    --tkv-border: #d9dde2;
    --tkv-muted: #667085;
    --tkv-surface: #ffffff;
    --tkv-soft: #f7f8fa;
    --tkv-active: #f0f8ed;
    --tkv-radius: 10px;
    --tkv-shadow: 0 2px 10px rgba(41, 44, 48, 0.05);
}

.techaptic-knowledge-videos-page .site-content .ast-container,
.techaptic-knowledge-videos-page .site-content > .ast-container {
    max-width: 1680px;
    width: 100%;
}

.tkv-root,
.tkv-root * {
    box-sizing: border-box;
}

.tkv-root {
    width: 100%;
    margin: 0 auto;
    color: var(--tkv-dark);
    font-family: inherit;
}

.tkv-bootstrap-data {
    display: none !important;
}

.tkv-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
}

.tkv-heading h1,
.tkv-heading p,
.tkv-queue h2,
.tkv-search-card h2 {
    margin: 0;
}

.tkv-heading h1 {
    font-size: clamp(25px, 2vw, 34px);
    line-height: 1.1;
    font-weight: 800;
    color: var(--tkv-dark);
}

.tkv-heading p {
    margin-top: 4px;
    font-size: 14px;
    color: #4f5661;
}

.tkv-heading-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--tkv-purple);
}

.tkv-heading-icon svg,
.tkv-section-icon svg,
.tkv-explore-icon svg,
.tkv-context-icon svg,
.tkv-external-icon svg,
.tkv-clear-queue svg,
.tkv-chevron svg,
.tkv-search-input-wrap > span svg {
    width: 100%;
    height: 100%;
}

.tkv-watch-grid {
    display: grid;
    grid-template-columns: minmax(0, 65fr) minmax(340px, 35fr);
    gap: 18px;
    align-items: stretch;
}

.tkv-watch-column {
    min-width: 0;
}

.tkv-player-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--tkv-radius);
    background: #111;
    box-shadow: var(--tkv-shadow);
}

.tkv-player-poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tkv-player-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 28px;
    min-height: 50px;
    padding: 7px 4px 0;
}

.tkv-context-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--tkv-dark) !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    transition: color .18s ease;
}

.tkv-context-link:hover,
.tkv-context-link:focus-visible {
    color: var(--tkv-green) !important;
}

.tkv-context-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}

.tkv-context-icon-guide { color: var(--tkv-green); }
.tkv-context-icon-youtube { color: var(--tkv-youtube); }
.tkv-external-icon {
    width: 15px;
    height: 15px;
    color: currentColor;
}

.tkv-queue {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    border: 1px solid var(--tkv-border);
    border-radius: var(--tkv-radius);
    background: var(--tkv-surface);
    box-shadow: var(--tkv-shadow);
    overflow: hidden;
}

.tkv-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
}

.tkv-queue h2 {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
}

.tkv-clear-queue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: #525866;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    padding: 6px;
}

.tkv-clear-queue:hover,
.tkv-clear-queue:focus-visible {
    color: var(--tkv-green-dark);
}

.tkv-clear-queue svg {
    width: 16px;
    height: 16px;
}

.tkv-queue-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #edf0f2;
    border-bottom: 1px solid var(--tkv-border);
}

.tkv-tab,
.tkv-mode-button {
    border: 0;
    background: #fff;
    color: #111;
    font: inherit;
    cursor: pointer;
}

.tkv-tab {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 3px solid transparent;
}

.tkv-tab.is-active {
    color: var(--tkv-green-dark);
    border-bottom-color: var(--tkv-green);
}

.tkv-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #edf0f2;
    color: #31343a;
    font-size: 11px;
    font-weight: 800;
}

.tkv-tab.is-active .tkv-count {
    background: #e8f4e4;
    color: var(--tkv-green-dark);
}

.tkv-queue-scroll {
    position: relative;
    flex: 1 1 auto;
    min-height: 160px;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #aeb4bd transparent;
}

.tkv-queue-scroll::-webkit-scrollbar,
.tkv-results-scroll::-webkit-scrollbar {
    width: 8px;
}

.tkv-queue-scroll::-webkit-scrollbar-thumb,
.tkv-results-scroll::-webkit-scrollbar-thumb {
    background: #aeb4bd;
    border-radius: 999px;
}

.tkv-empty-state,
.tkv-search-empty {
    margin: 0;
    padding: 24px 18px;
    color: var(--tkv-muted);
    font-size: 14px;
    line-height: 1.5;
}

.tkv-queue-item {
    display: grid;
    grid-template-columns: 24px 72px minmax(0, 1fr) auto 32px;
    align-items: center;
    gap: 9px;
    min-height: 62px;
    padding: 7px 8px;
    border-bottom: 1px solid #edf0f2;
    background: #fff;
}

.tkv-queue-item.is-current {
    background: var(--tkv-active);
}

.tkv-current-marker {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: #b6bbc3;
    font-size: 14px;
}

.tkv-queue-item.is-current .tkv-current-marker {
    color: var(--tkv-youtube);
}

.tkv-queue-thumb,
.tkv-result-thumb,
.tkv-explore-thumb {
    position: relative;
    overflow: hidden;
    background: #151515;
}

.tkv-queue-thumb {
    width: 72px;
    aspect-ratio: 16 / 9;
    border-radius: 5px;
}

.tkv-queue-thumb img,
.tkv-result-thumb img,
.tkv-explore-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.tkv-duration-badge {
    position: absolute;
    left: 6px;
    bottom: 5px;
    z-index: 1;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
}

.tkv-queue-title {
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--tkv-dark);
}

.tkv-queue-meta {
    margin-top: 3px;
    color: #68707b;
    font-size: 11px;
    line-height: 1.2;
}

.tkv-queue-time {
    font-size: 11px;
    color: #5d6470;
    white-space: nowrap;
}

.tkv-queue-remove {
    border: 0;
    background: transparent;
    color: #666d77;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    border-radius: 5px;
}

.tkv-queue-remove:hover,
.tkv-queue-remove:focus-visible {
    color: var(--tkv-green-dark);
    background: #f2f5f1;
}

.tkv-search-card {
    display: grid;
    grid-template-columns: minmax(260px, 27fr) minmax(0, 73fr);
    margin-top: 8px;
    border: 1px solid var(--tkv-border);
    border-radius: var(--tkv-radius);
    background: #fff;
    box-shadow: var(--tkv-shadow);
    overflow: hidden;
}

.tkv-search-controls {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--tkv-border);
}

.tkv-search-card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    color: var(--tkv-dark);
    font-size: 19px;
    line-height: 1.2;
    font-weight: 800;
}

.tkv-section-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--tkv-purple);
}

.tkv-search-input-wrap {
    position: relative;
}

.tkv-search-input {
    width: 100%;
    min-height: 42px;
    padding: 9px 40px 9px 12px;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    background: #fff;
    color: var(--tkv-dark);
    font: inherit;
    font-size: 14px;
}

.tkv-search-input:focus {
    outline: 2px solid rgba(54, 160, 22, .18);
    border-color: var(--tkv-green);
}

.tkv-search-input-wrap > span {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 18px;
    height: 18px;
    color: #626975;
    transform: translateY(-50%);
    pointer-events: none;
}

.tkv-search-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
}

.tkv-mode-button {
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid #cfd4da;
    border-radius: 5px;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.tkv-mode-button.is-active {
    background: var(--tkv-green);
    border-color: var(--tkv-green);
    color: #111;
}

.tkv-mode-button.is-active:hover,
.tkv-mode-button.is-active:focus-visible {
    background: var(--tkv-green);
    border-color: var(--tkv-green);
    color: #fff;
}

.tkv-mode-button:not(.is-active):hover,
.tkv-mode-button:not(.is-active):focus-visible {
    border-color: var(--tkv-green);
    color: var(--tkv-green-dark);
}

.tkv-advanced-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--tkv-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.tkv-advanced-toggle[aria-expanded="true"] {
    color: var(--tkv-purple);
}

.tkv-chevron {
    display: inline-grid;
    width: 18px;
    height: 18px;
    transition: transform .22s ease;
}

.tkv-advanced-toggle[aria-expanded="true"] .tkv-chevron,
.tkv-explore-toggle[aria-expanded="true"] > .tkv-chevron {
    transform: rotate(180deg);
}

.tkv-advanced-body {
    padding-top: 6px;
}

.tkv-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tkv-field {
    display: grid;
    gap: 5px;
    min-width: 0;
    color: var(--tkv-dark);
    font-size: 12px;
    font-weight: 700;
}

.tkv-field select {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 28px 0 9px;
    border: 1px solid #cfd4da;
    border-radius: 5px;
    background-color: #fff;
    color: var(--tkv-dark);
    font: inherit;
    font-size: 12px;
}

.tkv-time-filter {
    margin-top: 18px;
}

.tkv-time-filter-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--tkv-dark);
    font-size: 12px;
    font-weight: 800;
}

.tkv-time-help {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border: 1px solid #666d77;
    border-radius: 50%;
    color: #4e555f;
    font-size: 10px;
    font-weight: 800;
}

.tkv-dual-range {
    position: relative;
    height: 26px;
}

.tkv-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 99px;
    transform: translateY(-50%);
    background: linear-gradient(
        to right,
        #cfd3d8 0%,
        #cfd3d8 var(--tkv-range-from),
        #111 var(--tkv-range-from),
        #111 var(--tkv-range-to),
        #cfd3d8 var(--tkv-range-to),
        #cfd3d8 100%
    );
}

.tkv-dual-range input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 26px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    appearance: none;
    pointer-events: none;
}

.tkv-dual-range input[type="range"]::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.tkv-dual-range input[type="range"]::-moz-range-track {
    height: 4px;
    background: transparent;
}

.tkv-dual-range input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border: 0;
    border-radius: 50%;
    background: #111;
    appearance: none;
    pointer-events: auto;
    cursor: grab;
}

.tkv-dual-range input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: #111;
    pointer-events: auto;
    cursor: grab;
}

.tkv-time-values {
    display: flex;
    justify-content: space-between;
    margin-top: -1px;
    color: #424851;
    font-size: 11px;
    font-weight: 700;
}

.tkv-search-results {
    min-width: 0;
    min-height: 390px;
    padding: 0 10px 8px 16px;
}

.tkv-results-head {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-bottom: 1px solid #edf0f2;
    font-size: 14px;
}

.tkv-results-scroll {
    height: 388px;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #aeb4bd transparent;
}

.tkv-results-list {
    min-width: 0;
}

.tkv-result-item {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 84px;
    padding: 9px 8px;
    border-bottom: 1px solid #edf0f2;
}

.tkv-result-item {
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.tkv-result-item:hover,
.tkv-result-item:focus-visible {
    background: #fafcf9;
    outline: none;
}

.tkv-result-item:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(54, 160, 22, .35);
}

.tkv-result-item .tkv-result-button {
    cursor: pointer;
}

.tkv-result-thumb {
    width: 108px;
    aspect-ratio: 16 / 9;
    border-radius: 5px;
}

.tkv-result-content {
    min-width: 0;
}

.tkv-result-title {
    display: block;
    color: var(--tkv-dark);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.tkv-result-video-title {
    display: block;
    margin-top: 2px;
    color: #4d535d;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.tkv-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
    color: #6b727d;
    font-size: 11px;
    line-height: 1.3;
}

.tkv-result-actions {
    display: flex;
    gap: 8px;
}

.tkv-result-button {
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid #cfd4da;
    border-radius: 6px;
    background: #fff;
    color: var(--tkv-dark);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.tkv-result-button:hover,
.tkv-result-button:focus-visible {
    border-color: var(--tkv-green);
    color: var(--tkv-green-dark);
    background: #f5fbf3;
}

.tkv-explore {
    margin-top: 10px;
    border: 1px solid var(--tkv-border);
    border-radius: var(--tkv-radius);
    background: #fff;
    box-shadow: var(--tkv-shadow);
    overflow: hidden;
}

.tkv-explore-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 72px;
    padding: 12px 16px;
    border: 0;
    background: #fff;
    color: var(--tkv-dark);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tkv-explore-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tkv-explore-heading strong {
    display: block;
    font-size: 19px;
    line-height: 1.15;
}

.tkv-explore-heading small {
    display: block;
    margin-top: 3px;
    color: #616874;
    font-size: 12px;
    line-height: 1.25;
}

.tkv-explore-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: var(--tkv-purple);
}

.tkv-explore-body {
    overflow: hidden;
}

.tkv-explore-inner {
    padding: 6px 16px 20px;
}

.tkv-explore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 18px;
}

.tkv-explore-card {
    position: relative;
    min-width: 0;
}

.tkv-explore-select {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tkv-explore-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 7px;
}

.tkv-explore-title {
    display: -webkit-box;
    min-height: 3.75em;
    margin-top: 8px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: var(--tkv-dark);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.tkv-explore-queue {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: var(--tkv-dark);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.tkv-explore-queue:hover,
.tkv-explore-queue:focus-visible {
    border-color: var(--tkv-green);
    color: var(--tkv-green-dark);
}

.tkv-screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tkv-admin-message {
    padding: 14px 16px;
    border: 1px solid #fecaca;
    border-radius: 7px;
    background: #fef2f2;
    color: #991b1b;
}

@media (max-width: 1180px) {
    .tkv-watch-grid {
        grid-template-columns: minmax(0, 62fr) minmax(300px, 38fr);
    }

    .tkv-search-card {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .tkv-result-item {
        grid-template-columns: 94px minmax(0, 1fr) auto;
    }

    .tkv-result-thumb { width: 94px; }
    .tkv-result-actions { grid-column: auto; justify-content: flex-end; }
}

@media (max-width: 920px) {
    .tkv-watch-grid,
    .tkv-search-card {
        grid-template-columns: 1fr;
    }

    .tkv-queue {
        max-height: 360px;
    }

    .tkv-search-controls {
        border-right: 0;
        border-bottom: 1px solid var(--tkv-border);
    }

    .tkv-search-results {
        min-height: 0;
    }

    .tkv-results-scroll {
        height: 360px;
    }

    .tkv-explore-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tkv-heading {
        align-items: flex-start;
    }

    .tkv-heading-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .tkv-heading p {
        font-size: 12px;
    }

    .tkv-player-links {
        align-items: flex-start;
        gap: 7px 18px;
    }

    .tkv-context-link {
        font-size: 13px;
    }

    .tkv-field-row {
        grid-template-columns: 1fr;
    }

    .tkv-result-item {
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: start;
    }

    .tkv-result-thumb { width: 96px; }
    .tkv-result-actions { grid-column: 1 / -1; justify-content: stretch; }
    .tkv-result-button { flex: 1 1 0; }

    .tkv-queue-item {
        grid-template-columns: 20px 66px minmax(0, 1fr) 26px;
    }

    .tkv-queue-time { display: none; }

    .tkv-explore-grid {
        grid-template-columns: 1fr;
    }

    .tkv-explore-toggle {
        min-height: 64px;
        padding: 10px 12px;
    }

    .tkv-explore-heading small {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tkv-root *,
    .tkv-root *::before,
    .tkv-root *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

/* =====================================================================
   Phase 3 — real Techaptic landing layout refinements
   ===================================================================== */

/* The shortcode owns the page width. Do not require an outer block/container. */
body.techaptic-knowledge-videos-page #content.site-content {
    padding-top: 28px !important;
    padding-bottom: 48px !important;
}

body.techaptic-knowledge-videos-page .site-content .ast-container,
body.techaptic-knowledge-videos-page .site-content > .ast-container {
    width: 100% !important;
    max-width: 1640px !important;
    margin-inline: auto !important;
    padding-left: clamp(18px, 2.2vw, 38px) !important;
    padding-right: clamp(18px, 2.2vw, 38px) !important;
}

body.techaptic-knowledge-videos-page .content-area,
body.techaptic-knowledge-videos-page .site-main,
body.techaptic-knowledge-videos-page article.page,
body.techaptic-knowledge-videos-page .entry-content,
body.techaptic-knowledge-videos-page .entry-content > .wp-block-shortcode {
    width: 100% !important;
    max-width: none !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.tkv-root {
    max-width: 1540px;
    font-family: "Source Sans 3", sans-serif;
}

/* Techaptic typography: Montserrat for headings/UI controls, Source Sans 3 for body copy. */
.tkv-heading h1,
.tkv-queue h2,
.tkv-search-card h2,
.tkv-explore-heading strong,
.tkv-tab,
.tkv-mode-button,
.tkv-advanced-toggle,
.tkv-field,
.tkv-result-title,
.tkv-result-video-title,
.tkv-explore-title,
.tkv-context-link,
.tkv-result-button,
.tkv-clear-queue {
    font-family: "Montserrat", sans-serif;
}

.tkv-heading p,
.tkv-empty-state,
.tkv-search-empty,
.tkv-search-input,
.tkv-field select,
.tkv-time-values,
.tkv-result-meta,
.tkv-queue-meta,
.tkv-queue-time,
.tkv-explore-heading small {
    font-family: "Source Sans 3", sans-serif;
}

.tkv-heading {
    margin-bottom: 18px;
}

/* Desktop: player is the dominant surface; queue is secondary. */
.tkv-watch-grid {
    grid-template-columns: minmax(0, 65fr) minmax(330px, 35fr);
    gap: 18px;
    align-items: start;
}

.tkv-player-stage {
    aspect-ratio: 16 / 9;
}

/* JS synchronizes this height to the 16:9 player stage on desktop. */
.tkv-queue {
    height: var(--tkv-watch-height, auto);
    max-height: var(--tkv-watch-height, none);
}

.tkv-queue-scroll {
    min-height: 0;
}

/* Keep the search controller compact and give results the majority of width. */
.tkv-search-card {
    grid-template-columns: 310px minmax(0, 1fr);
    margin-top: 10px;
}

.tkv-search-controls {
    padding: 16px 15px;
}

.tkv-search-results {
    min-height: 0;
    padding-right: 10px;
}

.tkv-results-scroll {
    height: 420px;
    max-height: 420px;
    overflow-y: auto;
}

/* Queue/results are the two internal scrolling regions on the landing page. */
.tkv-queue-scroll,
.tkv-results-scroll {
    overscroll-behavior-y: auto;
    scrollbar-gutter: stable;
}

/* Preserve the two-knob time-range visual: selected segment black, outside grey. */
.tkv-range-track {
    background: linear-gradient(
        to right,
        #cfd3d8 0%,
        #cfd3d8 var(--tkv-range-from),
        #111111 var(--tkv-range-from),
        #111111 var(--tkv-range-to),
        #cfd3d8 var(--tkv-range-to),
        #cfd3d8 100%
    );
}

.tkv-dual-range input[type="range"]::-webkit-slider-thumb,
.tkv-dual-range input[type="range"]::-moz-range-thumb {
    background: #111111;
}

/* Explore is intentionally the only expandable region that grows the document vertically. */
.tkv-explore {
    margin-top: 12px;
}

@media (max-width: 1260px) {
    .tkv-root {
        max-width: 100%;
    }

    .tkv-watch-grid {
        grid-template-columns: minmax(0, 64fr) minmax(320px, 36fr);
    }

    .tkv-search-card {
        grid-template-columns: 290px minmax(0, 1fr);
    }
}

@media (max-width: 980px) {
    body.techaptic-knowledge-videos-page #content.site-content {
        padding-top: 22px !important;
    }

    .tkv-watch-grid,
    .tkv-search-card {
        grid-template-columns: 1fr;
    }

    .tkv-queue {
        height: auto !important;
        max-height: 360px !important;
    }

    .tkv-search-controls {
        border-right: 0;
        border-bottom: 1px solid var(--tkv-border);
    }

    .tkv-results-scroll {
        height: 360px;
        max-height: 360px;
    }
}

@media (max-width: 640px) {
    body.techaptic-knowledge-videos-page .site-content .ast-container,
    body.techaptic-knowledge-videos-page .site-content > .ast-container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    body.techaptic-knowledge-videos-page #content.site-content {
        padding-top: 18px !important;
        padding-bottom: 32px !important;
    }

    .tkv-heading {
        gap: 10px;
        margin-bottom: 14px;
    }

    .tkv-player-links {
        min-height: 44px;
    }

    .tkv-results-scroll {
        height: 340px;
        max-height: 340px;
    }
}


/* =====================================================================
   Phase 3.1 — isolated full-width breakout container
   Only fixes Astra/Gutenberg content-width constraints. No behavior changes.
   ===================================================================== */

/* Neutralize page-level width constraints only on Knowledge Videos pages. */
body.techaptic-knowledge-videos-page #content.site-content,
body.techaptic-knowledge-videos-page #content.site-content > .ast-container,
body.techaptic-knowledge-videos-page #primary,
body.techaptic-knowledge-videos-page .content-area,
body.techaptic-knowledge-videos-page .site-main,
body.techaptic-knowledge-videos-page article.page,
body.techaptic-knowledge-videos-page .entry-content,
body.techaptic-knowledge-videos-page .entry-content > .wp-block-shortcode {
    width: 100% !important;
    max-width: none !important;
}

body.techaptic-knowledge-videos-page #content.site-content > .ast-container,
body.techaptic-knowledge-videos-page #primary,
body.techaptic-knowledge-videos-page .content-area,
body.techaptic-knowledge-videos-page .site-main,
body.techaptic-knowledge-videos-page article.page,
body.techaptic-knowledge-videos-page .entry-content,
body.techaptic-knowledge-videos-page .entry-content > .wp-block-shortcode {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/*
 * The shortcode becomes its own responsive landing container. The relative
 * left/translate breakout makes it independent of any remaining WordPress,
 * Gutenberg or Astra content-width variable without affecting other pages.
 */
body.techaptic-knowledge-videos-page .tkv-root {
    position: relative;
    left: 50%;
    width: calc(100vw - 48px);
    max-width: 1600px;
    margin-left: 0;
    margin-right: 0;
    transform: translateX(-50%);
}

@media (max-width: 980px) {
    body.techaptic-knowledge-videos-page .tkv-root {
        width: calc(100vw - 32px);
    }
}

@media (max-width: 640px) {
    body.techaptic-knowledge-videos-page .tkv-root {
        width: calc(100vw - 24px);
    }
}


/* =====================================================================
   Phase 3.2 — compact landing state + viewport-aware desktop sizing
   Keeps the player/queue/search behavior unchanged; only reduces first-view
   vertical pressure until the visitor actually performs a search.
   ===================================================================== */

/* Compact first-level Search & Discover state. Results do not reserve a tall
 * empty panel before the visitor supplies a keyword/filter/time criterion. */
.tkv-search-card.is-idle {
    display: block;
}

.tkv-search-card.is-idle .tkv-search-controls {
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto auto;
    grid-template-areas:
        "heading search modes advanced"
        "advanced-body advanced-body advanced-body advanced-body";
    align-items: center;
    gap: 10px 14px;
    padding: 12px 15px;
    border-right: 0;
}

.tkv-search-card.is-idle .tkv-search-controls > h2 {
    grid-area: heading;
    margin: 0;
    white-space: nowrap;
}

.tkv-search-card.is-idle .tkv-search-input-wrap {
    grid-area: search;
    min-width: 0;
}

.tkv-search-card.is-idle .tkv-search-mode {
    grid-area: modes;
    display: flex;
    gap: 7px;
    margin-top: 0;
}

.tkv-search-card.is-idle .tkv-mode-button {
    min-width: 126px;
    min-height: 40px;
    padding-inline: 14px;
}

.tkv-search-card.is-idle .tkv-advanced-toggle {
    grid-area: advanced;
    width: auto;
    min-width: 105px;
    margin-top: 0;
    padding: 8px 0 8px 10px;
}

.tkv-search-card.is-idle .tkv-advanced-body {
    grid-area: advanced-body;
    width: min(620px, 100%);
    padding-top: 4px;
}

.tkv-search-card.is-idle .tkv-search-results {
    display: none;
}

/* Once criteria exist, restore the two-column search/results workspace and
 * reveal the bounded internal-scroll result surface without extending page height. */
.tkv-search-card.is-engaged {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
}

.tkv-search-card.is-engaged .tkv-search-results {
    display: block;
    animation: tkv-results-reveal .22s ease-out both;
}

@keyframes tkv-results-reveal {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* On shorter desktop/laptop viewports, preserve 16:9 but reduce the overall
 * landing width slightly so Watch + compact Search + Explore are discoverable
 * sooner. Taller desktops keep the full 1600px presentation. */
@media (min-width: 1261px) and (max-height: 900px) {
    body.techaptic-knowledge-videos-page .tkv-root {
        max-width: 1460px;
    }

    .tkv-heading {
        margin-bottom: 14px;
    }

    .tkv-player-links {
        min-height: 46px;
        padding-top: 5px;
    }
}

@media (min-width: 1100px) and (max-height: 780px) {
    body.techaptic-knowledge-videos-page .tkv-root {
        max-width: 1280px;
    }

    .tkv-heading {
        margin-bottom: 12px;
    }
}

/* Intermediate widths keep the compact idle state, but stack the heading
 * above the controls before the page reaches the full mobile layout. */
@media (max-width: 1260px) and (min-width: 981px) {
    .tkv-search-card.is-idle .tkv-search-controls {
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-areas:
            "heading heading heading"
            "search modes advanced"
            "advanced-body advanced-body advanced-body";
    }
}

@media (max-width: 980px) {
    .tkv-search-card.is-idle {
        display: block;
    }

    .tkv-search-card.is-idle .tkv-search-controls {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "heading"
            "search"
            "modes"
            "advanced"
            "advanced-body";
        gap: 9px;
        border-bottom: 0;
    }

    .tkv-search-card.is-idle .tkv-search-mode {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .tkv-search-card.is-idle .tkv-mode-button,
    .tkv-search-card.is-idle .tkv-advanced-toggle,
    .tkv-search-card.is-idle .tkv-advanced-body {
        width: 100%;
        min-width: 0;
    }

    .tkv-search-card.is-engaged {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tkv-search-card.is-engaged .tkv-search-results {
        animation: none;
    }
}


/* =====================================================================
   Phase 3.3 — design-first landing shell
   Restores Phase 3.1 width and turns Search & Discover into a first-level
   accordion like Explore Videos. The original two-column search workspace
   stays intact after opening it; Advanced remains nested in its left column.
   ===================================================================== */

/* Restore the Phase 3.1 width. The Phase 3.2 viewport-height shrink rules are
 * intentionally neutralized because they made scaled 4K desktops too narrow. */
body.techaptic-knowledge-videos-page .tkv-root {
    width: calc(100vw - 48px);
    max-width: 1600px;
}

@media (min-width: 1100px) and (max-height: 900px) {
    body.techaptic-knowledge-videos-page .tkv-root {
        max-width: 1600px;
    }
}

/* Search & Discover is visible on the landing page as a single row, just like
 * Explore Videos. Its workspace is second-level detail. */
.tkv-search-shell {
    margin-top: 10px;
    border: 1px solid var(--tkv-border);
    border-radius: var(--tkv-radius);
    background: #fff;
    box-shadow: var(--tkv-shadow);
    overflow: hidden;
}

.tkv-search-shell-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 72px;
    padding: 12px 16px;
    border: 0;
    background: #fff;
    color: var(--tkv-dark);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tkv-search-shell-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tkv-search-shell-heading > span:last-child {
    display: grid;
    gap: 2px;
}

.tkv-search-shell-heading strong {
    font-family: "Montserrat", sans-serif;
    color: var(--tkv-dark);
    font-size: 19px;
    line-height: 1.2;
    font-weight: 800;
}

.tkv-search-shell-heading small {
    font-family: "Source Sans 3", sans-serif;
    color: var(--tkv-muted);
    font-size: 12px;
    line-height: 1.25;
}

.tkv-search-shell-toggle[aria-expanded="true"] > .tkv-chevron {
    transform: rotate(180deg);
}

.tkv-search-shell-body {
    border-top: 1px solid var(--tkv-border);
}

/* Restore the older two-column search layout inside the opened accordion. */
.tkv-search-shell .tkv-search-card,
.tkv-search-shell .tkv-search-card.is-idle,
.tkv-search-shell .tkv-search-card.is-engaged {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    margin-top: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-search-controls,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-search-controls {
    display: block;
    padding: 16px 15px;
    border-right: 1px solid var(--tkv-border);
    border-bottom: 0;
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-search-controls > h2,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-search-controls > h2 {
    margin: 0 0 13px;
    white-space: normal;
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-search-mode,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-search-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 10px;
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-mode-button,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-mode-button {
    width: auto;
    min-width: 0;
    min-height: 38px;
    padding: 7px 9px;
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-advanced-toggle,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-advanced-toggle {
    width: 100%;
    min-width: 0;
    margin-top: 10px;
    padding: 8px 0;
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-advanced-body,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-advanced-body {
    width: 100%;
    padding-top: 6px;
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-search-results,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-search-results {
    display: block;
    min-height: 0;
    padding-right: 10px;
    animation: none;
}

.tkv-search-shell .tkv-results-scroll {
    height: 420px;
    max-height: 420px;
    overflow-y: auto;
}

@media (max-width: 980px) {
    body.techaptic-knowledge-videos-page .tkv-root {
        width: calc(100vw - 32px);
    }

    .tkv-search-shell .tkv-search-card,
    .tkv-search-shell .tkv-search-card.is-idle,
    .tkv-search-shell .tkv-search-card.is-engaged {
        grid-template-columns: 1fr;
    }

    .tkv-search-shell .tkv-search-card.is-idle .tkv-search-controls,
    .tkv-search-shell .tkv-search-card.is-engaged .tkv-search-controls {
        border-right: 0;
        border-bottom: 1px solid var(--tkv-border);
    }

    .tkv-search-shell-toggle {
        min-height: 66px;
    }
}

@media (max-width: 640px) {
    body.techaptic-knowledge-videos-page .tkv-root {
        width: calc(100vw - 24px);
    }

    .tkv-search-shell-heading small {
        display: none;
    }
}

/* ============================================================
   Phase 4 — isolated FluentPlayer frame + strict consent gate
   Functional layer only; final visual tuning intentionally deferred.
   ============================================================ */
.tkv-player-frame {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
}

.tkv-root.is-player-frame-loaded .tkv-player-frame {
    opacity: 1;
    pointer-events: auto;
}

.tkv-player-frame[hidden] {
    display: none !important;
}

.tkv-root.is-player-frame-loaded .tkv-player-poster {
    visibility: hidden;
}

.tkv-consent-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.tkv-consent-layer[hidden],
.tkv-consent-shade[hidden],
.tkv-consent-overlay[hidden] {
    display: none !important;
}

.tkv-consent-shade,
.tkv-consent-overlay {
    position: absolute;
    inset: 0;
}

.tkv-consent-shade {
    background: rgba(3, 7, 18, 0.64);
    backdrop-filter: blur(1px);
}

.tkv-consent-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    text-align: center;
    pointer-events: auto;
}

.tkv-consent-text {
    max-width: 40ch;
    margin: 0;
    color: #ffffff;
    font-family: "Source Sans 3", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: normal;
    text-transform: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.tkv-consent-btn,
html body .tkv-root button.tkv-consent-btn {
    appearance: none;
    -webkit-appearance: none;
    min-height: 38px;
    margin: 0;
    padding: 9px 18px;
    border: 0;
    border-radius: 8px;
    background: #36a016;
    color: #ffffff;
    font-family: "Montserrat", sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.2;
    letter-spacing: normal !important;
    text-transform: none !important;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.20);
}

.tkv-consent-btn:hover,
html body .tkv-root button.tkv-consent-btn:hover {
    background: #2d8612;
    color: #ffffff;
}

.tkv-consent-btn:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.tkv-consent-btn:disabled,
.tkv-consent-btn.is-loading {
    cursor: wait;
    opacity: 0.72;
}

.tkv-consent-feedback {
    max-width: 44ch;
    margin: 0;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
}

.tkv-root.tkv-consent-pending .tkv-consent-shade,
.tkv-root.tkv-consent-pending .tkv-consent-overlay {
    display: none !important;
}


/* Phase 4.3 — structural reliability: native disclosure controls. */
.tkv-search-shell > summary,
.tkv-explore > summary {
    list-style: none;
}
.tkv-search-shell > summary::-webkit-details-marker,
.tkv-explore > summary::-webkit-details-marker {
    display: none;
}
.tkv-search-shell:not([open]) > .tkv-search-shell-body,
.tkv-explore:not([open]) > .tkv-explore-body {
    display: none !important;
}
.tkv-search-shell[open] > .tkv-search-shell-toggle > .tkv-chevron,
.tkv-explore[open] > .tkv-explore-toggle > .tkv-chevron {
    transform: rotate(180deg);
}
.tkv-search-shell-toggle,
.tkv-explore-toggle {
    user-select: none;
}


/* Phase 4.5 — strict discovery gating mirrors the article consent model. */
.tkv-root.tkv-consent-pending .tkv-search-shell > summary,
.tkv-root.tkv-consent-pending .tkv-explore > summary,
.tkv-root.tkv-no-consent .tkv-search-shell > summary,
.tkv-root.tkv-no-consent .tkv-explore > summary {
    pointer-events: none;
    cursor: default;
}

.tkv-root.tkv-consent-pending .tkv-search-shell-body,
.tkv-root.tkv-consent-pending .tkv-explore-body,
.tkv-root.tkv-no-consent .tkv-search-shell-body,
.tkv-root.tkv-no-consent .tkv-explore-body {
    display: none !important;
}

/* v0.4.9: duration belongs in Video Titles metadata, never over the thumbnail. */
.tkv-result-item.is-video-result .tkv-duration-badge { display: none !important; }


/* Phase 4.13: before marketing consent, the player consent control is the
 * only interactive entry point. Context links, queue controls and discovery
 * controls stay visible for orientation but are intentionally inert. */
.tkv-context-link.is-consent-locked {
    opacity: .46;
    pointer-events: none;
    cursor: default;
}

.tkv-root.tkv-no-consent .tkv-queue,
.tkv-root.tkv-consent-pending .tkv-queue {
    --tkv-consent-disabled-opacity: .72;
}

.tkv-root.tkv-no-consent .tkv-queue-scroll,
.tkv-root.tkv-consent-pending .tkv-queue-scroll {
    pointer-events: none;
}

.tkv-tab:disabled,
.tkv-clear-queue:disabled,
.tkv-mode-button:disabled,
.tkv-advanced-toggle:disabled {
    cursor: default;
}

.tkv-root.tkv-no-consent .tkv-queue-tabs,
.tkv-root.tkv-consent-pending .tkv-queue-tabs,
.tkv-root.tkv-no-consent .tkv-clear-queue,
.tkv-root.tkv-consent-pending .tkv-clear-queue {
    opacity: .58;
}

/* ============================================================
   Phase 5.0 — Visual baseline
   Closely follows the approved early Techaptic Knowledge Videos mockup while
   preserving the newer V1 behavior (no Explore Videos, row-click playback,
   contextual queue clearing, consent gate, dynamic Category facet).
   ============================================================ */

/* Global surface rhythm. */
body.techaptic-knowledge-videos-page .tkv-root {
    --tkv-radius: 8px;
    --tkv-border: #dfe3e8;
    --tkv-muted: #667085;
    --tkv-soft: #f7f8fa;
    --tkv-active: #eff8ec;
    --tkv-shadow: 0 2px 12px rgba(41, 44, 48, 0.045);
    max-width: 1600px;
    color: var(--tkv-dark);
}

.tkv-heading {
    gap: 12px;
    margin-bottom: 14px;
}

.tkv-heading-icon {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    color: var(--tkv-purple);
}

.tkv-heading h1 {
    font-family: "Montserrat", sans-serif;
    font-size: clamp(26px, 1.85vw, 33px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.tkv-heading p {
    margin-top: 5px;
    color: #525a66;
    font-size: 14px;
    line-height: 1.35;
}

/* Player stays dominant (65/35 decision), with the cleaner mockup treatment. */
.tkv-watch-grid {
    gap: 20px;
}

.tkv-player-stage,
.tkv-queue,
.tkv-search-shell {
    border-radius: 8px;
}

.tkv-player-stage {
    box-shadow: 0 1px 5px rgba(41, 44, 48, .08);
}

/* Context links read as secondary action chips, not extra player overlays. */
.tkv-player-links {
    gap: 12px;
    min-height: 52px;
    padding: 10px 0 0;
}

.tkv-context-link {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid #e2e5e9;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(41,44,48,.025);
    font-size: 14px;
    font-weight: 700;
    transition: border-color .16s ease, color .16s ease, background .16s ease, box-shadow .16s ease;
}

.tkv-context-link:hover,
.tkv-context-link:focus-visible {
    border-color: #cfd6cc;
    background: #fbfdfb;
    color: var(--tkv-green-dark) !important;
    box-shadow: 0 2px 7px rgba(41,44,48,.05);
}

.tkv-context-icon {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
}

.tkv-external-icon {
    width: 14px;
    height: 14px;
    margin-left: 2px;
}

/* Queue */
.tkv-queue {
    border-color: #dde2e7;
    box-shadow: 0 2px 10px rgba(41,44,48,.035);
}

.tkv-queue-header {
    min-height: 58px;
    padding: 13px 16px 11px;
}

.tkv-queue h2 {
    font-family: "Montserrat", sans-serif;
    font-size: 21px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.tkv-clear-queue {
    gap: 7px;
    padding: 7px 4px;
    color: #555e6c;
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.tkv-clear-queue svg {
    width: 15px;
    height: 15px;
}

.tkv-queue-tabs {
    gap: 0;
    padding: 0 0;
    border-top: 1px solid #eef0f2;
    border-bottom: 1px solid #dfe3e8;
    background: #f8f9fa;
}

.tkv-tab {
    min-height: 44px;
    border: 0;
    border-radius: 0;
    background: #f8f9fa;
    color: #17191c;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    transition: background .16s ease, color .16s ease;
}

.tkv-tab:hover,
.tkv-tab:focus-visible {
    background: #f1f3f4;
}

.tkv-tab.is-active {
    border: 0;
    background: var(--tkv-green);
    color: #fff;
}

.tkv-tab.is-active:hover,
.tkv-tab.is-active:focus-visible {
    background: var(--tkv-green-dark);
    color: #fff;
}

.tkv-count {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    font-size: 10px;
}

.tkv-tab.is-active .tkv-count {
    background: rgba(255,255,255,.88);
    color: var(--tkv-green-dark);
}

.tkv-queue-scroll {
    background: #fff;
}

.tkv-queue-item {
    grid-template-columns: 22px 80px minmax(0, 1fr) auto 28px;
    gap: 9px;
    min-height: 66px;
    padding: 8px 9px;
    border-bottom-color: #edf0f2;
}

.tkv-queue-item.is-current {
    background: #edf7ea;
}

.tkv-current-marker {
    width: 18px;
    height: 18px;
    font-size: 13px;
}

.tkv-queue-thumb {
    width: 80px;
    border-radius: 5px;
}

.tkv-queue-title {
    font-family: "Montserrat", sans-serif;
    font-size: 12.5px;
    line-height: 1.24;
    font-weight: 700;
}

.tkv-queue-meta,
.tkv-queue-time {
    color: #667085;
    font-size: 10.8px;
}

.tkv-queue-remove {
    width: 26px;
    height: 26px;
    padding: 0;
    font-size: 19px;
}

/* Search shell and workspace */
.tkv-search-shell {
    margin-top: 12px;
    border-color: #dde2e7;
    box-shadow: 0 2px 10px rgba(41,44,48,.03);
}

.tkv-search-shell-toggle {
    min-height: 66px;
    padding: 12px 16px;
}

.tkv-search-shell-heading {
    gap: 11px;
}

.tkv-section-icon {
    width: 24px;
    height: 24px;
    color: var(--tkv-purple);
}

.tkv-search-shell-heading strong {
    font-family: "Montserrat", sans-serif;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.tkv-search-shell-heading small {
    margin-top: -1px;
    color: #667085;
    font-size: 12.5px;
}

.tkv-search-shell .tkv-search-card,
.tkv-search-shell .tkv-search-card.is-idle,
.tkv-search-shell .tkv-search-card.is-engaged {
    grid-template-columns: 360px minmax(0, 1fr);
}

.tkv-search-shell .tkv-search-card.is-idle .tkv-search-controls,
.tkv-search-shell .tkv-search-card.is-engaged .tkv-search-controls {
    padding: 15px 16px 18px;
    background: #fff;
}

.tkv-search-input-wrap {
    position: relative;
}

.tkv-search-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 42px 10px 13px;
    border: 1px solid #d7dce1;
    border-radius: 6px;
    background: #fff;
    color: var(--tkv-dark);
    font-family: "Source Sans 3", sans-serif;
    font-size: 14px;
    box-shadow: none;
}

.tkv-search-input:hover {
    border-color: #c8ced5;
}

.tkv-search-input:focus {
    border-color: #9ca3ad;
    box-shadow: 0 0 0 2px rgba(41,44,48,.055);
    outline: none;
}

.tkv-search-input-wrap > span {
    right: 13px;
    width: 19px;
    height: 19px;
    color: #56606d;
}

.tkv-search-mode {
    gap: 8px !important;
    margin-top: 10px !important;
}

.tkv-mode-button {
    min-height: 40px !important;
    border: 1px solid #d7dce1;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font-family: "Montserrat", sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.tkv-mode-button.is-active {
    border-color: var(--tkv-green);
    background: var(--tkv-green);
    color: #111;
}

.tkv-mode-button.is-active:hover,
.tkv-mode-button.is-active:focus-visible {
    background: var(--tkv-green);
    border-color: var(--tkv-green);
    color: #fff;
}

.tkv-mode-button:not(.is-active):hover,
.tkv-mode-button:not(.is-active):focus-visible {
    border-color: var(--tkv-green);
    color: var(--tkv-green-dark);
    background: #fff;
}

.tkv-advanced-toggle {
    min-height: 40px;
    margin-top: 9px !important;
    padding: 7px 1px !important;
    color: #17191c;
    font-family: "Montserrat", sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.tkv-advanced-toggle[aria-expanded="true"] {
    color: var(--tkv-purple);
}

.tkv-advanced-toggle .tkv-chevron {
    width: 16px;
    height: 16px;
}

.tkv-advanced-body {
    padding-top: 8px !important;
}

.tkv-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

/* Video Chapters has no sort in V1: do not leave an empty second control. */
.tkv-field[hidden],
.tkv-field-row [hidden] {
    display: none !important;
}

.tkv-field-row.is-category-only {
    grid-template-columns: minmax(0, 1fr);
}

.tkv-field.is-full-width {
    width: 100%;
}

.tkv-field {
    gap: 6px;
    color: #17191c;
    font-family: "Montserrat", sans-serif;
    font-size: 11.5px;
    font-weight: 700;
}

.tkv-field select {
    min-height: 40px;
    padding: 8px 34px 8px 11px;
    border: 1px solid #d7dce1;
    border-radius: 6px;
    background-color: #fff;
    color: #24272b;
    font-size: 13px;
}

.tkv-field select:focus {
    border-color: #8d949e;
    box-shadow: 0 0 0 2px rgba(41,44,48,.05);
    outline: 0;
}

.tkv-time-filter {
    margin-top: 14px;
}

.tkv-time-filter-title {
    margin-bottom: 8px;
    color: #17191c;
    font-family: "Montserrat", sans-serif;
    font-size: 11.5px;
    font-weight: 700;
}

.tkv-time-help {
    width: 18px;
    height: 18px;
    border-color: #67717e;
    color: #67717e;
    font-size: 11px;
}

.tkv-dual-range {
    height: 24px;
}

.tkv-range-track {
    height: 4px;
    border-radius: 99px;
}

.tkv-dual-range input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border: 0;
    box-shadow: none;
}

.tkv-dual-range input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: 0;
    box-shadow: none;
}

.tkv-time-values {
    margin-top: -1px;
    color: #2e3339;
    font-size: 12px;
    font-weight: 600;
}

/* Results dominate the second row, as in the reference mockup. */
.tkv-search-results {
    background: #fff;
}

.tkv-results-head {
    min-height: 45px;
    padding: 13px 18px 10px;
    border-bottom: 1px solid #edf0f2;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.tkv-search-shell .tkv-results-scroll {
    height: 420px;
    max-height: 420px;
}

.tkv-result-item {
    grid-template-columns: 118px minmax(0, 1fr) auto;
    gap: 16px;
    min-height: 88px;
    padding: 10px 14px;
    border-bottom: 1px solid #edf0f2;
    background: #fff;
    transition: background .14s ease;
}

.tkv-result-item:hover,
.tkv-result-item:focus-visible {
    background: #fafcf9;
}

.tkv-result-item.is-current {
    background: #f0f8ed;
}

.tkv-result-thumb {
    width: 118px;
    aspect-ratio: 16 / 9;
    border-radius: 5px;
}

.tkv-result-title {
    color: #24272b;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    line-height: 1.22;
    font-weight: 700;
}

.tkv-result-video-title {
    margin-top: 2px;
    color: #4e5662;
    font-family: "Montserrat", sans-serif;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 600;
}

.tkv-result-meta {
    margin-top: 4px;
    color: #69717d;
    font-family: "Source Sans 3", sans-serif;
    font-size: 11.5px;
    line-height: 1.25;
}

.tkv-result-actions {
    align-self: center;
    gap: 8px;
}

.tkv-result-button {
    min-width: 112px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid #d7dce1;
    border-radius: 6px;
    background: #fff;
    color: #24272b;
    font-family: "Montserrat", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tkv-result-button:hover,
.tkv-result-button:focus-visible {
    border-color: var(--tkv-green);
    background: #fff;
    color: var(--tkv-green-dark);
}

/* Internal scrollbars: slim and visible without dominating the layout. */
.tkv-queue-scroll,
.tkv-results-scroll {
    scrollbar-width: thin;
    scrollbar-color: #aeb4bd transparent;
}

.tkv-queue-scroll::-webkit-scrollbar,
.tkv-results-scroll::-webkit-scrollbar {
    width: 7px;
}

.tkv-queue-scroll::-webkit-scrollbar-thumb,
.tkv-results-scroll::-webkit-scrollbar-thumb {
    background: #aeb4bd;
    border-radius: 99px;
}

/* Consent state remains visibly disabled but doesn't invent new components. */
.tkv-root.tkv-no-consent .tkv-queue-tabs,
.tkv-root.tkv-consent-pending .tkv-queue-tabs,
.tkv-root.tkv-no-consent .tkv-clear-queue,
.tkv-root.tkv-consent-pending .tkv-clear-queue {
    opacity: .48;
}

/* Responsive preservation of the functional hierarchy. */
@media (max-width: 1260px) {
    .tkv-search-shell .tkv-search-card,
    .tkv-search-shell .tkv-search-card.is-idle,
    .tkv-search-shell .tkv-search-card.is-engaged {
        grid-template-columns: 330px minmax(0, 1fr);
    }

    .tkv-result-item {
        grid-template-columns: 104px minmax(0, 1fr) auto;
        gap: 12px;
    }

    .tkv-result-thumb {
        width: 104px;
    }
}

@media (max-width: 980px) {
    .tkv-search-shell .tkv-search-card,
    .tkv-search-shell .tkv-search-card.is-idle,
    .tkv-search-shell .tkv-search-card.is-engaged {
        grid-template-columns: 1fr;
    }

    .tkv-result-item {
        grid-template-columns: 110px minmax(0, 1fr) auto;
    }
}

@media (max-width: 680px) {
    .tkv-heading-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .tkv-context-link {
        flex: 1 1 auto;
        justify-content: center;
        padding-inline: 10px;
        font-size: 12.5px;
    }

    .tkv-search-shell-toggle {
        min-height: 60px;
        padding: 10px 12px;
    }

    .tkv-result-item {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 10px;
    }

    .tkv-result-thumb {
        width: 92px;
    }

    .tkv-result-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
    }

    .tkv-result-button {
        width: 100%;
    }

    .tkv-field-row {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   Phase 5.1 — targeted visual refinement
   Only the explicitly reviewed visual details below are changed.
   ============================================================ */

/* 1, 7, final note: primary/section icons are neutral black. The primary
 * Knowledge Videos icon spans the title/subtitle block without distortion. */
.tkv-heading {
    align-items: center;
}

.tkv-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    color: #111111;
}

.tkv-heading-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tkv-section-icon {
    color: #111111;
}

/* 2: Clear action changes only its text on hover/focus. The trash icon and
 * background stay neutral so the action does not read as a large CTA. */
.tkv-clear-queue,
.tkv-clear-queue:hover,
.tkv-clear-queue:focus-visible {
    background: transparent !important;
    color: #555e6c;
    box-shadow: none !important;
}

.tkv-clear-queue [data-tkv-clear-label] {
    transition: color .16s ease;
}

.tkv-clear-queue:hover [data-tkv-clear-label],
.tkv-clear-queue:focus-visible [data-tkv-clear-label] {
    color: var(--tkv-purple);
}

/* My Queue is the only mixed-case section title in this block; preserve the
 * actual localized label rather than inheriting any theme uppercase rule. */
.tkv-queue h2 {
    text-transform: none !important;
}

/* 3, 4, 11 and final note: both queue tabs and search-mode buttons use the
 * same rounded selection language.
 * - selected: green + white
 * - unselected hover/focus: green + black
 * - neutral: white/soft + black */
.tkv-queue-tabs {
    gap: 6px;
    padding: 6px;
    background: #f8f9fa;
}

.tkv-tab {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #17191c;
}

.tkv-tab:not(.is-active):hover,
.tkv-tab:not(.is-active):focus-visible {
    border-color: var(--tkv-green);
    background: var(--tkv-green);
    color: #111111;
}

.tkv-tab.is-active,
.tkv-tab.is-active:hover,
.tkv-tab.is-active:focus-visible {
    border-color: var(--tkv-green);
    background: var(--tkv-green);
    color: #ffffff;
}

.tkv-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    line-height: 1;
    vertical-align: middle;
    transform: translateY(-1px);
    transition: background-color .16s ease, color .16s ease;
}

.tkv-tab:not(.is-active):hover .tkv-count,
.tkv-tab:not(.is-active):focus-visible .tkv-count {
    background: rgba(255, 255, 255, .92);
    color: #111111;
}

.tkv-tab.is-active .tkv-count,
.tkv-tab.is-active:hover .tkv-count,
.tkv-tab.is-active:focus-visible .tkv-count {
    background: rgba(255, 255, 255, .92);
    color: var(--tkv-green-dark);
}

.tkv-mode-button {
    border-radius: 10px !important;
    background: #ffffff;
    color: #111111;
}

.tkv-mode-button:not(.is-active):hover,
.tkv-mode-button:not(.is-active):focus-visible {
    border-color: var(--tkv-green);
    background: var(--tkv-green);
    color: #111111;
}

.tkv-mode-button.is-active,
.tkv-mode-button.is-active:hover,
.tkv-mode-button.is-active:focus-visible {
    border-color: var(--tkv-green);
    background: var(--tkv-green);
    color: #ffffff;
}

/* 5: non-current queue rows intentionally have no pseudo-menu/grip marker.
 * Keep the column so thumbnails and text stay aligned. */
.tkv-current-marker:empty {
    visibility: hidden;
}

/* 6: Full Guide icon follows its text color: neutral by default, green on
 * hover/focus. YouTube retains its familiar red brand icon. */
.tkv-context-icon-guide {
    color: currentColor;
}

.tkv-guide-link:hover .tkv-context-icon-guide,
.tkv-guide-link:focus-visible .tkv-context-icon-guide {
    color: currentColor;
}

/* 8: Search & Discover disclosure animation is driven by JS using the same
 * 0.32s cubic-bezier height / 0.24s opacity timing as the article chapter
 * panel. These base properties prevent visual snapping during the transition. */
.tkv-search-shell-body {
    transform-origin: top center;
}

/* 9: temporarily triple the desktop footer breathing room for visual review. */
body.techaptic-knowledge-videos-page #content.site-content {
    padding-bottom: 144px !important;
}

/* 12: Advanced is a text disclosure, not a pill/button. Collapsed = dark;
 * hover/open = green. No background change. Per the requested visual behavior,
 * the chevron remains pointing down in either state. */
.tkv-advanced-toggle,
.tkv-advanced-toggle:hover,
.tkv-advanced-toggle:focus-visible,
.tkv-advanced-toggle[aria-expanded="true"] {
    min-height: 0;
    padding: 8px 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

.tkv-advanced-toggle {
    color: #17191c;
}

.tkv-advanced-toggle:hover,
.tkv-advanced-toggle:focus-visible,
.tkv-advanced-toggle[aria-expanded="true"] {
    color: var(--tkv-green);
}

.tkv-advanced-toggle[aria-expanded="true"] .tkv-chevron {
    transform: none !important;
}

/* 13 + previously agreed From/To visual clarification. */
.tkv-time-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.tkv-time-help-mark {
    display: block;
    line-height: 1;
    transform: translateY(-1px);
}

.tkv-dual-range {
    isolation: isolate;
}

.tkv-range-track {
    z-index: 1;
    height: 4px;
    border: 0;
    box-shadow: none;
}

.tkv-dual-range input[type="range"] {
    z-index: 2;
    -webkit-appearance: none !important;
    appearance: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0;
}

.tkv-dual-range input[data-tkv-time-from] {
    z-index: 3;
}

.tkv-dual-range input[data-tkv-time-to] {
    z-index: 4;
}

.tkv-dual-range input[type="range"]::-webkit-slider-runnable-track {
    height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tkv-dual-range input[type="range"]::-moz-range-track {
    height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tkv-dual-range input[type="range"]::-moz-range-progress {
    height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tkv-dual-range input[type="range"]::-webkit-slider-thumb {
    position: relative;
    z-index: 5;
    cursor: grab;
}

.tkv-dual-range input[type="range"]::-moz-range-thumb {
    cursor: grab;
}

.tkv-dual-range input[type="range"]:active::-webkit-slider-thumb {
    cursor: grabbing;
}

.tkv-dual-range input[type="range"]:active::-moz-range-thumb {
    cursor: grabbing;
}

.tkv-time-values {
    align-items: center;
    margin-top: 3px;
}

.tkv-time-value {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}

.tkv-time-value-to {
    justify-content: flex-end;
    text-align: right;
}

.tkv-time-edge-label {
    color: #69717d;
    font-family: "Source Sans 3", sans-serif;
    font-size: 10.5px;
    font-weight: 600;
}

.tkv-time-value output {
    color: #24272b;
    font-weight: 700;
}

@media (max-width: 680px) {
    .tkv-heading-icon {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }

    body.techaptic-knowledge-videos-page #content.site-content {
        padding-bottom: 96px !important;
    }
}


/* ============================================================
   Phase 5.2 — focused interaction-state refinement
   Functional search/queue/consent/playback logic is unchanged.
   ============================================================ */

/* Keep the primary Knowledge Videos icon at the current title+subtitle scale.
 * It already reads as the page identity without competing with the player. */

/* Search & Discover is a disclosure, so provide a visible but restrained
 * interaction/state cue:
 *   closed = neutral black
 *   closed hover/focus = Techaptic green
 *   open = Techaptic purple
 * The subtitle stays muted so only the actionable heading/icon/chevron move. */
.tkv-search-shell-toggle .tkv-section-icon,
.tkv-search-shell-toggle .tkv-search-shell-heading strong,
.tkv-search-shell-toggle > .tkv-chevron {
    color: #17191c;
    transition: color .16s ease, transform .22s ease;
}

.tkv-search-shell:not([open]) > .tkv-search-shell-toggle:hover .tkv-section-icon,
.tkv-search-shell:not([open]) > .tkv-search-shell-toggle:focus-visible .tkv-section-icon,
.tkv-search-shell:not([open]) > .tkv-search-shell-toggle:hover .tkv-search-shell-heading strong,
.tkv-search-shell:not([open]) > .tkv-search-shell-toggle:focus-visible .tkv-search-shell-heading strong,
.tkv-search-shell:not([open]) > .tkv-search-shell-toggle:hover > .tkv-chevron,
.tkv-search-shell:not([open]) > .tkv-search-shell-toggle:focus-visible > .tkv-chevron {
    color: var(--tkv-green);
}

.tkv-search-shell[open] > .tkv-search-shell-toggle .tkv-section-icon,
.tkv-search-shell[open] > .tkv-search-shell-toggle .tkv-search-shell-heading strong,
.tkv-search-shell[open] > .tkv-search-shell-toggle > .tkv-chevron,
.tkv-search-shell[open] > .tkv-search-shell-toggle:hover .tkv-section-icon,
.tkv-search-shell[open] > .tkv-search-shell-toggle:focus-visible .tkv-section-icon,
.tkv-search-shell[open] > .tkv-search-shell-toggle:hover .tkv-search-shell-heading strong,
.tkv-search-shell[open] > .tkv-search-shell-toggle:focus-visible .tkv-search-shell-heading strong,
.tkv-search-shell[open] > .tkv-search-shell-toggle:hover > .tkv-chevron,
.tkv-search-shell[open] > .tkv-search-shell-toggle:focus-visible > .tkv-chevron {
    color: var(--tkv-purple);
}

/* Context actions: only the text changes to green on hover. The semantic icons
 * stay fixed so Guide remains purple, YouTube remains red, and the external
 * link glyph remains neutral. */
.tkv-context-icon-guide,
.tkv-guide-link:hover .tkv-context-icon-guide,
.tkv-guide-link:focus-visible .tkv-context-icon-guide {
    color: var(--tkv-purple) !important;
}

.tkv-context-icon-youtube,
.tkv-youtube-link:hover .tkv-context-icon-youtube,
.tkv-youtube-link:focus-visible .tkv-context-icon-youtube {
    color: var(--tkv-youtube) !important;
}

.tkv-context-link .tkv-external-icon,
.tkv-context-link:hover .tkv-external-icon,
.tkv-context-link:focus-visible .tkv-external-icon {
    color: var(--tkv-dark) !important;
}

/* Clear Videos / Clear Chapters: text-only green hover, trash icon neutral. */
.tkv-clear-queue:hover [data-tkv-clear-label],
.tkv-clear-queue:focus-visible [data-tkv-clear-label] {
    color: var(--tkv-green) !important;
}

/* Advanced state model:
 * collapsed = dark, hover = green, expanded = purple.
 * Explicit child/currentColor rules prevent browser/theme button focus styles
 * from making the label appear to disappear after toggling. */
.tkv-advanced-toggle,
.tkv-advanced-toggle > span:first-child,
.tkv-advanced-toggle .tkv-chevron {
    color: #17191c !important;
    -webkit-text-fill-color: currentColor;
    opacity: 1 !important;
    visibility: visible !important;
}

.tkv-advanced-toggle:not([aria-expanded="true"]):hover,
.tkv-advanced-toggle:not([aria-expanded="true"]):focus-visible,
.tkv-advanced-toggle:not([aria-expanded="true"]):hover > span:first-child,
.tkv-advanced-toggle:not([aria-expanded="true"]):focus-visible > span:first-child,
.tkv-advanced-toggle:not([aria-expanded="true"]):hover .tkv-chevron,
.tkv-advanced-toggle:not([aria-expanded="true"]):focus-visible .tkv-chevron {
    color: var(--tkv-green) !important;
}

.tkv-advanced-toggle[aria-expanded="true"],
.tkv-advanced-toggle[aria-expanded="true"] > span:first-child,
.tkv-advanced-toggle[aria-expanded="true"] .tkv-chevron,
.tkv-advanced-toggle[aria-expanded="true"]:hover,
.tkv-advanced-toggle[aria-expanded="true"]:focus-visible,
.tkv-advanced-toggle[aria-expanded="true"]:hover > span:first-child,
.tkv-advanced-toggle[aria-expanded="true"]:focus-visible > span:first-child,
.tkv-advanced-toggle[aria-expanded="true"]:hover .tkv-chevron,
.tkv-advanced-toggle[aria-expanded="true"]:focus-visible .tkv-chevron {
    color: var(--tkv-purple) !important;
}

/* Range geometry: Chrome/WebKit positions the thumb relative to the native
 * track box. Because that box is intentionally zero-height, -9px centers an
 * 18px thumb exactly on our custom visual track. Firefox already centers its
 * thumb on the custom range box. */
.tkv-dual-range input[type="range"]::-webkit-slider-thumb {
    margin-top: -9px !important;
}

/* Hovering an actual playable queue/result row now communicates the target by
 * changing only its primary title. Metadata stays muted and stable. */
.tkv-queue-title,
.tkv-result-title {
    transition: color .15s ease;
}

.tkv-queue-item:hover .tkv-queue-title,
.tkv-queue-item:focus-within .tkv-queue-title,
.tkv-result-item:hover .tkv-result-title,
.tkv-result-item:focus-visible .tkv-result-title {
    color: var(--tkv-green-dark) !important;
}

/* Search result queue membership is persistent within the current custom
 * queue, not merely a one-click/focus flash. The initial newest-first default
 * discovery queue is deliberately not painted green. */
.tkv-result-item.is-queued,
.tkv-result-item.is-queued:hover,
.tkv-result-item.is-queued:focus-visible {
    background: var(--tkv-active) !important;
}


/* ============================================================
   Phase 5.3 — queue-membership and micro-alignment refinement
   Functional search/queue/consent/playback/cache logic unchanged.
   ============================================================ */

/* Queue membership belongs to the action itself, not the whole result row.
 * Keep result rows neutral so green is not overloaded as both hover/current
 * position and persistent membership state. */
.tkv-result-item.is-queued,
.tkv-result-item.is-queued:hover,
.tkv-result-item.is-queued:focus-visible {
    background: transparent !important;
}

.tkv-result-item.is-queued:hover,
.tkv-result-item.is-queued:focus-visible {
    background: #fafcf9 !important;
}

.tkv-result-item.is-queued .tkv-result-button {
    border-color: var(--tkv-green-dark) !important;
    background: var(--tkv-green-dark) !important;
    color: #fff !important;
}

.tkv-result-item.is-queued .tkv-result-button:hover,
.tkv-result-item.is-queued .tkv-result-button:focus-visible {
    border-color: var(--tkv-green) !important;
    background: var(--tkv-green) !important;
    color: #fff !important;
}

/* The circular information glyph was optically high beside the label. Keep
 * its box unchanged and lower the whole glyph slightly. */
.tkv-time-help {
    position: relative;
    top: 4px;
}

/* Align the trash glyph with the Clear label's visual baseline and make the
 * stroke slightly more legible without enlarging the icon footprint. */
.tkv-clear-queue > span:first-child {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    line-height: 1;
    position: relative;
    top: -1px;
    flex: 0 0 16px;
}

.tkv-clear-queue > span:first-child svg {
    display: block;
    width: 16px !important;
    height: 16px !important;
}

.tkv-clear-queue > span:first-child svg path {
    stroke-width: 2.05;
}


/* v0.5.5: Astra/browser button focus can temporarily override the clear-action
 * text color after a mouse click. Keep the label explicitly visible in every
 * focus/active state; only hover/focus-visible receives the green affordance. */
.tkv-clear-queue,
.tkv-clear-queue:focus,
.tkv-clear-queue:active,
.tkv-clear-queue:focus-visible {
    background: transparent !important;
    color: #555e6c !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tkv-clear-queue [data-tkv-clear-label],
.tkv-clear-queue:focus [data-tkv-clear-label],
.tkv-clear-queue:active [data-tkv-clear-label] {
    color: #555e6c !important;
    -webkit-text-fill-color: currentColor !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tkv-clear-queue:hover [data-tkv-clear-label],
.tkv-clear-queue:focus-visible [data-tkv-clear-label] {
    color: var(--tkv-green) !important;
    -webkit-text-fill-color: currentColor !important;
}

.tkv-clear-queue > span:first-child,
.tkv-clear-queue:focus > span:first-child,
.tkv-clear-queue:active > span:first-child,
.tkv-clear-queue:focus-visible > span:first-child {
    color: #555e6c !important;
    opacity: 1 !important;
    visibility: visible !important;
}
\n\n/* ============================================================\n   v0.5.6 — final Chapter Start Range info-glyph optical alignment\n   ============================================================ */\n.tkv-time-filter-title {\n    align-items: center;\n}\n\n.tkv-time-help {\n    position: relative;\n    top: 1px;\n}\n\n.tkv-time-help-mark {\n    line-height: 1;\n    transform: translateY(1px) !important;\n}\n

/* ============================================================
   v0.5.6.5 — small alignment polish only
   ============================================================ */
/* Keep the external-link glyph on the same optical row as the action label. */
.tkv-context-link > span:nth-child(2) {
    display: inline-block;
    line-height: 1.2;
}

.tkv-external-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    line-height: 1;
    position: relative;
    top: -1px;
}

.tkv-external-icon svg {
    display: block;
    width: 15px !important;
    height: 15px !important;
}

/* Keep the Chapter Start Range helper circle and inner mark centered on the
 * same row as the label text. */
.tkv-time-filter-title {
    align-items: center;
}

.tkv-time-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
    position: relative;
    top: -1px;
}

.tkv-time-help-mark {
    display: block;
    line-height: 1;
    transform: none !important;
    position: relative;
    top: 0;
}
