/* Aquelarre — cristal nocturno. Cada pad es un farolillo que se enciende al sonar. */

:root {
  color-scheme: dark;
  --night-top: #1B1433;
  --night-mid: #0E0B1A;
  --night-low: #140A0C;
  --bg:
    radial-gradient(60% 40% at 88% 0%, rgba(239, 229, 208, .16), transparent 70%),
    radial-gradient(70% 45% at 0% 100%, rgba(255, 122, 24, .20), transparent 70%),
    radial-gradient(60% 40% at 100% 55%, rgba(140, 80, 255, .16), transparent 70%),
    linear-gradient(180deg, var(--night-top), var(--night-mid) 45%, var(--night-low));

  --t1: #F7F2FF;
  --t2: rgba(247, 242, 255, .72);
  --t3: rgba(247, 242, 255, .48);
  --on-accent: #160C06;

  --glass-fill: rgba(28, 22, 46, .52);
  --glass-fill-strong: rgba(20, 16, 34, .86);
  --glass-blur: blur(22px) saturate(170%);
  --glass-rim: linear-gradient(155deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .10) 35%,
    rgba(255, 255, 255, .02) 60%, rgba(255, 170, 110, .22));
  --card: rgba(30, 24, 48, .62);
  --hairline: rgba(255, 255, 255, .10);

  --pumpkin: #FF8A1F;
  --toxic: #A6FF3D;
  --blood: #FF4458;
  --witch: #B07BFF;
  --slime: #FF6BD6;
  --ghost: #72F1FF;
  --moon: #FFD25E;
  --bone: #EFE5D0;

  --r-pad: 28px;
  --r-bar: 32px;
  --r-card: 24px;
  --r-tile: 14px;
  --r-sheet: 36px;

  --sh-float: 0 16px 40px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
  --sh-pad: 0 8px 20px rgba(0, 0, 0, .35);

  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;

  --spring: linear(0, .092 4%, .291 8%, .512 12%, .708 16%, .859 20%, .979 25%, 1.037 30%, 1.054 35%, 1.049 40%, 1.02 50%, 1.002 60%, .997 70%, 1);
  --spring-pop: linear(0, .128 4%, .405 8%, .703 12%, .942 16%, 1.092 20%, 1.162 25%, 1.141 30%, 1.083 35%, 1.026 40%, .974 50%, .985 60%, 1.001 70%, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-bottom: max(calc(var(--safe-bottom) - 12px), 10px);
  --dock-h: 64px;
}

* { box-sizing: border-box; }

html {
  background: var(--night-mid);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font: 400 17px/1.35 var(--font);
  color: var(--t1);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior-y: none;
}

/* iOS ignora background-attachment: fixed */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
[hidden] { display: none !important; }
svg.ic { width: 1em; height: 1em; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tnum { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ cristal */

.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--sh-float), inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(0, 0, 0, .30);
  transform: translateZ(0);
}

.glass::before,
.pad::before,
.card::before,
.glass-lite::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--glass-rim);
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 20% -30%, rgba(255, 255, 255, .18), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
}

.glass-lite {
  position: relative;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16);
}

.card {
  position: relative;
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--sh-pad), inset 0 1px 0 rgba(255, 255, 255, .14);
}

/* ------------------------------------------------------------ cabecera */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 6px) 16px 10px;
  transition: background .24s, box-shadow .24s;
}

.topbar.is-scrolled {
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 1px 0 var(--hairline);
}

.topbar__text { flex: 1; min-width: 0; }
.topbar__title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.topbar__status {
  margin: 2px 0 0;
  min-height: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar__status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--toxic); box-shadow: 0 0 8px var(--toxic); }
.topbar__status .dot.off { background: var(--blood); box-shadow: 0 0 8px var(--blood); }

.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 22px;
  color: var(--t1);
  transition: transform .42s var(--spring), background .2s;
}
.icon-btn:active { transform: scale(.88); transition-duration: 90ms; transition-timing-function: var(--ease-out); }

/* ------------------------------------------------------------ banners */

.banners { padding: 0 16px; display: grid; gap: 10px; }
.banners:empty { display: none; }
.banners { margin-bottom: 6px; }

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 500;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.banner .bi { font-size: 22px; flex: none; }
.banner p { margin: 0; flex: 1; }
.banner small { display: block; color: var(--t2); font-size: 13px; }
.banner--alert { background: color-mix(in oklab, var(--blood) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--blood) 55%, transparent); }
.banner--warn { background: color-mix(in oklab, var(--moon) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--moon) 35%, transparent); }

.banner--resume {
  width: 100%;
  text-align: left;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  background: var(--blood);
  color: #fff;
  animation: breathe 1.6s ease-in-out infinite;
}
@keyframes breathe { 50% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--blood) 30%, transparent); } }

/* ------------------------------------------------------------ vistas */

.view {
  padding: 4px 16px calc(var(--safe-bottom) + 176px);
  animation: viewIn .22s var(--ease-out);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.section { margin-top: 18px; content-visibility: auto; contain-intrinsic-size: auto 300px; }
.section:first-child { margin-top: 6px; }
.section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 4px 12px;
  font-size: 20px;
  font-weight: 700;
}
.section__head .sdot { width: 9px; height: 9px; border-radius: 50%; background: var(--a, var(--pumpkin)); box-shadow: 0 0 10px var(--a, var(--pumpkin)); }
.section__head .count { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--t3); }

/* ------------------------------------------------------------ pads */

.pads {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.pad {
  --a: var(--pumpkin);
  position: relative;
  isolation: isolate;
  aspect-ratio: 1;
  border-radius: var(--r-pad);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  overflow: hidden;
  text-align: left;
  background:
    linear-gradient(160deg, color-mix(in oklab, var(--a) 22%, transparent), transparent 58%),
    rgba(30, 24, 48, .62);
  box-shadow: var(--sh-pad), inset 0 1px 0 rgba(255, 255, 255, .16);
  contain: layout style;
  transition: transform .42s var(--spring), box-shadow .24s, opacity .2s, filter .2s;
}

.pad::before {
  padding: 1.5px;
  background: linear-gradient(155deg, var(--a), color-mix(in oklab, var(--a) 15%, transparent) 45%, rgba(255, 255, 255, .08));
}

.pad::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-top: 2px solid var(--a);
  background: linear-gradient(to top, color-mix(in oklab, var(--a) 62%, transparent), color-mix(in oklab, var(--a) 26%, transparent));
  transform: translateY(101%);
}

.pad.is-pressed { transform: scale(.94); transition: transform 90ms var(--ease-out); }
.pad.is-holding { transform: scale(1.04); transition: transform .42s var(--spring-pop); }

.pad__emoji { font-size: 44px; line-height: 1; transition: filter .24s; }
.pad__label {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.pad__label small { display: block; font-size: 12px; font-weight: 500; color: var(--t2); }
.pad__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 18px;
  color: var(--t3);
}
.pad__badge .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in oklab, var(--a) 30%, transparent); border-top-color: var(--a); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.pad.is-playing { box-shadow: 0 0 0 1.5px var(--a), 0 0 28px color-mix(in oklab, var(--a) 50%, transparent), var(--sh-pad); }
.pad.is-playing::after { animation: rise var(--dur, 2s) linear forwards; }
.pad.is-playing .pad__emoji { animation: pop .5s var(--spring-pop); filter: drop-shadow(0 0 12px var(--a)); }
.pad.is-looping { box-shadow: 0 0 0 1.5px var(--a), 0 0 28px color-mix(in oklab, var(--a) 50%, transparent), var(--sh-pad); }
.pad.is-looping::after { transform: translateY(0); animation: glow 2.4s ease-in-out infinite; }
.pad.is-looping .pad__emoji { filter: drop-shadow(0 0 12px var(--a)); }
.pad.is-loading .pad__emoji { opacity: .45; }
.pad.is-unavailable { opacity: .5; filter: saturate(.2); }

@keyframes rise { to { transform: translateY(0); } }
@keyframes pop { from { transform: scale(.8); } }
@keyframes glow { 50% { opacity: .55; } }

.pad__loopmark {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 16px;
  color: var(--a);
}

/* ------------------------------------------------------------ parar efectos */

.stop-fx {
  position: fixed;
  z-index: 30;
  right: 16px;
  bottom: calc(var(--tab-bottom) + var(--dock-h) * 2 + 22px);
  height: 48px;
  padding: 0 18px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--blood);
  box-shadow: 0 10px 30px color-mix(in oklab, var(--blood) 45%, transparent), inset 0 1px 0 rgba(255, 255, 255, .3);
  animation: popIn .44s var(--spring-pop);
}
.stop-fx [data-icon] { font-size: 18px; }
.stop-fx:active { transform: scale(.94); }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } }

/* ------------------------------------------------------------ dock: mini-player + tabs */

.dock {
  position: fixed;
  z-index: 40;
  left: 16px;
  right: 16px;
  bottom: var(--tab-bottom);
  display: grid;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}

.tabbar {
  height: var(--dock-h);
  border-radius: var(--r-bar);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 4px;
}

.tabbar__pill {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 4);
  border-radius: 28px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .38s var(--spring);
}

.tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  transition: color .2s, transform .42s var(--spring);
}
.tab [data-icon] { font-size: 24px; }
.tab.is-active { color: var(--t1); }
.tab:active { transform: scale(.92); transition-duration: 90ms; }

.mini {
  height: var(--dock-h);
  border-radius: var(--r-bar);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
}

.mini__info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  height: 100%;
}

.art {
  --a: var(--pumpkin);
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 26px;
  background:
    radial-gradient(80% 80% at 30% 20%, color-mix(in oklab, var(--a) 70%, white 10%), color-mix(in oklab, var(--a) 35%, #120c20));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 12px color-mix(in oklab, var(--a) 30%, transparent);
  position: relative;
}

.mini__text { min-width: 0; display: grid; }
.mini__title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini__time { font-size: 13px; font-weight: 500; color: var(--t2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mini__loop { color: var(--t3); font-size: 20px; }
.mini__loop.is-on { color: var(--moon); background: rgba(255, 210, 94, .16); }

.mini__play {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #120c20;
  background: var(--t1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  transition: transform .42s var(--spring);
}
.mini__play svg.ic { fill: currentColor; stroke-width: 1.5; }
.mini__play:active { transform: scale(.88); transition-duration: 90ms; }
.mini__play.is-busy svg { opacity: .3; }

.mini__progress {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}
.mini__progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--a, var(--pumpkin));
  transform-origin: left;
  transform: scaleX(0);
}

/* ------------------------------------------------------------ música */

.offline-card { padding: 16px; display: grid; gap: 12px; }
.offline-card__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.offline-card__title { font-size: 17px; font-weight: 700; }
.offline-card__meta { font-size: 13px; color: var(--t2); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--toxic); transition: width .3s var(--ease-out); }

.btn {
  height: 56px;
  border-radius: 28px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  transition: transform .42s var(--spring), opacity .2s;
}
.btn:active { transform: scale(.96); transition-duration: 90ms; }
.btn [data-icon] { font-size: 20px; }
.btn--primary { background: var(--pumpkin); color: var(--on-accent); box-shadow: 0 8px 24px color-mix(in oklab, var(--pumpkin) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn--ghost { background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px var(--hairline); }
.btn--danger { background: color-mix(in oklab, var(--blood) 20%, transparent); color: var(--blood); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--blood) 40%, transparent); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; }

.segmented {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  height: 44px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.segmented button {
  border-radius: 19px;
  font-size: 15px;
  font-weight: 600;
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .25s, color .2s;
}
.segmented button.is-on { background: rgba(255, 255, 255, .16); color: var(--t1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 2px 8px rgba(0, 0, 0, .25); }

.list { padding: 4px 0; overflow: hidden; }
.row {
  --a: var(--pumpkin);
  position: relative;
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px 10px 14px;
  text-align: left;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 76px; right: 0; height: 1px; background: var(--hairline); }
.row:active { background: rgba(255, 255, 255, .05); }
.row__body { flex: 1; min-width: 0; }
.row__title { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__meta { font-size: 13px; color: var(--t2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.is-current .row__title { color: var(--a); }
.row__action { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 22px; color: var(--t2); border-radius: 50%; }
.row__action.is-done { color: var(--toxic); }
.row__action.is-error { color: var(--blood); }

.ring {
  --p: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(var(--toxic) calc(var(--p) * 1turn), rgba(255, 255, 255, .14) 0);
  display: grid;
  place-items: center;
  -webkit-mask: radial-gradient(circle, transparent 9px, #000 9.5px);
  mask: radial-gradient(circle, transparent 9px, #000 9.5px);
}

.eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { width: 4px; border-radius: 2px; background: #fff; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
.eq.is-paused i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

.status-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--t2); }
.status-chip.is-processing { color: var(--moon); background: rgba(255, 210, 94, .12); }
.status-chip.is-error { color: var(--blood); background: rgba(255, 68, 88, .14); }

/* ------------------------------------------------------------ la abuela */

.abuela { display: grid; gap: 16px; }
.abuela-stage { display: grid; justify-items: center; gap: 4px; padding: 24px 16px 20px; text-align: center; }
.abuela-skull {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 84px;
  background: radial-gradient(circle, rgba(176, 123, 255, .28), transparent 70%);
  transition: filter .3s, transform .4s var(--spring);
}
.abuela-stage.is-off .abuela-skull { filter: grayscale(1) brightness(.55); }
.abuela-stage.is-starting .abuela-skull { animation: float 1.2s ease-in-out infinite; }
.abuela-stage.is-speaking .abuela-skull {
  background: radial-gradient(circle, color-mix(in oklab, var(--toxic) 45%, transparent), transparent 70%);
  animation: skullTalk .32s ease-in-out infinite alternate;
}
.abuela-stage.is-listening .abuela-skull {
  background: radial-gradient(circle, color-mix(in oklab, var(--ghost) 40%, transparent), transparent 70%);
  animation: ripple 1.4s ease-out infinite;
}
@keyframes skullTalk { from { transform: scale(1) rotate(-2deg); } to { transform: scale(1.07) rotate(2deg); } }
@keyframes ripple {
  from { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ghost) 55%, transparent); }
  to { box-shadow: 0 0 0 28px transparent; }
}
.abuela-state { margin: 8px 0 0; font-size: 21px; font-weight: 800; }
.abuela-sub { color: var(--t2); font-size: 14px; font-variant-numeric: tabular-nums; }

.abuela-talk {
  width: 100%;
  min-height: 96px;
  border-radius: 48px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 19px;
  font-weight: 800;
  color: var(--on-accent);
  background: var(--pumpkin);
  box-shadow: 0 10px 30px color-mix(in oklab, var(--pumpkin) 40%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .42s var(--spring), background .2s, color .2s;
  touch-action: none;
}
.abuela-talk [data-icon], .abuela-talk svg.ic { font-size: 26px; }
.abuela-talk.is-ptt { background: rgba(255, 255, 255, .1); color: var(--t1); box-shadow: inset 0 0 0 2px var(--ghost); }
.abuela-talk.is-holding { background: var(--ghost); color: #06222a; transform: scale(.97); }
.abuela-talk.is-auto { background: rgba(255, 255, 255, .07); color: var(--t2); box-shadow: inset 0 0 0 1px var(--hairline); }
.abuela-talk:disabled { opacity: .6; }

.abuela-log { padding: 6px 0; }
.abuela-log p { margin: 0; padding: 10px 16px; font-size: 15px; line-height: 1.35; }
.abuela-log p + p { border-top: 1px solid var(--hairline); }
.abuela-log .ai { color: var(--t1); }
.abuela-log .user { color: var(--t2); }
.abuela-hint { margin: 0 4px; font-size: 13px; color: var(--t2); line-height: 1.45; }

/* ------------------------------------------------------------ vacío */

.empty {
  margin-top: 40px;
  padding: 32px 24px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}
.empty__icon { font-size: 64px; filter: drop-shadow(0 0 24px rgba(255, 138, 31, .45)); animation: float 4s ease-in-out infinite; }
.empty h2 { margin: 6px 0 0; font-size: 22px; font-weight: 700; }
.empty p { margin: 0 0 10px; color: var(--t2); max-width: 300px; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-4deg); } }

/* ------------------------------------------------------------ subir */

.form { padding: 18px 16px; display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--t2); text-transform: uppercase; letter-spacing: .04em; margin-left: 4px; }

.input {
  height: 50px;
  width: 100%;
  border-radius: 16px;
  border: 0;
  padding: 0 16px;
  font-size: 17px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px var(--hairline);
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.input:focus { box-shadow: inset 0 0 0 2px var(--pumpkin); }
.input::placeholder { color: var(--t3); }

.dropzone {
  position: relative;
  min-height: 112px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .18);
  outline: 1.5px dashed rgba(255, 255, 255, .22);
  outline-offset: -8px;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }
.dropzone__icon { font-size: 30px; color: var(--pumpkin); }
.dropzone__title { font-weight: 700; }
.dropzone__sub { font-size: 13px; color: var(--t2); }
.dropzone.has-file { outline-color: color-mix(in oklab, var(--toxic) 60%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--t2);
}
.chip.is-on { background: rgba(255, 255, 255, .18); color: var(--t1); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 12px; font-size: 24px; background: rgba(255, 255, 255, .06); }
.emoji-grid button.is-on { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6); }

.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.swatch { aspect-ratio: 1; border-radius: 50%; background: var(--a); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 0 0 0 transparent; transition: transform .42s var(--spring), box-shadow .2s; }
.swatch.is-on { box-shadow: 0 0 0 3px var(--night-mid), 0 0 0 5px var(--a); transform: scale(.9); }

.toggle-row { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.toggle-row__text { flex: 1; }
.toggle-row__text b { display: block; font-weight: 600; }
.toggle-row__text small { color: var(--t2); font-size: 13px; }

.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: rgba(255, 255, 255, .16); transition: background .25s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .38s var(--spring); }
.switch input:checked + span { background: var(--toxic); }
.switch input:checked + span::after { transform: translateX(20px); }

.range { width: 100%; accent-color: var(--pumpkin); height: 32px; }

.segmented--sm { height: 38px; }
.segmented--sm button { font-size: 14px; }
.segmented button svg.ic { font-size: 16px; }
.url-row { display: flex; gap: 8px; }
.url-row .input { flex: 1; min-width: 0; }
.url-row .btn { height: 50px; border-radius: 16px; padding: 0 16px; font-size: 15px; }
.trim-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* voz */
.voice { display: grid; gap: 16px; }
.rec { display: grid; justify-items: center; gap: 8px; padding: 6px 0 2px; text-align: center; }
.rec__btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .85);
  transition: transform .42s var(--spring);
}
.rec__btn span {
  width: 62px;
  height: 62px;
  border-radius: 31px;
  background: var(--blood);
  box-shadow: 0 0 24px color-mix(in oklab, var(--blood) 55%, transparent);
  transition: width .35s var(--spring), height .35s var(--spring), border-radius .35s var(--spring);
}
.rec__btn.is-rec span { width: 30px; height: 30px; border-radius: 8px; }
.rec__btn.is-rec { animation: breathe 1.6s ease-in-out infinite; }
.rec__btn:active { transform: scale(.92); transition-duration: 90ms; }
.rec__btn:disabled { opacity: .5; }
.rec__status { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.preset {
  min-height: 66px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  background: rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform .42s var(--spring), background .2s;
}
.preset span { font-size: 26px; line-height: 1; }
.preset.is-on { background: rgba(255, 255, 255, .18); color: var(--t1); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55); }
.preset:active { transform: scale(.94); transition-duration: 90ms; }
.textarea { height: auto; min-height: 96px; padding: 12px 16px; resize: none; line-height: 1.35; }
.select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F7F2FF' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.select option, .select optgroup { background: #1B1433; color: var(--t1); }
.voice-meta { display: flex; justify-content: space-between; gap: 8px; padding: 0 4px; font-size: 13px; color: var(--t2); font-variant-numeric: tabular-nums; }

.upload-progress { display: grid; gap: 8px; }
.upload-progress .bar > span { background: var(--pumpkin); }
.upload-progress p { margin: 0; font-size: 15px; font-weight: 600; text-align: center; }

.lib-head { margin: 28px 4px 12px; display: flex; align-items: baseline; justify-content: space-between; }
.lib-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.lib-head span { font-size: 13px; color: var(--t3); }

/* ------------------------------------------------------------ hoja inferior */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(5, 3, 10, .55);
  animation: fadeIn .22s var(--ease-out);
}

.sheet {
  position: fixed;
  z-index: 61;
  left: 8px;
  right: 8px;
  bottom: 8px;
  max-height: calc(100dvh - var(--safe-top) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--r-sheet);
  padding: 10px 16px calc(var(--safe-bottom) + 12px);
  background: var(--glass-fill-strong);
  animation: sheetIn .44s var(--spring);
  max-width: 560px;
  margin: 0 auto;
}
.sheet.is-leaving { animation: sheetOut .22s var(--ease-out) forwards; }
.sheet__grab { width: 40px; height: 5px; border-radius: 3px; margin: 0 auto 12px; background: rgba(255, 255, 255, .25); }
.sheet__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet__head h3 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet__actions { display: grid; gap: 10px; }
.sheet__group { display: grid; gap: 4px; margin-bottom: 18px; }
.sheet__group h4 { margin: 4px 4px 6px; font-size: 13px; font-weight: 600; color: var(--t2); text-transform: uppercase; letter-spacing: .04em; }
.sheet .form { padding: 0; }
.tips { margin: 0; padding-left: 20px; color: var(--t2); font-size: 15px; display: grid; gap: 8px; }
.tips b { color: var(--t1); }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(110%); } }
@keyframes sheetOut { to { transform: translateY(110%); opacity: .6; } }

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  top: calc(var(--safe-top) + 10px);
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  background: rgba(30, 24, 48, .92);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--sh-float), inset 0 0 0 1px var(--hairline);
  animation: toastIn .44s var(--spring);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -24px) scale(.9); } }

/* ------------------------------------------------------------ escritorio */

@media (min-width: 620px) {
  .views, .banners, .topbar { max-width: 600px; margin-left: auto; margin-right: auto; }
  .pads { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .pad.is-playing::after { animation-duration: var(--dur) !important; }
  .pad.is-pressed { transform: none; filter: brightness(1.25); }
}
