* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --vh: 1vh; /* Fallback para navegadores que no soportan dvh */
    --body-padding-top: 10px;
    --body-padding-side: 150px;
    --body-padding-bottom: 10px;
    --body-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --scrollbar-width: 0px;
}

html, body {
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    touch-action: manipulation;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    /* Ocupa todo el viewport vertical y distribuye header/contenido/footer */
    height: calc(var(--vh, 1vh) * 100);
    min-height: calc(var(--vh, 1vh) * 100);
    max-height: calc(var(--vh, 1vh) * 100);
    display: flex;
    flex-direction: column;
    padding: var(--body-padding-top) var(--body-padding-side) calc(var(--body-padding-bottom) + var(--body-safe-area-bottom));
    font-size: 14px;
    overflow: hidden; /* sin scroll vertical en body */
    overscroll-behavior-y: none; /* evitar scroll/bounce innecesario */
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes expandHeight {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 2000px;
        opacity: 1;
    }
}

.material-icons {
    font-size: inherit;
    vertical-align: middle;
    line-height: 1;
}

.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto; /* ocupa el espacio disponible entre el menú y la firma */
    min-height: 0; /* permite que la lista con overflow funcione */
    gap: 24px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.header h1 .material-icons {
    font-size: 28px;
}

.subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

.controls-section {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 10px;
    padding: 12px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    position: -webkit-sticky;
    position: sticky;
    top: 15px;
    z-index: 50;
    backdrop-filter: blur(6px);
    flex-shrink: 0; /* no colapsar al ajustar el alto */
    width: 100%;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.8rem;
    white-space: nowrap;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-control input[type="range"] {
    width: 120px;
    height: 4px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    appearance: none;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #634b4b;
    cursor: pointer;
}

.speed-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #634b4b;
    cursor: pointer;
    border: none;
}

.speed-value {
    font-weight: 600;
    color: #513737;
    min-width: 40px;
    font-size: 0.8rem;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-left: 0;
    flex: 1 1 100%;
    width: 100%;
}

.btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn {
    flex: 1 1 0;
    justify-content: center;
}

.btn .material-icons {
    font-size: 16px;
}

.btn-secondary {
    background: #0ea5e9;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #0284c7;
}

.btn-add {
    background: #6366f1;
    color: white;
}

.btn-add:hover {
    background: #4f46e5;
}

.btn-play {
    background: #6366f1;
    color: white;
}

.btn-play:hover:not(:disabled) {
    background: #4f46e5;
}

.btn-stop {
    background: #ef4444;
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: #dc2626;
}

.btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    opacity: 0.6;
}

.status {
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 12px;
    font-size: 0.8rem;
}

.status.speaking {
    background-color: #d4edda;
    color: #155724;
}

.status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.status.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.announcements-list {
    display: grid;
    gap: 12px;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
    flex: 1 1 auto; /* ocupa el espacio entre el menú y la firma */
    min-height: 0;   /* necesario para que overflow funcione en flex */
    overflow-y: auto; /* único scroll vertical */
    scrollbar-gutter: stable both-edges; /* reservar gutter y mantener ancho */
    padding-right: var(--scrollbar-width);
    margin-right: calc(-1 * var(--scrollbar-width));
}

body.edit-mode .announcements-list,
body.generation-mode .announcements-list {
    height: auto;
    max-height: none; /* gestionado por flex */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.edit-mode .announcements-list::-webkit-scrollbar,
body.generation-mode .announcements-list::-webkit-scrollbar {
    width: 6px;
}

body.edit-mode .announcements-list::-webkit-scrollbar-track,
body.generation-mode .announcements-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

body.edit-mode .announcements-list::-webkit-scrollbar-thumb,
body.generation-mode .announcements-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

body.edit-mode .announcements-list::-webkit-scrollbar-thumb:hover,
body.generation-mode .announcements-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

body.modal-open {
    overflow: hidden;
}

.empty-state {
    background: white;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.empty-state .material-icons {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.empty-subtitle {
    font-size: 0.85rem !important;
    color: #9ca3af !important;
}

.announcement-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    animation: fadeIn 0.4s ease;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.announcement-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 4px;
}

.announcement-number .material-icons {
    font-size: 18px;
}

.btn-delete {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.btn-delete .material-icons {
    font-size: 16px;
}

.btn-delete:hover {
    background: #dc2626;
}

.announcement-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.announcement-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 12px;
    align-items: start;
}

.mobile-top-row {
    display: contents;
}

.type-section,
.fields-section,
.languages-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 80px;
    justify-content: flex-start;
}

.type-section label,
.fields-section label,
.languages-section label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.type-section label .material-icons,
.fields-section label .material-icons,
.languages-section label .material-icons {
    font-size: 14px;
}

.fields-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    flex: 1;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.form-group select,
.type-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.2s;
    height: 32px;
    box-sizing: border-box;
}

.form-group select:focus,
.type-select:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
}

.field-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 100px;
    flex: 1;
}

.field-item--destination {
    position: relative;
}

.field-item label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: capitalize;
}

.destination-input {
    position: relative;
}

.destination-input::-webkit-calendar-picker-indicator {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236366f1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') center/contain no-repeat;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.destination-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%234f46e5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') center/contain no-repeat;
}

.field-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: border-color 0.2s;
    background: #f9fafb;
    height: 32px;
    box-sizing: border-box;
}

.field-input:focus {
    outline: none;
    border-color: #6366f1;
    background: white;
}

.language-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
    flex: 1;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 32px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    user-select: none;
    box-sizing: border-box;
}

.language-option:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-1px);
}

.language-option.selected {
    border-color: #3b82f6;
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.flights-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flight-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flight-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    padding: 12px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.flight-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.flight-item__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.flight-type-control {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.flight-type-control label {
    white-space: nowrap;
}

.flight-type-control select {
    flex: 1 1 auto;
    min-width: 0;
}

.flight-item__title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.flight-item__title .material-icons {
    font-size: 18px;
    color: #6366f1;
}

.btn-remove-flight {
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-remove-flight .material-icons {
    font-size: 20px;
}

.btn-remove-flight:hover:not(.disabled) {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.btn-remove-flight:focus-visible {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

.btn-remove-flight.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.flight-item__fields {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 1fr);
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.flight-item__fields-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.flight-item__fields-row .field-item {
    flex: 1;
    min-width: 140px;
}

.flight-language-selector-inline {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
}

.flight-language-selector-inline label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 4px;
}

.flight-language-selector-inline label .material-icons {
    font-size: 14px;
}

.flight-language-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.flight-item__languages {
    margin-top: 8px;
}

.flight-language-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.flight-language-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.flight-language-option:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.flight-language-option.selected {
    border-color: #6366f1;
    background: #6366f1;
    color: white;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.flight-language-option.disabled,
.flight-language-option:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-style: dashed;
    pointer-events: none;
}

.flight-language-option:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
}

.field-item--inline {
    min-width: 160px;
}

.announcement-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.announcement-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #4b5563;
}

.announcement-type .material-icons {
    font-size: 18px;
}

.announcement-type .type-select {
    width: auto;
    min-width: 200px;
}

.flight-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-add-flight {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #6366f1;
    background: rgba(99, 102, 241, 0.08);
    color: #4338ca;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.btn-add-flight .material-icons {
    font-size: 18px;
}

.btn-add-flight:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: #4f46e5;
    transform: translateY(-1px);
}

.btn-add-flight:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
}

.language-audio-player-wrapper {
    margin-bottom: 12px;
}

.language-audio-player {
    width: 100%;
    height: 40px;
    border-radius: 8px;
    outline: none;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.language-audio-player::-webkit-media-controls-panel {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 8px;
}

.language-audio-player::-webkit-media-controls-enclosure {
    border-radius: 8px;
}

.language-audio-player::-webkit-media-controls-play-button {
    filter: brightness(0) saturate(100%) invert(46%) sepia(94%) saturate(3139%) hue-rotate(233deg) brightness(97%) contrast(92%);
    cursor: pointer;
}

.language-audio-player::-webkit-media-controls-pause-button {
    filter: brightness(0) saturate(100%) invert(46%) sepia(94%) saturate(3139%) hue-rotate(233deg) brightness(97%) contrast(92%);
    cursor: pointer;
}

.language-audio-player::-webkit-media-controls-current-time-display,
.language-audio-player::-webkit-media-controls-time-remaining-display {
    color: #4338ca;
    font-weight: 600;
    font-size: 0.85rem;
}

.language-audio-player::-webkit-media-controls-timeline {
    background: #cbd5e1;
    border-radius: 25px;
    margin: 0 8px;
}

.language-audio-player::-webkit-media-controls-volume-slider {
    background: #cbd5e1;
    border-radius: 25px;
}

.language-audio-player::-moz-range-track {
    background: #cbd5e1;
    border-radius: 25px;
}

.language-audio-player::-moz-range-progress {
    background: #6366f1;
    border-radius: 25px;
}

.language-speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
}

.language-speed-control label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.language-speed-control label .material-icons {
    font-size: 16px;
}

.language-speed-control__inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-speed-input {
    width: 100px;
}

.language-speed-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    min-width: 42px;
}

.language-audio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.language-audio-actions .btn {
    flex: 0 0 auto;
}

.language-audio-status,
.language-audio-error,
.language-audio-note,
.language-audio-empty {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.language-audio-status {
    color: #4338ca;
    animation: pulse 2s ease-in-out infinite;
}

.language-audio-status .loading-spinner {
    width: 18px;
    height: 18px;
}

.language-audio-error {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.08);
    padding: 8px 10px;
    border-radius: 6px;
}

.language-audio-note {
    color: #2563eb;
    font-size: 0.8rem;
}

.language-audio-empty {
    color: #6b7280;
    background: #f3f4f6;
    padding: 10px 12px;
    border-radius: 6px;
}

.language-audio-status .material-icons,
.language-audio-error .material-icons,
.language-audio-note .material-icons,
.language-audio-empty .material-icons {
    font-size: 18px;
}

.language-preview-controls {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.language-audio-controls-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.language-audio-controls-row .btn {
    flex-shrink: 0;
}

.language-preview-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: 8px;
    font-size: 0.8rem;
    color: #6b7280;
    background: rgba(241, 245, 249, 0.4);
}

.language-preview-placeholder .material-icons {
    font-size: 18px;
    color: #9ca3af;
}

.text-display {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    will-change: max-height, opacity, padding;
}

.text-display[data-show-preview="true"],
.text-display.is-visible {
    max-height: 3000px;
    opacity: 1;
    padding-top: 12px;
}

.playback-line.playback-line--summary {
    margin-top: 8px;
    margin-bottom: 12px;
    color: #1f2937;
    line-height: 1.6;
    text-indent: 0;
    padding-left: 0;
}

.playback-flight-list,
.preview-flight-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.playback-flight-item,
.preview-flight-item {
    display: flex;
    align-items: flex-start;
    gap: 0;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 10px;
    background: rgba(243, 244, 246, 0.6);
}

.playback-flight-item .flight-index,
.preview-flight-item .flight-index {
    display: none;
}

.playback-flight-item .flight-body,
.preview-flight-item .flight-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.playback-flight-item .flight-label,
.preview-flight-item .flight-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a;
}

.flight-content {
    font-size: 0.78rem;
    color: #1f2937;
    line-height: 1.5;
    margin: 0;
    text-indent: 0;
    padding-left: 0;
}

.announcement-preview-wrapper {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.preview-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.preview-toggle input {
    display: none;
}

.preview-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.preview-toggle-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.preview-toggle:focus-within .preview-toggle-slider {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.preview-toggle input:checked + .preview-toggle-slider {
    background: #6366f1;
}

.preview-toggle input:checked + .preview-toggle-slider::after {
    transform: translateX(20px);
}

.preview-toggle-label {
    font-size: 0.85rem;
}

.preview-toggle--language {
    gap: 8px;
    background: rgba(99, 102, 241, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
}

.preview-toggle--language .preview-toggle-label {
    font-size: 0.75rem;
}

.preview-languages {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1;
}

.preview-languages:empty {
    display: none;
}

.preview-language-btn {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #4b5563;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preview-language-btn:focus-visible {
    outline: 2px solid #4338ca;
    outline-offset: 2px;
}

.preview-language-btn:hover {
    border-color: #6366f1;
    color: #312e81;
}

.preview-language-btn.configured {
    border-color: rgba(124, 58, 237, 0.4);
    background: rgba(167, 139, 250, 0.12);
    color: #6d28d9;
}

.preview-language-btn.active {
    background: #6366f1;
    color: white;
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.preview-lang-flag {
    font-size: 1rem;
}

.preview-lang-name {
    line-height: 1;
}

.announcement-preview {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    padding: 0 14px;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.announcement-preview.is-visible {
    max-height: 3000px;
    opacity: 1;
    padding: 14px;
}

.preview-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 0.85rem;
}

.preview-placeholder .material-icons {
    font-size: 18px;
    color: #9ca3af;
}

.preview-language-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4338ca;
}

.preview-language-header .material-icons {
    font-size: 18px;
}

.preview-language-flag {
    font-size: 1rem;
}

.announcement-preview-section {
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.preview-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 4px 12px;
    border-radius: 999px;
}

.preview-chip .material-icons {
    font-size: 16px;
}

.preview-chip--intro {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.preview-chip--content {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.preview-chip--outro {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
}

.announcement-preview-section p {
    margin: 0;
    font-size: 0.85rem;
    color: #111827;
    line-height: 1.5;
}

.preview-empty-text {
    color: #9ca3af;
    font-style: italic;
}

.preview-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
    backdrop-filter: blur(6px);
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.preview-modal__dialog {
    background: white;
    border-radius: 16px;
    width: min(850px, 100%);
    max-height: 90vh;
    max-height: 90dvh;
    max-height: calc(var(--vh, 1vh) * 90);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(30, 41, 59, 0.4);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.preview-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
    color: white;
}

.preview-modal__title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-modal__title .material-icons {
    font-size: 22px;
}

.preview-modal__close {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    border-radius: 999px;
    padding: 6px 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.preview-modal__close .material-icons {
    font-size: 18px;
}

.preview-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.preview-modal__tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.preview-modal__tabs-container {
    display: flex;
    gap: 8px;
}

.preview-modal__tab {
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    background: white;
    border: 1px solid #cbd5f5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.preview-modal__tab .material-icons {
    font-size: 18px;
}

.preview-modal__tab:hover {
    color: #1d4ed8;
    border-color: #94a3b8;
}

.preview-modal__tab.active {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.25);
}

.preview-modal__body {
    padding: 20px 22px;
    overflow-y: auto;
    background: #f1f5f9;
}

.preview-modal__summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.preview-modal__summary-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #475569;
    background: rgba(148, 163, 184, 0.18);
    padding: 6px 10px;
    border-radius: 999px;
}

.preview-modal__warning {
    margin-top: 14px;
    font-size: 0.75rem;
    color: #c2410c;
    background: rgba(252, 211, 77, 0.25);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-modal__body .playback-group {
    margin-bottom: 18px;
}

.preview-modal__body .playback-group:last-child {
    margin-bottom: 0;
}

.preview-modal__body .playback-section {
    background: rgba(255, 255, 255, 0.92);
}

.preview-modal__body .playback-content-item {
    background: rgba(248, 250, 252, 0.85);
}

/* Controles del modal de vista previa */
.preview-modal__controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

.preview-view-switch-wrapper {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.preview-view-switch {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #d1d5db;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
}

.preview-view-switch:checked {
    background: #6366f1;
}

.preview-view-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.preview-view-switch:checked + .preview-view-slider {
    transform: translateX(20px);
}

.preview-view-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

/* Vista unificada */
.preview-modal__unified-content {
    padding: 20px 22px;
    background: #f8fafc;
}

.unified-text {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 1rem;
    line-height: 1.5;
    color: #374151;
    white-space: normal;
    word-wrap: break-word;
}

.preview-modal__empty {
    text-align: center;
    color: #475569;
    font-size: 0.9rem;
    padding: 20px;
}

.preview-modal__empty .material-icons {
    font-size: 32px;
    margin-bottom: 10px;
    color: #94a3b8;
}


@media (max-width: 768px) {
    body {
        --body-padding-top: 10px;
        --body-padding-side: 10px;
        --body-padding-bottom: 10px;
        overflow-x: hidden;
    }

    /* Evitar zoom automático en campos de texto/número */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Mejorar visibilidad de la flechita del dropdown de destinos en móvil */
    .destination-input::-webkit-calendar-picker-indicator {
        opacity: 1 !important;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%234f46e5" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') center/contain no-repeat !important;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    }

    .destination-input::-webkit-calendar-picker-indicator:hover {
        opacity: 1 !important;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23333333" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') center/contain no-repeat !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
        gap: 18px;
    }

    .footer-signature {
        margin-top: 10px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
        position: static;
        top: auto;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
    }

    .speed-control input[type="range"] {
        width: 100%;
    }

    .action-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: 1fr;
        gap: 8px;
        margin-left: 0;
        width: 100%;
    }

    .btn {
        flex: none;
        width: 100%;
        justify-content: center;
        font-size: 0.75rem;
        padding: 10px 8px;
    }

    #previewModalBtn {
        grid-column: 1;
        grid-row: 1;
    }

    #playAllBtn {
        grid-column: 2;
        grid-row: 1;
    }

    #stopBtn {
        grid-column: 3;
        grid-row: 1;
    }

    .announcement-row {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .mobile-top-row {
        display: flex;
        gap: 12px;
    }

    .mobile-top-row .type-section,
    .mobile-top-row .languages-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-height: auto;
    }

    .flight-item {
        padding: 10px;
    }

    .flight-item__header {
        align-items: stretch;
        gap: 8px;
    }

    .flight-item__controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
        width: 100%;
    }

    .flight-type-control {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .flight-type-control label {
        font-size: 0.75rem;
    }

    .flight-type-control select {
        width: 100%;
    }

    .flight-item__fields {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .flight-item__fields-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
    }

    /* Primera fila: Vuelo y Destino */
    .flight-item__fields-row .field-item:first-child,
    .flight-item__fields-row .field-item:nth-child(2) {
        grid-row: 1;
    }

    .flight-item__fields-row .field-item:first-child {
        grid-column: 1;
    }

    .flight-item__fields-row .field-item:nth-child(2) {
        grid-column: 2;
    }

    /* Segunda fila: Puerta e Idiomas */
    .flight-item__fields-row .field-item:nth-child(3),
    .flight-language-selector-inline {
        grid-row: 2;
    }

    .flight-item__fields-row .field-item:nth-child(3) {
        grid-column: 1;
    }

    .flight-language-selector-inline {
        grid-column: 2;
        min-width: 100%;
    }

    .flight-item__fields-row .field-item {
        min-width: 0;
    }

    .flight-actions {
        justify-content: flex-start;
    }

    .btn-add-flight {
        width: 100%;
        justify-content: center;
    }

    .language-audio-actions {
        flex-direction: column;
    }

    .language-audio-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .language-audio-controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .language-speed-control {
        width: 100%;
    }

    .preview-toggle--language {
        width: 100%;
        justify-content: space-between;
    }

    .language-preview-placeholder {
        flex-direction: column;
        align-items: flex-start;
    }

    .playback-flight-item,
    .preview-flight-item {
        flex-direction: column;
    }

    .playback-flight-item .flight-body,
    .preview-flight-item .flight-body {
        width: 100%;
    }

    .preview-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .preview-languages {
        width: 100%;
        justify-content: flex-start;
    }

    .preview-language-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .type-section label,
    .languages-section label {
        margin-bottom: 0;
        font-size: 0.75rem;
    }

    .fields-section {
        min-height: auto;
    }

    .fields-inline {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .language-selector {
        gap: 6px;
    }

    /* Mejoras adicionales para scroll en móvil */
    .announcements-list {
        height: auto;
        max-height: none; /* gestionado por flex */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        scrollbar-gutter: stable both-edges;
    }

    /* Asegurar que todos los elementos respeten los márgenes */
    .announcement-card,
    .playback-card {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
    }

    /* Mejorar el scroll en iOS */
    .announcements-list::-webkit-scrollbar {
        width: 4px;
    }

    .announcements-list::-webkit-scrollbar-track {
        background: transparent;
    }

    .announcements-list::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    /* Mejorar modales en móvil */
    .preview-modal {
        padding: 0;
        align-items: stretch;
        justify-content: flex-start;
    }

    .preview-modal__dialog {
        width: 100vw;
        height: calc(var(--vh, 1vh) * 100);
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        flex: 1 1 auto;
    }

    .preview-modal__body {
        padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
    }

    .preview-modal__summary {
        flex-direction: row;
        gap: 12px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .preview-modal__summary-item {
        justify-content: flex-start;
        flex: 1;
        min-width: 0;
    }

    /* Controles del modal en móvil */
    .preview-modal__controls {
        justify-content: center;
    }

    .preview-view-toggle {
        font-size: 0.8rem;
    }

    .preview-view-switch-wrapper {
        width: 40px;
        height: 22px;
    }

    .preview-view-slider {
        width: 18px;
        height: 18px;
    }

    .preview-view-switch:checked + .preview-view-slider {
        transform: translateX(18px);
    }

    .preview-modal__unified-content {
        padding: 0;
    }

    .unified-text {
        width: 100%;
        border-radius: 0;
        padding: 20px 20px 24px;
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Simplificar tabs en móvil - solo banderas */
    .preview-modal__tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .preview-modal__tab .material-icons {
        font-size: 18px;
    }

    .preview-modal__tab span:not(.material-icons) {
        display: none;
    }

    .preview-modal__tab.active span:not(.material-icons) {
        display: inline;
    }

    /* Footer en móvil */
    .footer-signature {
        padding: 6px 15px;
        margin-top: 6px;
        font-size: 0.7rem;
    }
}

/* Modo reproducción */
.announcement-card.playing {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-color: #60a5fa;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.announcement-card.loading {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #fbbf24;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.playing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    color: #fbbf24;
}

.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fbbf24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top: 2px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.announcement-content.playing-mode {
    padding: 16px;
}

.header-languages {
    display: inline-flex;
    gap: 6px;
    margin-left: 12px;
    align-items: center;
}

.language-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.language-badge.active {
    background: #fbbf24;
    color: #1f2937;
    border-color: #f59e0b;
}

.text-display {
    margin-bottom: 16px;
}
.announcement-text {
    font-size: 1rem;
    line-height: 1.5;
    color: white;
    font-weight: 500;
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: opacity 0.3s ease;
}

.announcement-text.inactive {
    opacity: 0.4;
    color: #9ca3af;
}

.audio-timer {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: white;
}

.current-time {
    color: #fbbf24;
}

.separator {
    color: rgba(255, 255, 255, 0.6);
}

.total-time {
    color: rgba(255, 255, 255, 0.8);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s ease;
}

.playback-card {
    background: #f8fafc;
    border-left: 4px solid #6366f1;
    padding: 18px;
}

.playback-card .announcement-header {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 18px;
}

.playback-card .announcement-number {
    color: #1f2937;
    font-size: 1rem;
    gap: 6px;
}

.playback-card.playing {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-left-color: #4338ca;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
}

.playback-card.loading {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-left-color: #f97316;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.2);
}

.playback-card.language-es {
    border-left-color: #6366f1;
}

.playback-card.language-en {
    border-left-color: #6366f1;
}

.playback-card.language-pt {
    border-left-color: #6366f1;
}

.playback-card.playing.language-es {
    border-left-color: #4338ca;
}

.playback-card.playing.language-en {
    border-left-color: #4338ca;
}

.playback-card.playing.language-pt {
    border-left-color: #4338ca;
}

.playback-card .announcement-count {
    font-size: 0.75rem;
    margin-left: 8px;
    color: #6b7280;
    background: rgba(148, 163, 184, 0.15);
    padding: 2px 8px;
    border-radius: 999px;
}

.playback-card.playing .announcement-count {
    color: #1e3a8a;
    background: rgba(59, 130, 246, 0.12);
}

.playback-card.loading .announcement-count {
    color: #c2410c;
    background: rgba(249, 115, 22, 0.12);
}

.playback-group {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

.playback-group:last-child {
    margin-bottom: 0;
}

.playback-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.group-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #4b5563;
}

.group-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4338ca;
    background: rgba(99, 102, 241, 0.12);
    padding: 2px 8px;
    border-radius: 999px;
}

.group-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.playback-section {
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.7);
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.playback-section:last-of-type {
    margin-bottom: 0;
}

.section-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    color: #3730a3;
    text-transform: uppercase;
}

.section-chip--intro {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.section-chip .material-icons {
    font-size: 16px;
}

.section-chip--content {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.section-chip--outro {
    background: rgba(249, 115, 22, 0.1);
    color: #c2410c;
}

.playback-line {
    font-size: 0.9rem;
    color: #111827;
    line-height: 1.5;
    margin: 0;
    text-indent: 0;
    padding-left: 0;
}

.playback-line.muted {
    color: #9ca3af;
    font-style: italic;
}

.playback-contents {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.playback-content-item {
    display: flex;
    align-items: flex-start;
    gap: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.playback-content-item.playback-content-empty {
    justify-content: center;
    background: rgba(241, 245, 249, 0.6);
    border-style: dashed;
}

.content-index {
    display: none;
}

.playback-card.language-es .content-index {
    background: #6366f1;
}

.playback-card.language-en .content-index {
    background: #6366f1;
}

.playback-card.language-pt .content-index {
    background: #6366f1;
}

.content-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.content-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.content-body p {
    font-size: 0.9rem;
    color: #1f2937;
    line-height: 1.5;
    margin: 0;
    text-indent: 0;
    padding-left: 0;
}

.playback-card.playing .content-body p {
    color: #111827;
}

.playback-card.loading .content-body p {
    color: #7c2d12;
}

/* Footer Signature */
.footer-signature {
    text-align: center;
    padding: 8px 20px;
    margin-top: 10px;
    margin-bottom: 0px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    /* en layout flex del body, la firma queda abajo naturalmente */
    flex-shrink: 0; /* evitar que reduzca el contenido central */
}

.footer-signature p {
    margin: 0;
}

.footer-signature a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 1px;
}

.footer-signature a:hover {
    color: white;
    border-bottom-color: white;
    transform: translateY(-1px);
}

/* Modal para audio pendiente en móviles */
.pending-audio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.pending-audio-modal .modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.pending-audio-modal h3 {
    margin: 0 0 12px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.pending-audio-modal p {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 14px;
}

.pending-audio-modal .play-button {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pending-audio-modal .play-button:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15);
}

.pending-audio-modal .play-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.pending-audio-modal .play-button .material-icons {
    font-size: 20px;
}
