/* ============ Olee Voice Studio — deep-ocean voice console ============ */
:root {
  --abyss:    #04080a;
  --deep:     #07111400;
  --surface:  #0a161a;
  --surface2: #0f1f24;
  --line:     rgba(120, 224, 208, 0.10);
  --line-2:   rgba(120, 224, 208, 0.18);
  --aqua:     #3ff0d2;
  --aqua-dim: #1c9a87;
  --coral:    #ff6a5a;
  --amber:    #ffcf6b;
  --text:     #e7f4f2;
  --muted:    #6f908d;
  --muted-2:  #4d6a67;
  --display: "Clash Display", sans-serif;
  --body:    "General Sans", sans-serif;
  --mono:    "JetBrains Mono", monospace;
  --r: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(63, 240, 210, 0.10), transparent 60%),
    radial-gradient(900px 600px at 12% 110%, rgba(255, 106, 90, 0.08), transparent 55%),
    linear-gradient(180deg, #050b0d, #03070800 40%),
    var(--abyss);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* grain + sonar atmospherics */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.sonar-lines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: repeating-linear-gradient(0deg, transparent 0 38px, rgba(63,240,210,0.025) 38px 39px);
  mask-image: radial-gradient(80% 60% at 70% 30%, #000, transparent 80%);
}

/* ============ Topbar ============ */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 16px; }
.mark svg { display: block; filter: drop-shadow(0 0 14px rgba(63,240,210,0.45)); }
.mark .glyph { fill: none; stroke: var(--aqua); stroke-width: 1.6; }
.mark .tail { fill: var(--aqua); opacity: 0.85; }
.mark .eye  { fill: var(--coral); }
.brand-txt h1 {
  font-family: var(--display); font-weight: 600; font-size: 22px;
  letter-spacing: -0.01em; line-height: 1;
}
.brand-txt h1 em { font-style: normal; color: var(--aqua); }
.brand-txt p {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-top: 6px;
}
.status {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--muted); padding: 8px 14px; border: 1px solid var(--line);
  border-radius: 100px; background: rgba(10,22,26,0.6); backdrop-filter: blur(6px);
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2);
  box-shadow: 0 0 0 0 rgba(63,240,210,0.5); }
.status.ok  .dot { background: var(--aqua); animation: pulse 2.4s infinite; }
.status.bad .dot { background: var(--coral); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(63,240,210,0.45); }
  70% { box-shadow: 0 0 0 7px rgba(63,240,210,0); }
  100% { box-shadow: 0 0 0 0 rgba(63,240,210,0); }
}

/* ============ Telemetry strip ============ */
.telemetry {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: auto 1.4fr 1.4fr auto; gap: clamp(16px, 3vw, 40px);
  align-items: center;
  max-width: 1360px; margin: 0 auto; width: 100%;
  padding: 16px clamp(20px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}
.telemetry.off { opacity: 0.45; }
.tele-k { font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.gpu-name { font-size: 12px; color: var(--text); white-space: nowrap; }
.gpu-name span { color: var(--aqua); }
.meter-box { min-width: 0; }
.tele-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.tele-v { font-size: 11px; color: var(--text); }
.meter { height: 6px; border-radius: 6px; background: rgba(63,240,210,0.08);
  overflow: hidden; border: 1px solid var(--line); }
.meter-fill {
  height: 100%; width: 0%; border-radius: 6px;
  background: linear-gradient(90deg, var(--aqua-dim), var(--aqua));
  box-shadow: 0 0 12px rgba(63,240,210,0.5); transition: width 0.6s cubic-bezier(.2,.8,.2,1), background 0.4s;
}
.meter-fill.hot { background: linear-gradient(90deg, var(--amber), var(--coral));
  box-shadow: 0 0 12px rgba(255,106,90,0.5); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  font-size: 11px; color: var(--text); padding: 6px 11px; border-radius: 100px;
  border: 1px solid var(--line); background: rgba(3,8,9,0.4); white-space: nowrap;
}
.chip i { color: var(--muted); font-style: normal; font-size: 9px; letter-spacing: 0.14em; margin-right: 4px; }
@media (max-width: 880px) {
  .telemetry { grid-template-columns: 1fr 1fr; gap: 14px 20px; }
  .gpu-name { grid-column: 1 / -1; }
  .chips { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ============ Stage / panels ============ */
.stage {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 22px;
  padding: clamp(20px, 4vw, 44px) clamp(20px, 5vw, 64px) 64px;
  max-width: 1360px; margin: 0 auto;
}
@media (max-width: 880px) { .stage { grid-template-columns: 1fr; } }

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 30px clamp(20px, 3vw, 32px) 28px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.02);
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.output { animation-delay: 0.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.panel-tab {
  position: absolute; top: -1px; left: 24px; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
  background: var(--surface2); padding: 4px 12px; border: 1px solid var(--line);
  border-radius: 100px;
}
.panel-tab span { color: var(--aqua); margin-right: 6px; }

/* ============ Composer ============ */
.field-label {
  display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin: 6px 0 10px;
}
textarea {
  width: 100%; resize: vertical; min-height: 132px;
  background: rgba(3,8,9,0.55); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.55; padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea::placeholder { color: var(--muted-2); }
textarea:focus {
  outline: none; border-color: var(--line-2);
  box-shadow: 0 0 0 3px rgba(63,240,210,0.08), 0 0 30px -12px rgba(63,240,210,0.4) inset;
}
.char-row { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2);
  text-align: right; margin-top: 7px; }

/* expressions palette */
.palette { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(3,8,9,0.35); overflow: hidden; }
.palette summary { list-style: none; cursor: pointer; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; }
.palette summary::-webkit-details-marker { display: none; }
.palette-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.pal-group { display: flex; flex-direction: column; gap: 8px; }
.pal-k { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted-2); }
.pal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pal-chips button {
  font-family: var(--body); font-size: 12.5px; color: var(--muted);
  background: rgba(63,240,210,0.05); border: 1px solid var(--line);
  border-radius: 100px; padding: 5px 12px; cursor: pointer; transition: all 0.15s;
}
.pal-chips button:hover { color: #032420; background: var(--aqua); border-color: var(--aqua);
  transform: translateY(-1px); }

/* voice picker */
.voice-pick { margin-top: 20px; }
.voice-row { display: flex; gap: 8px; }
.select-wrap { position: relative; flex: 1; }
.select-arrow {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--aqua); pointer-events: none; font-size: 12px;
}
#voice {
  -webkit-appearance: none; appearance: none; width: 100%;
  background: rgba(3,8,9,0.55); border: 1px solid var(--line-2); border-radius: 11px;
  color: var(--text); font-family: var(--body); font-size: 15px; font-weight: 500;
  padding: 13px 38px 13px 15px; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
#voice:focus { outline: none; border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(63,240,210,0.08); }
#voice option { background: #07151a; color: var(--text); }
.preview-btn { width: 46px; display: grid; place-items: center; font-size: 13px; }
.preview-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.preview-btn.playing { color: var(--aqua); border-color: rgba(63,240,210,0.4);
  background: rgba(63,240,210,0.1); }

.controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; margin-top: 22px;
}
.control { display: flex; flex-direction: column; gap: 9px; }
.control.span2 { grid-column: 1 / -1; }
.control-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: baseline;
}
.control-label b { color: var(--aqua); font-family: var(--mono); font-weight: 500; font-size: 12px; }
.hint { font-size: 10.5px; color: var(--muted-2); letter-spacing: 0.02em; }

.segmented { display: flex; gap: 4px; background: rgba(3,8,9,0.5);
  border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.seg {
  flex: 1; padding: 9px 0; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--muted); font-family: var(--mono);
  font-size: 12px; letter-spacing: 0.1em; transition: all 0.2s;
}
.seg.active { background: linear-gradient(180deg, rgba(63,240,210,0.22), rgba(63,240,210,0.10));
  color: var(--text); box-shadow: inset 0 0 0 1px rgba(63,240,210,0.4); }

/* sliders */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  border-radius: 4px; background: linear-gradient(90deg, var(--aqua-dim), var(--aqua));
  background-repeat: no-repeat; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #06181a; border: 2px solid var(--aqua);
  box-shadow: 0 0 12px rgba(63,240,210,0.6); transition: transform 0.15s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #06181a;
  border: 2px solid var(--aqua); box-shadow: 0 0 12px rgba(63,240,210,0.6);
}

.seed-row { display: flex; gap: 8px; }
input[type="number"] {
  flex: 1; background: rgba(3,8,9,0.5); border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); font-family: var(--mono); font-size: 13px;
  padding: 9px 12px;
}
input[type="number"]:focus { outline: none; border-color: var(--line-2); }
.ghost-btn {
  background: rgba(3,8,9,0.4); border: 1px solid var(--line); color: var(--muted);
  border-radius: 9px; cursor: pointer; font-family: var(--mono); font-size: 12px;
  padding: 9px 12px; transition: all 0.2s;
}
.ghost-btn:hover { color: var(--aqua); border-color: var(--line-2); }
#diceBtn { font-size: 16px; line-height: 1; }

/* clone */
.clone { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(3,8,9,0.35); overflow: hidden; }
.clone summary {
  list-style: none; cursor: pointer; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.clone summary::-webkit-details-marker { display: none; }
.sum-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text); }
.sum-tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-2); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 100px; }
.clone[open] .sum-tag.on, .sum-tag.on { color: var(--coral); border-color: rgba(255,106,90,0.4); }
.clone-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.drop {
  border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 22px;
  text-align: center; cursor: pointer; transition: all 0.2s;
}
.drop.drag { border-color: var(--aqua); background: rgba(63,240,210,0.05); }
.drop.has { border-style: solid; border-color: rgba(63,240,210,0.4); }
.drop-ico { font-size: 22px; color: var(--aqua); display: block; margin-bottom: 6px; }
.drop p { font-size: 13.5px; color: var(--muted); }
.drop u { color: var(--aqua); text-underline-offset: 3px; }
.drop small { font-size: 10.5px; color: var(--muted-2); }
.ref-text { min-height: 70px; font-size: 14px; }
.clean-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--muted); cursor: pointer; }
.clean-toggle input { accent-color: var(--aqua); cursor: pointer; }
.clear-clone { align-self: flex-start; }

/* reference transcript head + auto-transcribe */
.reftext-head { display: flex; align-items: center; justify-content: space-between; }
.auto-tr { padding: 5px 11px; font-size: 11px; }
.auto-tr:disabled { opacity: 0.4; cursor: not-allowed; }
.auto-tr.busy { color: var(--aqua); border-color: var(--line-2); }

/* enhance toggle */
.enhance-toggle {
  display: flex; align-items: center; gap: 10px; margin-top: 18px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(100deg, rgba(63,240,210,0.06), rgba(63,240,210,0.01));
  cursor: pointer; transition: border-color 0.2s;
}
.enhance-toggle:hover { border-color: var(--line-2); }
.enhance-toggle input { accent-color: var(--aqua); width: 16px; height: 16px; cursor: pointer; }
.et-spark { color: var(--aqua); font-size: 14px; }
.et-txt { font-family: var(--display); font-weight: 600; font-size: 14px; }
.et-sub { font-family: var(--mono); font-size: 10px; color: var(--muted-2);
  letter-spacing: 0.04em; margin-left: auto; }

/* generate */
.generate {
  position: relative; width: 100%; margin-top: 24px; padding: 17px;
  border: 0; border-radius: 13px; cursor: pointer; overflow: hidden;
  font-family: var(--display); font-weight: 600; font-size: 16px; letter-spacing: 0.01em;
  color: #032420;
  background: linear-gradient(180deg, #5ffbe0, var(--aqua));
  box-shadow: 0 12px 40px -12px rgba(63,240,210,0.7), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}
.generate:hover { transform: translateY(-2px); box-shadow: 0 18px 50px -14px rgba(63,240,210,0.8); }
.generate:active { transform: translateY(0); }
.generate::after {
  content: ""; position: absolute; inset: 0; border-radius: 13px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.5), transparent 60%);
  opacity: 0; transition: opacity 0.3s;
}
.generate:hover::after { opacity: 0.25; }
.gen-spinner { display: none; }
.generate.loading { color: transparent; pointer-events: none; filter: saturate(1.2); }
.generate.loading .gen-label { opacity: 0; }
.generate.loading .gen-spinner {
  display: block; position: absolute; top: 50%; left: 50%;
  width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  border: 2.5px solid rgba(3,36,32,0.25); border-top-color: #032420;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* progress */
.progress { margin-top: 14px; }
.progress-track { height: 8px; border-radius: 8px; background: rgba(63,240,210,0.08);
  border: 1px solid var(--line); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%; border-radius: 8px;
  background: linear-gradient(90deg, var(--aqua-dim), var(--aqua));
  box-shadow: 0 0 14px rgba(63,240,210,0.5);
  transition: width 0.35s cubic-bezier(.2,.8,.2,1);
}
.progress-meta { display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 9px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
#progressEta { color: var(--aqua); }
.stop-btn { margin-top: 10px; width: 100%; padding: 8px 12px; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  color: var(--coral); background: rgba(255,107,107,0.07);
  border: 1px solid var(--coral); border-radius: 9px;
  transition: background .15s ease; }
.stop-btn:hover { background: rgba(255,107,107,0.16); }

.err { color: var(--coral); font-family: var(--mono); font-size: 12px; margin-top: 12px;
  min-height: 16px; }

/* ============ Output / player ============ */
.player {
  position: relative; border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(63,240,210,0.06), transparent 70%), rgba(3,8,9,0.5);
  height: 200px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.viz { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-empty { text-align: center; z-index: 1; }
.player-empty p { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--muted); }
.player-empty small { font-size: 11.5px; color: var(--muted-2); }
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: linear-gradient(0deg, rgba(3,8,9,0.85), transparent);
}
.play {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: 1px solid rgba(63,240,210,0.4); background: rgba(63,240,210,0.12);
  display: grid; place-items: center; transition: all 0.2s;
}
.play:hover { background: rgba(63,240,210,0.22); transform: scale(1.05); }
.play svg { width: 20px; height: 20px; fill: var(--aqua); }
.play .ico-pause { display: none; }
.play.playing .ico-play { display: none; }
.play.playing .ico-pause { display: block; }
.time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.time i { color: var(--muted-2); font-style: normal; margin: 0 2px; }
.download {
  margin-left: auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: #032420; text-decoration: none;
  background: var(--aqua); padding: 9px 15px; border-radius: 100px; transition: all 0.2s;
}
.download:hover { box-shadow: 0 0 18px rgba(63,240,210,0.6); }

/* history */
.history-head { display: flex; align-items: center; justify-content: space-between;
  margin: 26px 0 12px; }
.history-head h2 { font-family: var(--display); font-weight: 600; font-size: 15px;
  letter-spacing: 0.04em; }
.history { list-style: none; display: flex; flex-direction: column; gap: 8px;
  max-height: 320px; overflow-y: auto; padding-right: 4px; }
.history::-webkit-scrollbar { width: 6px; }
.history::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.hist-empty { font-size: 12.5px; color: var(--muted-2); padding: 10px 2px; font-style: italic; }
.hist-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 11px; background: rgba(3,8,9,0.35);
  transition: border-color 0.2s, transform 0.15s; animation: rise 0.4s both;
}
.hist-item:hover { border-color: var(--line-2); transform: translateX(2px); }
.hist-play {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--aqua);
  display: grid; place-items: center; font-size: 12px;
}
.hist-play:hover { background: rgba(63,240,210,0.12); }
.hist-meta { flex: 1; min-width: 0; }
.hist-text { font-size: 13px; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; }
.hist-sub { font-family: var(--mono); font-size: 10px; color: var(--muted-2);
  letter-spacing: 0.06em; text-transform: uppercase; margin-top: 3px; }
.hist-dl {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; cursor: pointer;
  color: var(--muted); background: rgba(63,240,210,0.05); border: 1px solid var(--line);
  border-radius: 100px; padding: 7px 12px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  transition: all 0.18s;
}
.hist-dl svg { display: block; }
.hist-dl:hover { color: #032420; background: var(--aqua); border-color: var(--aqua);
  box-shadow: 0 0 14px rgba(63,240,210,0.4); }
.history-actions { display: flex; gap: 8px; }
