/* Rediseño del panel del presentador (lienzo «Traductor en vivo · Hub» de Claude Design).
 * Se carga después de style.css: reordena el panel en dos columnas con tarjetas numeradas.
 * Colores con los tokens semánticos de restart-ui, para que el modo oscuro siga funcionando. */

.rd-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Barra superior ─────────────────────────────────────── */
.rd-topbar {
    justify-content: space-between;
}

.rd-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.rd-brand-sep {
    width: 1px;
    height: 24px;
    background: var(--rs-border);
}

.rd-brand-app {
    font-size: 14px;
    font-weight: 600;
    color: var(--rs-text-muted);
    white-space: nowrap;
}

.rd-topbar-slot {
    display: inline-flex;
    align-items: center;
}

.rd-topbar-slot:empty {
    display: none;
}

/* ── Encabezado ─────────────────────────────────────────── */
.rd-hero {
    padding-bottom: 88px;
}

.rd-hero-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.rd-hero-text {
    max-width: 600px;
}

.rd-evento {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #ffffff;
}

.rd-evento[hidden] {
    display: none;
}

.rd-evento-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, .25);
}

.rd-evento-txt {
    min-width: 0;
}

.rd-evento-label {
    font: 700 11px var(--rs-mono, 'Space Mono', monospace);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #a8aaf0;
}

.rd-evento-nombre {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* ── Pestañas sobre el encabezado ───────────────────────── */
.rd-section-header {
    margin: 0;
}

.rd-tabs.scribe-main-tabs {
    position: relative;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: -64px 0 20px;
    padding: 5px;
    border: 0;
    border-radius: 12px;
    background: var(--rs-surface);
    box-shadow: 0 8px 24px rgba(18, 21, 104, .14);
}

.rd-tabs .scribe-main-tab {
    margin: 0;
    padding: 9px 16px;
    border: 0;
    border-radius: 9px;
    color: var(--rs-text-muted);
    font-size: 14px;
    font-weight: 600;
}

.rd-tabs .scribe-main-tab:hover {
    color: var(--rs-text);
    background: var(--rs-accent-a06);
}

.rd-tabs .scribe-main-tab.is-active {
    background: var(--rs-accent);
    color: var(--rs-on-accent, #ffffff);
    border: 0;
}

/* ── Grilla de dos columnas ─────────────────────────────── */
.rd-grid.scribe-live-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.rd-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.rd-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 24px;
    border: 1px solid var(--rs-border-soft, var(--rs-border));
    border-radius: 16px;
    background: var(--rs-surface);
    box-shadow: 0 1px 3px rgba(18, 21, 104, .06);
}

.rd-card.scribe-panel-audience-wrap {
    padding: 22px 24px;
}

.rd-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rd-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--rs-accent-a12);
    color: var(--rs-accent);
    font: 700 13px var(--rs-mono, 'Space Mono', monospace);
}

.rd-card-title {
    flex: 1 1 auto;
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--rs-text);
}

.rd-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
}

.rd-chip[hidden] {
    display: none;
}

.rd-chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.rd-chip--ok {
    background: rgba(15, 122, 74, .1);
    color: #0f7a4a;
}

.rd-chip--vivo {
    background: rgba(180, 35, 24, .08);
    color: #b42318;
    font-variant-numeric: tabular-nums;
}

.rd-chip--vivo .rd-chip-dot {
    animation: rd-latido 1.2s ease-in-out infinite;
}

@keyframes rd-latido {
    50% { opacity: .35; }
}

.rd-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.rd-row--end {
    align-items: flex-end;
}

.rd-grow {
    flex: 1 1 200px;
    min-width: 0;
}

.rd-grow--2 {
    flex-grow: 2;
}

.rd-card .scribe-session-setup {
    display: flex;
}

.rd-card .scribe-public-session-name-field {
    flex: 1 1 260px;
}

.rd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rd-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
}

.rd-session-status {
    margin-top: 0;
}

/* ── Conversación en vivo ───────────────────────────────── */
.rd-live {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--rs-accent-a06);
    border: 1px solid var(--rs-accent-a12);
}

.rd-mic {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--rs-accent);
    color: var(--rs-on-accent, #ffffff);
    box-shadow: 0 0 0 6px var(--rs-accent-a12);
}

.rd-live .scribe-live-status {
    flex: 1 1 220px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.rd-live .scribe-live-status.is-idle,
.rd-live .scribe-live-status.is-paused,
.rd-live .scribe-live-status.is-connecting,
.rd-live .scribe-live-status.is-live,
.rd-live .scribe-live-status.is-receiving {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.rd-live-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rd-btn-stop:not(:disabled) {
    color: #b42318;
    border-color: rgba(180, 35, 24, .35);
}

.rd-card.scribe-panel-conversation.is-live {
    border-color: rgba(180, 35, 24, .25);
}

.rd-ultima {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rd-ultima[hidden] {
    display: none;
}

.rd-mini {
    font: 700 11px var(--rs-mono, 'Space Mono', monospace);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--rs-text-muted);
}

.rd-linea {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.rd-linea[hidden] {
    display: none;
}

.rd-linea p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--rs-text-muted);
}

.rd-linea--trad p {
    color: var(--rs-text);
    font-weight: 700;
}

.rd-lang {
    flex: 0 0 auto;
    margin-top: 1px;
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--rs-accent-a12);
    color: var(--rs-accent);
    font: 700 11px var(--rs-mono, 'Space Mono', monospace);
}

/* ── Idioma y pantalla ──────────────────────────────────── */
.rd-card .scribe-lang-row {
    gap: 12px 20px;
}

.rd-lang-nota {
    flex: 1 1 220px;
    padding-bottom: 12px;
}

.rd-switches {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--rs-border-soft, var(--rs-border));
}

.rd-switch {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rs-border-soft, var(--rs-border));
    cursor: pointer;
}

.rd-switch:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.rd-switch > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rd-switch b {
    font-size: 14px;
    font-weight: 600;
    color: var(--rs-text);
}

.rd-switch small {
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--rs-text-muted);
}

.rd-sw {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    position: relative;
    width: 40px;
    height: 24px;
    margin: 0;
    border-radius: 12px;
    background: var(--rs-border);
    cursor: pointer;
    transition: background .15s;
}

.rd-sw::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(18, 21, 104, .25);
    transition: transform .15s;
}

.rd-sw:checked {
    background: var(--rs-accent);
}

.rd-sw:checked::after {
    transform: translateX(16px);
}

.rd-sw:focus-visible {
    outline: 2px solid var(--rs-accent);
    outline-offset: 2px;
}

/* ── Compartir ──────────────────────────────────────────── */
.rd-btn-grande.rs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    font-size: 15px;
}

.rd-qr {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
    background: var(--rs-accent-a06);
}

.rd-qr-img {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.rd-qr-img canvas {
    width: 104px !important;
    height: 104px !important;
}

.rd-qr-img canvas[hidden] {
    display: none;
}

.rd-qr-vacio {
    padding: 8px;
    font-size: 11.5px;
    line-height: 1.35;
    text-align: center;
    color: #5f5f7d;
}

.rd-qr-vacio[hidden] {
    display: none;
}

.rd-qr-txt {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.rd-qr-t {
    font-size: 14px;
    font-weight: 700;
    color: var(--rs-text);
}

.rd-link {
    align-self: flex-start;
    margin-top: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--rs-accent);
    font: 600 13px inherit;
    font-family: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.rd-link:disabled {
    color: var(--rs-text-muted);
    text-decoration: none;
    cursor: default;
}

.rd-url {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 12px;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
}

.rd-url[hidden] {
    display: none;
}

.rd-url a {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 12.5px var(--rs-mono, 'Space Mono', monospace);
    color: var(--rs-text-muted);
    text-decoration: none;
}

.rd-icon-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: var(--rs-accent-a08);
    color: var(--rs-accent);
    cursor: pointer;
}

.rd-2btn {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.rd-2btn .rs-btn,
.rd-btn-ancho.rs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.2;
}

.rd-btn-ancho.rs-btn {
    width: 100%;
}

/* ── Público en vivo ────────────────────────────────────── */
.rd-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.rd-stats > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    border-radius: 12px;
    background: var(--rs-accent-a06);
}

.rd-stats b {
    font-size: 22px;
    font-weight: 800;
    color: var(--rs-accent);
    font-variant-numeric: tabular-nums;
}

.rd-stats span {
    font-size: 12px;
    color: var(--rs-text-muted);
}

.rd-hint[hidden] {
    display: none;
}

.rd-card .rd-audience.scribe-audience-panel-compact {
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.rd-audience .scribe-audience-top {
    display: none;
}

.rd-audience .scribe-audience-columns {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Pantallas chicas ───────────────────────────────────── */
@media (max-width: 1040px) {
    .rd-grid.scribe-live-card {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .rd-tabs.scribe-main-tabs {
        margin-top: -56px;
    }

    .rd-card {
        padding: 18px;
    }

    .rd-brand-sep,
    .rd-brand-app {
        display: none;
    }
}

/* El botón original de Historial queda solo para scribe.js: la pestaña nueva lo reemplaza */
#scribeHistoryToggleBtn {
    display: none !important;
}

/* La cuenta regresiva de la agenda solo aparece cuando hay una charla con tiempo */
.scribe-live-countdown[hidden],
.scribe-live-countdown:empty {
    display: none !important;
}

/* El estado ya lo dice la etiqueta «Activa» de la tarjeta 01 */
.rd-card #scribePublicSessionStateBadge {
    display: none;
}

@media (max-width: 520px) {
    .rd-topbar .dm-boton span {
        display: none;
    }

    .rd-topbar .dm-boton {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .rd-topbar .rs-topbar-right {
        gap: 6px;
    }
}
