:root {
    --em-bg: #0f172a;
    --em-bg-alt: #141d38;
    --em-card: #1a2440;
    --em-card-alt: #202b4d;
    --em-border: #2a3560;
    --em-text: #f4f6fb;
    --em-muted: #97a1c2;
    --em-accent: #f5b942;
    --em-accent-dark: #d99a1f;
    --em-accent-contrast: #201404;
    --em-danger: #ef4444;
    --em-success: #22c55e;
    --em-info: #60a5fa;
    --em-warning: #f59e0b;
    --em-radius: 16px;
    --em-radius-sm: 10px;
    --em-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    --em-header-bg: rgba(15, 23, 42, 0.85);
    --em-bottomnav-bg: rgba(20, 29, 56, 0.95);
    --em-accent-soft: rgba(245, 185, 66, 0.1);
    --em-accent-soft-strong: rgba(245, 185, 66, 0.15);
    --em-success-soft: rgba(34, 197, 94, 0.12);
    --em-info-soft: rgba(96, 165, 250, 0.15);
    --em-warning-soft: rgba(245, 158, 11, 0.15);
    --em-danger-soft: rgba(239, 68, 68, 0.15);
    --em-input-bg: #202b4d;
    --em-input-border: #384277;
}

/* Light mode -- toggled via the sun/moon button in the header, persisted
   in localStorage as `emusic_theme` (see app.js's initThemeToggle). */
[data-theme="light"] {
    --em-bg: #f3f5fb;
    --em-bg-alt: #e7ebf6;
    --em-card: #ffffff;
    --em-card-alt: #eef1f9;
    --em-border: #dde3f0;
    --em-text: #1a2033;
    --em-muted: #626d8a;
    --em-accent: #c9820a;
    --em-accent-dark: #a66b06;
    --em-accent-contrast: #ffffff;
    --em-danger: #dc2626;
    --em-success: #16a34a;
    --em-info: #2563eb;
    --em-warning: #b45309;
    --em-shadow: 0 12px 30px rgba(30, 41, 82, 0.1);
    --em-header-bg: rgba(255, 255, 255, 0.85);
    --em-bottomnav-bg: rgba(255, 255, 255, 0.95);
    --em-accent-soft: rgba(201, 130, 10, 0.1);
    --em-accent-soft-strong: rgba(201, 130, 10, 0.15);
    --em-success-soft: rgba(22, 163, 74, 0.1);
    --em-info-soft: rgba(37, 99, 235, 0.12);
    --em-warning-soft: rgba(180, 83, 9, 0.12);
    --em-danger-soft: rgba(220, 38, 38, 0.12);
    --em-input-bg: #ffffff;
    --em-input-border: #c7d0e6;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--em-bg);
    color: var(--em-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

.em-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top, var(--em-bg-alt), var(--em-bg) 60%);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Header */
.em-header {
    padding: max(16px, env(safe-area-inset-top)) 20px 12px;
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--em-header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--em-border);
}

.em-header__inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.em-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.2px;
}

.em-header__logo {
    height: 28px;
    width: auto;
}

.em-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.em-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--em-card);
    border: 1px solid var(--em-border);
    color: var(--em-text);
    font-size: 17px;
    cursor: pointer;
    line-height: 1;
}

.em-icon-btn:active { transform: scale(0.95); }
.em-icon-btn--danger { color: var(--em-danger); }
.em-icon-btn[hidden] { display: none; }

.em-fab {
    position: fixed;
    right: 18px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    z-index: 25;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--em-accent);
    color: var(--em-accent-contrast);
    border: none;
    box-shadow: var(--em-shadow);
    cursor: pointer;
}

.em-fab:active { transform: scale(0.94); }

/* Main */
.em-main {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 20px 100px;
}

.em-main--bare {
    padding-bottom: 20px;
}

/* Bottom nav */
.em-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    justify-content: space-around;
    background: var(--em-bottomnav-bg);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--em-border);
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
}

.em-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--em-muted);
    padding: 6px 10px;
    border-radius: var(--em-radius-sm);
    transition: color 0.15s, background 0.15s;
    flex: 1;
    white-space: nowrap;
}

.em-bottom-nav__icon { font-size: 20px; }

.em-bottom-nav__item.is-active,
.em-bottom-nav__item:active {
    color: var(--em-accent);
    background: var(--em-accent-soft);
}

/* Buttons */
.em-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: var(--em-radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.em-btn:active { transform: scale(0.98); }
.em-btn--block { width: 100%; }

.em-btn--primary {
    background: var(--em-accent);
    color: var(--em-accent-contrast);
}

.em-btn--primary:hover { background: var(--em-accent-dark); }

.em-btn--ghost {
    background: transparent;
    color: var(--em-muted);
    border: 1px solid var(--em-border);
    margin-top: 10px;
}

.em-btn--soft {
    background: var(--em-accent-soft-strong);
    color: var(--em-accent);
    border: 1px solid transparent;
}

/* Identify page */
.em-identify {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

.em-identify__theme-toggle {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
}

.em-identify__card {
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    box-shadow: var(--em-shadow);
    padding: 32px 26px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.em-identify__mark {
    height: 56px;
    margin-bottom: 14px;
}

.em-identify__title {
    font-size: 22px;
    margin: 0 0 8px;
}

.em-identify__subtitle {
    color: var(--em-muted);
    font-size: 14px;
    margin: 0 0 22px;
}

.em-identify__form,
.em-identify__returning {
    text-align: left;
}

.em-identify__returning { text-align: center; }
.em-identify__returning p { margin-bottom: 16px; }

/* Fields */
.em-field { margin-bottom: 16px; text-align: left; }

.em-field label {
    display: block;
    font-size: 13px;
    color: var(--em-muted);
    margin-bottom: 6px;
}

.em-field input,
.em-field select,
.em-field textarea,
.em-search input {
    width: 100%;
    background: var(--em-input-bg);
    border: 1px solid var(--em-input-border);
    color: var(--em-text);
    border-radius: var(--em-radius-sm);
    padding: 12px 14px;
    font-size: 15px;
}

.em-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2397a1c2' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 36px;
}

.em-field input:focus,
.em-field select:focus,
.em-field textarea:focus,
.em-search input:focus {
    outline: none;
    border-color: var(--em-accent);
}

.em-form { max-width: 480px; margin-bottom: 28px; }

.em-avatar-field {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.em-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--em-border);
    background: var(--em-bg-alt);
}

.em-avatar-upload-btn {
    margin-top: 0;
    cursor: pointer;
    font-size: 13px;
    padding: 9px 16px;
}

/* Page header */
.em-page__header { margin-bottom: 18px; }
.em-page__header h1 { margin: 0 0 4px; font-size: 24px; }
.em-muted { color: var(--em-muted); font-size: 14px; margin: 0; }

.em-page__header--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.em-quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.em-quick-actions__btn {
    flex: none;
    margin-top: 0;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
}

/* Search + chips */
.em-search { margin-bottom: 14px; }

.em-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 18px;
}

.em-chip {
    flex: none;
    background: var(--em-card);
    border: 1px solid var(--em-border);
    color: var(--em-muted);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.em-chip.is-active {
    background: var(--em-accent);
    border-color: var(--em-accent);
    color: var(--em-accent-contrast);
    font-weight: 600;
}

.em-chip--favorite {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--em-accent);
    border-color: var(--em-accent-soft-strong);
}

.em-chip--favorite.is-active {
    background: var(--em-accent);
    border-color: var(--em-accent);
    color: var(--em-accent-contrast);
}

/* Song list */
.em-song-list { display: flex; flex-direction: column; gap: 10px; }

.em-song-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    padding: 14px 16px;
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.em-song-card:active { transform: scale(0.99); }

.em-song-card__title { font-weight: 700; font-size: 16px; }
.em-song-card__artist {
    color: var(--em-muted);
    font-size: 13px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.em-song-card__side {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.em-tag {
    background: var(--em-card-alt);
    color: var(--em-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
}

.em-tag--org {
    background: var(--em-accent-soft-strong);
    color: var(--em-accent);
}

.em-tag--public {
    background: var(--em-success-soft);
    color: var(--em-success);
}

.em-key {
    background: var(--em-bg-alt);
    color: var(--em-accent);
    font-weight: 700;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: var(--em-radius-sm);
    border: 1px solid var(--em-border);
}

.em-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--em-border);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.em-fav-btn.is-active { color: var(--em-accent); }
.em-fav-btn--lg svg { width: 28px; height: 28px; }

@keyframes emFavPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.em-fav-btn.is-pulsing { animation: emFavPulse 0.35s ease; }

.em-song-card.is-leaving {
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.em-empty {
    color: var(--em-muted);
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
}

/* Song detail */
.em-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--em-muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.em-song__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.em-song__header h1 { margin: 0 0 4px; font-size: 24px; }

.em-transpose {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.em-transpose__btn {
    background: var(--em-accent);
    color: var(--em-accent-contrast);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.em-transpose__current {
    font-weight: 600;
    font-size: 14px;
}

.em-transpose__reset {
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--em-border);
    color: var(--em-muted);
    border-radius: var(--em-radius-sm);
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

/* Auto-scroll (teleprompter) controls on the "Letra y acordes" tab */
.em-autoscroll {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    padding: 10px 14px;
    margin-bottom: 12px;
}

.em-autoscroll__toggle {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--em-accent);
    color: var(--em-accent-contrast);
    border: none;
    cursor: pointer;
}

.em-autoscroll__toggle svg { margin-left: 2px; }

.em-autoscroll__speed {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.em-autoscroll__speed-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--em-border);
    color: var(--em-muted);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.em-autoscroll__speed-label {
    font-size: 13px;
    color: var(--em-muted);
    min-width: 70px;
    text-align: center;
}

.em-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-bottom: 1px solid var(--em-border);
    margin-bottom: 16px;
}

.em-tab {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--em-muted);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.em-tab.is-active {
    color: var(--em-accent);
    border-bottom-color: var(--em-accent);
}

.em-tab-panel { display: none; }
.em-tab-panel.is-active { display: block; }

.em-lyrics {
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    padding: 18px;
    white-space: pre-wrap;
    line-height: 1.7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    margin: 0;
}

.em-lyrics--mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    /* Chord columns only line up in a fixed-width font with no
       wrapping -- let long lines scroll horizontally instead of
       wrapping (which would break the chord/lyric alignment). */
    white-space: pre;
    overflow-x: auto;
}

.em-lyrics .em-chord {
    color: var(--em-accent);
    font-weight: 700;
}

.em-lyrics .em-annotation {
    color: var(--em-muted);
    font-style: italic;
    font-weight: 400;
}

.em-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--em-muted);
    font-size: 13px;
    margin-top: 8px;
}

.em-sheet {
    background: #fff;
    border-radius: var(--em-radius);
    padding: 14px;
    text-align: center;
}

.em-sheet img {
    max-width: 100%;
    border-radius: var(--em-radius-sm);
}

.em-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.em-links a {
    display: block;
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    padding: 12px 14px;
    color: var(--em-accent);
    font-size: 14px;
}

.em-audio-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

.em-audio-item {
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    padding: 12px 14px;
}

.em-audio-item__title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.em-audio-item__player {
    width: 100%;
    height: 36px;
}

.em-notes {
    margin-top: 20px;
    background: var(--em-card-alt);
    border-radius: var(--em-radius);
    padding: 14px 16px;
}

.em-notes h3 { margin: 0 0 6px; font-size: 14px; color: var(--em-muted); }
.em-notes__text { margin: 0; white-space: pre-wrap; font-size: 14px; }

/* Flash messages — custom HeroUI-inspired alert, replaces Winter's default.
   Winter's Snowboard "flash" plugin builds this exact markup itself:
   <div class="flash-message {type}">{message}<div class="flash-timer"></div></div>
   appended to <body>, so we style those two classes directly. */
/* Selectors are written as "body > div.flash-message" (not just
   ".flash-message") on purpose: Winter ships its own default flash
   styling (modules/system/assets/css/snowboard.extras.css) which can
   end up loaded on the page too. Matching (and slightly exceeding) its
   selector specificity, on top of loading our stylesheet last (see
   layouts/default.htm, theme.css is linked after {% styles %}),
   guarantees our design wins over the default gray Winter banner
   regardless of load order. */
body > div.flash-message {
    position: fixed !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    left: 50% !important;
    right: auto !important;
    margin-left: 0 !important;
    transform: translateX(-50%) !important;
    z-index: 500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: calc(100vw - 32px) !important;
    max-width: 420px !important;
    background: var(--em-card) !important;
    border: 1px solid var(--em-border);
    border-left: 3px solid var(--em-muted);
    border-radius: 14px !important;
    padding: 14px 16px !important;
    color: var(--em-text) !important;
    font-size: 14px;
    line-height: 1.4;
    text-shadow: none !important;
    box-shadow: var(--em-shadow) !important;
    cursor: pointer;
    overflow: hidden;
}

body > div.flash-message::before {
    content: 'ℹ';
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    background: var(--em-info-soft);
    color: var(--em-info);
}

body > div.flash-message.success { background: var(--em-card) !important; border-left-color: var(--em-success); }
body > div.flash-message.success::before { content: '✓'; background: var(--em-success-soft); color: var(--em-success); }

body > div.flash-message.error { background: var(--em-card) !important; border-left-color: var(--em-danger); }
body > div.flash-message.error::before { content: '✕'; background: var(--em-danger-soft); color: var(--em-danger); }

body > div.flash-message.warning { background: var(--em-card) !important; border-left-color: var(--em-warning); }
body > div.flash-message.warning::before { content: '⚠'; background: var(--em-warning-soft); color: var(--em-warning); }

body > div.flash-message .flash-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.35;
    transition-property: width;
    transition-timing-function: linear;
}

body > div.flash-message .flash-timer.timeout-out { width: 0%; }

/* Snowboard's "transition" plugin drives show/hide via these class names */
/* !important here is required: Winter's own snowboard.extras.css defines
   competing .show-in/.show-out rules with a DIFFERENT transform
   (scale(.9) instead of our translateX/Y), and that stylesheet is
   injected by JS at runtime (StylesheetLoader.js appends it to <head>
   on the 'ready' event) -- always AFTER our theme.css link, no matter
   where we place it in the template. At equal selector specificity the
   later stylesheet wins, which silently dropped our translateX(-50%)
   centering during the transition and made the flash jump into a
   clipped corner before snapping back to center once the transition
   classes were removed. !important guarantees ours always applies. */
body > div.flash-message.show-in,
body > div.flash-message.hide-out {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(-10px) !important;
}

body > div.flash-message.show-out,
body > div.flash-message.hide-in {
    opacity: 1 !important;
    transform: translateX(-50%) translateY(0) !important;
}

body > div.flash-message.show-active,
body > div.flash-message.hide-active {
    transition: opacity 0.25s ease, transform 0.25s ease !important;
}

@media (max-width: 480px) {
    body > div.flash-message {
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        transform: none;
    }

    body > div.flash-message.show-in,
    body > div.flash-message.hide-out {
        transform: translateY(-10px) !important;
    }

    body > div.flash-message.show-out,
    body > div.flash-message.hide-in {
        transform: translateY(0) !important;
    }
}

/* Toasts (used by app.js for small confirmations) */
.em-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%);
    background: var(--em-card-alt);
    border: 1px solid var(--em-border);
    color: var(--em-text);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    z-index: 50;
    box-shadow: var(--em-shadow);
}

/* Confirmation modal (used by the "Instalar" button, reusable elsewhere) */
.em-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 30, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.em-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.em-modal {
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    box-shadow: var(--em-shadow);
    padding: 26px 24px 22px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.2s ease;
}

.em-modal-overlay.is-open .em-modal {
    transform: scale(1) translateY(0);
}

.em-modal__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--em-accent-soft-strong);
    color: var(--em-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.em-modal__title {
    margin: 0 0 8px;
    font-size: 18px;
}

.em-modal__body {
    margin: 0 0 22px;
    color: var(--em-muted);
    font-size: 14px;
    line-height: 1.5;
}

.em-modal__actions {
    display: flex;
    gap: 10px;
}

.em-modal__actions .em-btn {
    flex: 1;
    margin-top: 0;
    padding: 11px 16px;
    font-size: 14px;
}

/* Generic empty state (orden del día, and reusable elsewhere) */
.em-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
    color: var(--em-muted);
    padding: 48px 20px;
}

.em-empty-state svg { color: var(--em-border); }
.em-empty-state p { margin: 0; font-size: 14px; max-width: 320px; }

/* Orden del día: list + drag-to-reorder */
.em-agenda-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.em-agenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--em-card);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    padding: 10px 12px;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.em-agenda-item.is-dragging {
    opacity: 0.4;
}

.em-agenda-item.is-leaving {
    opacity: 0;
    transform: scale(0.97);
}

.em-agenda-item__handle {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--em-muted);
    cursor: grab;
    flex: none;
    touch-action: none;
}

.em-agenda-item__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    color: var(--em-text);
}

.em-agenda-item__title {
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-agenda-item__artist {
    color: var(--em-muted);
    font-size: 13px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.em-agenda-item__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: transparent;
    border: none;
    color: var(--em-danger);
    cursor: pointer;
    padding: 6px;
}

/* "Agregar música" picker modal */
.em-modal--picker {
    max-width: 460px;
    text-align: left;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.em-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.em-modal__header .em-modal__title { margin: 0; }

.em-agenda-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.em-agenda-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
}

.em-agenda-picker-item__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.em-agenda-picker-item__title {
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-agenda-picker-item__artist {
    color: var(--em-muted);
    font-size: 12px;
    margin-top: 1px;
}

.em-agenda-picker-item__add {
    flex: none;
    margin-top: 0;
    padding: 8px;
    line-height: 1;
}
