.header__title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.header__subtitle {
    color: #9aa3ad;
    font-size: 12px;
}

.import-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 16px 48px;
}

.card {
    background: #1b1f24;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1b1f24;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 11px 16px;
    margin-bottom: 14px;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-l {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.topbar-r {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.day-lbl {
    font-size: 14px;
    font-weight: 500;
}

.day-sub {
    font-size: 11px;
    color: #9aa3ad;
    margin-top: 2px;
}

.stats-row {
    display: flex;
    gap: 14px;
}

.stat {
    font-size: 12px;
    color: #9aa3ad;
}

.stat b {
    color: #e0e0e0;
    font-weight: 500;
}

.gap-ctrl {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #9aa3ad;
}

.gap-ctrl input[type=range] {
    width: 80px;
    accent-color: #4fc3f7;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    color: #9aa3ad;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    border: 1.5px dashed rgba(79, 195, 247, 0.35);
    min-height: 220px;
    padding: 24px;
    margin-bottom: 16px;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.drop-zone.drag-over {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.08);
    transform: translateY(-1px);
}

.drop-zone.has-files {
    min-height: 112px;
}

.drop-zone__icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.12);
    color: #7bd6ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone__icon svg {
    width: 30px;
    height: 30px;
}

.drop-zone__title {
    font-size: 22px;
}

.drop-zone__text {
    max-width: 540px;
    color: #aeb7c0;
}

#fileInput {
    display: none;
}


.notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(79, 195, 247, 0.2);
    background: rgba(79, 195, 247, 0.12);
    color: #dff4ff;
}

.notice--error {
    border-color: rgba(255, 112, 112, 0.28);
    background: rgba(255, 112, 112, 0.12);
    color: #ffd7d7;
}

.groups {
    display: grid;
    gap: 16px;
}

.visit-card {
    background: #1b1f24;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.visit-card--ready {
    border-color: rgba(76, 175, 80, 0.45);
}

.visit-card--uploading {
    border-color: rgba(79, 195, 247, 0.45);
}

.visit-card__head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: #15191d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.visit-card__head-main {
    min-width: 0;
}

.visit-card__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.visit-card__meta {
    color: #9aa3ad;
    font-size: 13px;
}

.visit-card__body {
    padding: 18px;
}

.visit-card__search {
    position: relative;
}

.visit-card__search--head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    width: min(360px, 100%);
}

.patient-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #111418;
    color: #e0e0e0;
    font-size: 15px;
}

.patient-input:focus {
    outline: none;
    border-color: #4fc3f7;
}

.patient-picker {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 2;
    display: none;
    max-height: 260px;
    overflow: auto;
    background: #111418;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.patient-picker--open {
    display: block;
}

.patient-picker__item {
    width: 100%;
    padding: 11px 14px;
    border: 0;
    background: transparent;
    color: #e0e0e0;
    text-align: left;
    cursor: pointer;
}

.patient-picker__item:hover {
    background: rgba(79, 195, 247, 0.08);
}

.patient-selected {
    flex: 1 1 220px;
    min-width: 0;
    color: #7bd6ff;
    font-size: 13px;
    text-align: center;
}

.review-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.02);
    color: #aeb7c0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.review-btn:hover {
    border-color: rgba(79, 195, 247, 0.5);
    background: rgba(79, 195, 247, 0.08);
    color: #7bd6ff;
}

.review-btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    stroke-width: 1.8;
}

.create-patient-btn {
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 10px;
    border: 1px dashed rgba(123, 214, 255, 0.4);
    background: rgba(79, 195, 247, 0.08);
    color: #7bd6ff;
    font-size: 24px;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
}

.create-patient-btn:disabled {
    opacity: .45;
    cursor: default;
}

.assignment-hint {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 193, 7, 0.12);
    color: #ffd970;
    font-size: 13px;
}

.thumb-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.thumb {
    width: 92px;
    height: 92px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #111418;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb--tagged {
    border-color: rgba(79, 195, 247, 0.8);
}

.thumb--pickable {
    outline: 2px dashed rgba(79, 195, 247, 0.6);
    outline-offset: 2px;
}

.thumb__num,
.thumb__tag {
    position: absolute;
    left: 6px;
    right: 6px;
    font-size: 11px;
    border-radius: 8px;
    padding: 3px 6px;
}

.thumb__num {
    top: 6px;
    left: auto;
    right: 6px;
    width: auto;
    background: rgba(0, 0, 0, 0.64);
    text-align: center;
}

.thumb__tag {
    bottom: 6px;
    background: rgba(79, 195, 247, 0.92);
    color: #041822;
    font-weight: 700;
}

.thumb--good::after,
.thumb--bad::after {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.thumb--good::after {
    content: '✓';
    background: #4caf50;
}

.thumb--bad::after {
    content: '✕';
    background: #ff7070;
}

.views-block {
    padding-top: 8px;
}

.views-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(56px, 1fr));
    gap: 6px;
    overflow-x: auto;
}

.view-slot {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #111418;
    padding: 6px 7px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    cursor: pointer;
    color: #e0e0e0;
}

.view-slot--filled {
    border-color: rgba(79, 195, 247, 0.7);
    background: rgba(79, 195, 247, 0.08);
}

.view-slot--picking {
    outline: 2px dashed rgba(79, 195, 247, 0.6);
    outline-offset: 2px;
}

.view-slot__name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.upload-progress {
    margin-top: 16px;
}

.upload-progress__bar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4fc3f7, #86f7c6);
    transition: width .2s ease;
}

.upload-progress__text {
    color: #9aa3ad;
    font-size: 13px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn--primary {
    background: linear-gradient(135deg, #4fc3f7, #37a2d9);
    color: #041822;
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn:disabled {
    opacity: .5;
    cursor: default;
}

.slide-menu__link--active {
    background: rgba(79, 195, 247, 0.12);
    color: #7bd6ff;
}

.review-screen {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #0f1317;
    flex-direction: column;
}

.review-screen.open {
    display: flex;
}

.rv-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #171c20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.rv-topbar__title {
    flex: 1;
    min-width: 0;
}

.rv-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: #e0e0e0;
    cursor: pointer;
}

.rv-back:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rv-back svg,
.size-btn svg,
.lb-nav svg,
.lb-action svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 1.8;
}

.rv-title {
    font-size: 14px;
    font-weight: 600;
}

.rv-sub,
.rv-stats {
    color: #9aa3ad;
    font-size: 12px;
}

.rv-filters {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #171c20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.flt-btn {
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: #9aa3ad;
    cursor: pointer;
    font-size: 12px;
}

.flt-btn:hover,
.size-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.flt-btn.active {
    background: #e0e0e0;
    color: #0f1317;
    border-color: #e0e0e0;
}

.flt-sep {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.14);
    margin: 0 4px;
}

.size-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: #9aa3ad;
    font-size: 12px;
}

.size-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: #9aa3ad;
    cursor: pointer;
}

.size-btn.active {
    background: rgba(79, 195, 247, 0.12);
    border-color: rgba(79, 195, 247, 0.45);
    color: #7bd6ff;
}

.rv-kbd {
    display: flex;
    gap: 10px;
    padding: 6px 16px;
    background: #111418;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.kbd-hint,
.lb-kbd-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #7f8a96;
    font-size: 11px;
}

kbd {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #1a2026;
    color: #c6ced6;
    font-size: 10px;
    line-height: 1.5;
}

.rv-grid-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.rv-grid {
    display: grid;
    gap: 8px;
}

.rv-grid.size-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rv-grid.size-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.rv-grid.size-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rv-grid.size-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.rv-card {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #111418;
    cursor: pointer;
}

.rv-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

.rv-card.selected {
    border: 2px solid #4fc3f7;
}

.rv-card.rv-good {
    border: 2px solid #4caf50;
}

.rv-card.rv-bad {
    border: 2px solid #ff7070;
    opacity: .78;
}

.rv-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.rv-card-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.62));
}

.rv-fname {
    color: rgba(255, 255, 255, 0.85);
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rv-vtag {
    flex-shrink: 0;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.9);
    color: #041822;
    font-size: 9px;
    font-weight: 700;
}

.rv-status,
.rv-num-badge {
    position: absolute;
    top: 6px;
}

.rv-status {
    left: 6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.rv-status.good {
    background: #4caf50;
}

.rv-status.bad {
    background: #ff7070;
}

.rv-num-badge {
    right: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.44);
    color: rgba(255, 255, 255, 0.82);
    font-size: 10px;
}

.assign-view-btn {
    position: absolute;
    right: 6px;
    bottom: 28px;
    min-height: 24px;
    padding: 0 8px;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    font-size: 10px;
    opacity: 0;
    transition: opacity .15s ease;
}

.rv-card:hover .assign-view-btn {
    opacity: 1;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0, 0, 0, 0.92);
    flex-direction: column;
}

.lightbox.open {
    display: flex;
}

.lb-topbar,
.lb-bottombar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    flex-shrink: 0;
}

.lb-counter,
.lb-fname {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

.lb-fname {
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-close,
.lb-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.lb-close {
    width: 32px;
    height: 32px;
    font-size: 18px;
}

.lb-img-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px 70px;
    overflow: hidden;
}

.lb-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lb-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
}

.lb-prev {
    left: 14px;
}

.lb-next {
    right: 14px;
}

.lb-bottombar {
    justify-content: center;
    flex-wrap: wrap;
}

.lb-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.lb-good {
    background: #4caf50;
    color: #fff;
}

.lb-bad {
    background: #ff7070;
    color: #fff;
}

.lb-rot,
.lb-view-sel {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.lb-kbd {
    display: flex;
    gap: 14px;
    justify-content: center;
    padding: 0 16px 12px;
    flex-wrap: wrap;
}

.lb-kbd kbd {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.72);
}

.lb-view-popup {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 130px;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 32px));
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #171c20;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lb-view-popup.open {
    display: block;
}

.lb-view-popup h4 {
    margin-bottom: 8px;
    color: #9aa3ad;
    font-size: 12px;
}

.lb-view-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.lb-vs {
    padding: 5px 4px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    cursor: pointer;
}

.lb-vs:hover {
    background: rgba(255, 255, 255, 0.05);
}

.lb-vs.active {
    border-color: rgba(79, 195, 247, 0.45);
    background: rgba(79, 195, 247, 0.12);
}

.lb-vs-n {
    color: #e0e0e0;
    font-size: 10px;
    font-weight: 600;
}

.lb-vs-s {
    color: #9aa3ad;
    font-size: 9px;
}

@media (max-width: 960px) {
    .import-intro {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .stats {
        grid-template-columns: 1fr;
    }

    .visit-card__head {
        flex-direction: column;
        align-items: stretch;
    }

    .patient-selected {
        text-align: left;
    }

    .visit-card__search--head {
        width: 100%;
    }

    .review-btn {
        order: 3;
    }

    .rv-grid.size-4,
    .rv-grid.size-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lb-img-wrap {
        padding: 16px 48px;
    }

    .thumb {
        width: 78px;
        height: 78px;
    }
}