/* Webinar page — extends case.css with state-specific bits.
 * Shared shell (case-hero-wrap, case-sidebar-card, case-body, case-cta) lives
 * in case.css. JS i18n via window.T_WEBINAR (no translatable strings here). */

/* ─── Hero state badge — replaces case-type-badge with state colors ─── */
.wb-state-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}
.wb-state-badge i { font-size: 0.55rem; color: inherit; }   /* override .case-meta i blue */

.wb-state-badge--planned {
    border: 1px solid rgba(59,130,246,0.35);
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04));
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(59,130,246,0.1);
}
.wb-state-badge--live {
    border: 1px solid rgba(239,68,68,0.45);
    background: linear-gradient(135deg, rgba(239,68,68,0.18), rgba(239,68,68,0.06));
    color: #fca5a5;
    box-shadow: 0 0 14px rgba(239,68,68,0.18);
}
.wb-state-badge--live .wb-live-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #ef4444;
}
@keyframes wb-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.wb-state-badge--processing {
    border: 1px solid rgba(251,146,60,0.35);
    background: linear-gradient(135deg, rgba(251,146,60,0.12), rgba(251,146,60,0.04));
    color: #fdba74;
}
.wb-state-badge--finished {
    border: 1px solid rgba(59,130,246,0.35);
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04));
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(59,130,246,0.1);
}

/* Hero CTA panel — case-sidebar-card visual language with bigger padding. */
.case-hero-wrap.webinar-page .case-hero-bottom { border-bottom: none; }
.case-hero-wrap.webinar-page .case-cta         { margin-top: 2.75rem; }

/* Divider for states without a hero CTA block. */
.wb-hero-divider {
    margin: 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    height: 0;
}

.wb-hero-cta {
    margin: 0.9rem 0 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1rem;
    background: linear-gradient(160deg, rgba(11, 12, 21, 0.8), rgba(15, 30, 60, 0.2));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1rem;
    transition: border-color 0.3s;
}

/* Hero countdown readout — same style as V3 ring side row, no ring */
.wb-cd-readout {
    display: inline-flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-width: 0;
}
.wb-cd-readout-row {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    line-height: 1.2;
}
.wb-cd-unit { white-space: nowrap; }
.wb-cd-unit + .wb-cd-unit { margin-left: 0.4em; }
.wb-cd-readout-row strong {
    color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.wb-cd-readout-sub {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.42);
    font-weight: 600;
}
.wb-hero-cta:hover { border-color: rgba(255, 255, 255, 0.12); }

/* State: live — same language as wb-live-card (sidebar) */
.wb-hero-cta--live {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(160deg, rgba(75, 15, 20, 0.55), rgba(40, 10, 15, 0.25));
}
.wb-hero-cta--live:hover { border-color: rgba(239, 68, 68, 0.42); }

/* Live readout — mirrors sidebar wb-live-banner language inside hero CTA */
.wb-live-readout {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex: 1 1 auto;
    min-width: 0;
}
.wb-live-readout-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: wb-pulse 1.6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.wb-live-readout-text { flex: 1; min-width: 0; }
.wb-live-readout-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.wb-live-readout-sub {
    font-size: 0.78rem;
    color: rgba(252, 165, 165, 0.78);
    line-height: 1.35;
    margin-top: 0.25rem;
}

/* Red pill button — visual twin of state 1 blue calendar button */
.wb-cta-go-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    background: #dc2626;
    text-decoration: none;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    transition: background 0.25s, box-shadow 0.25s;
}
.wb-cta-go-live:hover {
    background: #b91c1c;
    box-shadow: 0 0 22px rgba(220, 38, 38, 0.6);
    color: #fff;
}
.wb-cta-go-live:active { filter: brightness(0.92); }

/* State: finished — same language as wb-finished-card (sidebar) */
.wb-hero-cta--finished {
    border-color: rgba(96, 165, 250, 0.18);
    background: linear-gradient(160deg, rgba(11, 12, 21, 0.85), rgba(15, 30, 60, 0.3));
}
.wb-hero-cta--finished:hover { border-color: rgba(96, 165, 250, 0.3); }

/* ─── Buttons inside panel — sidebar action-btn standard (§5.1) ─── */
.wb-cta-primary,
.wb-cta-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.8rem 1.1rem;
    border-radius: 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.wb-cta-primary i,
.wb-cta-primary--live i,
.wb-cta-secondary i { font-size: 0.78rem; }

/* Primary blue — bg-blue-600, shadow-blue-900/50 */
.wb-cta-primary {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.45);
}
.wb-cta-primary:hover {
    background: #3b82f6;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.55);
}
.wb-cta-primary:active { filter: brightness(0.92); }

/* Live red */
.wb-cta-primary--live {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 6px 16px rgba(127, 29, 29, 0.45);
}
.wb-cta-primary--live:hover {
    background: #ef4444;
    box-shadow: 0 8px 20px rgba(127, 29, 29, 0.55);
}
.wb-cta-primary--live:active { filter: brightness(0.92); }

/* Secondary glass */
.wb-cta-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
}
.wb-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
}

/* Mobile */
@media (max-width: 767px) {
    .wb-hero-cta { padding: 0.95rem 1rem; gap: 0.45rem; }
    .wb-cta-primary,
    .wb-cta-primary--live,
    .wb-cta-secondary {
        flex: 1 1 100%;
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
}

/* Sidebar info card — Spec sheet (date / time / duration / language / access). */
.wb-reg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
}
.wb-reg-eyebrow {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(96, 165, 250, 0.75);
    font-weight: 700;
}
.wb-reg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.7);
    animation: wb-reg-pulse 2s ease-in-out infinite;
}
@keyframes wb-reg-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.85); }
}
/* Speakers scroll wrapper — caps height ~5 entries, vertical scroll for the rest. */
.wb-speakers-scroll {
    max-height: 40rem;            /* ≈ 5 speaker rows of 96px image + padding + margin */
    overflow-y: auto;
    padding-right: 0.4rem;        /* breathing room for scrollbar */
    margin-right: -0.4rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.wb-speakers-scroll::-webkit-scrollbar { width: 5px; }
.wb-speakers-scroll::-webkit-scrollbar-track { background: transparent; }
.wb-speakers-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}
.wb-speakers-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }

/* Footer info — three icon+text rows with hairline dividers */
.wb-reg-foot {
    display: flex;
    flex-direction: column;
    margin-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.wb-reg-foot-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0;
    line-height: 1.4;
}
.wb-reg-foot-row + .wb-reg-foot-row {
    border-top: 1px solid rgba(255, 255, 255, 0.045);
}
.wb-reg-foot-icon {
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.1rem;
    color: rgba(96, 165, 250, 0.9);
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wb-reg-foot-icon svg {
    width: 100%;
    height: 100%;
}
.wb-reg-foot-text {
    flex: 1 1 auto;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Spec sheet — 3 baseline-aligned flex rows; date font-size adapts via container query. */
.wb-reg-b-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.wb-reg-b-row {
    display: flex;
    align-items: baseline;
    column-gap: 3rem;
}
.wb-reg-b-row > * { flex: 1 1 0; min-width: 0; }
.wb-reg-b-cell { container-type: inline-size; }
.wb-reg-b-row--values { margin-bottom: 0.05rem; }
.wb-reg-b-grid .wb-reg-b-row:last-child { margin-top: 0.45rem; }
.wb-reg-b-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.015em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.wb-reg-b-value--lg {
    font-size: clamp(1.5rem, 17.5cqi, 2.4rem);
    letter-spacing: -0.035em;
    font-weight: 800;
}
.wb-reg-b-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(96, 165, 250, 0.6);
    font-weight: 700;
    line-height: 1;
}
.wb-reg-b-sub {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.2;
    /* Long timezone labels ("Красноярск / Новосибирск / Бангкок") shouldn't wrap.
       The gradient mask fades the right edge so a partial trailing city dissolves
       gracefully instead of being cut mid-word. Short content never reaches the
       fade zone, so it's invisible when not needed. */
    white-space: nowrap;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
}

/* ─── Sidebar: Live status card (state 2) — status only, NO button ─── */
.wb-live-card {
    border-color: rgba(239,68,68,0.3) !important;
    background: linear-gradient(160deg, rgba(75,15,20,0.55), rgba(40,10,15,0.25)) !important;
}
.wb-live-card h4 { color: rgba(252,165,165,0.7) !important; }
.wb-live-banner {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: 0.7rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
}
.wb-live-banner-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(239,68,68,0.6);
    animation: wb-pulse 1.6s cubic-bezier(0.4,0,0.6,1) infinite;
}
.wb-live-banner-text { flex: 1; }
.wb-live-banner-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
}
.wb-live-banner-sub {
    font-size: 0.7rem;
    color: rgba(252,165,165,0.7);
    line-height: 1.35;
}

/* ─── Sidebar: Processing card (state 3) — info + spinner, NO button ─── */
.wb-processing-card {
    text-align: center;
    padding: 2rem 1.2rem 2.2rem !important;
}
.wb-processing-icon {
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    border: 1.5px solid rgba(251,146,60,0.22);
    background: rgba(251,146,60,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.wb-processing-icon i {
    font-size: 1rem;
    color: rgba(253,186,116,0.7);
    animation: wb-spin 2.4s linear infinite;
}
@keyframes wb-spin { to { transform: rotate(360deg); } }
.wb-processing-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    margin-bottom: 0.45rem;
}
.wb-processing-text {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.55;
    max-width: 280px;
    margin: 0 auto;
}

/* ─── Sidebar: Finished card (state 4) — info, NO button ─── */
.wb-finished-card {
    text-align: center;
    padding: 2rem 1.2rem 2.2rem !important;
    background: linear-gradient(160deg, rgba(11,12,21,0.85), rgba(15,30,60,0.3)) !important;
    border-color: rgba(96,165,250,0.18) !important;
}
.wb-finished-icon {
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 50%;
    border: 1.5px solid rgba(96,165,250,0.2);
    background: rgba(96,165,250,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.wb-finished-icon i { font-size: 1rem; color: rgba(96,165,250,0.75); }
.wb-finished-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.45rem;
}
.wb-finished-text {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.55;
    max-width: 280px;
    margin: 0 auto;
}

/* Rate UI — sidebar trigger + native <dialog> (top-layer escapes z-index traps). */

/* Header row inside sidebar speakers card */
.wb-rate-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}
.wb-rate-panel-head h4 { margin: 0 !important; }

/* Trigger pill (sidebar) and Save pill (dialog) share identical styling */
.wb-rate-open,
.wb-rate-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    white-space: nowrap;
    box-shadow: 0 5px 14px rgba(30, 58, 138, 0.42);
    transition: all 0.2s;
}
.wb-rate-open:hover,
.wb-rate-save:hover {
    background: #3b82f6;
    box-shadow: 0 7px 18px rgba(30, 58, 138, 0.52);
}
.wb-rate-open:active,
.wb-rate-save:active { filter: brightness(0.92); }

/* Suppress the default browser focus ring on programmatic / mouse focus
   (browser auto-focuses .wb-rate-save when the dialog opens — we don't
   want a thick outline drawn around the pill on every open). Keep an
   accessible ring for actual keyboard navigation via :focus-visible. */
.wb-rate-open:focus,
.wb-rate-save:focus { outline: none; }
.wb-rate-open:focus-visible,
.wb-rate-save:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.55);
    outline-offset: 2px;
}

/* Save button — loading state (waiting for server) */
.wb-rate-save.is-loading {
    pointer-events: none;
    color: transparent;
    position: relative;
}
.wb-rate-save.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wb-rate-save-spin 0.6s linear infinite;
}
@keyframes wb-rate-save-spin {
    to { transform: rotate(360deg); }
}

/* Dialog overlaps the sidebar card exactly; JS pins top/right + start width. */
.wb-rate-dialog {
    position: fixed;
    top: 5rem;                           /* fallback; JS sets exact px */
    right: 1rem;                         /* fallback; JS sets exact px */
    bottom: auto;
    left: auto;
    margin: 0;
    padding: 0;
    /* Visual identity of case-sidebar-card — same border, same gradient family */
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 1rem;
    background: linear-gradient(160deg, #0c0d15 0%, #14182a 100%);
    color: rgba(255, 255, 255, 0.85);
    width: 1100px;
    max-width: calc(100vw - 2rem);
    /* Use height (not max-height) so flex-basis: 0 on body resolves to real
       space. With only max-height, dialog shrinks to header height and the
       body — set to flex:1 (basis 0) — collapses to 0px; only the header
       renders visibly. height: calc(100vh - 6rem) gives the dialog a
       concrete box for flexbox to distribute. */
    height: calc(100vh - 6rem);
    box-shadow:
        0 50px 100px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(96, 165, 250, 0.06),
        0 0 80px rgba(37, 99, 235, 0.12);
    overflow: hidden;
    display: none;
    flex-direction: column;
    --start-width: 420px;                /* JS overrides per-trigger */
}
.wb-rate-dialog[open] {
    display: flex;
    animation: wb-dlg-grow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.wb-rate-close {
    position: absolute;
    top: 0.7rem;
    right: 0.8rem;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.wb-rate-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: rotate(90deg);
}
.wb-rate-dialog::backdrop {
    background: rgba(5, 6, 12, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: wb-dlg-bg-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes wb-dlg-bg-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* clip-path open/close — element keeps full width; mask grows leftward, no reflow. */
@keyframes wb-dlg-grow {
    from {
        clip-path: inset(0 0 0 calc(100% - var(--start-width)) round 1rem);
        opacity: 0.9;
    }
    to {
        clip-path: inset(0 0 0 0 round 1rem);
        opacity: 1;
    }
}

/* Closing — mirror of open, faster + sharper exit easing */
.wb-rate-dialog.is-closing {
    animation: wb-dlg-shrink 0.26s cubic-bezier(0.5, 0, 0.75, 0) forwards !important;
}
.wb-rate-dialog.is-closing::backdrop {
    animation: wb-dlg-bg-out 0.22s ease-out forwards !important;
}
.wb-rate-dialog.is-closing .wb-rate-dialog-head,
.wb-rate-dialog.is-closing .wb-rate-dialog-body {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease-out;
}
@keyframes wb-dlg-shrink {
    from {
        clip-path: inset(0 0 0 0 round 1rem);
        opacity: 1;
    }
    to {
        clip-path: inset(0 0 0 calc(100% - var(--start-width)) round 1rem);
        opacity: 0;
    }
}
@keyframes wb-dlg-bg-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* Dialog header: title block on left, save pill on right */
.wb-rate-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 1.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), transparent);
}
.wb-rate-dialog-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.2rem;
}
.wb-rate-dialog-head p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
    line-height: 1.45;
}

/* Dialog body — scrollable list of speaker rows */
.wb-rate-dialog-body {
    overflow-y: auto;
    padding: 0.5rem 1.75rem 1.5rem;
    flex: 1;
}
.wb-rate-dialog-body::-webkit-scrollbar { width: 8px; }
.wb-rate-dialog-body::-webkit-scrollbar-track { background: transparent; }
.wb-rate-dialog-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

/* 3 columns: speaker (380px) | criteria (300px) | comment (1fr ~360px) */
.wb-rate-dialog-row {
    display: grid;
    grid-template-columns: 380px 300px 1fr;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.wb-rate-dialog-row:first-child { padding-top: 0.5rem; }
.wb-rate-dialog-row:last-child { border-bottom: none; padding-bottom: 0.5rem; }

/* Highlight row when user partially rated (1..3 of 4 criteria) on Save:
   per-speaker contract is all-or-nothing. JS removes the class on the
   next interaction inside the row. */
.wb-rate-dialog-row.wb-rate-row-incomplete {
    background: rgba(239, 68, 68, 0.06);
    box-shadow: inset 3px 0 0 0 rgba(239, 68, 68, 0.65);
    border-radius: 6px;
    transition: background 0.2s, box-shadow 0.2s;
}

/* Speaker block: identical to case-sidebar-card content — only kill bottom margin */
.wb-rate-dialog-row .case-sidebar-speaker { margin: 0; align-self: flex-start; }

/* Form column */
.wb-rate-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Criterion: label + stars */
.wb-rate-criterion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.wb-rate-criterion-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.3;
}

/* Stars (CSS-only, row-reverse so :checked ~ fills correctly) */
.wb-rate-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.12rem;
    flex-shrink: 0;
    position: relative;
}
.wb-rate-stars input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wb-rate-stars label {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.2);
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wb-rate-stars label:hover,
.wb-rate-stars label:hover ~ label,
.wb-rate-stars input:checked ~ label {
    color: #fbbf24;
}
.wb-rate-stars label:hover { transform: scale(1.15); }
.wb-rate-stars label::before { content: "★"; }

/* Comment textarea — sits in 3rd grid column, fixed ~4 visible rows */
.wb-rate-comment {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1.5;
    resize: vertical;
    margin: 0;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
}
.wb-rate-comment::placeholder { color: rgba(255, 255, 255, 0.32); }
.wb-rate-comment:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(255, 255, 255, 0.05);
}

/* ─── Stars rating widget (blue accent, outlined→filled) ─── */
.wb-rate-stars-a {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.15rem;
    flex-shrink: 0;
    position: relative;
}
.wb-rate-stars-a input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wb-rate-stars-a label {
    width: 1.55rem;
    height: 1.55rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.28);
    font-size: 1.45rem;
    line-height: 1;
    transition: color 0.18s, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), text-shadow 0.18s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wb-rate-stars-a label::before { content: "☆"; }
.wb-rate-stars-a label:hover,
.wb-rate-stars-a label:hover ~ label,
.wb-rate-stars-a input:checked ~ label {
    color: #60a5fa;
    text-shadow: 0 0 12px rgba(96, 165, 250, 0.55);
}
.wb-rate-stars-a label:hover::before,
.wb-rate-stars-a label:hover ~ label::before,
.wb-rate-stars-a input:checked ~ label::before { content: "★"; }
.wb-rate-stars-a label:hover { transform: scale(1.18); }

/* Mobile: dialog spans almost full width, slide-up from bottom */
@media (max-width: 767px) {
    .wb-rate-dialog {
        top: 1rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 2rem);
    }
    .wb-rate-dialog[open] {
        animation: wb-dlg-mobile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes wb-dlg-mobile-in {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .wb-rate-dialog-head {
        padding: 1rem 1.1rem;
        flex-wrap: wrap;
        gap: 0.85rem;
    }
    .wb-rate-dialog-head h3 { font-size: 0.95rem; }
    .wb-rate-dialog-head p { font-size: 0.72rem; }
    .wb-rate-dialog-body { padding: 0.5rem 1.1rem 1.1rem; }
    .wb-rate-dialog-row {
        display: block;
        padding: 1rem 0;
    }
    .wb-rate-dialog-row .case-sidebar-speaker { margin-bottom: 0.85rem; }
}

/* ─── Rating section (states 2/3/4 if is_rateable) ─── */
.wb-rating-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.wb-rating-section-head {
    margin-bottom: 1.6rem;
}
.wb-rating-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.4rem;
}
.wb-rating-section-sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
    max-width: 540px;
}
.wb-rating-section-sub strong { color: rgba(255,255,255,0.8); font-weight: 600; }

.wb-rating-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.wb-rating-card {
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 1rem;
    padding: 1.25rem 1.35rem;
    background: linear-gradient(160deg, rgba(11,12,21,0.7), rgba(15,30,60,0.18));
    transition: border-color 0.25s;
}
.wb-rating-card:hover { border-color: rgba(255,255,255,0.12); }
.wb-rating-card.is-rated {
    border-color: rgba(34,197,94,0.25);
    background: linear-gradient(160deg, rgba(11,12,21,0.7), rgba(20,40,25,0.2));
}

.wb-rating-speaker {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wb-rating-speaker img {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(59,130,246,0.2);
}
.wb-rating-speaker-meta { flex: 1; }
.wb-rating-speaker-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.1rem;
}
.wb-rating-speaker-position {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.35;
}
.wb-rating-speaker-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: rgba(34,197,94,0.12);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,0.25);
    display: none;
    flex-shrink: 0;
}
.wb-rating-card.is-rated .wb-rating-speaker-status { display: inline-flex; align-items: center; gap: 0.3rem; }

.wb-rating-criteria {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin-bottom: 1rem;
}
@media (min-width: 640px) {
    .wb-rating-criteria { grid-template-columns: 1fr 1fr; gap: 0.8rem 1.5rem; }
}
.wb-criterion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.wb-criterion-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.3;
}

/* Star rating (CSS-only, label/radio pattern) */
.wb-stars {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.15rem;
    flex-shrink: 0;
}
.wb-stars input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wb-stars label {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
    color: rgba(255,255,255,0.18);
    font-size: 1.05rem;
    line-height: 1;
    transition: color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wb-stars label:hover,
.wb-stars label:hover ~ label,
.wb-stars input:checked ~ label {
    color: #fbbf24;
}
.wb-stars label::before { content: "★"; }
.wb-rating-card.wb-rating-card--err .wb-criterion.wb-criterion--err .wb-stars label {
    color: rgba(239,68,68,0.45);
}

.wb-rating-comment {
    width: 100%;
    min-height: 4.5rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.6rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s, background 0.15s;
}
.wb-rating-comment::placeholder { color: rgba(255,255,255,0.32); }
.wb-rating-comment:focus {
    outline: none;
    border-color: rgba(59,130,246,0.45);
    background: rgba(255,255,255,0.05);
}

.wb-rating-card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 0.85rem;
}
.wb-rating-save {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    border-radius: 0.55rem;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
    font-family: inherit;
}
.wb-rating-save:hover { filter: brightness(1.12); }
.wb-rating-save:disabled { opacity: 0.4; cursor: not-allowed; filter: none; }

/* Aggregate display when card already rated */
.wb-rating-aggregate {
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    margin-right: auto;
}
.wb-rating-aggregate strong { color: #fbbf24; font-weight: 700; }
.wb-rating-card.is-rated .wb-rating-aggregate { display: inline-flex; }

/* Rating teaser for guests */
.wb-rating-guest {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 1rem;
    background: rgba(255,255,255,0.015);
}
.wb-rating-guest-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.78);
    margin-bottom: 0.5rem;
}
.wb-rating-guest-text {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    line-height: 1.55;
    max-width: 420px;
    margin: 0 auto;
}
.wb-rating-guest-text a { color: #60a5fa; text-decoration: none; font-weight: 600; }

/* ─── Mobile ─── */
@media (max-width: 767px) {
    .wb-hero-cta { gap: 0.5rem; }
    .wb-hero-cta .wb-cta-primary,
    .wb-hero-cta .wb-cta-secondary {
        flex: 1 1 100%;
        padding: 0.75rem 1rem;
        font-size: 0.82rem;
    }
    .wb-state-switcher { padding: 0.7rem 0.85rem; gap: 0.4rem; }
    .wb-state-btn { padding: 0.45rem 0.7rem; font-size: 0.72rem; }

    .wb-cd-num { font-size: 1.15rem; }
    .wb-cd-label { font-size: 0.55rem; }

    .wb-rating-section { margin-top: 2rem; padding-top: 2rem; }
    .wb-rating-section-title { font-size: 1.05rem; }
    .wb-rating-section-sub { font-size: 0.78rem; }
    .wb-rating-card { padding: 1rem; }
    .wb-rating-speaker img { width: 2.5rem; height: 2.5rem; }
    .wb-rating-speaker-name { font-size: 0.85rem; }
    .wb-rating-speaker-position { font-size: 0.7rem; }
    .wb-criterion { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
    .wb-stars label { width: 1.4rem; height: 1.4rem; font-size: 1.2rem; }
}

/* ═════════════════════════════════════════════════════════════════════
   GUEST state — single signup card with a blue tint across the whole area.
   Two-layer background: dark glass-base (same as hero CTA) + blue tint.
   ═════════════════════════════════════════════════════════════════════ */

/* Buttons */
.wb-guest-btn-ghost,
.wb-guest-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.wb-guest-btn-ghost {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.wb-guest-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}
.wb-guest-btn-primary {
    color: #fff;
    background: #2563eb;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}
.wb-guest-btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 0 22px rgba(59, 130, 246, 0.45);
    color: #fff;
}

/* Shell — hero-cta tokens + blue tint over the dark base (two-layer gradient) */
.wb-guest-x {
    margin: 0.9rem 0 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02)),
        linear-gradient(160deg, rgba(11, 12, 21, 0.8), rgba(15, 30, 60, 0.2));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.3s, background 0.25s;
    overflow: hidden;
}
.wb-guest-x:hover { border-color: rgba(255, 255, 255, 0.12); }

/* Body: head (icon + text block) on top, action buttons in a row below */
.wb-guest-x-body {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1.45rem;
}
.wb-guest-x-head {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}
.wb-guest-x-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.6rem;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.wb-guest-x-textblock {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.wb-guest-x-title {
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.3;
}
.wb-guest-x-text {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.76rem;
    line-height: 1.4;
}
.wb-guest-x-actions {
    display: flex;
    gap: 0.6rem;
}
.wb-guest-x-actions > a { flex: 1 1 0; }
