/* Kinito grouped model picker */
.kinito-model-search-cell > div > span {
    display: none !important;
}

.kinito-model-search-cell > div > div {
    width: 100%;
}

.kinito-model-picker {
    position: relative;
    display: grid;
    grid-template-columns: minmax(145px, .78fr) minmax(210px, 1.22fr);
    gap: 8px;
    width: 100%;
}

body.kinito-model-picker-open {
    overflow: hidden;
}

.kinito-model-picker.is-open:before {
    position: fixed;
    z-index: 9998;
    inset: 0;
    content: '';
    background: rgba(3, 12, 25, .62);
}

.kinito-model-picker__field {
    min-width: 0;
}

.kinito-model-picker__label {
    display: block;
    overflow: hidden;
    padding-bottom: 3px;
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kinito-model-picker__brand-select,
.kinito-model-picker__trigger {
    width: 100%;
    height: 36px;
    min-height: 36px;
    border: 1px solid #999;
    border-radius: 3px;
    color: rgba(255, 255, 255, .78);
    background-color: rgba(255, 255, 255, .2);
    font-family: inherit;
    font-size: 13px;
}

.kinito-model-picker__brand-select {
    padding: 0 30px 0 9px;
    cursor: pointer;
}

.kinito-model-picker__trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    padding: 0 34px 0 10px;
    text-align: left;
    cursor: pointer;
}

.kinito-model-picker__trigger > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kinito-model-picker__trigger > i,
.kinito-model-group__toggle > i {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    transition: transform .18s ease;
}

.kinito-model-picker.is-open .kinito-model-picker__trigger > i {
    transform: translateY(-25%) rotate(225deg);
}

.kinito-model-picker__trigger:hover,
.kinito-model-picker__trigger:focus,
.kinito-model-picker__brand-select:hover,
.kinito-model-picker__brand-select:focus {
    border-color: #fff;
    outline: none;
}

.kinito-model-picker__trigger:disabled {
    border-color: rgba(230, 230, 230, .31);
    color: rgba(255, 255, 255, .4);
    background: transparent;
    cursor: not-allowed;
}

.kinito-model-picker__model {
    position: relative;
}

.kinito-model-picker__panel[hidden] {
    display: none !important;
}

.kinito-model-picker__panel {
    position: fixed;
    z-index: 9999;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    display: flex;
    width: min(520px, calc(100vw - 32px));
    height: min(640px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(4, 20, 42, .28);
    color: #18263a;
    flex-direction: column;
    transform: translate(-50%, -50%);
}

.kinito-model-picker__panel-header {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px 8px 16px;
    border-bottom: 1px solid #e5eaf1;
}

.kinito-model-picker__panel-header strong {
    color: #092f61;
    font-size: 16px;
    font-weight: 700;
}

.kinito-model-picker__close {
    width: 34px;
    height: 34px;
    margin-left: auto;
    border: 0;
    color: #516074;
    background: transparent;
    font-size: 27px;
    line-height: 30px;
    cursor: pointer;
}

.kinito-model-picker__filter-wrap {
    display: block;
    padding: 12px 14px 8px;
}

.kinito-model-picker__filter {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 12px !important;
    border: 1px solid #c9d4e2 !important;
    border-radius: 6px !important;
    color: #18263a !important;
    background: #fff !important;
    font-size: 14px !important;
}

.kinito-model-picker__filter:focus {
    border-color: #2f76c8 !important;
    outline: 2px solid rgba(47, 118, 200, .14);
}

.kinito-model-picker__status {
    min-height: 20px;
    padding: 0 16px 5px;
    color: #68778a;
    font-size: 12px;
}

.kinito-model-picker__groups {
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;
    padding: 0 8px 8px;
    scrollbar-width: thin;
    flex: 1 1 auto;
}

.kinito-model-group {
    border-bottom: 1px solid #edf0f4;
}

.kinito-model-group:last-child {
    border-bottom: 0;
}

.kinito-model-group__head {
    display: flex;
    align-items: center;
    min-height: 43px;
}

.kinito-model-group__label,
.kinito-model-version {
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    color: #1f2d3e;
    cursor: pointer;
}

.kinito-model-group__label {
    flex: 1;
    padding: 7px 8px;
    font-size: 15px;
    font-weight: 700;
}

.kinito-model-group__label > span,
.kinito-model-version > span {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-left: 36px;
    line-height: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kinito-model-group input[type="checkbox"] {
    position: absolute !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.kinito-model-group__label > input[type="checkbox"] + span:before,
.kinito-model-version > input[type="checkbox"] + span:before {
    position: absolute;
    top: 1px;
    left: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #9eabb9;
    border-radius: 4px;
    content: '';
    background: #fff;
    box-sizing: border-box;
}

.kinito-model-group__label > input[type="checkbox"]:checked + span:before,
.kinito-model-version > input[type="checkbox"]:checked + span:before,
.kinito-model-group__label > input[type="checkbox"]:indeterminate + span:before {
    border-color: #e4381d;
    background: #e4381d;
}

.kinito-model-group__label > input[type="checkbox"]:checked + span:after,
.kinito-model-version > input[type="checkbox"]:checked + span:after {
    position: absolute;
    top: 4px;
    left: 7px;
    width: 7px;
    height: 12px;
    border-right: 3px solid #fff;
    border-bottom: 3px solid #fff;
    content: '';
    transform: rotate(45deg);
    box-sizing: border-box;
}

.kinito-model-group__label > input[type="checkbox"]:indeterminate + span:after {
    position: absolute;
    top: 11px;
    left: 5px;
    width: 12px;
    height: 3px;
    border-radius: 2px;
    content: '';
    background: #fff;
}

.kinito-model-group__label > input[type="checkbox"]:focus-visible + span:before,
.kinito-model-version > input[type="checkbox"]:focus-visible + span:before {
    outline: 3px solid rgba(47, 118, 200, .25);
    outline-offset: 2px;
}

.kinito-model-group__toggle {
    position: relative;
    width: 42px;
    height: 42px;
    border: 0;
    color: #607086;
    background: transparent;
    cursor: pointer;
    flex: 0 0 42px;
}

.kinito-model-group__toggle > i {
    right: 17px;
}

.kinito-model-group.is-expanded .kinito-model-group__toggle > i {
    transform: translateY(-25%) rotate(225deg);
}

.kinito-model-group.is-loading .kinito-model-group__toggle > i {
    width: 15px;
    height: 15px;
    border: 2px solid #b9c4d1;
    border-top-color: #e4381d;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: kinito-model-spin .7s linear infinite;
}

.kinito-model-group.has-selection > .kinito-model-group__head {
    background: #f5f8fc;
}

.kinito-model-group__children {
    display: block;
    padding: 2px 10px 10px 42px;
}

.kinito-model-group__children[hidden] {
    display: none !important;
}

.kinito-model-version {
    min-height: 40px;
    padding: 8px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 400;
}

.kinito-model-version:hover {
    background: #eef5fd;
}

.kinito-model-group__message {
    grid-column: 1 / -1;
    padding: 8px;
    color: #7a8798;
    font-size: 13px;
}

.kinito-model-picker__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #e5eaf1;
    background: #f8fafc;
}

.kinito-model-picker__clear,
.kinito-model-picker__done {
    min-width: 100px;
    height: 38px;
    padding: 0 17px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.kinito-model-picker__clear {
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #fff;
}

.kinito-model-picker__done {
    border: 1px solid #d92e16;
    color: #fff;
    background: #e4381d;
}

.kinito-model-picker__done:hover,
.kinito-model-picker__done:focus {
    background: #c92712;
}

@keyframes kinito-model-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@media screen and (min-width: 768px) {
    .kinito-model-search-cell {
        flex-basis: 50%;
        max-width: 50%;
    }

    body.home-page .kinito-model-search-cell {
        grid-column: span 2;
    }
}

@media screen and (min-width: 1600px) {
    body.home-page .kinito-model-search-cell {
        grid-column: auto;
    }
}

@media screen and (max-width: 767px) {
    body.home-page .kinito-model-search-cell {
        grid-column: 1 / -1;
    }

    .kinito-model-picker {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    }

    .kinito-model-picker__panel {
        position: fixed;
        z-index: 9999;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 88vh;
        max-height: 88dvh;
        border: 0;
        border-radius: 17px 17px 0 0;
        box-shadow: 0 -12px 42px rgba(0, 0, 0, .24);
        transform: none;
    }

    .kinito-model-picker__panel-header {
        min-height: 54px;
        padding-left: 18px;
    }

    .kinito-model-picker__groups {
        overscroll-behavior: contain;
    }

    .kinito-model-picker__footer {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

@media screen and (max-width: 420px) {
    .kinito-model-picker {
        grid-template-columns: minmax(0, 1fr);
    }
}
