@font-face {
  font-family: Geist;
  src: url('/fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #121212;
  --panel: #191918;
  --text: #f4f0ea;
  --muted: #b7b1aa;
  --line: #36322e;
  --accent: #ff7054;
  font-family: Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.shell { width: min(1120px, calc(100% - 104px)); margin-inline: auto; }
.site-head { height: 87px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #302c29; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-size: 1.03rem; font-weight: 650; letter-spacing: -.035em; }
.brand-mark { display: flex; align-items: center; gap: 3px; height: 22px; padding-inline: 3px; }
.brand-mark i { display: block; width: 3px; height: 9px; border-radius: 2px; background: var(--accent); transform: skewY(-20deg); }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 22px; }
.urano { display: block; width: 69px; height: auto; filter: brightness(0) invert(1); opacity: .87; }

.studio-page .site-head { height: 81px; }
.studio-page .urano { width: 110px; max-height: 58px; object-fit: contain; opacity: .96; }
.hero { display: flex; align-items: center; min-height: 171px; position: relative; isolation: isolate; padding-block: 31px 34px; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 19px; color: var(--accent); font-weight: 680; font-size: .875rem; letter-spacing: .09em; }
h1 { margin: 0; line-height: 1; letter-spacing: -.065em; font-weight: 660; }
.hero h1 { font-size: clamp(2.05rem, 4.8vw, 3.55rem); }
.hero h1 span { color: #f5a08b; }
.intro { margin: 12px 0 0; font-size: 1rem; line-height: 1.48; color: var(--muted); }
.wave { position: absolute; inset: 1px 0 0 53%; z-index: -1; overflow: hidden; pointer-events: none; }
.wave canvas { width: 100%; height: 100%; display: block; }

.voice-list { display: grid; gap: 12px; }
.catalog-row { --voice-color: #f5a08b; --voice-glow: #ff7a5a10; display: grid; grid-template-columns: minmax(162px, .61fr) minmax(0, 1.65fr) auto; align-items: center; min-height: 124px; gap: 26px; padding: 19px 23px; border: 1px solid var(--line); border-radius: 17px; background: radial-gradient(ellipse at 10% 0, var(--voice-glow), transparent 65%), var(--panel); }
.catalog-row:nth-child(even) { --voice-color: #f2bb94; --voice-glow: #ecaa6711; }
.voice-locale { display: flex; align-items: center; gap: 8px; color: var(--voice-color); font-size: .875rem; font-weight: 550; margin: 0 0 8px; }
.voice-name { margin: 0; font-size: clamp(1.45rem, 2.4vw, 1.9rem); line-height: 1.12; font-weight: 650; letter-spacing: -.042em; overflow-wrap: anywhere; }
.voice-desc { color: #ddd5cc; font-size: .975rem; margin: 0; line-height: 1.48; }
.flag { display: inline-block; position: relative; width: 19px; height: 13px; flex: 0 0 auto; border-radius: 2px; box-shadow: 0 0 0 1px #ffffff24; overflow: hidden; }
.flag::after { position: absolute; content: ''; width: 4px; height: 5px; top: 4px; }
.flag-es { background: linear-gradient(#b52232 25%, #f7c640 25% 75%, #b52232 75%); }
.flag-es::after { left: 5px; background: #a62d2d; border-radius: 1px 1px 2px 2px; }
.flag-mx { background: linear-gradient(90deg, #087752 33.333%, #fff9e8 33.333% 66.666%, #ce3a41 66.666%); }
.flag-mx::after { left: 8px; background: radial-gradient(ellipse at 38% 35%, #884c23 40%, #447746 47% 66%, transparent 70%); }
.voice-preview { margin-top: 8px; }
.mini-player { display: flex; align-items: center; gap: 10px; min-height: 31px; }
.mini-player audio { display: none; }
.sample-play { width: 27px; height: 31px; margin-left: -6px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 5px; background: transparent; color: var(--voice-color); }
.sample-play .play-icon { width: 10px; height: 12px; }
.sample-play.is-playing .play-icon { clip-path: none; background: linear-gradient(90deg, currentColor 34%, transparent 34% 66%, currentColor 66%); }
.sample-play:hover:not(:disabled) { background: #ffffff0a; }
.sample-waveform { position: relative; flex: 1; min-width: 26px; height: 26px; border-radius: 3px; }
.sample-waveform canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.sample-waveform:has(.sample-position:focus-visible) { outline: 2px solid var(--voice-color); outline-offset: 3px; }
.sample-position { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sample-position:disabled { cursor: default; }
.sample-time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.catalog-row .choose-voice { justify-self: end; display: inline-flex; align-items: center; min-height: 36px; color: var(--text); font-size: .875rem; font-weight: 570; white-space: nowrap; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: #b9a49a70; transition: color .2s, text-decoration-color .2s; }
.catalog-row .choose-voice:hover { color: var(--voice-color); text-decoration-color: currentColor; }
.editor-body label, .admin-main label { display: block; font-size: .875rem; font-weight: 650; }
.admin-main input:not([type=checkbox]) { width: 100%; color: var(--text); background: #22211f; border: 1px solid #423e39; border-radius: 10px; min-height: 46px; padding: 10px 14px; }
.text-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-button { padding: 0; border: 0; background: none; color: var(--muted); font-size: .875rem; text-align: left; }
.text-button:hover, .site-foot a:hover { color: var(--text); }
.editor-body textarea { display: block; width: 100%; min-height: clamp(460px, 60vh, 720px); padding: 16px; resize: vertical; margin-top: 10px; background: #111110; color: var(--text); border: 1px solid #403a34; border-radius: 12px; font-size: 1rem; line-height: 1.62; }
.editor-body textarea::placeholder { color: #a39b92; }
.count { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.action { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 20px; color: #160c09; background: #ff876d; border: 1px solid transparent; border-radius: 100px; font-weight: 720; font-size: .91rem; white-space: nowrap; transition: background .2s, transform .2s; }
.action:hover:not(:disabled) { background: #ffa28f; }
.action:active:not(:disabled) { transform: scale(.98); }
.action:disabled { opacity: .7; }
.play-icon { width: 10px; height: 12px; background: currentColor; clip-path: polygon(8% 0, 100% 50%, 8% 100%); }
.is-working .play-icon { width: 12px; height: 12px; background: transparent; clip-path: none; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.feedback { color: #ffc0ad; margin: 10px 0 0; font-size: .875rem; line-height: 1.5; }
.studio-feedback { margin-block: 14px; }
.editor-main { padding-top: 26px; }
.editor-back { display: inline-block; }
.editor-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin: 16px 0 22px; }
.editor-title h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.editor-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .875rem; }
.editor-voice strong { color: #f5a08b; font-size: 1rem; }
.editor-workspace, .editor-result { border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(214px, .34fr); }
.editor-body, .editor-plan { min-width: 0; padding: 21px; }
.editor-plan { display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #241e191f; }
.editor-plan h2, .editor-result h2 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: -.024em; }
.editor-plan dl { display: grid; gap: 11px; margin: 14px 0; }
.editor-plan dl > div { display: flex; justify-content: space-between; align-items: start; gap: 10px; font-size: .9rem; }
.editor-plan dt { color: var(--muted); }
.editor-plan dd { margin: 0; font-weight: 630; font-variant-numeric: tabular-nums; white-space: nowrap; }
.editor-help { color: var(--muted); margin: 10px 0 0; font-size: .875rem; line-height: 1.45; }
.quota-line { border-top: 1px solid var(--line); padding-top: 12px; }
.editor-illustration { display: grid; flex: 1; min-height: 106px; place-items: center; padding-bottom: 14px; }
.editor-illustration .book { width: 96px; height: 64px; }
.editor-submit { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 15px; padding: 13px 21px; }
.generation { flex: 1 1 255px; min-width: 0; }
.generation progress { width: 100%; height: 7px; accent-color: var(--accent); }
.generation p { color: var(--muted); font-size: .875rem; margin: 3px 0; }
.editor-result { margin-top: 14px; padding: 16px 21px; }
.result-heading, .result-controls { display: flex; align-items: center; gap: 12px; }
.result-duration { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.result-controls { margin-top: 11px; flex-wrap: wrap; }
.result-controls audio { flex: 1 1 220px; min-width: 0; height: 43px; }
#editor-status:not([hidden]) { margin-bottom: 10px; }
.editorial { margin-top: 17px; min-height: 88px; padding: 12px 10px; border-block: 1px solid var(--line); display: flex; align-items: center; gap: 20px; }
.editorial h2 { margin: 0; font-size: 1.08rem; font-weight: 650; letter-spacing: -.025em; }
.editorial p { margin: 4px 0 0; color: var(--muted); font-size: .9375rem; line-height: 1.44; }
.book { position: relative; width: 78px; height: 52px; flex: 0 0 auto; perspective: 320px; transform: rotate(-7deg); }
.book-shadow { position: absolute; inset: 23% 4% 0; border-radius: 50%; background: #ef6a4655; filter: blur(20px); }
.book-cover { position: absolute; inset: 18% 0 8%; background: linear-gradient(90deg, #66352d, #a35641 49%, #4a2721 50%, #8d4837); border: 1px solid #af6651; border-radius: 8px 8px 6px 6px; transform: rotateX(26deg); }
.book-page { position: absolute; width: 47%; height: 70%; top: 11%; border: 1px solid #ac6f5b; box-shadow: 0 3px 0 #7c4e3b, 0 5px 0 #32211b; }
.book-page::after { content: ''; position: absolute; inset: 19% 24% 20% 17%; background: repeating-linear-gradient(0deg, #542a2466 0 1px, transparent 1px 4px); }
.book-page-left { right: 50%; background: linear-gradient(110deg, #dc9b76, #edba96 58%, #775146); border-radius: 15% 30% 0 7%; transform: skewY(8deg); }
.book-page-right, .book-turn { left: 50%; border-radius: 30% 15% 7% 0; transform: skewY(-8deg); background: linear-gradient(67deg, #6c4740, #e1a98b 40%, #f1bc96); }
.book-turn { transform-origin: 0 50%; backface-visibility: hidden; animation: turn-page 6.8s ease-in-out infinite; }
@keyframes turn-page {
  0%, 12% { transform: skewY(-8deg) rotateY(0); opacity: 1; }
  34% { transform: skewY(0) rotateY(-77deg); opacity: 1; }
  48%, 100% { transform: skewY(8deg) rotateY(-174deg); opacity: 0; }
}
.site-foot { min-height: 58px; display: flex; align-items: center; justify-content: flex-end; color: var(--muted); font-size: .875rem; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }

.admin-main { width: min(850px, calc(100% - 104px)); margin: 45px auto 70px; }
.admin-main h1 { font-size: clamp(2.3rem, 6vw, 4.3rem); line-height: 1; letter-spacing: -.075em; }
.admin-main h2 { margin: 0; font-size: 1.12rem; font-weight: 650; }
.admin-head { margin-bottom: 26px; }
.admin-section { padding: 21px 24px; border: 1px solid var(--line); background: var(--panel); border-radius: 18px; margin-bottom: 14px; }
.admin-section > p { color: var(--muted); margin: 8px 0 0; font-size: .9rem; line-height: 1.4; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-top: 15px; }
.admin-grid label { line-height: 1.4; }
.admin-grid input:not([type=checkbox]) { display: block; margin-top: 6px; }
.admin-grid input[type=checkbox] { accent-color: var(--accent); }
.admin-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voice-card { border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }
.voice-card summary { padding: 12px 14px; cursor: pointer; }
.voice-card .admin-grid { margin: 0; padding: 5px 14px 15px; }
.voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 0 14px 15px; }
.voice-controls label { display: flex; align-items: center; gap: 4px; }
.voice-controls button { margin-left: auto; }
.admin-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.admin-message { margin: 0; color: var(--muted); }
.admin-message:empty { display: none; }
.client-form { margin-top: 16px; }
.client-line { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.client-line input { min-width: 0; }
.client-line button { flex: 0 0 auto; }
.client-list { margin: 12px 0 0; padding: 0; list-style: none; }
.client-list:empty { display: none; }
.client-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 9px 13px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.client-list li:last-child { border-bottom: 0; }
.client-state { color: var(--muted); font-size: .875rem; margin-right: auto; }

.login-main { width: min(475px, calc(100% - 42px)); margin: 68px auto 75px; }
.login-main h1 { font-size: clamp(2.6rem, 7vw, 4.1rem); line-height: .95; margin-bottom: 23px; }
.login-form { display: grid; justify-items: start; gap: 13px; }
.login-form p { margin: 0; line-height: 1.45; }
.login-form label { font-size: .875rem; font-weight: 650; }
.login-form input { width: 100%; border: 1px solid #423e39; border-radius: 10px; background: #22211f; color: var(--text); padding: 10px 14px; min-height: 46px; }
.login-form .admin-message { color: #ffc0ad; }

@media (max-width: 760px) {
  .shell, .admin-main { width: calc(100% - 42px); }
  .site-head, .studio-page .site-head { height: 66px; }
  .studio-page .urano { width: 94px; }
  .hero { min-height: 146px; }
  .wave { inset-inline-start: 50%; opacity: .64; }
  .catalog-row { gap: 14px; padding: 17px; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .catalog-row, .editor-grid { grid-template-columns: 1fr; }
  .catalog-row { gap: 8px; }
  .editor-body textarea { min-height: clamp(420px, 58vh, 550px); }
  .editor-plan { border-left: 0; border-top: 1px solid var(--line); }
  .editor-illustration { min-height: 77px; padding: 8px 0 0; }
  .editor-illustration .book { width: 78px; height: 52px; }
  .wave { inset-inline-start: 39%; opacity: .36; }
}
@media (max-width: 490px) {
  .hero { min-height: 134px; padding-block: 24px; }
  .intro { max-width: 36ch; }
  .action { padding-inline: 13px; }
  .editorial { padding-inline: 2px; gap: 12px; }
  .book { width: 60px; height: 43px; }
  .admin-section { padding-inline: 14px; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .book-turn, .is-working .play-icon { animation: none; }
}
