:root{
    --bg:#f6f7fb;
    --card:#fff;
    --text:#0f172a;
    --muted:#64748b;
    --line:#e6e8f0;
    --blue:#2563eb;
    --green:#16a34a;
    --red:#ef4444;
    --gray:#64748b;
    --header-h:64px;
}

*{box-sizing:border-box}
html{height:100%; overflow-x:hidden;}
body{
    min-height:100%;
    margin:0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
    padding-top: var(--header-h);
    overflow-x:hidden; /* ✅ убираем второй горизонтальный скролл */
}

a{color:inherit; text-decoration:none}
img{max-width:100%; height:auto; display:block}

/* контейнер делаем шире как в Отчетах (на всю ширину сайта) */
.container{
    max-width: 1200px;
    margin: 18px auto;
    padding: 0 14px;
    width: 100%;
}

.card{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:14px;
    padding:16px;
    box-shadow:0 8px 22px rgba(15,23,42,.06);
    width:100%;
    min-width:0; /* ✅ важно для grid/flex чтобы не вылазило */
}

.h1{font-size:22px;font-weight:900}
.h2{font-size:16px;font-weight:800}
.muted{color:var(--muted)}
.small{font-size:12px}
hr{border:0;border-top:1px solid var(--line);margin:14px 0}

.row{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    min-width:0;
}

.grid{display:grid;gap:12px;min-width:0}
.grid.two{grid-template-columns: 1fr 1fr}
@media (max-width:900px){.grid.two{grid-template-columns:1fr}}

.field label{display:block;font-size:12px;color:var(--muted);margin:0 0 6px 2px}

/* ✅ Самое главное: инпуты/селекты не вылазят из таблиц и карточек */
input, select, textarea{
    width:100%;
    max-width:100%;
    min-width:0;
    padding:10px 12px;
    border:1px solid var(--line);
    border-radius:10px;
    outline:none;
    background:#fff;
    color:var(--text);
    font-size:14px;
}

textarea{min-height:92px;resize:vertical}
input[readonly]{background:#f8fafc}
input:disabled, select:disabled, textarea:disabled{background:#f1f5f9;color:#334155}

/* кнопки */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:10px 12px;
    border-radius:10px;
    border:1px solid transparent;
    cursor:pointer;
    font-weight:800;
    user-select:none;
    white-space:nowrap;
}
.btn.blue{background:var(--blue);color:#fff}
.btn.green{background:var(--green);color:#fff}
.btn.red{background:var(--red);color:#fff}
.btn.gray{background:#eef2ff;color:#1e293b;border-color:#dbeafe}
.btn:disabled{opacity:.6;cursor:not-allowed}

.iconBtn{
    width:36px;height:36px;border-radius:10px;
    border:1px solid var(--line);
    background:#fff;cursor:pointer;font-weight:900;
}

.badge{
    display:inline-flex;align-items:center;gap:6px;
    padding:6px 10px;border-radius:999px;
    border:1px solid var(--line);background:#fff;
    font-size:12px;font-weight:800;color:#334155;
}

/* ✅ Таблицы: скролл только внутри блока, не по странице */
.tableWrap{
    overflow:auto;
    border:1px solid var(--line);
    border-radius:12px;
    width:100%;
    max-width:100%;
    -webkit-overflow-scrolling: touch;
}

table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    min-width:640px; /* на десктоп */
}
th,td{
    border-bottom:1px solid var(--line);
    padding:10px 10px;
    font-size:13px;
    text-align:left;
    vertical-align:middle;
}
th{background:#f8fafc;font-weight:900}

/* История лечения */
.treatTable{min-width:820px}
.treatTable .col-tooth{width:70px}
.treatTable .col-date{width:140px}
.treatTable .col-dis{width:90px}
.treatTable .col-price{width:110px}
.cellInput{width:100%; max-width:100%; min-width:0}

/* зубы */
.teeth{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px;
    margin:10px 0;
}
.tooth{
    width:46px;height:46px;border-radius:12px;
    border:1px solid var(--line);
    display:flex;align-items:center;justify-content:center;
    font-weight:900;background:#fff;cursor:pointer;
    transition:transform .05s ease;
}
.tooth:active{transform:scale(.97)}

/* болезни */
.buttons{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:10px;
    margin:12px 0;
}
@media (max-width:900px){.buttons{grid-template-columns:repeat(2,1fr)}}

.btnTag{
    border:1px solid var(--line);
    background:#fff;border-radius:12px;
    padding:10px 12px;cursor:pointer;
    font-weight:900;display:flex;align-items:center;gap:10px;
    min-width:0;
}
.btnTag b{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:30px;height:30px;
    border-radius:10px;
    color:#fff;
    flex:0 0 auto;
}
.btnTag.O b{background:#64748b}
.btnTag.C b{background:#f97316}
.btnTag.P b{background:#ef4444}
.btnTag.Pt b{background:#a855f7}
.btnTag.R b{background:#0ea5e9}
.btnTag.F b{background:#22c55e}
.btnTag.PR b{background:#f59e0b}
.btnTag.X b{background:#334155}

.tooth.O{background:#e2e8f0}
.tooth.C{background:#ffedd5}
.tooth.P{background:#fee2e2}
.tooth.Pt{background:#f3e8ff}
.tooth.R{background:#e0f2fe}
.tooth.F{background:#dcfce7}
.tooth.PR{background:#fef3c7}
.tooth.X{background:#e2e8f0;border-style:dashed}
.tooth.aiChanged{
    outline:3px solid rgba(16,185,129,.28);
    outline-offset:2px;
    animation:aiToothConfirmed .7s ease-out;
}

@keyframes aiToothConfirmed{
    0%{transform:scale(.78);box-shadow:0 0 0 0 rgba(16,185,129,.5)}
    70%{transform:scale(1.08);box-shadow:0 0 0 12px rgba(16,185,129,0)}
    100%{transform:scale(1)}
}

/* Shared ORBA microphone and tooth-chart review styles */
.aiDentalPanel{
    max-width:980px;
    margin:16px auto 18px;
    padding:18px;
    border:1px solid #a7f3d0;
    border-radius:18px;
    background:
        radial-gradient(circle at top right, rgba(16,185,129,.12), transparent 34%),
        linear-gradient(135deg,#f0fdf4 0%,#ffffff 58%,#f8fafc 100%);
    box-shadow:0 12px 30px rgba(15,118,110,.08);
}
.aiDentalHead{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
}
.aiDentalEyebrow{
    color:#047857;
    font-size:11px;
    font-weight:1000;
    letter-spacing:.12em;
    margin-bottom:4px;
}
.aiLocalBadge{
    display:inline-flex;
    align-items:center;
    min-height:28px;
    padding:5px 9px;
    border-radius:999px;
    color:#065f46;
    background:#d1fae5;
    border:1px solid #a7f3d0;
    font-size:11px;
    font-weight:900;
    white-space:nowrap;
}
.aiDentalHint{margin-top:8px;line-height:1.55}
.aiDentalCommand{
    width:100%;
    min-height:82px;
    margin-top:12px;
    resize:vertical;
    border-color:#a7f3d0;
    background:rgba(255,255,255,.92);
}
.aiDentalCommand:focus{
    outline:3px solid rgba(16,185,129,.14);
    border-color:#10b981;
}
.aiDentalControls{
    display:flex;
    align-items:stretch;
    gap:9px;
    margin-top:10px;
}
.aiVoiceLanguage{
    width:140px;
    min-width:140px;
}
.aiMicButton{
    color:#065f46;
    background:#ecfdf5;
    border:1px solid #6ee7b7;
}
.aiMicButton.listening{
    color:#fff;
    background:#ef4444;
    border-color:#ef4444;
    animation:aiMicPulse 1s infinite alternate;
}
@keyframes aiMicPulse{
    from{box-shadow:0 0 0 0 rgba(239,68,68,.35)}
    to{box-shadow:0 0 0 9px rgba(239,68,68,0)}
}
.aiDentalStatus{
    min-height:38px;
    margin-top:10px;
    padding:9px 11px;
    border-radius:11px;
    color:#475569;
    background:rgba(248,250,252,.9);
    border:1px solid #e2e8f0;
    font-size:13px;
    font-weight:750;
}
.aiDentalStatus.success{color:#065f46;background:#ecfdf5;border-color:#a7f3d0}
.aiDentalStatus.error{color:#991b1b;background:#fef2f2;border-color:#fecaca}
.aiDentalStatus.listening{color:#9f1239;background:#fff1f2;border-color:#fecdd3}
.aiDentalStatus.working{color:#1e40af;background:#eff6ff;border-color:#bfdbfe}
.aiDentalReview{
    margin-top:12px;
    padding:14px;
    border-radius:14px;
    background:#fff;
    border:1px solid #cbd5e1;
}
.aiDentalReviewList{display:grid;gap:8px;margin-top:10px}
.aiDentalReviewItem{
    display:grid;
    grid-template-columns:48px 24px minmax(150px,1fr) 56px;
    align-items:center;
    gap:6px;
    min-height:44px;
    padding:7px 10px;
    border-radius:11px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
}
.aiToothNumber{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:38px;
    height:34px;
    border-radius:10px;
    color:#fff;
    background:#0f172a;
    font-weight:1000;
}
.aiReviewArrow{text-align:center;color:#94a3b8;font-weight:1000}
.aiDiagnosisCode{font-weight:900}
.aiDiagnosisCode.C{color:#c2410c}
.aiDiagnosisCode.P{color:#b91c1c}
.aiDiagnosisCode.Pt{color:#7e22ce}
.aiDiagnosisCode.O{color:#475569}
.aiDiagnosisCode.R{color:#0369a1}
.aiDiagnosisCode.F{color:#047857}
.aiDiagnosisCode.PR{color:#b45309}
.aiDiagnosisCode.X{color:#334155}
.aiConfidence{
    text-align:right;
    color:#64748b;
    font-size:12px;
    font-weight:900;
}
.aiDentalWarnings{
    display:grid;
    gap:5px;
    margin-top:9px;
    color:#9a3412;
    font-size:12px;
    font-weight:800;
}
.aiDentalReviewActions{
    display:flex;
    justify-content:flex-end;
    gap:9px;
    margin-top:12px;
}

/* кошелек */
.walletGrid{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap:10px;
    max-width:900px;
    margin:0 auto;
    width:100%;
}
.walletBox{
    border:1px solid var(--line);
    border-radius:14px;
    padding:12px;
    background:#fff;
    min-width:0;
}
.walletBox .label{font-size:12px;color:var(--muted);font-weight:800}
.walletBox .value{font-size:20px;font-weight:1000;margin-top:6px}

/* галерея */
.gallery{display:flex;flex-wrap:wrap;gap:10px}
.gallery img{
    width:130px;height:100px;
    object-fit:cover;
    border-radius:12px;
    border:1px solid var(--line);
}

.autoPhotoBox{
    margin-top:12px;
    padding:14px;
    border:1px solid #bfdbfe;
    border-radius:14px;
    background:#eff6ff;
}
.autoPhotoBox.active{
    border-color:#86efac;
    background:#f0fdf4;
}
.appointmentValidationHint{
    min-height:18px;
    margin:-2px 0 8px;
    font-size:12px;
    font-weight:800;
    color:#64748b;
}
.appointmentValidationHint.error{color:#b91c1c}
.appointmentValidationHint.success{color:#047857}
.photoMessage{
    margin-top:10px;
    padding:11px 13px;
    border:1px solid;
    border-radius:12px;
    font-size:13px;
    font-weight:800;
}
.photoMessage.error{border-color:#fecaca;background:#fff1f2;color:#991b1b}
.photoMessage.success{border-color:#a7f3d0;background:#ecfdf5;color:#065f46}
.photoUploadForm input:disabled{
    opacity:.6;
    cursor:not-allowed;
    background:#f8fafc;
}
.photoUploadHintError{color:#b91c1c!important;font-weight:800}
.photoUploadHintSuccess{color:#047857!important;font-weight:800}
.photoPath{
    margin-top:9px;
    font-size:12px;
    overflow-wrap:anywhere;
}
.photoPath code{
    color:#1e3a8a;
    font-family:Consolas, Monaco, monospace;
}

/* модалки */
.modalBack{
    position:fixed;inset:0;background:rgba(2,6,23,.55);
    display:none;align-items:center;justify-content:center;padding:18px;
    z-index:9999;
}
.modalBack.show{display:flex}
.modal{
    width:min(520px, 100%);
    background:#fff;border-radius:16px;border:1px solid var(--line);
    padding:14px;
}

/* header */
.topbar{
    position:fixed;top:0;left:0;right:0;z-index:999;
    background:#0b1220;color:#fff;border-bottom:1px solid rgba(255,255,255,.08);
}
.topbar-inner{
    max-width:1200px;
    margin:0 auto;
    padding:10px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}
.brand{font-weight:1000;letter-spacing:.2px}.brand small{display:block;font-size:10px;color:#a9bbb5;font-weight:700;letter-spacing:.4px}.brandHome{color:#fff;text-decoration:none;cursor:pointer;border-radius:10px;padding:5px 7px;margin:-5px -7px;transition:background .18s ease,transform .18s ease}.brandHome:hover{background:rgba(255,255,255,.08);transform:translateY(-1px)}.brandHome:focus-visible{outline:2px solid #9fe0cc;outline-offset:2px}
.top-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.orbaUserPill{display:inline-flex;flex-direction:column;justify-content:center;min-height:40px;padding:5px 10px;border:1px solid rgba(255,255,255,.18);border-radius:10px;background:#111d2d;color:#fff;line-height:1.05}.orbaUserPill b{font-size:12px;max-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.orbaUserPill small{font-size:10px;color:#9fe0cc;margin-top:4px}

/* reminders */
.reminderWrap{position:relative;z-index:1100}
.reminderButton{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:40px;
    padding:8px 12px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:10px;
    background:#172033;
    color:#fff;
    cursor:pointer;
    font-weight:900;
}
.reminderBadge{
    min-width:20px;
    height:20px;
    padding:0 6px;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:#2563eb;
    color:#fff;
    font-size:11px;
}
.reminderBadge.urgent{background:#ef4444}
.reminderPanel{
    position:absolute;
    top:calc(100% + 10px);
    left:0;
    right:auto;
    width:min(420px, calc(100vw - 20px));
    max-height:75vh;
    overflow:auto;
    display:none;
    padding:14px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
    color:var(--text);
    box-shadow:0 18px 45px rgba(2,6,23,.28);
    z-index:1200;
}
.reminderPanel.show{display:block}
.reminderPanelHead{display:flex;align-items:center;justify-content:space-between;gap:10px}
.reminderClose{
    width:32px;height:32px;border:0;border-radius:9px;background:#f1f5f9;
    color:#334155;font-size:22px;line-height:1;cursor:pointer;
}
.reminderPermission{width:100%;margin-top:10px;white-space:normal}
.reminderSectionTitle{font-size:12px;font-weight:900;color:#64748b;margin:14px 0 7px;text-transform:uppercase}
.reminderList{display:grid;gap:7px}
.reminderItem{
    display:grid;
    grid-template-columns:58px 1fr;
    gap:10px;
    align-items:center;
    padding:9px;
    border:1px solid var(--line);
    border-radius:11px;
    background:#fff;
}
.reminderItem.urgent{border-color:#fecaca;background:#fff7f7}
.reminderItem.past{opacity:.55}
.reminderTime{font-weight:1000;color:#2563eb;text-align:center}
.reminderItem.urgent .reminderTime{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    min-height:48px;
    border-radius:12px;
    background:linear-gradient(145deg,#fff1f2,#ffedd5);
    color:#dc2626;
}
.reminderItem.urgent .reminderTime strong{font-size:21px;line-height:1}
.reminderItem.urgent .reminderTime span{font-size:10px;line-height:1.2;margin-top:3px;text-transform:uppercase}
.reminderInfo{min-width:0}
.reminderInfo b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reminderEmpty{padding:12px;border:1px dashed var(--line);border-radius:11px;color:var(--muted);font-size:12px;text-align:center}

.urgentReminderHero{
    position:relative;
    overflow:hidden;
    padding:18px;
    margin-bottom:14px;
    border:1px solid #fed7aa;
    border-radius:20px;
    background:
        radial-gradient(circle at 92% -15%,rgba(251,146,60,.28),transparent 42%),
        linear-gradient(135deg,#fff7ed 0%,#fff 52%,#fff1f2 100%);
    box-shadow:0 16px 38px rgba(154,52,18,.10);
}
.urgentReminderHero::after{
    content:"";
    position:absolute;
    right:-55px;
    bottom:-75px;
    width:190px;
    height:190px;
    border:28px solid rgba(251,146,60,.08);
    border-radius:50%;
    pointer-events:none;
}
.urgentReminderHeroHead{
    position:relative;
    z-index:1;
    display:grid;
    grid-template-columns:auto 1fr auto;
    align-items:center;
    gap:14px;
}
.urgentReminderClock{
    display:grid;
    place-items:center;
    width:54px;
    height:54px;
    border-radius:17px;
    background:linear-gradient(145deg,#f97316,#e11d48);
    color:#fff;
    font-size:26px;
    box-shadow:0 12px 24px rgba(225,29,72,.22);
}
.urgentReminderCopy{min-width:0}
.urgentReminderEyebrow{
    color:#c2410c;
    font-size:11px;
    line-height:1;
    font-weight:1000;
    letter-spacing:.12em;
}
.urgentReminderTitle{
    margin-top:5px;
    color:#431407;
    font-size:20px;
    line-height:1.2;
    font-weight:1000;
}
.urgentReminderCaption{margin-top:5px;color:#9a3412;font-size:12px;font-weight:700}
.urgentReminderCount{
    display:grid;
    place-items:center;
    width:54px;
    height:54px;
    border:7px solid rgba(249,115,22,.18);
    border-radius:50%;
    background:#fff;
    color:#dc2626;
    font-size:24px;
    font-weight:1000;
    box-shadow:0 8px 22px rgba(154,52,18,.10);
}
.urgentReminderList{
    position:relative;
    z-index:1;
    display:grid;
    gap:8px;
    max-height:260px;
    margin-top:14px;
    overflow:auto;
}
.urgentReminderList .reminderEmpty{
    border-color:#fed7aa;
    background:rgba(255,255,255,.72);
    color:#9a3412;
}
.urgentReminderList .reminderItem{box-shadow:0 8px 18px rgba(154,52,18,.06)}

.appointmentToastHolder{
    position:fixed;
    top:calc(var(--header-h) + 14px);
    right:14px;
    z-index:12000;
    width:min(410px, calc(100vw - 28px));
    display:grid;
    gap:10px;
}
.appointmentToast{
    position:relative;
    overflow:hidden;
    padding:18px;
    border:1px solid #fdba74;
    border-radius:20px;
    background:
        radial-gradient(circle at 100% 0,rgba(251,146,60,.22),transparent 38%),
        linear-gradient(145deg,#fff 0%,#fff7ed 100%);
    color:#0f172a;
    box-shadow:0 22px 55px rgba(124,45,18,.24);
    animation:reminderPulse .8s ease-out 2;
}
.appointmentToastTop{display:flex;align-items:center;gap:12px}
.appointmentToastIcon{
    display:grid;
    place-items:center;
    width:48px;
    height:48px;
    flex:0 0 auto;
    border-radius:15px;
    background:linear-gradient(145deg,#f97316,#e11d48);
    color:#fff;
    font-size:23px;
    box-shadow:0 10px 22px rgba(225,29,72,.22);
}
.appointmentToastHeading{min-width:0}
.appointmentToastEyebrow{font-size:10px;font-weight:1000;letter-spacing:.13em;color:#c2410c}
.appointmentToastTitle{font-size:21px;line-height:1.15;font-weight:1000;color:#9f1239;margin-top:3px}
.appointmentToastPatient{margin-top:14px;font-size:17px;font-weight:1000;color:#1e293b}
.appointmentToastMeta{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.appointmentToastMeta span{
    padding:6px 9px;
    border:1px solid #fed7aa;
    border-radius:999px;
    background:rgba(255,255,255,.8);
    color:#7c2d12;
    font-size:12px;
    font-weight:800;
}
.appointmentToastProgress{height:5px;margin-top:14px;border-radius:999px;background:#ffedd5;overflow:hidden}
.appointmentToastProgress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#f97316,#e11d48)}
.appointmentToastActions{display:flex;gap:8px;justify-content:flex-end;margin-top:12px;flex-wrap:wrap}
@keyframes reminderPulse{
    0%{transform:translateY(-8px) scale(.97);box-shadow:0 0 0 0 rgba(249,115,22,.40)}
    100%{transform:translateY(0) scale(1);box-shadow:0 0 0 16px rgba(249,115,22,0)}
}

@media (max-width:900px){
    .urgentReminderHero{padding:15px}
}

/* footer */
.footer{
    margin:22px auto 26px;
    max-width:1200px;
    padding:0 14px;
    color:var(--muted);
    font-size:12px;
    text-align:center;
}

/* ============================
   ✅ МОБИЛЬНАЯ ВЕРСИЯ
   ============================ */
@media (max-width: 520px){
    :root{ --header-h: 88px; } /* header станет выше из-за переноса кнопок */

    .container{
        margin: 12px auto;
        padding: 0 10px;
    }

    .card{
        padding: 12px;
        border-radius: 14px;
    }

    .h1{font-size:18px}
    .h2{font-size:14px}

    /* кнопки не вылазят */
    .btn{
        width:100%;
        justify-content:center;
    }
    .top-actions .btn{
        width:auto;
        padding:8px 10px;
        font-size:12px;
    }
    .reminderButton{padding:8px 10px;font-size:12px}
    .reminderPanel{position:fixed;top:var(--header-h);right:10px;left:10px;width:auto;max-height:calc(100vh - var(--header-h) - 12px)}
    .appointmentToastHolder{left:10px;right:10px;width:auto}
    .appointmentToastActions .btn{width:100%}
    .urgentReminderHeroHead{grid-template-columns:auto 1fr}
    .urgentReminderCount{grid-column:1 / -1;width:100%;height:42px;border-width:4px;border-radius:13px}
    .urgentReminderTitle{font-size:17px}

    /* таблицы на телефоне: меньше min-width */
    table{min-width: 720px;} /* скролл внутри .tableWrap */
    .treatTable{min-width: 860px;}

    /* зубная карта — меньше */
    .tooth{
        width:38px;
        height:38px;
        border-radius:10px;
        font-size:12px;
    }

    /* кнопки болезней — по 1 колонке */
    .buttons{grid-template-columns:1fr}

    .aiDentalPanel{padding:13px}
    .aiDentalHead{flex-direction:column}
    .aiDentalControls{flex-direction:column}
    .aiVoiceLanguage{width:100%;min-width:0}
    .aiDentalReviewItem{
        grid-template-columns:42px 18px minmax(110px,1fr) 44px;
        padding:7px 8px;
        font-size:12px;
    }
    .aiDentalReviewActions{flex-direction:column-reverse}

    /* кошелек — 1 колонка */
    .walletGrid{
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    /* галерея — в 2 колонки */
    .gallery img{
        width: calc(50% - 5px);
        height: 110px;
    }
}

/* ✅ Убираем второй вертикальный скролл, который появляется из-за flex-footer */
html, body{overflow-x:hidden;}


/* ORBA — unified dental intelligence */
.orbaPanel{
  --orba-emerald:#00a884;
  --orba-deep:#063b35;
  --orba-ink:#102a27;
  position:relative;
  overflow:hidden;
  margin:24px 0;
  padding:22px;
  border:1px solid rgba(0,139,111,.24);
  border-radius:26px;
  background:
    radial-gradient(circle at 12% 5%,rgba(0,209,164,.16),transparent 32%),
    radial-gradient(circle at 92% 8%,rgba(59,130,246,.11),transparent 28%),
    linear-gradient(145deg,#f6fffc 0%,#ffffff 52%,#f5fbff 100%);
  box-shadow:0 24px 70px rgba(5,74,64,.12);
}
.orbaPanel:before{
  content:"";position:absolute;inset:-1px;pointer-events:none;border-radius:inherit;
  background:linear-gradient(110deg,transparent 20%,rgba(255,255,255,.75) 46%,transparent 72%);
  transform:translateX(-120%);animation:orbaSheen 9s ease-in-out infinite;
}
@keyframes orbaSheen{0%,68%{transform:translateX(-120%)}82%,100%{transform:translateX(120%)}}
.orbaTopbar{position:relative;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.orbaIdentity{display:flex;align-items:center;gap:13px}.orbaMiniMark{width:46px;height:46px;border-radius:16px;background:linear-gradient(145deg,#023d34,#00a884);box-shadow:0 12px 26px rgba(0,121,96,.25);display:grid;place-items:center}.orbaMiniMark span{width:19px;height:19px;border:3px solid #fff;border-top-color:transparent;border-radius:50%;transform:rotate(-32deg)}
.orbaEyebrow{font-size:10px;font-weight:900;letter-spacing:.19em;color:#08705e}.orbaTitleRow{display:flex;align-items:center;gap:8px}.orbaTitleRow .h1{font-size:28px;line-height:1;letter-spacing:.04em;color:#063b35}.orbaVersion{padding:3px 7px;border-radius:999px;background:#dff8ef;color:#08705e;font-size:10px;font-weight:900}
.orbaStateBadge{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #d3e7e1;border-radius:999px;background:rgba(255,255,255,.86);font-size:12px;font-weight:800;color:#355a54;box-shadow:0 8px 20px rgba(15,61,54,.06)}.orbaStateDot{width:8px;height:8px;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 5px rgba(148,163,184,.14)}
.orbaWorkspace{position:relative;z-index:1;display:grid;grid-template-columns:minmax(250px,.8fr) minmax(360px,1.4fr);gap:22px;align-items:stretch}
.orbaVisualColumn{border:1px solid rgba(15,118,95,.14);border-radius:22px;background:linear-gradient(160deg,rgba(2,61,52,.98),rgba(5,91,76,.94));padding:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:420px;color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}
.orbaOrb{position:relative;width:180px;height:180px;border:0;background:transparent;cursor:pointer;display:grid;place-items:center;margin:4px auto 20px}.orbaCore{position:relative;z-index:4;width:96px;height:96px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 34% 28%,#5fffd6 0%,#00bd91 34%,#006e5c 72%,#023b34 100%);box-shadow:0 0 25px rgba(45,255,204,.46),0 0 70px rgba(0,190,144,.35),inset 0 0 18px rgba(255,255,255,.28)}.orbaCoreText{font-size:17px;font-weight:950;letter-spacing:.12em;color:#fff;text-shadow:0 2px 10px rgba(0,0,0,.3)}
.orbaHalo{position:absolute;border-radius:50%;border:1px solid rgba(107,255,220,.35);inset:18px}.haloTwo{inset:5px;border-style:dashed;animation:orbaRotate 16s linear infinite}.haloThree{inset:-12px;border-color:rgba(107,255,220,.12);animation:orbaPulse 4s ease-in-out infinite}.haloOne{animation:orbaPulse 2.8s ease-in-out infinite reverse}@keyframes orbaRotate{to{transform:rotate(360deg)}}@keyframes orbaPulse{0%,100%{transform:scale(.95);opacity:.45}50%{transform:scale(1.05);opacity:1}}
.orbaWave{position:absolute;z-index:5;bottom:5px;left:50%;transform:translateX(-50%);height:28px;display:flex;align-items:center;gap:4px;opacity:.35}.orbaWave i{display:block;width:3px;height:8px;border-radius:3px;background:#9cffe8}.orbaStateTitle{text-align:center;font-size:17px;font-weight:850;min-height:25px}.orbaLiveText{text-align:center;margin-top:7px;min-height:38px;max-width:290px;font-size:12px;line-height:1.45;color:rgba(232,255,249,.72)}
.orbaCapabilityGrid{width:100%;display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:20px}.orbaCapability{border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.08);color:#e9fff9;border-radius:13px;padding:9px 7px;font-size:10px;font-weight:750;cursor:pointer;transition:.2s}.orbaCapability:hover{background:rgba(255,255,255,.15);transform:translateY(-1px)}.orbaCapability span{display:block;font-size:17px;margin-bottom:3px}
.orbaConversationColumn{display:flex;flex-direction:column;min-width:0}.orbaHistory{flex:1;min-height:220px;max-height:340px;overflow:auto;padding:14px;border:1px solid #dcebe7;border-radius:17px;background:rgba(248,252,251,.82)}.orbaMessage{max-width:88%;margin:8px 0;padding:11px 13px;border-radius:15px;white-space:pre-wrap;line-height:1.5;font-size:13px;box-shadow:0 5px 14px rgba(15,61,54,.04)}.orbaMessage.assistant{background:#fff;border:1px solid #dbe9e5;border-bottom-left-radius:5px}.orbaMessage.user{margin-left:auto;background:linear-gradient(145deg,#d9f8ed,#c8f0e5);border-bottom-right-radius:5px;color:#073d34}.orbaMessage.error{background:#fff0f0;border:1px solid #efc3c3;color:#8b1f1f}.orbaMessage small{display:block;margin-top:7px;color:#71827e;font-size:10px;font-weight:650}
.orbaModeBar{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0 9px}.orbaMode{border:1px solid #d5e6e1;background:#fff;color:#49645f;border-radius:999px;padding:6px 10px;font-size:11px;font-weight:750;cursor:pointer}.orbaMode.active{background:#063b35;border-color:#063b35;color:#fff}
.orbaInput{width:100%;resize:vertical;border:1px solid #cfe0dc;border-radius:15px;padding:12px 13px;background:#fff;min-height:82px;font:inherit;line-height:1.45;outline:none;transition:.2s}.orbaInput:focus{border-color:#00a884;box-shadow:0 0 0 4px rgba(0,168,132,.1)}
.orbaControls{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}.orbaWakeButton{background:#fff;border-color:#cfe0dc}.orbaWakeButton.active{background:#e0fbf3;border-color:#00a884;color:#06715d}.orbaSendButton{margin-left:auto}.orbaStatus{margin-top:10px;padding:9px 11px;border-radius:11px;background:#f1f6f5;color:#506763;font-size:12px;font-weight:700}.orbaStatus.error{background:#fff0f0;color:#9a2626}.orbaStatus.success{background:#e8fbf4;color:#08705e}.orbaStatus.listening,.orbaStatus.transcribing,.orbaStatus.thinking,.orbaStatus.charting,.orbaStatus.xray,.orbaStatus.speaking{background:#e9f7ff;color:#075c84}
.orbaReview{position:relative;z-index:1;margin-top:18px}.orbaSafetyNote{position:relative;z-index:1;margin-top:16px;padding:11px 13px;border-radius:13px;background:rgba(255,248,230,.9);border:1px solid #f1dfae;color:#705b28;font-size:11px;line-height:1.5}
.orbaPanel[data-state="standby"] .orbaStateDot{background:#38bdf8;box-shadow:0 0 0 5px rgba(56,189,248,.15)}.orbaPanel[data-state="listening"] .orbaStateDot,.orbaPanel[data-state="transcribing"] .orbaStateDot{background:#2dd4bf;box-shadow:0 0 0 5px rgba(45,212,191,.18)}.orbaPanel[data-state="thinking"] .orbaStateDot,.orbaPanel[data-state="charting"] .orbaStateDot,.orbaPanel[data-state="xray"] .orbaStateDot{background:#f59e0b;box-shadow:0 0 0 5px rgba(245,158,11,.17)}.orbaPanel[data-state="success"] .orbaStateDot,.orbaPanel[data-state="speaking"] .orbaStateDot{background:#22c55e;box-shadow:0 0 0 5px rgba(34,197,94,.17)}.orbaPanel[data-state="error"] .orbaStateDot{background:#ef4444;box-shadow:0 0 0 5px rgba(239,68,68,.15)}
.orbaPanel[data-state="listening"] .orbaWave,.orbaPanel[data-state="speaking"] .orbaWave{opacity:1}.orbaPanel[data-state="listening"] .orbaWave i,.orbaPanel[data-state="speaking"] .orbaWave i{animation:orbaBars .85s ease-in-out infinite alternate}.orbaWave i:nth-child(2){animation-delay:.1s!important}.orbaWave i:nth-child(3){animation-delay:.2s!important}.orbaWave i:nth-child(4){animation-delay:.3s!important}.orbaWave i:nth-child(5){animation-delay:.2s!important}.orbaWave i:nth-child(6){animation-delay:.1s!important}@keyframes orbaBars{from{height:5px}to{height:27px}}
.orbaPanel[data-state="thinking"] .orbaCore,.orbaPanel[data-state="charting"] .orbaCore,.orbaPanel[data-state="xray"] .orbaCore{animation:orbaThink 1.15s ease-in-out infinite}@keyframes orbaThink{0%,100%{filter:hue-rotate(0);transform:scale(.96)}50%{filter:hue-rotate(25deg);transform:scale(1.05)}}
@media(max-width:850px){.orbaWorkspace{grid-template-columns:1fr}.orbaVisualColumn{min-height:340px}.orbaConversationColumn{min-height:460px}}
@media(max-width:560px){.orbaPanel{padding:14px;border-radius:20px}.orbaTopbar{align-items:flex-start}.orbaStateBadge{padding:7px 9px}.orbaWorkspace{gap:14px}.orbaVisualColumn{padding:16px}.orbaOrb{width:150px;height:150px}.orbaCapabilityGrid{grid-template-columns:1fr}.orbaCapability span{display:inline;margin-right:5px}.orbaControls>*{width:100%;margin-left:0}.orbaSendButton{margin-left:0}.orbaMessage{max-width:96%}}

/* ORBA Universal v4.1 — global clinic command center */
.orbaGlobalButton{border:0;border-radius:14px;padding:9px 14px;display:inline-flex;align-items:center;gap:9px;background:linear-gradient(135deg,#063b35,#00a884);color:#fff;font-weight:900;letter-spacing:.05em;cursor:pointer;box-shadow:0 10px 24px rgba(0,121,96,.22)}
.orbaGlobalButton:hover{transform:translateY(-1px);box-shadow:0 13px 28px rgba(0,121,96,.3)}
.orbaGlobalButtonOrb{width:17px;height:17px;border:2px solid #fff;border-top-color:transparent;border-radius:50%;display:inline-block;animation:orbaGlobalSpin 2.4s linear infinite}
@keyframes orbaGlobalSpin{to{transform:rotate(360deg)}}
.orbaGlobalBackdrop{position:fixed;inset:0;z-index:4000;background:rgba(5,24,22,.46);backdrop-filter:blur(4px);display:flex;justify-content:flex-end;opacity:0;visibility:hidden;transition:.24s ease}
.orbaGlobalBackdrop.show{opacity:1;visibility:visible}
.orbaGlobalPanel{width:min(560px,100%);height:100%;background:linear-gradient(180deg,#f7fffc 0,#fff 38%);box-shadow:-24px 0 70px rgba(3,43,37,.25);padding:20px;display:flex;flex-direction:column;gap:14px;transform:translateX(32px);transition:.24s ease;overflow:hidden}
.orbaGlobalBackdrop.show .orbaGlobalPanel{transform:translateX(0)}
.orbaGlobalHead{display:flex;align-items:center;justify-content:space-between;gap:12px}
.orbaGlobalIdentity{display:flex;align-items:center;gap:12px}
.orbaGlobalOrb{width:50px;height:50px;border-radius:18px;background:radial-gradient(circle at 35% 30%,#7fffd9,#00a884 45%,#06443b 100%);display:grid;place-items:center;box-shadow:0 14px 34px rgba(0,168,132,.3);position:relative}
.orbaGlobalOrb:before,.orbaGlobalOrb:after{content:"";position:absolute;inset:-7px;border:1px solid rgba(0,168,132,.28);border-radius:22px;animation:orbaGlobalPulse 2.2s ease-out infinite}.orbaGlobalOrb:after{inset:-13px;animation-delay:.7s}
.orbaGlobalOrb span{width:19px;height:19px;border:3px solid #fff;border-top-color:transparent;border-radius:50%;animation:orbaGlobalSpin 1.8s linear infinite}
@keyframes orbaGlobalPulse{0%{transform:scale(.88);opacity:.85}100%{transform:scale(1.15);opacity:0}}
.orbaGlobalEyebrow{font-size:10px;font-weight:900;letter-spacing:.18em;color:#08705e}.orbaGlobalTitle{font-size:26px;font-weight:950;color:#063b35;line-height:1.1}.orbaGlobalTitle small{font-size:11px;background:#dff8ef;color:#08705e;padding:4px 7px;border-radius:999px;vertical-align:middle}
.orbaGlobalClose{border:0;background:#edf7f4;color:#315d56;width:38px;height:38px;border-radius:13px;font-size:25px;cursor:pointer}
.orbaGlobalState{display:flex;align-items:center;gap:9px;padding:9px 12px;border:1px solid #d9ece7;border-radius:13px;background:#fff;color:#416b64;font-size:12px;font-weight:800}.orbaGlobalState i{width:9px;height:9px;border-radius:50%;background:#00a884;box-shadow:0 0 0 5px rgba(0,168,132,.12)}.orbaGlobalState.thinking i,.orbaGlobalState.listening i{animation:orbaStateBlink .8s ease-in-out infinite alternate}.orbaGlobalState.error i{background:#dc3545}.orbaGlobalState.success i{background:#159447}.orbaGlobalState.standby i{background:#f0a000}
@keyframes orbaStateBlink{to{transform:scale(1.55);opacity:.45}}
.orbaGlobalHistory{flex:1;min-height:220px;overflow:auto;border:1px solid #dcece8;border-radius:18px;background:rgba(255,255,255,.86);padding:14px;display:flex;flex-direction:column;gap:10px;scroll-behavior:smooth}
.orbaGlobalMessage{max-width:88%;padding:11px 13px;border-radius:16px;white-space:pre-wrap;line-height:1.48;font-size:14px;box-shadow:0 8px 20px rgba(17,62,55,.05)}.orbaGlobalMessage small{display:block;margin-top:6px;opacity:.65;font-size:10px}.orbaGlobalMessage.assistant{align-self:flex-start;background:#edf9f5;color:#123f38;border-bottom-left-radius:5px}.orbaGlobalMessage.user{align-self:flex-end;background:linear-gradient(135deg,#057663,#00a884);color:#fff;border-bottom-right-radius:5px}.orbaGlobalMessage.error{align-self:flex-start;background:#fff0f1;color:#9d2633}
.orbaGlobalLinks,.orbaCoreLinks{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 2px}.orbaGlobalLinks .btn,.orbaCoreLinks .btn{padding:7px 10px;font-size:12px}
.orbaGlobalSlots{display:flex;flex-wrap:wrap;gap:7px}.orbaGlobalSlots button{border:1px solid #bfe5db;background:#effbf7;color:#076f5d;border-radius:10px;padding:7px 10px;font-weight:850;cursor:pointer}
.orbaGlobalAction,.orbaCoreAction{border:1px solid #9fdacb;background:#effbf7;border-radius:16px;padding:12px;display:flex;flex-direction:column;gap:10px;color:#103f37}.orbaGlobalActionControls{display:flex;gap:8px;flex-wrap:wrap}.orbaCoreActionText{font-weight:800}
.orbaGlobalQuick{display:flex;gap:7px;flex-wrap:wrap}.orbaGlobalQuick button{border:1px solid #d4e8e2;background:#fff;color:#315e56;border-radius:999px;padding:7px 10px;font-size:11px;font-weight:850;cursor:pointer}
.orbaGlobalInput{width:100%;resize:vertical;min-height:76px;border:1px solid #cfe4de;border-radius:16px;padding:12px 13px;font:inherit;outline:none;background:#fff}.orbaGlobalInput:focus{border-color:#00a884;box-shadow:0 0 0 4px rgba(0,168,132,.11)}
.orbaGlobalControls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.orbaGlobalControls select{min-width:104px;border:1px solid #d1e5df;border-radius:12px;padding:9px;background:#fff}.orbaGlobalControls .btn{padding:9px 12px}.orbaGlobalControls .active{background:#dff8ef;border-color:#00a884;color:#06705e}
.orbaGlobalSafety{font-size:11px;color:#71837f;line-height:1.4;padding:0 2px}
.orbaCoreLinks,.orbaCoreAction{margin-top:8px}
@media(max-width:720px){.orbaGlobalPanel{padding:14px}.orbaGlobalTitle{font-size:22px}.orbaGlobalControls .btn{flex:1}.orbaGlobalButton span:last-child{display:none}.orbaGlobalButton{padding:10px}.orbaGlobalHistory{min-height:180px}}


/* ORBA Desktop Agent v4.1 */
.orbaDesktopStatus{margin:0 18px 10px;padding:8px 11px;border-radius:12px;font-size:12px;font-weight:700;border:1px solid transparent;transition:.2s ease}
.orbaDesktopStatus.online{background:#eafff6;border-color:#9fe0c6;color:#08704f}
.orbaDesktopStatus.offline{background:#f4f6f6;border-color:#d8dfdd;color:#66736f}

/* ORBA Universal v4.1 */
.gallery a{position:relative}
.dicomBadge{position:absolute;left:7px;bottom:7px;background:#0a7059;color:#fff;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800;letter-spacing:.04em;box-shadow:0 4px 16px #002b2166}
.orbaGlobalQuick{display:flex;gap:7px;flex-wrap:wrap}
.orbaGlobalQuick button{white-space:nowrap}

.orbaTenantPill{display:flex;flex-direction:column;gap:1px;padding:8px 12px;border-radius:14px;background:#10233a;color:#fff;text-decoration:none;min-width:150px;max-width:260px}.orbaTenantPill b,.orbaTenantPill small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.orbaTenantPill small{opacity:.7;font-size:11px}@media(max-width:1100px){.orbaTenantPill{min-width:120px;max-width:180px}}

/* Orbadent v5.2 — один крупный снимок + просмотр в текущей вкладке */
.latestXrayGallery{display:block!important;max-width:980px}
.latestXrayCard{position:relative;display:block;width:100%;padding:0;border:1px solid var(--line);border-radius:20px;overflow:hidden;background:#07111f;cursor:zoom-in;box-shadow:0 14px 34px rgba(15,23,42,.12)}
.latestXrayCard img{display:block;width:100%!important;height:min(58vh,620px)!important;object-fit:contain!important;border:0!important;border-radius:0!important;background:#07111f}
.latestXrayHint{position:absolute;left:16px;bottom:16px;padding:8px 12px;border-radius:999px;background:rgba(2,6,23,.72);color:#fff;font-size:13px;font-weight:800;backdrop-filter:blur(8px)}
.xrayViewer{position:fixed;inset:0;z-index:10000;display:none;flex-direction:column;background:rgba(3,8,18,.96);backdrop-filter:blur(12px);color:#fff}
.xrayViewer.show{display:flex;animation:xrayFadeIn .18s ease-out}
.xrayViewerTop{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.12);background:rgba(15,23,42,.76)}
.xrayViewerTitle{font-weight:900;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.xrayViewerControls{display:flex;gap:8px;flex-shrink:0}
.xrayViewerControls button{min-width:44px;height:42px;border:1px solid rgba(255,255,255,.18);border-radius:12px;background:rgba(255,255,255,.09);color:#fff;font-size:20px;font-weight:900;cursor:pointer}
.xrayViewerControls button:nth-child(2){min-width:68px;font-size:13px}
.xrayViewerStage{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;cursor:grab}
.xrayViewerStage:active{cursor:grabbing}
.xrayViewerStage img{display:block;max-width:92vw;max-height:82vh;user-select:none;transform-origin:center center;transition:transform .06s linear;box-shadow:0 20px 70px rgba(0,0,0,.4)}
.xrayViewerHelp{padding:9px 16px;text-align:center;font-size:12px;color:#cbd5e1;background:rgba(15,23,42,.72)}
body.xrayViewerOpen{overflow:hidden}
@keyframes xrayFadeIn{from{opacity:0}to{opacity:1}}
@media(max-width:700px){.latestXrayCard img{height:48vh!important}.latestXrayHint{left:10px;bottom:10px;font-size:12px}.xrayViewerTop{padding:10px}.xrayViewerControls button{min-width:40px;height:40px}.xrayViewerTitle{font-size:13px}.xrayViewerHelp{font-size:11px}}

/* Orbadent 5.4 — полноценная мобильная оболочка */
.mobileDock{display:none}
@media (max-width:760px){
  :root{--mobile-dock-h:76px;--header-h:66px}
  html{background:#edf5f2;scroll-padding-top:calc(var(--header-h) + 12px)}
  body{padding-bottom:calc(var(--mobile-dock-h) + env(safe-area-inset-bottom));background:linear-gradient(180deg,#edf8f4 0,#f7f9fb 240px,#f7f9fb 100%)}
  body::before{content:"";position:fixed;z-index:-1;inset:0 0 auto;height:280px;background:radial-gradient(circle at 15% 0,rgba(30,203,159,.22),transparent 46%),linear-gradient(145deg,#052f2a,#096f5d);pointer-events:none}
  .topbar{background:rgba(5,38,34,.94);border-bottom:1px solid rgba(255,255,255,.1);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
  .topbar-inner{min-height:64px;padding:8px 14px;flex-wrap:nowrap}
  .brand{font-size:19px;letter-spacing:-.02em}.brand small{font-size:8px;opacity:.8}
  .top-actions{margin-left:auto;flex-wrap:nowrap;gap:7px}
  .top-actions>a.btn.gray,.top-actions>a.btn.red,.top-actions>.orbaUserPill{display:none}
  .top-actions .orbaGlobalButton{width:42px;height:42px;padding:0;justify-content:center;border-radius:15px;box-shadow:none}
  .top-actions .reminderButton{width:42px;height:42px;padding:0;border-radius:15px;background:rgba(255,255,255,.09)}
  .top-actions .reminderButton>span:nth-child(2){display:none}
  .reminderBadge{position:absolute;right:-3px;top:-4px;border:2px solid #063b35}
  .container,.wrap{width:auto!important;max-width:none!important;margin:14px auto!important;padding:0 12px!important}
  .card,.box,.hero{border-radius:22px!important;padding:16px!important;box-shadow:0 12px 36px rgba(14,54,47,.08)}
  .card>.row:first-child{align-items:flex-start!important;gap:12px}
  .h1,h1{font-size:23px!important;line-height:1.12;letter-spacing:-.025em}
  .h2,h2{font-size:17px!important;line-height:1.2}
  input,select,textarea{min-height:48px;font-size:16px!important;border-radius:14px!important;padding:11px 12px!important}
  textarea{min-height:96px}
  .btn{min-height:46px;border-radius:14px;padding:10px 14px;font-size:14px;display:inline-flex;align-items:center;justify-content:center}
  form.row{display:grid;grid-template-columns:1fr 96px;gap:8px}
  form.row>input,form.row>select,form.row>label{min-width:0!important;width:100%}
  form.row>.btn.gray{grid-column:1/-1}
  .urgentReminderHero{border:0;border-radius:24px;padding:16px;background:linear-gradient(145deg,#fff7ed,#fff 58%);box-shadow:0 14px 36px rgba(124,45,18,.12)}
  .urgentReminderHeroHead{grid-template-columns:46px 1fr auto;gap:10px}
  .urgentReminderClock{width:46px;height:46px;border-radius:15px;font-size:21px}
  .urgentReminderTitle{font-size:16px}.urgentReminderCaption{font-size:11px}
  .urgentReminderCount{grid-column:auto;width:44px;height:44px;border-width:5px;font-size:19px;border-radius:50%}
  .reminderPanel{inset:calc(var(--header-h) + 8px) 10px auto!important;width:auto;max-height:calc(100dvh - var(--header-h) - var(--mobile-dock-h) - 24px);border-radius:22px;padding:16px}
  .mobileDock{position:fixed;z-index:3000;left:10px;right:10px;bottom:calc(8px + env(safe-area-inset-bottom));height:68px;padding:7px 8px;display:flex;align-items:stretch;justify-content:space-around;gap:2px;border:1px solid rgba(255,255,255,.7);border-radius:24px;background:rgba(255,255,255,.93);box-shadow:0 16px 44px rgba(4,45,38,.25);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
  .mobileDock a,.mobileDock button{position:relative;min-width:0;flex:1;border:0;border-radius:17px;background:transparent;color:#7b8d89;text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font:inherit;cursor:pointer}
  .mobileDock span{font-size:20px;line-height:1}.mobileDock small{font-size:9px;font-weight:850;line-height:1.15}
  .mobileDock .active{color:#06725e;background:#e8faf4}
  .mobileDock .mobileDockOrba{color:#fff;max-width:62px;margin:-18px 2px 0;border:6px solid #f7faf9;border-radius:50%;background:linear-gradient(145deg,#00b88e,#075b4d);box-shadow:0 9px 22px rgba(0,135,104,.3)}
  .mobileDock .mobileDockOrba span{font-size:25px}.mobileDock .mobileDockOrba small{color:#fff}
  .mobileDock i{position:absolute;top:2px;right:8px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#ef4444;color:#fff;font-size:10px;font-style:normal;font-weight:900;line-height:18px}
  .footer{padding-bottom:16px}
  .tableWrap:has(.patientsTable){overflow:visible;border:0}
  .patientsTable{min-width:0!important;border-collapse:separate;border-spacing:0 10px}
  .patientsTable thead{display:none}
  .patientsTable tbody,.patientsTable tr,.patientsTable td{display:block;width:100%}
  .patientsTable tr{position:relative;margin-bottom:12px;padding:14px;border:1px solid #dce9e5;border-radius:19px;background:#fff;box-shadow:0 8px 24px rgba(15,61,54,.07)}
  .patientsTable td{display:grid;grid-template-columns:105px 1fr;gap:10px;align-items:start;padding:7px 0;border:0!important;text-align:right;overflow-wrap:anywhere}
  .patientsTable td::before{content:attr(data-label);text-align:left;color:#7b8d89;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
  .patientsTable td:nth-child(2){display:block;padding:0 0 11px;margin-bottom:5px;border-bottom:1px solid #edf2f0!important;text-align:left;font-size:18px}
  .patientsTable td:nth-child(2)::before{display:none}
  .patientsTable td:last-child form{display:block}.patientsTable td:last-child .btn{width:100%;min-height:40px}
  .orbaGlobalBackdrop{align-items:flex-end;justify-content:center;background:rgba(3,24,21,.56)}
  .orbaGlobalPanel{width:100%;height:min(92dvh,820px);padding:16px 14px calc(16px + env(safe-area-inset-bottom));border-radius:28px 28px 0 0;transform:translateY(36px);box-shadow:0 -24px 70px rgba(3,43,37,.28)}
  .orbaGlobalBackdrop.show .orbaGlobalPanel{transform:translateY(0)}
  .orbaGlobalQuick{overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px}.orbaGlobalQuick button{flex:0 0 auto;min-height:38px}
  .orbaGlobalHistory{min-height:0}.orbaGlobalInput{min-height:64px}
  .orbaGlobalControls{display:grid;grid-template-columns:1fr 1fr}.orbaGlobalControls select{grid-column:1/-1;width:100%}.orbaGlobalControls .btn{width:100%;margin:0}.orbaGlobalControls .btn:last-child{grid-column:1/-1}
  .latestXrayCard img{height:42dvh!important}
}

@media (max-width:390px){
  .mobileDock{left:6px;right:6px}.mobileDock small{font-size:8px}
  .brand{font-size:17px}.urgentReminderEyebrow{font-size:9px}.urgentReminderTitle{font-size:14px}
}

@media (display-mode:standalone) and (max-width:760px){
  .topbar-inner{padding-top:calc(8px + env(safe-area-inset-top))}
}

/* ORBADENT 5.6 - clean blue & white dental platform, desktop + mobile */
:root{--bg:#f2f7ff;--card:#fff;--text:#12284b;--muted:#6b7f9a;--line:#dfebfa;--blue:#1262ee;--green:#139ccc;--red:#f34c64;--header-h:76px}
body{background:linear-gradient(180deg,#edf5ff 0,#f7faff 280px,#f7faff 100%);color:var(--text);font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif}
.topbar{background:rgba(255,255,255,.97);color:#16315a;border-bottom:1px solid #dce8f9;box-shadow:0 4px 22px rgba(18,62,123,.045);backdrop-filter:blur(18px)}
.topbar-inner{max-width:none;min-height:74px;padding:9px 30px}
.brandHome{color:#132d64!important;font-size:25px;font-weight:900;letter-spacing:-.07em!important;display:flex;align-items:center;gap:0}
.obBrandMark{display:inline-grid;place-items:center;margin-right:9px;width:34px;height:34px;color:white;border-radius:50%;background:linear-gradient(140deg,#102d91,#0ebcf1);font-size:29px;line-height:1;letter-spacing:0}
.obBrandBlue{color:#169ddd}
.brandHome:hover{background:#e9f3ff;color:#12315c!important}
.top-actions>a.btn.gray{background:#fff;border:1px solid #e1ecfa;color:#285078}
.orbaUserPill{background:#f0f6ff;border:1px solid #dceafc;color:#122d5a;min-width:120px;border-radius:16px}
.orbaUserPill small{color:#477faf}.reminderButton{background:#f0f6ff!important;color:#1257b2!important;border:1px solid #dceafd;border-radius:14px}
.container{max-width:1520px}.card,.box{border-color:#e0eafa;border-radius:23px;box-shadow:0 10px 34px rgba(18,62,123,.06)}.card:hover{box-shadow:0 12px 34px rgba(18,62,123,.065)}
.h1,h1{color:#12325e;letter-spacing:-.025em}.h2,h2{color:#1c3c69}th{background:#f1f6fe;color:#244876}
.btn{border-radius:13px}.btn.blue{background:linear-gradient(135deg,#145cec,#1597ec)}.btn.green{background:linear-gradient(135deg,#135be5,#119bc9)}.btn.gray{background:#f0f5fc;border-color:#dce9fa;color:#28507d}
input:focus,select:focus,textarea:focus{border-color:#4ca0ff;box-shadow:0 0 0 3px rgba(55,140,245,.1)}
.orbaSidebar{position:fixed;left:0;top:var(--header-h);bottom:0;width:102px;background:linear-gradient(180deg,#072f76,#081d51);display:flex;flex-direction:column;align-items:center;gap:14px;padding:22px 8px;z-index:800;box-shadow:7px 0 20px rgba(11,43,107,.05)}
.orbaSidebar a{width:86px;min-height:77px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border-radius:16px;color:#c7ddff;text-decoration:none;font-size:11px;font-weight:750}
.orbaSidebar a span{font-size:25px;line-height:1}.orbaSidebar a:hover,.orbaSidebar a.active{color:#fff;background:linear-gradient(140deg,#1da0ff,#175fea);box-shadow:0 9px 24px rgba(16,121,255,.26)}
@media(min-width:761px){body:has(.orbaSidebar) .container,body:has(.orbaSidebar) .wrap{max-width:calc(100% - 110px)!important;width:auto!important;margin-left:calc(110px + max(14px, (100vw - 1630px) / 2))!important;margin-right:max(16px, (100vw - 1630px) / 2)!important}body:has(.orbaSidebar) .topbar-inner{padding-left:126px}body:has(.orbaSidebar) .top-actions>a.btn.gray{display:none}}
.orbaFab{position:fixed;right:24px;bottom:24px;z-index:3100;width:69px;height:69px;border:4px solid #fff;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;color:#fff;background:radial-gradient(circle at 35% 28%,#61dcff,#178aff 45%,#093890);box-shadow:0 12px 34px rgba(5,79,184,.32),0 0 0 5px rgba(24,139,255,.14);cursor:pointer}
.orbaFab:hover{transform:translateY(-3px);box-shadow:0 15px 42px rgba(0,100,210,.39)}.orbaFabRing{font-size:31px;line-height:30px}.orbaFabText{font-size:10px;font-weight:950;letter-spacing:.08em}
.orbaFabToast{position:fixed;right:100px;bottom:40px;z-index:3200;max-width:min(360px,calc(100vw - 125px));padding:12px 17px;border-radius:15px;background:#102d62;color:#fff;font-size:13px;font-weight:750;box-shadow:0 13px 30px rgba(3,31,77,.28)}.orbaFabToast[hidden]{display:none}
.orbaGlobalBackdrop{background:rgba(10,33,70,.45)}.orbaGlobalPanel{border-radius:28px 0 0 28px;border:1px solid #d9e9ff}.orbaGlobalHead{color:#142c56}.orbaGlobalTitle{color:#103675!important}.orbaGlobalOrb{background:linear-gradient(145deg,#1748c5,#2fc6fe)}.orbaGlobalState i{background:#189eec}.orbaGlobalMessage.user{background:#dceaff;color:#123c8d}.orbaGlobalMessage.assistant{background:#fff}.orbaGlobalControls .btn.green{background:#116eea}
.orba-price-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:15px}.orba-price-field{display:flex;flex-direction:column;gap:7px;background:#f5f9ff;border:1px solid #dae8f9;border-radius:18px;padding:13px}.orba-price-field span{font-weight:750}.orba-price-field small{color:#7790b2;font-size:10px}
.tooth{position:relative;color:#193c72;border:1px solid #c5d9f1;border-radius:15px;box-shadow:0 4px 12px rgba(21,86,174,.06)}.toothCount{position:absolute;top:-6px;right:-5px;background:#116eea;color:#fff;min-width:15px;min-height:15px;border-radius:10px;font-size:10px;font-weight:800;line-height:15px}.toothCount:empty{display:none}.tooth.aiChanged{box-shadow:0 0 0 3px rgba(18,114,239,.22)}.btnTag{border-radius:14px}
.xrayViewer{background:rgba(3,13,37,.97)}.xrayViewerTop{background:#071d43}.xrayViewerStage img{max-width:96vw;max-height:86dvh}.xrayViewerThumbnails{display:flex;gap:10px;align-items:center;overflow-x:auto;max-height:86px;padding:7px 12px;background:#0b224b}.xrayViewerThumb{flex:0 0 auto;padding:1px;border:2px solid transparent;border-radius:10px;background:#1e3860;cursor:pointer}.xrayViewerThumb.active{border-color:#48b4ff}.xrayViewerThumb img{width:66px;height:51px;object-fit:contain}
.orbaPageHero{border-radius:24px;padding:22px;background:linear-gradient(110deg,#072d73,#1575e9);color:#fff}.orbaPageHero h1{color:#fff;margin:0 0 6px}.orbaPageHero p{color:#d3e7ff;margin:0}.orbaDashStats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.orbaDashStat{border:1px solid #dfecfa;border-radius:22px;background:#fff;padding:20px;min-height:126px;box-shadow:0 8px 28px rgba(18,74,152,.055)}.orbaDashStat .icon{font-size:25px;display:inline-grid;place-items:center;background:#e7f3ff;border-radius:14px;width:50px;height:50px}.orbaDashStat b{font-size:26px;display:block;margin-top:10px;color:#09295c}.orbaDashStat small{font-size:12px;color:#7189a9}.orbaDashContent{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:16px}.orbaDashItem{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px;border-bottom:1px solid #edf3fb}.orbaDashItem:last-child{border:0}.orbaDashItem a{color:#0960ca;font-weight:750}.orbaDashActionGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.orbaDashActionGrid a{display:block;background:#f2f7ff;border:1px solid #dceafb;border-radius:16px;padding:16px;font-weight:800;color:#0e4da7}
@media(max-width:1100px){.orba-price-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.orbaDashStats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
  :root{--mobile-dock-h:77px;--header-h:67px}
  body{background:#f4f8ff!important;padding-bottom:calc(var(--mobile-dock-h) + env(safe-area-inset-bottom) + 12px)}body::before{display:none}
  .topbar{background:rgba(255,255,255,.97)!important;border-bottom:1px solid #dce9fa}.topbar-inner{min-height:64px;padding:8px 12px}.brandHome{font-size:20px!important;color:#113d88!important}.obBrandMark{width:26px;height:26px;font-size:22px}
  .top-actions .reminderButton{width:42px;height:42px}.orbaSidebar{display:none}
  .mobileDock{background:rgba(255,255,255,.97)!important;border:1px solid #dce8fa;box-shadow:0 13px 37px rgba(23,69,136,.16);gap:6px}.mobileDock a,.mobileDock button{color:#7288aa}.mobileDock .active{color:#0d68de;background:#e7f2ff}
  .orbaFab{bottom:calc(92px + env(safe-area-inset-bottom));right:16px;width:60px;height:60px;box-shadow:0 9px 26px rgba(16,97,211,.3)}.orbaFabRing{font-size:26px;line-height:25px}.orbaFabText{font-size:9px}.orbaFabToast{bottom:calc(108px + env(safe-area-inset-bottom));right:82px}
  .container,.wrap{max-width:none!important;width:auto!important;margin:14px auto!important;padding:0 12px!important}.card,.box{padding:16px!important;border-radius:21px!important}
  .orbaGlobalPanel{border-radius:26px 26px 0 0}.orbaDashStats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.orbaDashStat{padding:12px;min-height:100px}.orbaDashStat b{font-size:21px}.orbaDashStat .icon{width:38px;height:38px;font-size:20px}.orbaDashContent{grid-template-columns:1fr}.orbaDashActionGrid{grid-template-columns:1fr 1fr;gap:8px}.orbaDashActionGrid a{padding:12px;font-size:12px}
  .orba-price-grid{grid-template-columns:1fr 1fr;gap:8px}.orba-price-field{padding:10px}.orba-price-field span{font-size:12px}.orba-price-field input{min-height:42px}
  .teeth{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:6px}.tooth{width:auto;height:40px;border-radius:10px;font-size:11px}.toothCount{min-width:14px;min-height:14px;font-size:9px;line-height:14px}
  .treatTable{min-width:0!important;border:0;border-collapse:separate;border-spacing:0 12px}.treatTable thead{display:none}.treatTable tbody,.treatTable tr,.treatTable td{display:block;width:100%}.treatTable tr{border:1px solid #dce8fa;border-radius:17px;background:#f8fbff;padding:8px 12px}.treatTable td{border:0!important;padding:6px 0;display:grid;grid-template-columns:95px 1fr;gap:6px;align-items:center}.treatTable td:before{color:#687fa0;font-size:11px;font-weight:800}.treatTable td:nth-child(1):before{content:'Зуб'}.treatTable td:nth-child(2):before{content:'Дата'}.treatTable td:nth-child(3):before{content:'Диагноз'}.treatTable td:nth-child(4):before{content:'Заметка'}.treatTable td:nth-child(5):before{content:'Цена'}
  .tableWrap:has(.treatTable){overflow:visible;border:0}.treatTable input{padding:7px!important;min-height:40px!important}.xrayViewerHelp{font-size:10px}
}
@media(max-width:380px){.brandHome{font-size:17px!important}.teeth{gap:4px}.tooth{height:35px;font-size:10px}.orbaDashActionGrid{grid-template-columns:1fr}}
.xrayViewerControls button:nth-child(3){min-width:69px;font-size:13px}

/* Prior large ORBA widget kept for backwards compatibility, but replaced visually by floating ORBA. */
#orbaPanel{display:none!important}

.orbaToothInfo{max-width:980px;margin:12px auto;padding:12px 15px;border-radius:15px;background:#e9f3ff;border:1px solid #c9dffa;color:#164b8c;font-size:13px;font-weight:750}

/* ORBADENT V10.10: shared legacy theme; clinical status colors unchanged */
:root{--bg:#f4f8f6;--card:#fff;--text:#17342e;--muted:#526d64;--line:#dbe8e2;--blue:#08765d;--green:#16764c}
body{background:var(--bg);color:var(--text)}
.card{border-color:var(--line);border-radius:16px;box-shadow:0 8px 24px rgba(20,65,50,.06)}
.btn.blue,.btn.green{background:#08765d;color:#fff;border-color:#08765d}
.btn.gray{background:#edf5f1;color:#174b3d;border-color:#dbe8e2}
.topbar{background:#fff!important;color:#17342e;border-bottom-color:#dbe8e2;box-shadow:0 4px 20px rgba(20,65,50,.06)}
.brandHome,.topbar .brandHome{color:#075943!important}
.brandHome:hover{background:#e5f2eb;color:#075943!important}
:where(a,button,input,select,textarea):focus-visible{outline:2px solid #08765d;outline-offset:2px}
@media(max-width:600px){.container{padding-left:10px;padding-right:10px}.card{min-width:0;overflow-wrap:anywhere}.tableWrap{max-width:100%}}
