
:root {
    --bg: #070b18;
    --ink: #e8ecf7;
    --muted: #9aa6c2;
    --line: rgba(255, 255, 255, .12);
    --teal: #0d9488;
    --teal-d: #0f766e;
    --cyan: #0891b2;
    --indigo: #4f46e5;
    --amber: #f59e0b;
    --pink: #ec4899;
    --grad: linear-gradient(120deg, #0d9488, #0891b2 45%, #4f46e5);

    --p-bg: #eef2f7;
    --p-panel: #ffffff;
    --p-ink: #1f2937;
    --p-muted: #6b7280;
    --p-line: #e5e7eb;
    --p-primary: #0d9488;
    --p-primary-d: #0f766e;
    --student: #eef2ff;
    --student-b: #c7d2fe;
    --patient: #ecfdf5;
    --patient-b: #a7f3d0;
    --shadow-sm: 0 2px 10px -4px rgba(16, 24, 40, .2);

    --stage-h: clamp(520px, calc(100svh - 356px), 800px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.demo {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(1000px 520px at 12% -8%, rgba(13, 148, 136, .30), transparent 60%),
        radial-gradient(900px 560px at 92% 0%, rgba(79, 70, 229, .32), transparent 60%),
        radial-gradient(800px 500px at 50% 110%, rgba(236, 72, 153, .14), transparent 60%),
        linear-gradient(180deg, #070b18, #0a1128 60%, #070b18);
    background-attachment: fixed;
    overflow-x: hidden;
}

button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

.wm {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    user-select: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='380' height='250'%3E%3Cg transform='rotate(-24 190 125)' font-family='Helvetica,Arial,sans-serif' text-anchor='middle'%3E%3Ctext x='190' y='128' font-size='60' font-weight='800' letter-spacing='11' fill='%2394a3b8' fill-opacity='.19' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1'%3E%D0%94%D0%95%D0%9C%D0%9E%3C/text%3E%3Ctext x='190' y='158' font-size='14' font-weight='700' letter-spacing='6' fill='%2394a3b8' fill-opacity='.21'%3ECASUS %C2%B7 DEMO%3C/text%3E%3C/g%3E%3C/svg%3E");
    background-size: 380px 250px;
}

/* The watermark word in the Latin alphabet for every non-Ukrainian page. */
html:not([lang="uk"]) .wm {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='380' height='250'%3E%3Cg transform='rotate(-24 190 125)' font-family='Helvetica,Arial,sans-serif' text-anchor='middle'%3E%3Ctext x='190' y='128' font-size='60' font-weight='800' letter-spacing='11' fill='%2394a3b8' fill-opacity='.19' stroke='%23ffffff' stroke-opacity='.08' stroke-width='1'%3EDEMO%3C/text%3E%3Ctext x='190' y='158' font-size='14' font-weight='700' letter-spacing='6' fill='%2394a3b8' fill-opacity='.21'%3ECASUS %C2%B7 DEMO%3C/text%3E%3C/g%3E%3C/svg%3E");
}

.topbar {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 16px 10px;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    backdrop-filter: blur(8px);
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
    white-space: nowrap;
}

.back .arw { transition: transform .18s ease; display: inline-block; }
.back .txt-short { display: none; }
.back:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.back:hover .arw { transform: translateX(-4px); }

.tb-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.01em;
}

.tb-brand .logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--grad);
    font-size: 1rem;
    box-shadow: 0 10px 24px -10px rgba(13, 148, 136, .9);
}

.tb-brand .tag {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
    padding: 4px 9px;
    border-radius: 999px;
    color: #1b1206;
    background: linear-gradient(120deg, #fbbf24, #fb7185);
}

.tb-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 20px;
    border-radius: 999px;
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    background: var(--grad);
    background-size: 180% 180%;
    box-shadow: 0 16px 34px -14px rgba(13, 148, 136, .8);
    animation: shift 8s ease infinite;
    transition: transform .16s ease;
    white-space: nowrap;
}

.tb-cta:hover { transform: translateY(-2px) scale(1.02); }

@keyframes shift {
    0%, 100% { background-position: 0 50%; }
    50% { background-position: 100% 50%; }
}

.ribbon {
    position: relative;
    z-index: 5;
    margin: 0 auto;
    max-width: 1240px;
    padding: 0 16px;
}

.ribbon > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 7px 14px;
    border-radius: 12px;
    background: linear-gradient(100deg, rgba(251, 191, 36, .95), rgba(251, 113, 133, .95));
    color: #1b1206;
    font-size: .8rem;
    font-weight: 750;
    letter-spacing: .01em;
    text-align: center;
    line-height: 1.35;
}

.ribbon .rec {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #b91c1c;
    box-shadow: 0 0 0 0 rgba(185, 28, 28, .6);
    animation: recPulse 1.6s infinite;
    flex: none;
}

@keyframes recPulse {
    0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .55); }
    70% { box-shadow: 0 0 0 9px rgba(185, 28, 28, 0); }
    100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}

.theater {
    position: relative;
    z-index: 2;
    max-width: 1240px;
    margin: 14px auto 36px;
    padding: 0 16px;
}

.frame {
    border-radius: 20px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, .10);
    box-shadow:
        0 60px 120px -40px rgba(0, 0, 0, .85),
        0 0 0 1px rgba(255, 255, 255, .04),
        0 0 90px -20px rgba(79, 70, 229, .35);
}

.frame-bar {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    background: #172036;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.frame-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.frame-bar .dot.r { background: #ff5f57; }
.frame-bar .dot.y { background: #febc2e; }
.frame-bar .dot.g { background: #28c840; }

.frame-bar .url {
    margin-left: 10px;
    padding: 3px 14px;
    border-radius: 8px;
    font-size: .72rem;
    color: #b4bfd8;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, .08);
}

.frame-bar .tag {
    margin-left: auto;
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .12em;
    padding: 3px 9px;
    border-radius: 999px;
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, .45);
}

.screen {
    container-type: size;
    position: relative;
    height: var(--stage-h);
    overflow: hidden;
    background: var(--p-bg);
    color: var(--p-ink);
    font-size: 16px;
    isolation: isolate;
}

.scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease, visibility .35s;
}

.scene.on { opacity: 1; visibility: visible; }

.scene-picker {
    padding: 16px 22px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.pk-hero { flex: none; display: flex; gap: 12px; width: 100%; max-width: 900px; margin: 0 auto; }

.pk-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 50px;
    padding: 0 18px;
    border: 2px solid var(--p-primary);
    border-radius: 16px;
    background: #fff;
    color: #94a3b8;
    font-size: .92rem;
    box-shadow: 0 12px 28px -20px rgba(13, 148, 136, .8);
}

.pk-search svg { flex: none; width: 20px; height: 20px; fill: none; stroke: #94a3b8; stroke-width: 2; stroke-linecap: round; }
.pk-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pk-rand {
    flex: none;
    display: flex;
    align-items: center;
    gap: 11px;
    height: 50px;
    padding: 0 18px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(120deg, #4f46e5, #7c3aed);
    box-shadow: 0 14px 28px -14px rgba(79, 70, 229, .8);
}

.pk-rand svg { flex: none; width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.pk-rand b { display: block; font-size: .9rem; line-height: 1.15; }
.pk-rand small { display: block; font-size: .7rem; opacity: .85; }

.pk-filters { flex: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.pk-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }

.sg {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 10px;
    color: #374151;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, transform .12s ease;
}

.sg i { padding: 1px 7px; border-radius: 999px; background: #eef2f7; color: #64748b; font-size: .7rem; font-style: normal; }
.sg.crit { color: #b91c1c; }
.sg.done { color: #15803d; }
.sg.on { background: #0f172a; color: #fff; }
.sg.on i { background: rgba(255, 255, 255, .18); color: #fff; }

.cat-tiles { flex: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }

.cat-tile {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 11px 12px;
    border: 1px solid var(--p-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: opacity .3s ease;
}

.cat-tile.ct-empty { opacity: .42; }

.ct-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--cat);
    background: color-mix(in srgb, var(--cat) 13%, #fff);
    font-weight: 800;
}

.ct-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ct-name { font-size: .8rem; font-weight: 700; line-height: 1.2; }
.ct-bar { display: block; height: 4px; border-radius: 9px; background: #eef2f7; overflow: hidden; }
.ct-bar i { display: block; width: 10%; height: 100%; border-radius: 9px; background: var(--cat); }
.ct-sub { font-size: .68rem; color: var(--p-muted); }

.cs-head { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.cs-head h3 { margin: 0; font-size: 1.05rem; letter-spacing: -.01em; }
.cs-count { padding: 2px 9px; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: .72rem; font-weight: 700; }

.pk-list {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 12px;
    overflow: hidden;
    padding-bottom: 14px;
}

.case-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px 16px 13px;
    border: 1px solid var(--p-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    animation: inUp .32s ease both;
}

.case-card.critical { border-top: 3px solid #ef4444; }
.case-card.hide { display: none; }
.cc-critical { align-self: flex-start; padding: 2px 9px; border-radius: 999px; background: #fef2f2; color: #b91c1c; font-size: .68rem; font-weight: 800; }
.cc-title { flex: 1; font-size: .9rem; font-weight: 750; line-height: 1.35; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.cc-start {
    padding: 7px 14px;
    border: 1.5px solid var(--p-line);
    border-radius: 11px;
    background: #fff;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}

.cc-start.pressed { border-color: var(--p-primary); background: var(--p-primary); color: #fff; transform: scale(.96); }
.cc-code { color: #b6bdc9; font-size: .66rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.sg.pressed, .tab.pressed, .send.pressed, .btn.pressed, .ew-chip.pressed { transform: scale(.95); }
.send, .tab, .btn, .ew-chip { transition: transform .12s ease, background .2s ease; }

body.no-cc .cap-in { opacity: 0 !important; }

@keyframes inUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes alarm { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes inLeft { from { opacity: 0; transform: translateX(-16px) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes inRight { from { opacity: 0; transform: translateX(16px) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

.scene-consult {
    display: grid;
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
}

.vstage {
    --stage-w: 42cqw;
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(165deg, #d9f3ee 0%, #cfe9f3 55%, #e3e6fb 100%);
    box-shadow: 0 30px 70px -40px rgba(15, 23, 42, .45);
}

/* The chips are a row of their own above the portrait: nothing ever lies over the face. */
.vs-top { position: relative; z-index: 3; flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 12px 0; }

.vs-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 20px -10px rgba(15, 23, 42, .4);
    color: var(--p-ink);
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.vs-chip.ptimer { font-variant-numeric: tabular-nums; }
.vs-chip.ptimer::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--p-primary); animation: pulse 1.6s ease-in-out infinite; }
.vs-chip.voice { cursor: pointer; }
.vs-chip.vs-code { margin-right: auto; color: var(--p-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .74rem; letter-spacing: .04em; }
.vs-chip.vs-code:empty { display: none; }
.vs-chip.vs-ai { letter-spacing: .04em; cursor: help; }
.vs-chip .sw { position: relative; flex: none; width: 28px; height: 16px; border-radius: 999px; background: var(--p-primary); transition: background .2s ease; }
.vs-chip .sw::after { content: ""; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.vs-chip .sw.off { background: #cbd5e1; }
.vs-chip .sw.off::after { transform: translateX(-12px); }

.avatar-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.avatar-slot { position: relative; flex: 1; min-width: 0; display: grid; place-items: center; }

.avatar-slot .avatar {
    position: absolute;
    left: 50%;
    bottom: 18px;
    display: block;
    width: auto;
    height: min(92%, calc(var(--stage-w) * 1.15));
    aspect-ratio: 1 / 1;
    transform: translateX(-50%);
}

/* A bust is wider than the stage: the head sits high, the shoulders run past the sides, the chest goes behind the band. */
.avatar-slot.bust .avatar { top: 0; bottom: auto; height: max(104%, calc(var(--stage-w) * 1.02)); }

.avatar-slot.drawn .avatar {
    position: static;
    height: min(59%, calc(var(--stage-w) * .72));
    margin-bottom: 20px;
    border: 5px solid #fff;
    border-radius: 50%;
    background: #f1f5f9;
    box-shadow: 0 24px 60px -28px rgba(15, 23, 42, .6);
    transform: none;
}

.vs-band {
    position: relative;
    z-index: 2;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: -22px;
    padding: 13px 14px 14px 18px;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -18px 40px -26px rgba(15, 23, 42, .5);
}

.vs-speaking {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity .3s ease;
}

.vs-speaking::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5eead4; animation: pulse 1s ease-in-out infinite; }
.screen[data-speaker="patient"] .vs-speaking { opacity: 1; }

.vs-plate { min-width: 0; }
.vs-plate .pname { font-size: clamp(1.25rem, 2.4cqw, 1.9rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.vs-plate .pname small { margin-left: 8px; color: var(--p-muted); font-size: .5em; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.vs-plate .pgender { margin-top: 3px; color: var(--p-muted); font-size: .72rem; }

.vs-plate .complaint {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.vm-numerics { display: flex; gap: 6px; }

.vm-num {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 6px 9px;
    border-radius: 12px;
    background: #f1f5f9;
    transition: background .3s ease;
}

.vm-num.n-nibp { flex-grow: 1.5; }
.vm-num .k { color: var(--p-muted); font-size: .62rem; font-weight: 700; }
.vm-num b { font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vm-num .u { color: var(--p-muted); font-size: .56rem; white-space: nowrap; }
.vm-num.alarm { background: #fef2f2; }
.vm-num.alarm b { color: #dc2626; animation: alarm 1.2s ease-in-out infinite; }

.chatwrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 13px 18px 14px;
    border: 1px solid var(--p-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 30px 70px -40px rgba(15, 23, 42, .45);
}

.visit-head { flex: none; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 280px 10px 0; border-bottom: 1px solid var(--p-line); }

.vh-face {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #d9f3ee var(--pt-thumb) 50% 56% / 190% auto no-repeat;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #5eead4;
}

.screen.pt-bust .vh-face, .screen.pt-bust .msg-patient::before { background-position: 50% 20%; background-size: 290% auto; }
.screen.pt-drawn .vh-face, .screen.pt-drawn .msg-patient::before { background-position: 50% 50%; background-size: cover; }

.vh-text { flex: 1; min-width: 0; }
.vh-text h2 { margin: 0; overflow: hidden; font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
.vh-text p { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; overflow: hidden; color: var(--p-muted); font-size: .72rem; white-space: nowrap; }
.vh-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }

.chat {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 6px 4px 4px 2px;
    overflow: hidden auto;
    scrollbar-width: none;
}

.chat::-webkit-scrollbar, .results::-webkit-scrollbar { display: none; }

.msg { flex: none; max-width: 78%; padding: 9px 13px 10px; border-radius: 18px; font-size: .9rem; line-height: 1.45; }
.msg .who, .effect .who { display: block; margin-bottom: 3px; color: var(--p-muted); font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.msg-patient {
    position: relative;
    align-self: flex-start;
    margin-left: 38px;
    border-radius: 18px 18px 18px 6px;
    background: #f1f5f9;
    animation: inLeft .32s cubic-bezier(.2, .8, .2, 1) both;
}

.msg-patient::before {
    content: "";
    position: absolute;
    left: -38px;
    bottom: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #d9f3ee var(--pt-thumb) 50% 56% / 190% auto no-repeat;
}

.msg-student {
    align-self: flex-end;
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    box-shadow: 0 12px 26px -16px rgba(13, 148, 136, .9);
    animation: inRight .32s cubic-bezier(.2, .8, .2, 1) both;
}

.msg-student .who { color: #fff; opacity: .8; }
.caret { display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--p-primary); animation: blink .9s steps(2) infinite; }

.effect {
    flex: none;
    align-self: stretch;
    padding: 9px 13px;
    border-left: 3px solid #7c3aed;
    border-radius: 12px;
    background: #f5f3ff;
    font-size: .84rem;
    line-height: 1.4;
    animation: inLeft .32s ease both;
}

.effect .who { color: #6d28d9; }

.statusrow { flex: none; min-height: 16px; padding: 0 4px; }
.thinking { display: none; align-items: center; gap: 8px; color: var(--p-primary); font-size: .78rem; font-weight: 600; }
.thinking.on { display: flex; }
.thinking.helping { color: #6d28d9; }
.dots { display: inline-flex; gap: 4px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: bounce 1.2s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }

.inputrow {
    flex: none;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 7px 6px 8px;
    border-radius: 20px;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px var(--p-line);
}

.mic {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(140deg, #14b8a6, #0d9488);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(13, 148, 136, .9);
    transition: background .2s ease;
}

.mic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.field { flex: 1; min-width: 0; min-height: 40px; padding: 10px 4px; font-size: .9rem; line-height: 1.4; }
.field .ph, .dict-area .ph { color: #9ca3af; }
.send { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--p-primary); color: #fff; font-size: .95rem; }

.screen[data-speaker="doctor"] .mic { background: #ef4444; animation: micPulse 1.1s ease-in-out infinite; }

@keyframes micPulse {
    0%, 100% { box-shadow: 0 8px 16px -8px rgba(239, 68, 68, .8), 0 0 0 0 rgba(239, 68, 68, .5); }
    50% { box-shadow: 0 8px 16px -8px rgba(239, 68, 68, .8), 0 0 0 9px rgba(239, 68, 68, 0); }
}

.actions { flex: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }

.act {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 66px;
    padding: 8px 4px;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px var(--p-line);
    font-size: .74rem;
    font-weight: 700;
    text-align: center;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.act .ic {
    box-sizing: content-box;
    width: 18px;
    height: 18px;
    padding: 7px;
    border-radius: 11px;
    background: rgba(13, 148, 136, .12);
    color: #0d9488;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.act.o-amber .ic { background: rgba(217, 119, 6, .13); color: #d97706; }
.act.o-indigo .ic { background: rgba(79, 70, 229, .12); color: #4f46e5; }
.act.o-cyan .ic { background: rgba(8, 145, 178, .12); color: #0891b2; }
.act.o-green .ic { background: rgba(22, 163, 74, .12); color: #16a34a; }
.act .lb { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.act.pressed { background: #fff; box-shadow: inset 0 0 0 1px #5eead4, 0 14px 26px -18px rgba(13, 148, 136, .8); transform: translateY(-2px); }

/* «Скасувати» / «Завершити» live with the tools but sit in the head of the conversation. */
.act.ah {
    position: absolute;
    top: 13px;
    flex-direction: row;
    gap: 7px;
    min-height: 0;
    height: 42px;
    padding: 0 14px;
    border-radius: 13px;
    font-size: .84rem;
    letter-spacing: -.005em;
}

.act.ah .ic { width: 18px; height: 18px; padding: 0; border-radius: 0; background: none; color: currentColor; stroke-width: 2.4; }

.act.end, .act.end.pressed {
    right: 18px;
    width: 146px;
    background: linear-gradient(135deg, #0d9488, #4f46e5);
    color: #fff;
    box-shadow: 0 12px 26px -12px rgba(13, 148, 136, .95), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.act.cancel, .act.cancel.pressed {
    right: 172px;
    width: 132px;
    background: #fef2f2;
    box-shadow: inset 0 0 0 1.5px #fecaca;
    color: #dc2626;
}

.act.cancel.pressed { background: #fee2e2; box-shadow: inset 0 0 0 1.5px #dc2626; }
.act.ah.pressed { transform: translateY(-1px) scale(.97); }

.ov {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, .45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s;
}

.ov.show { opacity: 1; visibility: visible; }

.modal, .sheet {
    display: flex;
    flex-direction: column;
    width: min(620px, 100%);
    max-height: 100%;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 40px 90px -30px rgba(15, 23, 42, .6);
    transform: translateY(10px) scale(.98);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}

.ov.show .modal, .ov.show .sheet { transform: none; }
.modal.wide { width: min(940px, 100%); }

.modal-h {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--p-line);
    font-size: 1.02rem;
    font-weight: 800;
}

.modal-h .x { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #f1f5f9; font-size: .8rem; transition: transform .12s ease; }
.modal-h .x.pressed { background: #e2e8f0; transform: scale(.92); }
.modal-b { min-height: 0; padding: 16px 18px; overflow: hidden; }
.modal-f { flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--p-line); }
.btn { padding: 9px 16px; border-radius: 12px; font-size: .86rem; font-weight: 750; white-space: nowrap; }
.btn.grey { background: #f8fafc; box-shadow: inset 0 0 0 1.5px var(--p-line); color: #475569; }
.btn.primary { background: var(--p-primary); color: #fff; }
.rtext { margin: 0; font-size: .92rem; line-height: 1.5; }

.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.diff-card { position: relative; padding: 15px 10px; border: 1.5px solid var(--p-line); border-radius: 14px; font-weight: 800; text-align: center; transition: transform .12s ease, background .15s ease; }
.diff-card.recommended { border-color: var(--p-primary); box-shadow: 0 0 0 3px rgba(13, 148, 136, .14); }
.diff-card.pressed { background: #f0fdfa; transform: scale(.96); }
.diff-rec { position: absolute; top: -9px; left: 50%; padding: 2px 9px; border-radius: 999px; background: var(--p-primary); color: #fff; font-size: .58rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; transform: translateX(-50%); }
.diff-link { display: inline-block; margin-top: 13px; color: var(--indigo); font-size: .84rem; }

.ov-prep { background: rgba(255, 255, 255, .86); }
.center-msg { color: #0f766e; font-size: 1.05rem; font-weight: 750; text-align: center; }
.center-msg .dots { margin-left: 8px; vertical-align: middle; color: var(--p-primary); }

.ov-sheet { padding: 12px; }
.sheet { width: 100%; height: 100%; }
.sheet-b { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 350px) minmax(0, 1fr); }
.sheet-l { min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; overflow: hidden; border-right: 1px solid var(--p-line); }
.tabs { flex: none; display: flex; gap: 2px; padding: 4px; border-radius: 13px; background: #f1f5f9; }
.tab { flex: 1; padding: 7px 4px; border-radius: 10px; color: #64748b; font-size: .76rem; font-weight: 700; text-align: center; white-space: nowrap; }
.tab.on { background: #fff; color: var(--p-primary-d); box-shadow: var(--shadow-sm); }
.sheet-search { flex: none; padding: 9px 13px; border: 2px solid var(--p-primary); border-radius: 14px; color: #94a3b8; font-size: .84rem; }
.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; overflow: hidden; }
.items[hidden] { display: none; }

.item {
    display: grid;
    place-items: center;
    min-height: 40px;
    padding: 7px 8px;
    border: 1.5px solid #5eead4;
    border-radius: 12px;
    color: var(--p-primary-d);
    font-size: .78rem;
    line-height: 1.2;
    text-align: center;
    transition: transform .12s ease, background .15s ease, opacity .2s ease;
}

.item.done { background: #f0fdfa; opacity: .55; }
.item.pressed { background: #ccfbf1; transform: scale(.95); }

.sheet-r { min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; overflow: hidden; }
.sheet-r .lbl, .d-lbl { color: var(--p-muted); font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.results { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; overflow: hidden auto; scrollbar-width: none; }

.res {
    flex: none;
    padding: 11px 14px;
    border: 1px solid var(--p-line);
    border-left: 4px solid #0d9488;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    animation: inUp .4s cubic-bezier(.2, .8, .2, 1) both;
}

.res-lab { border-left-color: #4f46e5; }
.res-instr { border-left-color: #0891b2; }
.res h4 { margin: 0; font-size: .94rem; }
.res .sub { margin: 1px 0 6px; color: var(--p-muted); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
.res p { margin: 0; font-size: .86rem; line-height: 1.45; }
.res .note { margin-top: 7px; }
.res img { display: block; width: 100%; aspect-ratio: 1000 / 640; max-height: 250px; margin-top: 6px; object-fit: contain; border-radius: 10px; background: #0f172a; }

table.lab { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.lab th { padding: 4px 6px; border-bottom: 1.5px solid var(--p-line); color: var(--p-muted); font-size: .6rem; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
table.lab td { padding: 5px 6px; border-bottom: 1px solid #f1f5f9; }
table.lab .v { font-weight: 700; text-align: center; }
table.lab td.ab { color: #b91c1c; font-weight: 800; }
table.lab td.r { color: var(--p-muted); }

.hint { margin: 0 0 10px; color: var(--p-muted); font-size: .82rem; line-height: 1.4; }
.dict-area { min-height: 92px; padding: 11px 13px; border: 2px solid var(--p-primary); border-radius: 14px; box-shadow: 0 0 0 3px rgba(79, 70, 229, .22); font-size: .9rem; line-height: 1.45; }
.dict-mic { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 7px; border-radius: 16px; background: #f8fafc; box-shadow: inset 0 0 0 1px var(--p-line); color: var(--p-muted); font-size: .8rem; }
.dict-mic .mic { width: 40px; height: 40px; border-radius: 13px; }

.toast {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 40;
    max-width: calc(100% - 32px);
    padding: 10px 18px;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font-size: .86rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 14px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.ov-wait { padding: 10px; }
.ew-progress { display: flex; align-items: center; gap: 12px; }
.ew-bar { flex: 1; height: 7px; overflow: hidden; border-radius: 99px; background: #e6f4f1; }
.ew-fill { width: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #0d9488, #0891b2); }
.ew-clock { color: var(--p-muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.ew-steps { display: grid; gap: 4px; margin: 10px 0 12px; padding: 0; list-style: none; }
.ew-step { display: flex; align-items: center; gap: 9px; color: #94a3b8; font-size: .84rem; }
.ew-dot { flex: none; width: 15px; height: 15px; border: 2px solid #d5dbe6; border-radius: 50%; }
.ew-step.active { color: var(--p-ink); font-weight: 700; }
.ew-step.active .ew-dot { border-color: #99f6e4; border-top-color: var(--p-primary); animation: spin .8s linear infinite; }
.ew-step.done { color: #16a34a; }
.ew-step.done .ew-dot { border-color: #16a34a; background: #16a34a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.500 6.300 5 8.700 9.500 3.700' fill='none' stroke='%23fff' stroke-width='1.800' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.ew-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ew-card { min-width: 0; padding: 13px 15px; border: 1px solid var(--p-line); border-radius: 16px; background: #fbfcfd; }
.ew-card h4 { margin: 0 0 4px; font-size: .95rem; }
.ew-hint { margin: 0 0 8px; color: var(--p-muted); font-size: .78rem; line-height: 1.35; }
.ew-label { margin: 9px 0 6px; font-size: .82rem; font-weight: 700; }
.ew-score-row { display: flex; align-items: center; gap: 14px; }
.ew-range { position: relative; flex: 1; height: 6px; border-radius: 99px; background: #e5e7eb; }
.ew-range i { position: absolute; top: 0; left: 0; height: 100%; border-radius: 99px; background: var(--p-primary); }
.ew-range b { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--p-primary); box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(15, 23, 42, .35); }
.ew-score { min-width: 2ch; color: var(--p-primary-d); font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ew-chips { display: flex; gap: 7px; }
.ew-chip { padding: 6px 13px; border: 1.5px solid var(--p-line); border-radius: 999px; background: #fff; font-size: .82rem; }
.ew-chip.on { border-color: var(--p-primary); background: #ccfbf1; color: var(--p-primary-d); font-weight: 700; }
.ew-actions { display: flex; gap: 8px; margin-top: 13px; }
.ew-saved-note { display: none; margin: 13px 0 0; color: #15803d; font-size: .82rem; font-weight: 700; line-height: 1.4; }
.ew-card.saved .ew-actions { display: none; }
.ew-card.saved .ew-saved-note { display: block; }
.ew-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.ew-tile { padding: 8px 4px; border: 1px solid var(--p-line); border-radius: 12px; background: #fff; text-align: center; }
.ew-tile b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ew-tile span { display: block; color: var(--p-muted); font-size: .66rem; line-height: 1.2; }
.ew-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin: 9px 0; padding: 0; font-size: .82rem; list-style: none; }
.ew-checks li::before { content: "✓"; margin-right: 8px; color: #16a34a; font-weight: 900; }
.ew-checks li.miss { color: var(--p-muted); }
.ew-checks li.miss::before { content: "—"; color: #94a3b8; }
.ew-vitals { width: 100%; border-collapse: collapse; font-size: .8rem; }
.ew-vitals th { padding: 4px 6px; border-bottom: 1.5px solid var(--p-line); color: var(--p-muted); font-weight: 700; text-align: left; }
.ew-vitals td { padding: 4px 6px; border-bottom: 1px solid #f1f5f9; font-variant-numeric: tabular-nums; }

.ov-debrief { padding: 14px; }
.deb { width: min(680px, 100%); height: 100%; max-height: 100%; }
.deb-b { position: relative; flex: 1; min-height: 0; padding: 6px 22px 14px; overflow: hidden; }
.deb-in { padding-top: 6px; }
.blk { opacity: 0; transform: translateY(8px); transition: opacity .45s ease, transform .45s ease; }
.blk.show { opacity: 1; transform: none; }
.d-line { margin: 10px 0 0; color: #4b5563; font-size: .88rem; }
.d-line b { color: #111827; font-variant-numeric: tabular-nums; }
.d-lbl { margin: 16px 0 6px; }

.score {
    display: inline-block;
    padding: 5px 20px;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    font-size: .98rem;
    font-variant-numeric: tabular-nums;
    background: #16a34a;
}

.score.mid { background: #d97706; }
.score.low { background: #dc2626; }
.d-note { margin: 5px 0 0; font-size: .74rem; color: var(--p-muted); }
.sa-compare { display: flex; gap: 8px; }
.sa-compare > div { min-width: 86px; padding: 8px 14px; border: 1px solid var(--p-line); border-radius: 12px; }
.sa-compare span { display: block; color: var(--p-muted); font-size: .72rem; }
.sa-compare b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.sa-verdict { margin: 8px 0 0; font-size: .9rem; line-height: 1.4; }
.sa-verdict + .sa-verdict { margin-top: 2px; }
.crit-line { margin: 0; padding: 4px 0; font-size: .88rem; line-height: 1.45; }
.crit-line b { font-variant-numeric: tabular-nums; }
.crit-line.total { margin-top: 4px; padding-top: 7px; border-top: 1px solid var(--p-line); font-weight: 800; }
.d-dx { font-weight: 800; font-size: 1.02rem; line-height: 1.4; margin: 0; }
.d-yours { margin: 8px 0 0; font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge-ok { padding: 3px 11px; border-radius: 999px; background: #16a34a; color: #fff; font-size: .74rem; font-weight: 800; }

ul.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
ul.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.42; }
ul.ticks li::before { content: "✓"; flex: none; color: #16a34a; font-weight: 900; }
ul.ticks li.no::before { content: "✗"; color: #dc2626; }
ul.ticks li.no { color: #6b7280; }
ul.ticks li .flag { font-size: .66rem; font-weight: 800; color: #b91c1c; background: #fee2e2; padding: 1px 7px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }

.cursor {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 60;
    width: 28px;
    height: 28px;
    margin: -4px 0 0 -4px;
    pointer-events: none;
    opacity: 0;
    transition: transform var(--dur, .8s) cubic-bezier(.45, .05, .25, 1), opacity .3s ease;
    filter: drop-shadow(0 4px 6px rgba(15, 23, 42, .45));
    will-change: transform;
}

.cursor.on { opacity: 1; }
.cursor.instant { transition: opacity .3s ease; }
.cursor svg { display: block; width: 100%; height: 100%; }

.cursor::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 34px;
    height: 34px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    border: 2px solid rgba(79, 70, 229, .8);
    background: rgba(79, 70, 229, .18);
    opacity: 0;
    transform: scale(.3);
}

.cursor.click::after { animation: ripple .55s ease-out; }

@keyframes ripple { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.5); } }

.poster, .endcard {
    position: absolute;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
    text-align: center;
    background:
        radial-gradient(700px 360px at 50% 38%, rgba(79, 70, 229, .40), transparent 70%),
        rgba(7, 11, 24, .74);
    backdrop-filter: blur(5px);
    transition: opacity .4s ease, visibility .4s;
}

.poster { overflow: auto; }
.poster.hide, .endcard.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.poster-in { max-width: 560px; color: #fff; }
.poster-in.wide { max-width: 900px; width: 100%; }

.play-big {
    position: relative;
    width: 104px;
    height: 104px;
    margin: 0 auto 22px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--grad);
    box-shadow: 0 24px 60px -16px rgba(13, 148, 136, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: transform .2s ease;
}

.poster:hover .play-big { transform: scale(1.07); }
.play-big svg { width: 40px; height: 40px; margin-left: 5px; fill: #fff; }

.play-big::before, .play-big::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(94, 234, 212, .7);
    animation: ring 2.4s ease-out infinite;
}

.play-big::after { animation-delay: 1.2s; }

@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }

.poster h2, .endcard h2 { margin: 0 0 10px; font-size: clamp(1.4rem, 3.2vw, 2rem); letter-spacing: -.02em; line-height: 1.15; }
.poster p, .endcard p { margin: 0 auto; color: #c3cce3; line-height: 1.55; font-size: 1rem; max-width: 34em; }

.poster .meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }

.meta span {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .08);
    font-size: .8rem;
    font-weight: 650;
    color: #e6ecfb;
}

.endcard { color: #fff; z-index: 79; }
.endcard .btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }

.endcard .b {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 750;
    font-size: .98rem;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease;
}

.endcard .b:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .16); }
.endcard .b.main { border-color: transparent; background: var(--grad); box-shadow: 0 18px 38px -14px rgba(13, 148, 136, .85); }

.choices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
    text-align: left;
}

.choice {
    --acc: #2dd4bf;
    --acc2: #818cf8;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 18px 18px 16px;
    overflow: hidden;
    border-radius: 20px;
    border: 1.5px solid rgba(255, 255, 255, .18);
    background:
        radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--acc) 22%, transparent), transparent 70%),
        linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
    color: #fff;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, box-shadow .25s ease;
}

.choice[data-case="emergency"] { --acc: #fb7185; --acc2: #f59e0b; }
.choice[data-case="regular"] { --acc: #2dd4bf; --acc2: #818cf8; }
.choice:hover, .choice:focus-visible { transform: translateY(-4px); border-color: var(--acc); box-shadow: 0 30px 60px -26px var(--acc); outline: none; }

.ch-top { display: flex; align-items: center; gap: 11px; }

.ch-ic {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    background: linear-gradient(135deg, var(--acc), var(--acc2));
    box-shadow: 0 12px 26px -10px var(--acc);
}

.choice[data-case="emergency"] .ch-ic { animation: recPulse 1.8s infinite; }
.ch-kind { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--acc); }
.ch-dur { margin-left: auto; font-size: .78rem; font-weight: 700; color: #c3cce3; font-variant-numeric: tabular-nums; }
.ch-title { font-size: 1.38rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.ch-teaser { color: #c3cce3; font-size: .92rem; line-height: 1.5; }
.ch-points { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-points span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: .76rem; font-weight: 600; color: #e6ecfb; }

.ch-go {
    margin-top: 6px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px 9px 14px;
    border-radius: 999px;
    font-weight: 800;
    font-size: .92rem;
    color: #0b1020;
    background: linear-gradient(120deg, var(--acc), var(--acc2));
    transition: transform .2s ease;
}

.ch-go svg { width: 17px; height: 17px; fill: currentColor; }
.choice:hover .ch-go { transform: translateX(4px); }

.caption {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 8px 4px 2px;
}

.cap-in {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 860px;
    padding: 9px 20px 9px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(8px);
    color: #eef2fb;
    font-size: .95rem;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .35s ease, transform .35s ease;
}

.cap-in.show { opacity: 1; transform: none; }

.cap-in .ci {
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, .55), rgba(79, 70, 229, .55));
}

.controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .10);
    backdrop-filter: blur(8px);
}

.cbtn {
    flex: none;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .07);
    color: #fff;
    font-weight: 750;
    font-size: .85rem;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}

.cbtn:hover { background: rgba(255, 255, 255, .16); }
.cbtn:active { transform: scale(.94); }
.cbtn.play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--grad); box-shadow: 0 10px 22px -10px rgba(13, 148, 136, .9); }
.cbtn svg { width: 18px; height: 18px; fill: currentColor; }
.cbtn.on { background: rgba(94, 234, 212, .22); border-color: rgba(94, 234, 212, .6); }

.cbtn.snd { padding: 0; }
.cbtn.snd svg { width: 20px; height: 20px; }
.cbtn.snd:not(.on) { color: #fda4af; }

.sound-hint {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: max-content;
    max-width: min(340px, 86vw);
    padding: 9px 14px;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .7);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}

.sound-hint::after { content: ""; position: absolute; top: 100%; left: var(--arrow, 50%); margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; }
.sound-hint.show { opacity: 1; visibility: visible; transform: translateX(-50%); }

.seg {
    flex: none;
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
}

.seg button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #c3cce3;
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.seg button:hover:not(.on) { background: rgba(255, 255, 255, .10); color: #fff; }
.seg button.on { color: #fff; background: linear-gradient(120deg, rgba(13, 148, 136, .55), rgba(79, 70, 229, .55)); box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .45); }

.time { flex: none; font-variant-numeric: tabular-nums; font-size: .82rem; color: #c3cce3; min-width: 88px; text-align: center; }

.track { position: relative; flex: 1; min-width: 60px; height: 28px; cursor: pointer; touch-action: none; outline-offset: 2px; }
.track .bar { position: absolute; left: 0; right: 0; top: 12px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .16); }
.track .fill { position: absolute; left: 0; top: 12px; height: 5px; border-radius: 99px; background: var(--grad); width: 0; }
.track .mark { position: absolute; top: 8px; width: 2px; height: 13px; margin-left: -1px; border-radius: 2px; background: rgba(255, 255, 255, .55); }
.track .thumb { position: absolute; top: 7px; width: 15px; height: 15px; margin-left: -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(94, 234, 212, .3); transition: transform .12s ease; }
.track:hover .thumb { transform: scale(1.2); }

.chapters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }

.ch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .05);
    color: #c3cce3;
    font-size: .82rem;
    font-weight: 650;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.ch:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ch.on { color: #fff; border-color: rgba(94, 234, 212, .7); background: linear-gradient(120deg, rgba(13, 148, 136, .45), rgba(79, 70, 229, .45)); }

@media (max-width: 860px) {
    :root { --stage-h: clamp(480px, calc(100svh - 372px), 860px); }

    .topbar { padding: 10px 12px 8px; }
    .tb-brand .word { display: none; }
    .tb-cta { padding: 9px 14px; font-size: .86rem; }
    .back { padding: 9px 14px 9px 12px; font-size: .86rem; }
    .ribbon { padding: 0 12px; }
    .ribbon > div { font-size: .68rem; padding: 6px 10px; }
    .theater { padding: 0 12px; margin-top: 10px; }
    .frame { border-radius: 16px; }
    .frame-bar .url { display: none; }

    /* Like the real stacked layout: a compact patient card on top, the conversation takes the rest. */
    .scene-consult { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
    .vstage {
        --pt: clamp(84px, 25vw, 112px);
        flex: none;
        display: grid;
        grid-template-columns: var(--pt) minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr) auto;
        grid-template-areas: "slot top" "slot plate" "vitals vitals";
        column-gap: 12px;
        row-gap: 6px;
        padding: 10px 12px;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 0 0 1px var(--p-line), 0 10px 30px -24px rgba(15, 23, 42, .5);
    }
    .vs-top { grid-area: top; justify-content: flex-start; align-items: center; gap: 6px; min-width: 0; padding: 0; }
    .vs-chip { flex: none; height: 28px; padding: 0 9px; gap: 5px; background: #f1f5f9; box-shadow: none; font-size: .72rem; }
    .vs-chip.vs-code { display: none; }
    .vs-chip.voice { margin-left: auto; }
    .vs-chip .vc-lbl { display: none; }

    /* The portrait is a tile cropped to the face; speaking is a ring around it. */
    .avatar-wrap {
        grid-area: slot;
        width: var(--pt);
        height: var(--pt);
        align-self: start;
        border-radius: 24%;
        overflow: hidden;
        background: linear-gradient(165deg, #d9f3ee 0%, #cfe9f3 55%, #e3e6fb 100%);
        box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
        transition: box-shadow .3s ease;
    }
    .screen[data-speaker="patient"] .avatar-wrap { box-shadow: 0 0 0 3px #5eead4; }
    .avatar-slot .avatar, .avatar-slot.bust .avatar { top: 4%; bottom: auto; width: 140%; height: auto; }
    .avatar-slot.drawn .avatar { position: absolute; top: 50%; width: 84%; height: 84%; margin: 0; border-width: 2px; transform: translate(-50%, -50%); }
    .vs-band { display: contents; }
    .vs-speaking { display: none; }
    .vs-plate { grid-area: plate; align-self: start; }
    .vs-plate .pname { overflow: hidden; font-size: 1.1rem; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; }
    .vs-plate .pgender { display: none; }
    .vs-plate .complaint { margin-top: 3px; color: var(--p-muted); font-size: .8rem; }
    .vm-numerics { grid-area: vitals; gap: 4px; }
    .vm-num { flex-direction: row; align-items: baseline; justify-content: center; gap: 4px; padding: 5px 4px; border-radius: 10px; }
    .vm-num.n-nibp { flex-grow: 1.6; }
    .vm-num .k { font-size: .6rem; }
    .vm-num b { font-size: .92rem; }
    .vm-num .u { display: none; }

    .chatwrap { flex: 1 1 0; gap: 6px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
    .visit-head { display: none; }
    .chat { gap: 8px; padding: 4px 2px; }
    .msg { max-width: 90%; padding: 8px 12px; border-radius: 16px; font-size: .84rem; line-height: 1.4; }
    .msg-patient { margin-left: 0; background: #fff; box-shadow: 0 8px 24px -16px rgba(15, 23, 42, .5); }
    .msg-patient::before { display: none; }
    .effect { font-size: .8rem; }
    .statusrow { min-height: 0; }
    .inputrow { gap: 6px; padding: 5px 6px; border-radius: 18px; background: #fff; }
    .mic { width: 40px; height: 40px; border-radius: 13px; }
    .send { width: 36px; height: 36px; }
    .field { min-height: 36px; padding: 8px 2px; font-size: .84rem; }

    /* Seven tools in a 4-column grid; «Завершити» takes two cells. */
    .actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .act { gap: 2px; min-height: 48px; padding: 5px 2px; border-radius: 12px; background: #fff; font-size: .62rem; letter-spacing: -.01em; }
    .act .ic { width: 16px; height: 16px; padding: 5px; border-radius: 10px; }
    .act.ah { position: static; flex-direction: column; gap: 2px; width: auto; height: auto; min-height: 48px; padding: 5px 2px; border-radius: 12px; font-size: .66rem; }
    .act.ah .ic { padding: 0; }
    .act.end { grid-column: span 2; flex-direction: row; gap: 7px; font-size: .82rem; }

    .scene-picker { padding: 10px 10px 0; gap: 8px; }
    .pk-search { height: 42px; padding: 0 12px; font-size: .8rem; border-radius: 13px; }
    .pk-rand { height: 42px; padding: 0 12px; border-radius: 13px; }
    .pk-rand span { display: none; }
    .pk-seg-progress, .cat-tiles { display: none; }
    .sg { padding: 6px 9px; font-size: .74rem; }
    .pk-list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .case-card { padding: 10px 12px; gap: 6px; }
    .cc-title { font-size: .82rem; }

    .ov { padding: 10px; }
    .modal, .sheet { border-radius: 16px; }
    .modal-h { padding: 10px 14px; font-size: .94rem; }
    .modal-b { padding: 12px 14px; }
    .modal-f { padding: 10px 14px; }
    .sheet-b { grid-template-columns: minmax(0, 1fr); }
    .sheet-l { display: none; }
    .sheet-r { padding: 12px; }
    .ew-grid { grid-template-columns: minmax(0, 1fr); }
    #ewRecap { display: none; }
    .ew-steps { margin: 8px 0; }
    .ew-step { font-size: .78rem; }
    .deb-b { padding: 4px 14px 12px; }

    .caption { min-height: 66px; }
    .cap-in { font-size: .82rem; border-radius: 18px; padding: 8px 14px 8px 10px; gap: 10px; }
    .cap-in .ci { width: 30px; height: 30px; }
    .controls { gap: 8px; padding: 8px 10px; }
    .time { min-width: 0; font-size: .72rem; }
    .time .tot { display: none; }
    .cbtn { min-width: 36px; height: 36px; }
    .cbtn.play { width: 42px; height: 42px; }
    .chapters { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .chapters::-webkit-scrollbar { display: none; }
    .ch { flex: none; padding: 6px 12px; font-size: .78rem; }

    .play-big { width: 84px; height: 84px; margin-bottom: 16px; }
    .poster p, .endcard p { font-size: .9rem; }
    .choices { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 14px; }
    .choice { padding: 12px 14px; gap: 6px; border-radius: 16px; }
    .ch-teaser, .ch-points { display: none; }
    .ch-title { font-size: 1.1rem; }
    .ch-ic { width: 38px; height: 38px; font-size: 1.15rem; }
    .ch-go { margin-top: 2px; padding: 7px 16px 7px 12px; font-size: .84rem; }
    .poster .meta { margin-top: 12px; }
    .poster h2 { font-size: 1.25rem; }
    .seg button { padding: 0 10px; }
    .seg button span { display: none; }
    .endcard .b { padding: 10px 16px; font-size: .88rem; }
    .controls { flex-wrap: wrap; row-gap: 4px; }
    .track { order: 10; flex: 1 1 100%; height: 24px; }
    .track .bar, .track .fill { top: 10px; }
    .track .mark { top: 6px; }
    .track .thumb { top: 5px; }
    .time { margin-right: auto; }
}

/* A tablet: a larger face, two-line vitals tiles, the case code shown, the tools in one row. */
@media (min-width: 600px) and (max-width: 860px) {
    .vstage { --pt: clamp(130px, 20vw, 168px); column-gap: 16px; row-gap: 8px; padding: 12px 14px; }
    .vs-chip { height: 30px; padding: 0 11px; font-size: .76rem; }
    .vs-chip.vs-code { display: inline-flex; }
    .vs-plate .pname { font-size: 1.4rem; white-space: normal; }
    .vs-plate .pgender { display: block; }
    .vs-plate .complaint { font-size: .9rem; -webkit-line-clamp: 3; }
    .vm-num { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 10px; }
    .vm-num b { font-size: 1.1rem; }
    .avatar-slot .avatar, .avatar-slot.bust .avatar { top: 5%; width: 128%; }
    .actions { grid-template-columns: repeat(8, minmax(0, 1fr)); }
    .act, .act.ah { min-height: 56px; font-size: .68rem; }
}

/* A very narrow phone: the five vitals tiles go two-line so they still fit one row. */
@media (max-width: 350px) {
    .vm-numerics { gap: 3px; }
    .vm-num { flex-direction: column; align-items: center; gap: 0; padding: 3px 2px; }
    .vm-num .k { font-size: .52rem; }
    .vm-num b { font-size: .82rem; letter-spacing: -.02em; }
}

@media (max-width: 560px) {
    .back .txt-long, .tb-cta .txt-long { display: none; }
    .back .txt-short { display: inline; }
    .tb-brand { display: none; }
    .ribbon > div { flex-wrap: nowrap; text-align: left; gap: 8px; }
    #btnRestart, #btnFull { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mic, .vs-chip.ptimer::before, .vs-speaking::before { animation: none !important; }
    .cursor { transition: opacity .2s ease; }
    .tb-cta, .ribbon .rec, .play-big::before, .play-big::after { animation: none; }
}

/* The language menu is a light card on the demo's dark backdrop. */
.topbar .lang-menu { background: #fff; color: #1f2937; border-color: #e5e7eb; }
