
/* ==================================================
   KYLMSC — SKY MASTERS SWIMMING
   Complete responsive stylesheet
   ================================================== */

:root {
    --km-purple: #39208f;
    --km-purple2: #5b42ad;
    --km-ink: #171650;
    --km-muted: #67708b;
    --km-border: #dfe4f2;
    --km-bg: #f5f8ff;
    --km-light-purple: #f0edff;
}

/* GENERAL */

html {
    box-sizing: border-box;
    padding: 0 !important;
    background: var(--km-bg) !important;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body.kylmsc-site {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow-x: hidden;
    background: linear-gradient(#fff, var(--km-bg)) !important;
    color: var(--km-ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.kylmsc-site a {
    color: var(--km-purple);
}

[hidden],
.km-hidden-search {
    display: none !important;
}

/* HEADER */

.km-header {
    position: relative;
    z-index: 1000;
    background: white;
    border-bottom: 1px solid var(--km-border);
}

.km-header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    min-height: 88px;
    padding: 10px 24px;
}

.km-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    text-decoration: none !important;
}

    .km-brand img {
        width: 106px;
        max-height: 70px;
        height: auto;
        object-fit: contain;
    }

    .km-brand span {
        display: grid;
        line-height: 1.25;
    }

    .km-brand strong {
        font-size: 14px;
        letter-spacing: .05em;
    }

    .km-brand small {
        color: var(--km-muted);
        font-size: 12px;
    }

/* DESKTOP NAVIGATION */

.km-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    margin-left: auto;
}

    .km-nav a {
        display: block;
        padding: 12px 10px;
        border-radius: 8px;
        color: var(--km-ink) !important;
        font-size: 14px;
        font-weight: 650;
        text-decoration: none !important;
    }

        .km-nav a:hover,
        .km-nav a.active {
            background: var(--km-light-purple) !important;
            color: var(--km-purple) !important;
        }

.km-menu-button {
    display: none;
}

/* PAGE LAYOUT */

.km-page,
.kylmsc-site .km-page.km-page-full-width {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 70vh;
    margin: 0 auto;
    padding: 24px 24px 40px;
}

.km-horizontal-page,
.km-state-page {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-top: 0;
}

.km-page-heading {
    display: none !important;
}

/* PAGE NAME AND SELECTED FILTERS */

.km-current-page-bar {
    display: block;
    width: 100%;
    margin-bottom: 18px;
    padding: 12px 0 18px;
    border-bottom: 1px solid #d9e0f1;
}

.km-current-page-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.km-current-page-title {
    display: block;
    margin: 0;
    padding: 0;
    color: #30236b;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.25;
}

.km-selected-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.km-selected-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    border: 1px solid #d7c9f2;
    border-radius: 20px;
    background: #f0ebfa;
    color: #493184;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.km-selected-filter-label {
    font-weight: 800;
}

.km-selected-filter-value {
    font-weight: 600;
}

/* HORIZONTAL FILTER BAR */

.km-top-filter-panel {
    display: block;
    width: 100%;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #d9e0f1;
    border-radius: 12px;
    background: #f8faff;
}

.km-top-filter-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

.km-top-filter-form {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    flex: 1 1 auto;
    gap: 12px;
    min-width: 0;
    margin: 0;
}

.km-top-filter-field {
    display: flex;
    flex-direction: column;
    flex: 1 1 125px;
    gap: 5px;
    min-width: 105px;
    max-width: 220px;
}

    .km-top-filter-field label,
    .km-top-filter-search label {
        display: block;
        color: #30236b;
        font-size: 12px;
        font-weight: 700;
    }

.km-top-filter-select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 8px 10px;
    border: 1px solid #cbd3e8;
    border-radius: 8px;
    background: white;
    color: #17164c;
    font-size: 14px;
    cursor: pointer;
    appearance: auto;
}

.km-top-filter-search {
    display: flex;
    flex-direction: column;
    flex: 1 1 220px;
    gap: 5px;
    min-width: 180px;
}

    .km-top-filter-search input {
        display: block;
        width: 100%;
        height: 44px;
        padding: 10px 12px;
        border: 1px solid #cbd3e8;
        border-radius: 8px;
        background: white;
        color: #17164c;
        font-size: 14px;
    }

        .km-top-filter-select:focus,
        .km-top-filter-search input:focus {
            outline: 2px solid var(--km-purple2);
            outline-offset: 1px;
        }

/* RESULTS LAYOUT */

.km-horizontal-content,
.km-state-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 260px);
    align-items: start;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

    .km-horizontal-content.km-no-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

.km-filter-panel,
.km-results-panel,
.km-stats-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 18px;
    border: 1px solid var(--km-border);
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px #2222550d;
}

.km-results-panel,
.km-stats-panel {
    overflow: hidden;
}

    .km-filter-panel h2,
    .km-stats-panel h2,
    .km-section-heading h2 {
        margin: 0 0 14px;
        color: var(--km-ink);
        font-size: 18px;
    }

    .km-stats-panel h2 {
        padding-bottom: 12px;
        border-bottom: 2px solid #eee9ff;
        color: var(--km-purple);
    }

.km-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--km-border);
}

/* LEGACY WORKSPACE SUPPORT */

.km-workspace {
    display: grid;
    grid-template-columns: minmax(230px, 250px) minmax(0, 1fr) minmax(240px, 280px);
    align-items: start;
    gap: 20px;
    width: 100%;
}

    .km-workspace:not(:has(.km-stats-panel)) {
        grid-template-columns: minmax(230px, 250px) minmax(0, 1fr);
    }

    .km-workspace select,
    .km-workspace input,
    .km-workspace button {
        max-width: 100%;
    }

/* LEGACY FILTER CONTROLS */

.km-record-filter-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.km-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

    .km-filter-field label {
        color: #30236b;
        font-size: 13px;
        font-weight: 700;
    }

.km-filter-select,
.km-filter-panel select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cbd0e5;
    border-radius: 8px;
    background: white;
    color: #262344;
    font-size: 14px;
    cursor: pointer;
}

.km-filter-panel select {
    margin-bottom: 10px;
}

.km-filter-select:focus {
    outline: 2px solid #7357c9;
    outline-offset: 2px;
}

.km-filter-button {
    width: 100%;
    min-height: 44px;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #4c2d9d;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

    .km-filter-button:hover {
        background: #382077;
    }

/* TABLE SEARCH */

.km-search-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    color: var(--km-muted);
    font-size: 12px;
}

.km-table-search {
    min-width: 210px;
    padding: 10px 12px;
    border: 1px solid var(--km-border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
}

.km-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

/* COLLAPSIBLE RECORDS */

.km-state-records {
    width: 100%;
}

.km-age-group {
    margin-bottom: 10px;
    overflow: hidden;
    border: 1px solid #d8def0;
    border-radius: 9px;
    background: white;
}

.km-age-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    padding: 14px 18px;
    border: 0;
    border-radius: 6px;
    background: linear-gradient( 90deg, var(--km-purple), var(--km-purple2) );
    color: white;
    font-size: 19px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    user-select: none;
}

.km-age-group > .km-age-heading {
    margin-top: 0;
    border-radius: 0;
}

.km-age-heading:hover {
    background: #28166d;
}

.km-age-heading::after {
    content: "▼";
    margin-left: 12px;
}

.km-age-heading[aria-expanded="true"]::after {
    content: "▲";
}

.km-age-heading.collapsed::after {
    content: "▼";
}

.km-age-heading:focus-visible {
    outline: 3px solid #ffc107;
    outline-offset: -3px;
}

/* RECORD TABLES */

.km-results-panel table,
.km-records-table,
.km-top-times-table,
.km-athlete-table,
.km-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .km-results-panel th,
    .km-results-panel td,
    .km-records-table th,
    .km-records-table td,
    .km-top-times-table th,
    .km-top-times-table td,
    .km-athlete-table th,
    .km-athlete-table td,
    .km-stats-table th,
    .km-stats-table td {
        padding: 10px 12px;
        border-bottom: 1px solid #e5e9f2;
    }

    .km-results-panel th,
    .km-records-table th,
    .km-top-times-table th,
    .km-athlete-table th,
    .km-stats-table th {
        background: #f1f3ff;
        color: #15154f;
        font-weight: 700;
        text-align: left;
    }

    .km-records-table tbody tr:nth-child(even),
    .km-top-times-table tbody tr:nth-child(even),
    .km-athlete-table tbody tr:nth-child(even),
    .km-stats-table tbody tr:nth-child(even) {
        background: #f7f9ff;
    }

    .km-records-table tbody tr.km-highlight-record {
        background: #fff2a8;
    }

.km-record-time,
.km-swim-count {
    color: var(--km-purple);
    font-weight: 700;
}

.km-swim-count {
    font-variant-numeric: tabular-nums;
}

.km-athlete-table .km-record-time {
    white-space: nowrap;
}

/* TOP TIMES, ATHLETE PROFILE, STATS */

.km-top-times,
.km-athlete-results,
.km-stats-results {
    width: 100%;
    overflow: hidden;
    border: 1px solid #d8def0;
    border-radius: 10px;
    background: white;
}

.km-top-times-heading,
.km-athlete-results-heading,
.km-stats-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 20px;
    background: linear-gradient( 90deg, var(--km-purple), var(--km-purple2) );
    color: white;
}

    .km-top-times-heading h2,
    .km-athlete-results-heading h2,
    .km-stats-results-heading h2 {
        margin: 0;
        color: white;
        font-size: 20px;
    }

.km-result-count {
    padding: 6px 12px;
    border-radius: 20px;
    background: #ffffff2e;
    font-size: 13px;
    white-space: nowrap;
}

.km-rank-cell {
    text-align: center;
}

.km-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border-radius: 8px;
    background: #ede8ff;
    color: var(--km-purple);
    font-weight: 700;
}

.km-athlete-name {
    color: #15154f;
    font-weight: 600;
}

.km-meet-name {
    color: #15154f;
    font-weight: 500;
}

.km-no-results {
    padding: 20px;
    color: #68708b;
}

.km-stats-table th:first-child,
.km-stats-table td:first-child {
    width: 15%;
    text-align: center;
}

.km-stats-table th:last-child,
.km-stats-table td:last-child {
    width: 20%;
    text-align: center;
}

.km-stats-panel table {
    width: 100%;
    border-collapse: collapse;
}

.km-stats-panel th,
.km-stats-panel td {
    overflow-wrap: anywhere;
}

/* FOOTER */

.km-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 24px;
    border-top: 1px solid var(--km-border);
    background: white;
    color: var(--km-muted);
    font-size: 13px;
}

/* TABLET */

@media (max-width: 1100px) {

    .km-header-inner {
        flex-wrap: wrap;
    }

    .km-nav {
        margin-left: 0;
    }

    .km-workspace,
    .km-workspace:not(:has(.km-stats-panel)) {
        grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
    }

        .km-workspace .km-stats-panel {
            grid-column: 1 / -1;
        }
}

@media (max-width: 1050px) {

    .km-horizontal-content,
    .km-state-content {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1000px) {

    .kylmsc-site .km-page.km-page-full-width {
        padding: 18px 16px 30px;
    }

    .km-top-filter-field {
        max-width: none;
    }
}

/* ==========================================
   MOBILE NAVIGATION — FIXED
   ========================================== */

@media (max-width: 760px) {

    .km-header {
        position: relative;
        z-index: 1000;
    }

    .km-header-inner {
        position: relative;
        min-height: 72px;
        padding: 10px 16px;
        flex-wrap: nowrap;
    }

    .km-brand img {
        width: 76px;
    }

    .km-brand strong {
        font-size: 12px;
    }

    /* Hamburger button */

    .km-menu-button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 1002;
        min-width: 44px;
        min-height: 44px;
        margin-left: auto;
        padding: 8px;
        border: 0;
        border-radius: 8px;
        background: #f1edff;
        color: var(--km-purple);
        font-size: 23px;
        cursor: pointer;
    }

    /* Closed menu */

    .km-nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1001;
        width: 100%;
        margin: 0;
        padding: 12px 16px;
        border-bottom: 2px solid var(--km-purple);
        background: white;
        box-shadow: 0 12px 20px rgba(23, 22, 80, .15);
    }

        /* Open menu — matches JavaScript km-open */

        .km-nav.km-open {
            display: flex !important;
            flex-direction: column;
            align-items: stretch;
            gap: 4px;
        }

            .km-nav.km-open a {
                display: block;
                width: 100%;
                min-height: 44px;
                padding: 13px 16px;
                border-radius: 8px;
                color: var(--km-ink) !important;
                font-size: 15px;
                font-weight: 650;
                text-decoration: none !important;
            }

                .km-nav.km-open a:hover,
                .km-nav.km-open a.active {
                    background: var(--km-light-purple) !important;
                    color: var(--km-purple) !important;
                }

    /* Stack legacy panels */

    .km-workspace,
    .km-workspace:not(:has(.km-stats-panel)) {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .km-filter-panel,
    .km-results-panel,
    .km-stats-panel {
        padding: 14px;
    }

    .km-workspace .km-filter-panel {
        order: 1;
    }

    .km-workspace .km-results-panel {
        order: 2;
    }

    .km-workspace .km-stats-panel {
        order: 3;
    }

    .km-table-search {
        width: 100%;
        min-width: 0;
    }

    .km-footer {
        flex-direction: column;
    }
}

/* SMALL TABLES */

@media (max-width: 700px) {

    .km-top-times-heading,
    .km-athlete-results-heading,
    .km-stats-results-heading {
        padding: 14px;
    }

        .km-top-times-heading h2,
        .km-athlete-results-heading h2,
        .km-stats-results-heading h2 {
            font-size: 17px;
        }

    .km-top-times-table {
        min-width: 720px;
        font-size: 12px;
    }

    .km-athlete-table {
        min-width: 560px;
        font-size: 12px;
    }

        .km-top-times-table th,
        .km-top-times-table td,
        .km-athlete-table th,
        .km-athlete-table td,
        .km-stats-table th,
        .km-stats-table td {
            padding: 9px 8px;
            font-size: 12px;
        }
}

/* PHONE FILTER LAYOUT */

@media (max-width: 650px) {

    .kylmsc-site .km-page.km-page-full-width {
        padding: 14px 10px 24px;
    }

    .km-current-page-title {
        font-size: 22px;
    }

    .km-current-page-bar {
        padding-bottom: 12px;
    }

    .km-selected-filter-badge {
        padding: 6px 10px;
        font-size: 12px;
    }

    .km-top-filter-panel {
        padding: 10px;
    }

    .km-top-filter-row {
        display: block;
    }

    .km-top-filter-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        width: 100%;
    }

    .km-top-filter-field {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .km-top-filter-search {
        width: 100%;
        min-width: 0;
        margin-top: 10px;
    }

    .km-horizontal-content,
    .km-state-content {
        gap: 14px;
    }
}

@media (max-width: 600px) {

    .km-age-heading {
        padding: 13px 14px;
        font-size: 17px;
    }

    .km-records-table {
        min-width: 580px;
    }

        .km-records-table th,
        .km-records-table td {
            padding: 8px;
            font-size: 12px;
        }
}

/* ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* ============================================
   KYLMSC MOBILE NAVIGATION REPAIR
   ============================================ */

@media (max-width: 760px) {

    /* Keep header above page content */
    .km-header {
        position: relative !important;
        z-index: 9999 !important;
        overflow: visible !important;
    }

    .km-header-inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        position: relative !important;
        min-height: 70px !important;
        padding: 10px 15px !important;
        overflow: visible !important;
    }

    /* Hamburger button */
    .km-menu-button {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        margin: 0 0 0 auto !important;
        padding: 0 !important;
        border: 1px solid #dcd5f5 !important;
        border-radius: 8px !important;
        background: #f0edff !important;
        color: #39208f !important;
        font-size: 24px !important;
        line-height: 1 !important;
        cursor: pointer;
        z-index: 10001 !important;
    }

    /* Navigation when closed */
    .km-header .km-nav {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-height: 70vh !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 8px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        border: 1px solid #ded9ef !important;
        border-radius: 0 0 12px 12px !important;
        background: #fff !important;
        box-shadow: 0 12px 24px rgba(23,22,80,.18) !important;
        z-index: 10000 !important;
    }

    /* Navigation when opened */
    .km-header .km-nav.km-open {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 3px !important;
    }

    /* Each navigation link */
    .km-header .km-nav a {
        display: block !important;
        position: static !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        height: auto !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 12px 15px !important;
        border: 0 !important;
        border-radius: 8px !important;
        background: transparent !important;
        color: #171650 !important;
        font-family: Arial, sans-serif !important;
        font-size: 15px !important;
        font-weight: 650 !important;
        line-height: 22px !important;
        letter-spacing: normal !important;
        text-align: left !important;
        text-decoration: none !important;
        white-space: normal !important;
        overflow-wrap: break-word !important;
    }

    .km-header .km-nav a:hover,
    .km-header .km-nav a.active {
        background: #f0edff !important;
        color: #39208f !important;
    }

    /* Avoid inherited vertical or rotated text */
    .km-header .km-nav,
    .km-header .km-nav a {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        transform: none !important;
    }
}

/* ==========================================
   PAGE TITLE AND SELECTED FILTERS
   SAME HORIZONTAL LINE
   ========================================== */

.km-current-page-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px 24px !important;
    width: 100% !important;
}

.km-current-page-title {
    flex: 0 0 auto !important;
    margin: 0 !important;
    white-space: nowrap;
}

.km-selected-filters {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    flex: 1 1 auto !important;
    width: auto !important;
    gap: 8px !important;
    margin: 0 !important;
}

/* Smaller screens: keep the badges readable */

@media (max-width: 650px) {

    .km-current-page-info {
        align-items: flex-start !important;
    }

    .km-current-page-title {
        font-size: 21px !important;
    }

    .km-selected-filters {
        justify-content: flex-start !important;
    }
}

/* ==========================================
   SELECTED FILTERS - VALUES ONLY
   ========================================== */

/* Hide Gender, Course, Age Group, etc. labels */
.km-selected-filter-label {
    display: none !important;
}

/* Show only the selected filter value */
.km-selected-filter-value {
    display: none !important;
    /*display: inline !important;*/
    /*    font-weight: 600;*/
}

/* Keep badges on same line as page title */
.km-current-page-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px 24px !important;
}

.km-selected-filters {
    display: none !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    flex: 1 1 auto !important;
    width: auto !important;
    gap: 8px !important;
}

/* ==========================================
   HIDE SELECTED FILTER BREADCRUMBS
   ========================================== */

.km-selected-filters {
    display: none !important;
}

/* ==========================================
   COMPLETELY REMOVE FILTER BREADCRUMBS
   INCLUDING EMPTY CIRCLES
   ========================================== */

.km-selected-filters,
.km-selected-filter,
.km-selected-filter-label,
.km-selected-filter-value {
    display: none !important;
}

/* Remove any leftover badge spacing */
.km-selected-filters {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    width: 0 !important;
    height: 0 !important;
}

/* ==========================================
   ALIGN SEARCH RECORDS WITH FILTER DROPDOWNS
   ========================================== */

/* Align all filter fields along the bottom */
.km-top-filter-form {
    align-items: end;
}

    /* Make search inputs and dropdowns consistent */
    .km-top-filter-form input[type="search"],
    .km-top-filter-form input[type="text"],
    .km-top-filter-form select {
        box-sizing: border-box;
        height: 42px;
        min-height: 42px;
        margin-top: 0;
        margin-bottom: 0;
    }

/* Keep filter field spacing consistent */
.km-top-filter-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

    /* Prevent search field from getting extra spacing */
    .km-top-filter-field input[type="search"],
    .km-top-filter-field input[type="text"] {
        width: 100%;
    }

/* ==========================================
   ALIGN SEARCH BOX WITH FILTER DROPDOWNS
   ========================================== */

.km-top-filter-search,
.km-top-filter-field {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-self: end !important;
    min-width: 0;
}

    /* Match label height and spacing */
    .km-top-filter-search label,
    .km-top-filter-field label {
        display: block !important;
        margin: 0 0 6px 0 !important;
        padding: 0 !important;
        line-height: 18px !important;
    }

    /* Match search input and dropdown dimensions */
    .km-top-filter-search .km-table-search,
    .km-top-filter-field .km-top-filter-select {
        box-sizing: border-box !important;
        height: 42px !important;
        min-height: 42px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 12px !important;
        border-radius: 8px !important;
    }

/* Remove any extra spacing on the search wrapper */
.km-top-filter-search {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
