:root {
  /* Paleta alineada con el sitio principal */
  --bg: #f8f9fa;
  --panel: #ffffff;
  --panel-2: #f0f2f5;
  --panel-3: #e4e6e9;
  --line: #e9ecef;
  --line-2: #dee2e6;
  --text: #2b2d42;
  --muted: #8d99ae;
  --faint: #a3acba;
  --accent: #4361ee;
  --accent-dark: #3a0ca3;
  --accent-ink: #ffffff;
  --accent-soft: rgba(67, 97, 238, .1);
  --accent-line: rgba(67, 97, 238, .25);
  --sel: #4cc9f0;
  --sel-ink: #0b86a6;
  --danger: #f72585;
  --danger-ink: #b0145f;
  --ok: #4ad66d;
  --ok-ink: #1f8a4c;
  --ink: #0d0c0f;
  --grad: linear-gradient(135deg, #4361ee, #4cc9f0);
  --grad-play: linear-gradient(135deg, #4361ee, #3a0ca3);
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, .12);
  --ease: all .3s ease;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
button, input, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; flex: none; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-2); padding: 1px 6px; border-radius: 5px; }
kbd { font-family: var(--mono); font-size: 11px; background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }

/* ---------- Header ---------- */
.top {
  display: flex; align-items: center; gap: 24px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; font-size: 16px; color: var(--ink); }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 3px 10px rgba(67, 97, 238, .3); }
.logo svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.tab {
  border: 0; background: none; padding: 7px 14px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500;
  transition: var(--ease);
}
.tab:hover { color: var(--accent); }
.tab.active { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.server { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.server .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.server.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(74, 214, 109, .2); }
.server.bad .dot { background: var(--danger); }

.banner {
  background: rgba(247, 37, 133, .08); border-bottom: 1px solid rgba(247, 37, 133, .25);
  color: var(--danger-ink); padding: 9px 20px; font-size: 13px;
}

/* ---------- Layout ---------- */
.view { flex: 1; min-height: 0; }
#view-editor { display: grid; grid-template-columns: 300px 1fr; }
#view-editor[hidden] { display: none; }

/* ---------- Library ---------- */
.library {
  border-right: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
.panel-head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.count { font-family: var(--mono); font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 20px; padding: 1px 9px; }

.drop {
  margin: 0 16px 12px; padding: 18px 12px; border: 2px dashed var(--line-2); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; cursor: pointer;
  color: var(--muted); transition: var(--ease);
}
.drop svg { width: 26px; height: 26px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); margin-bottom: 4px; }
.drop strong { color: var(--text); font-weight: 600; }
.drop span { font-size: 12px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }

.lib-list { list-style: none; margin: 0; padding: 0 10px; overflow-y: auto; flex: 1; min-height: 60px; }
.lib-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  padding: 9px 8px; border-radius: 8px; border: 1px solid transparent; transition: var(--ease);
}
.lib-item:hover { background: var(--panel-2); border-color: var(--line); }
.lib-item input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.lib-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.lib-order { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.lib-item:hover .lib-order { opacity: 1; }
.lib-meta { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.lib-meta .dur { font-family: var(--mono); }
.lib-meta .err { color: var(--danger); }
.lib-actions { grid-column: 2 / -1; display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.mini {
  border: 1px solid var(--line-2); background: #fff; border-radius: 6px; padding: 2px 8px;
  font-size: 12px; cursor: pointer; color: var(--text); transition: var(--ease);
}
.mini:hover { border-color: var(--accent); color: var(--accent); }
.mini.icon { padding: 1px 6px; color: var(--muted); border-color: transparent; background: none; }
.mini:disabled { opacity: .35; pointer-events: none; }
.lib-empty { color: var(--faint); font-size: 13px; text-align: center; padding: 18px 10px; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.join-box { border-top: 1px solid var(--line); padding: 14px 16px 16px; background: var(--panel); }
.join-title { font-weight: 600; margin-bottom: 2px; color: var(--ink); }
.hint { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.join-row { display: flex; gap: 8px; align-items: flex-end; justify-content: space-between; }
.field-inline { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

/* ---------- Controls ---------- */
select, input.time, .url-row input, .project-name {
  background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; outline: none;
  transition: var(--ease);
}
select:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67, 97, 238, .2); }
select { cursor: pointer; }

.btn {
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: #fff; border-radius: 8px; color: var(--text);
  padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: var(--ease);
}
.btn:hover { background: var(--panel-2); transform: translateY(-2px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--ink); border-color: var(--ink); box-shadow: 0 4px 12px rgba(13, 12, 15, .2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12px; font-weight: 500; }
.btn.big { padding: 10px 20px; }
.btn svg { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.busy { pointer-events: none; opacity: .7; }

/* ---------- Workspace ---------- */
.workspace { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 16px 20px 20px; gap: 12px; overflow-y: auto; }
.project-bar { display: flex; align-items: center; gap: 16px; }
.project-name { font-size: 18px; font-weight: 600; background: transparent; border-color: transparent; padding: 4px 8px; margin-left: -8px; min-width: 0; flex: 1; max-width: 420px; color: var(--ink); }
.project-name:hover { border-color: var(--line-2); background: #fff; }
.readouts { display: flex; gap: 18px; margin-left: auto; }
.ro { display: flex; flex-direction: column; align-items: flex-end; }
.ro span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ro b { font-family: var(--mono); font-weight: 500; font-size: 17px; color: var(--ink); }
.ro.small { align-items: flex-start; }
.ro.small b { font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; box-shadow: var(--shadow); }
.group.right { margin-left: auto; }
.group .sep { width: 1px; align-self: stretch; background: var(--line); margin: 3px 4px; }
.tbtn {
  border: 0; background: none; border-radius: 7px; padding: 6px 10px; cursor: pointer; color: var(--text);
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: var(--ease);
}
.tbtn.icon { padding: 6px 8px; }
.tbtn:hover { background: var(--accent-soft); color: var(--accent); }
.tbtn:disabled { color: var(--faint); background: none; cursor: default; }
.tbtn svg { stroke: currentColor; }
.tbtn.toggle.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
#btnPlay { background: var(--grad-play); color: #fff; box-shadow: 0 4px 15px rgba(67, 97, 238, .3); }
#btnPlay:hover { background: var(--grad-play); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(67, 97, 238, .4); }
#btnPlay.playing { background: linear-gradient(135deg, var(--danger), #b5179e); box-shadow: 0 4px 15px rgba(247, 37, 133, .3); }
#btnPlay:disabled { background: var(--panel-3); color: var(--faint); box-shadow: none; transform: none; }
#btnPlay .i-pause { display: none; }
#btnPlay.playing .i-pause { display: block; }
#btnPlay.playing .i-play { display: none; }
#btnStop svg, #btnPlay svg { stroke: none; }
.vol { display: flex; align-items: center; gap: 6px; padding: 0 8px; color: var(--muted); }
.vol svg { width: 16px; height: 16px; stroke: none; }
.vol input { width: 70px; accent-color: var(--accent); box-shadow: none; border: 0; padding: 0; }

.wave-wrap {
  position: relative; height: 300px; flex: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--ease);
}
.wave-wrap:hover { box-shadow: var(--shadow-lg); }
.wave-wrap.over { border-color: var(--accent); }
#wave { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); text-align: center; pointer-events: none; gap: 2px;
}
.empty p { margin: 0; }
.empty strong { color: var(--ink); font-size: 15px; }
.empty-art { display: flex; align-items: center; gap: 5px; height: 56px; margin-bottom: 14px; }
.empty-art span { width: 5px; border-radius: 3px; background: var(--line-2); animation: bar 1.6s ease-in-out infinite; }
.empty-art span:nth-child(odd) { animation-delay: -.4s; }
.empty-art span:nth-child(3n) { animation-delay: -.8s; }
.empty-art span:nth-child(4n) { animation-delay: -1.2s; }
@keyframes bar { 0%, 100% { height: 12px; } 50% { height: 50px; background: var(--sel); } }

.hscroll { width: 100%; margin: -4px 0 0; accent-color: var(--accent); height: 14px; }
.hscroll:disabled { opacity: 0; }

.sel-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.sel-fields { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sel-fields label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
input.time { font-family: var(--mono); width: 110px; padding: 5px 8px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.tips { margin: 0; color: var(--faint); font-size: 12px; }

.export {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: auto; padding: 16px 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(67, 97, 238, .08), rgba(76, 201, 240, .06) 70%), var(--panel);
  border: 1px solid var(--accent-line); box-shadow: var(--shadow);
}
.export-title h3 { margin: 0; font-size: 15px; color: var(--ink); }
.export-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.export-fields { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.export-fields label, .dl-options label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

/* ---------- Downloader ---------- */
#view-links { overflow-y: auto; }
.dl { max-width: 820px; margin: 0 auto; padding: 36px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.dl-hero h2 {
  margin: 0 0 6px; font-size: 2rem; font-weight: 700; letter-spacing: -.02em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  width: fit-content;
}
.dl-hero p { margin: 0; color: var(--muted); }
.url-row { display: flex; gap: 8px; }
.url-row input { flex: 1; min-width: 0; padding: 12px 14px; font-size: 15px; border-radius: 8px; }

.info-card { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.info-card img { width: 160px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; background: var(--panel-3); flex: none; }
.info-site { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.info-title { font-weight: 600; font-size: 15px; margin: 2px 0; color: var(--ink); }
.info-sub { color: var(--muted); font-size: 13px; }
.info-card.loading { color: var(--muted); }

.dl-options { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.dl-options #btnDownload { margin-left: auto; }
.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-btn { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 7px 16px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; transition: var(--ease); }
.seg-btn:hover { color: var(--accent); }
.seg-btn svg { fill: none; }
.seg-btn.active { background: var(--accent); color: #fff; }

.jobs-head h3 { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.jobs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.jobs-empty { color: var(--faint); padding: 14px; border: 2px dashed var(--line-2); border-radius: var(--radius); text-align: center; }
.job { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; box-shadow: var(--shadow); transition: var(--ease); }
.job:hover { box-shadow: var(--shadow-lg); }
.job-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted); }
.job-badge.audio { color: var(--accent); background: var(--accent-soft); }
.job-badge.video { color: var(--sel-ink); background: rgba(76, 201, 240, .16); }
.job-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.job-actions { display: flex; gap: 6px; }
.job-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.bar { flex: 1; height: 6px; background: var(--panel-3); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 4px; transition: width .3s; }
.job.done .bar i { background: var(--ok); }
.job.error .bar i { background: var(--danger); width: 100% !important; }
.job.error .job-progress { color: var(--danger-ink); }
.job-pct { font-family: var(--mono); min-width: 44px; text-align: right; }

.dl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.legal { margin: 0; color: var(--faint); font-size: 12px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: min(380px, calc(100vw - 36px)); }
.toast { background: #fff; color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); animation: in .2s ease-out; white-space: pre-line; }
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--ok); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Responsive ---------- */
button, .tab, .seg-btn, .tbtn, .mini { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Tableta y móvil */
@media (max-width: 900px) {
  html, body { height: 100%; }
  body { height: 100dvh; }
  .top {
    flex-wrap: wrap; gap: 10px 16px;
    padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  }

  /* la pantalla entera se desplaza; biblioteca arriba, taller abajo */
  .view { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  #view-editor { display: block; }
  .library { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .lib-list { max-height: 240px; flex: none; }
  .workspace {
    overflow: visible; padding: 14px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  }

  /* 16px evita el zoom automático de iOS al enfocar un campo */
  select, input.time, .url-row input { font-size: 16px; }
  select, input.time { min-height: 40px; }

  /* objetivos táctiles */
  .tbtn { min-height: 40px; padding: 8px 12px; }
  .tbtn.icon { min-width: 40px; justify-content: center; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 36px; }
  .mini { min-height: 32px; padding: 4px 12px; }
  .mini.icon { min-width: 34px; }
  .lib-item { padding: 10px 8px; }
  .lib-item input[type=checkbox] { width: 20px; height: 20px; }
  .lib-order { opacity: 1; }
  .seg-btn { min-height: 40px; }

  /* barra de herramientas: una sola fila con desplazamiento horizontal */
  .toolbar { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > .group { flex: none; flex-wrap: nowrap; }
  .toolbar > .group.transport { order: -1; position: sticky; left: 0; z-index: 2; }
  .toolbar > .group.right { order: 0; margin-left: 0; }
  .toolbar > .group:not(.transport):not(.right) { order: 1; }

  .wave-wrap { height: 220px; }
  .hscroll { height: 28px; margin: -2px 0 0; }
  .tips { display: none; }

  .export { flex-direction: column; align-items: stretch; }
  .export-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .export-fields select { width: 100%; }
  .export-fields .btn { grid-column: 1 / -1; }

  .dl { padding: 24px max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }

  .toasts { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
}

/* Teléfono en vertical */
@media (max-width: 560px) {
  .top { flex-wrap: nowrap; gap: 10px; }
  .brand-name, .server .txt { display: none; }
  .tabs { flex: 1; min-width: 0; }
  .tab { flex: 1; min-width: 0; padding: 8px 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .server { margin-left: 0; }

  .panel-head { padding: 12px 16px 8px; }
  .drop { margin: 0 12px 10px; padding: 14px 12px; }
  .lib-list { max-height: 200px; padding: 0 6px; }
  .join-box { padding: 12px; }
  .join-box .hint { display: none; }

  .project-bar { flex-wrap: wrap; gap: 6px 12px; }
  .project-name { flex: 1 1 100%; max-width: none; }
  .readouts { margin-left: 0; width: 100%; justify-content: space-between; }
  .readouts .ro b { font-size: 15px; }

  .wave-wrap { height: 190px; }
  .vol input { width: 56px; }

  .sel-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
  .sel-fields label { flex-direction: column; align-items: stretch; gap: 4px; }
  input.time { width: 100%; }

  .export { padding: 14px; }
  .dl { padding-top: 20px; }
  .dl-hero h2 { font-size: 1.6rem; }
  .url-row { flex-wrap: wrap; }
  .url-row input { flex: 1 1 100%; }
  .url-row .btn { flex: 1; }
  .info-card { gap: 10px; padding: 10px; }
  .info-card img { width: 96px; }
  .dl-options { flex-direction: column; align-items: stretch; }
  .dl-options select { width: 100%; }
  .seg { width: 100%; }
  .seg-btn { flex: 1; justify-content: center; }
  .dl-options #btnDownload { margin-left: 0; width: 100%; }
  .dl-foot { flex-direction: column; align-items: flex-start; }
}

/* Teléfono en horizontal (poca altura) */
@media (max-height: 500px) and (orientation: landscape) {
  .top { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; gap: 10px; }
  .wave-wrap { height: clamp(120px, 38dvh, 220px); }
  .lib-list { max-height: 160px; }
  .dl-hero h2 { font-size: 1.4rem; }
}

/* Pantallas táctiles: sin efectos de "hover" que se queden pegados */
@media (hover: none) {
  .btn:hover, #btnPlay:hover { transform: none; }
  .btn.primary:hover { background: var(--accent); border-color: var(--accent); box-shadow: none; }
  .wave-wrap:hover, .job:hover { box-shadow: var(--shadow); }
}