/* =========================================================
   Text2Speech AI — Stylesheet
   Built by Team Brightmark Digital (https://brightmarkdigital.com)
   Design tokens:
   - Paper:      #F6F7FB   Surface: #FFFFFF   Ink: #14161B
   - Ink-muted:  #5B6270   Border: #E5E8F0
   - Signal (primary accent):  #5B5FEF (indigo-violet)
   - Pulse (secondary accent): #16C2B2 (teal)
   - Display face: Sora | Body: Inter | Data/mono: JetBrains Mono
   ========================================================= */

:root {
  --paper: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #FBFBFE;
  --ink: #14161B;
  --ink-muted: #5B6270;
  --ink-faint: #9AA1B2;
  --border: #E5E8F0;
  --border-strong: #D6DAE6;

  --signal: #5B5FEF;
  --signal-ink: #4741D6;
  --signal-tint: #EEEEFD;
  --signal-tint-strong: #DEDEFB;

  --pulse: #16C2B2;
  --pulse-tint: #E4FBF8;

  --danger: #E14A6D;
  --danger-tint: #FDECF0;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(20, 22, 27, 0.04), 0 1px 1px rgba(20, 22, 27, 0.03);
  --shadow-md: 0 8px 24px rgba(45, 50, 80, 0.08);
  --shadow-lg: 0 20px 48px rgba(45, 50, 80, 0.14);

  --font-display: "Sora", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 480px at 12% -8%, var(--signal-tint) 0%, transparent 60%),
    radial-gradient(ellipse 700px 420px at 100% 0%, var(--pulse-tint) 0%, transparent 55%);
  opacity: 0.8;
}

.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: orbFloat 16s ease-in-out infinite;
}
.orb-1 {
  width: 420px; height: 420px;
  top: -140px; left: -100px;
  background: radial-gradient(circle, var(--signal-tint-strong), transparent 70%);
  animation-duration: 18s;
}
.orb-2 {
  width: 380px; height: 380px;
  bottom: -160px; right: -80px;
  background: radial-gradient(circle, var(--pulse-tint), transparent 70%);
  animation-duration: 22s;
  animation-delay: -6s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 25px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
}

/* ---------------- Panel reveal-on-load ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- Topbar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 247, 251, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
  padding: 0 2px;
}

.brand-mark .bar {
  width: 4px;
  background: linear-gradient(180deg, var(--signal), var(--pulse));
  border-radius: 2px;
  animation: idleWave 1.4s ease-in-out infinite;
}
.brand-mark .bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.brand-mark .bar:nth-child(2) { height: 90%; animation-delay: 0.12s; }
.brand-mark .bar:nth-child(3) { height: 60%; animation-delay: 0.24s; }
.brand-mark .bar:nth-child(4) { height: 100%; animation-delay: 0.36s; }
.brand-mark .bar:nth-child(5) { height: 50%; animation-delay: 0.48s; }

.brand-mark-sm { height: 18px; }
.brand-mark-sm .bar { width: 3px; }

@keyframes idleWave {
  0%, 100% { transform: scaleY(0.55); }
  50% { transform: scaleY(1); }
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-sub {
  font-size: 11.5px; color: var(--ink-muted); font-weight: 500; letter-spacing: 0.02em;
  text-decoration: none; transition: color 0.15s ease;
}
.brand-sub:hover { color: var(--signal-ink); }

.topbar-right { display: flex; align-items: center; gap: 22px; }

.link-muted {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}
.link-muted:hover { color: var(--ink); }

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-family: var(--font-mono);
  color: var(--signal-ink);
  background: var(--signal-tint);
  border: 1px solid var(--signal-tint-strong);
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.badge-live i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pulse);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(22, 194, 178, 0.6);
  animation: livePing 1.8s ease-out infinite;
}
@keyframes livePing {
  0% { box-shadow: 0 0 0 0 rgba(22, 194, 178, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(22, 194, 178, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 194, 178, 0); }
}

/* ---------------- Layout ---------------- */

.app {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.95fr;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.panel:hover { box-shadow: var(--shadow-md); }

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

.panel-head h2 {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---------------- Text panel ---------------- */

.tool-icons { display: flex; gap: 6px; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--signal-tint); color: var(--signal-ink); border-color: var(--signal-tint-strong); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn-danger:hover { background: var(--danger-tint); color: var(--danger); border-color: #F6D3DC; }

.text-input {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface-2);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.text-input:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-tint);
}
.text-input::placeholder { color: var(--ink-faint); }

.counters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-muted);
}
.counters strong { color: var(--ink); font-weight: 600; }
.dot-sep { color: var(--ink-faint); }

.usage-row { margin-top: 14px; }
.usage-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.usage-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pulse), var(--signal));
  transition: width 0.5s ease, background 0.3s ease;
}
.usage-bar-fill.is-near-limit { background: linear-gradient(90deg, #F0A93B, var(--danger)); }

.language-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.language-row label { font-size: 13px; font-weight: 600; color: var(--ink); }
.hint { font-size: 12px; color: var(--ink-faint); flex-basis: 100%; }

.select-control {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.select-control:focus { outline: none; border-color: var(--signal); }
.select-compact { min-width: 130px; }

/* ---------------- Voice library ---------------- */

.count-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 999px;
}

.voice-search { display: flex; gap: 8px; margin-bottom: 14px; }
.search-input {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: var(--font-body);
  color: var(--ink);
}
.search-input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-tint); }

.voice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}
.voice-list::-webkit-scrollbar { width: 6px; }
.voice-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.voice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  text-align: left;
  animation: cardIn 0.3s ease backwards;
  animation-delay: calc(var(--i, 0) * 25ms);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.voice-card:hover { border-color: var(--signal-tint-strong); background: var(--signal-tint); transform: translateY(-1px); }
.voice-card.is-selected {
  border-color: var(--signal);
  background: var(--signal-tint);
  box-shadow: 0 0 0 3px var(--signal-tint-strong);
}

.voice-avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--signal), var(--pulse));
  flex-shrink: 0;
}

.voice-meta { min-width: 0; flex: 1; }
.voice-name { font-size: 14px; font-weight: 600; color: var(--ink); display: block; }
.voice-tags { font-size: 12px; color: var(--ink-muted); display: block; margin-top: 2px; }
.voice-tags span:not(:last-child)::after { content: "·"; margin: 0 4px; color: var(--ink-faint); }

.voice-play-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--signal-ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 12px;
  transition: background 0.15s ease;
}
.voice-play-btn:hover { background: var(--signal-tint-strong); }

.voice-skeleton {
  height: 58px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.inline-error {
  margin-top: 12px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-tint);
  border: 1px solid #F6D3DC;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}

/* ---------------- Settings panel ---------------- */

.selected-voice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  margin-bottom: 18px;
}
.selected-voice-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--signal), var(--pulse));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.selected-voice-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.selected-voice-name { font-size: 14px; font-weight: 600; }
.selected-voice-meta { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

.slider-group { margin-bottom: 18px; }
.slider-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.slider-row label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.slider-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal-ink);
  background: var(--signal-tint);
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 44px;
  text-align: center;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--signal);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.slider::-moz-range-thumb {
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--signal);
  cursor: pointer;
}

.slider-caption { font-size: 11.5px; color: var(--ink-faint); margin: 6px 0 0; line-height: 1.4; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 20px;
  cursor: pointer;
}
.switch-title { font-size: 13.5px; font-weight: 600; display: block; }
.switch-caption { font-size: 11.5px; color: var(--ink-faint); display: block; margin-top: 2px; }

.switch { position: relative; display: inline-block; width: 40px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--signal); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }

.btn-generate {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--signal), var(--signal-ink));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  padding: 15px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(91, 95, 239, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative;
}
.btn-generate:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(91, 95, 239, 0.34); }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: 0.75; cursor: progress; transform: none; }
.btn-generate::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.28) 50%, transparent 70%);
  background-size: 250% 100%;
  background-position: 150% 0;
  pointer-events: none;
}
.btn-generate:hover::before { animation: btnShine 1.1s ease; }
@keyframes btnShine {
  to { background-position: -50% 0; }
}

.btn-generate-wave { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 16px; }
.btn-generate-wave i {
  width: 3px; background: rgba(255,255,255,0.85); border-radius: 2px; height: 30%;
}
.btn-generate.is-loading .btn-generate-wave i { animation: genWave 0.9s ease-in-out infinite; }
.btn-generate-wave i:nth-child(1){animation-delay:0s}
.btn-generate-wave i:nth-child(2){animation-delay:.08s}
.btn-generate-wave i:nth-child(3){animation-delay:.16s}
.btn-generate-wave i:nth-child(4){animation-delay:.24s}
.btn-generate-wave i:nth-child(5){animation-delay:.32s}
.btn-generate-wave i:nth-child(6){animation-delay:.4s}
.btn-generate-wave i:nth-child(7){animation-delay:.48s}
@keyframes genWave {
  0%, 100% { height: 25%; }
  50% { height: 100%; }
}
.btn-generate:not(.is-loading) .btn-generate-wave i { height: 45%; }

.player-card {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.player-card.pop-in { animation: popIn 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.2); }
@keyframes popIn {
  0% { opacity: 0; transform: translateY(8px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.wave-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
  margin-bottom: 10px;
}
.wave-visualizer i {
  width: 3px;
  height: 20%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--signal), var(--pulse));
  transition: height 0.2s ease;
}
.wave-visualizer.is-playing i { animation: waveBounce 1s ease-in-out infinite; }
.wave-visualizer i:nth-child(odd) { animation-duration: 0.8s; }
.wave-visualizer i:nth-child(3n) { animation-duration: 1.2s; }
.wave-visualizer i:nth-child(4n) { animation-delay: -0.3s; }
.wave-visualizer i:nth-child(5n) { animation-delay: -0.6s; }
@keyframes waveBounce {
  0%, 100% { height: 20%; }
  50% { height: 90%; }
}
.player-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.player-title { font-size: 13.5px; font-weight: 600; }
.player-chars { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-muted); }
#audioPlayer { width: 100%; margin-bottom: 12px; }

.player-actions { display: flex; gap: 10px; }
.btn-secondary {
  flex: 1;
  text-align: center;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--signal);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-secondary:hover { background: var(--signal-ink); }
.btn-ghost { background: transparent; color: var(--signal-ink); border: 1px solid var(--signal-tint-strong); }
.btn-ghost:hover { background: var(--signal-tint); }

/* ---------------- History ---------------- */

.history-section {
  position: relative; z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px 28px;
}
.history-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.history-note { font-size: 12.5px; color: var(--ink-faint); margin: -6px 0 16px; }
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.history-empty { color: var(--ink-faint); font-size: 13.5px; grid-column: 1 / -1; }

.history-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 14px;
  animation: cardIn 0.3s ease backwards;
  animation-delay: calc(var(--i, 0) * 30ms);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.history-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.history-card-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.history-voice { font-size: 13px; font-weight: 600; }
.history-time { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); white-space: nowrap; }
.history-text {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-card audio { width: 100%; height: 32px; margin-bottom: 8px; }
.history-card-actions { display: flex; gap: 8px; }
.history-card-actions a, .history-card-actions button {
  font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--ink-muted);
  cursor: pointer; text-decoration: none;
}
.history-card-actions a:hover, .history-card-actions button:hover { color: var(--signal-ink); border-color: var(--signal-tint-strong); background: var(--signal-tint); }

/* ---------------- Footer ---------------- */

.site-footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 28px 40px;
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 32px;
}
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-title { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; margin: 0 0 4px; }
.footer-copy { font-size: 12.5px; color: var(--ink-muted); margin: 0; max-width: 240px; }
.footer-about h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); margin: 0 0 8px; }
.footer-about p { font-size: 13px; line-height: 1.65; color: var(--ink-muted); margin: 0; max-width: 620px; }
.footer-credit { margin-top: 10px !important; font-weight: 500; }
.footer-credit a, .footer-meta a {
  color: var(--signal-ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed var(--signal-tint-strong);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.footer-credit a:hover, .footer-meta a:hover { border-color: var(--signal-ink); }
.footer-meta {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--border);
  margin-top: 8px;
  padding-top: 16px;
  font-size: 12px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  display: flex; gap: 8px;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: 90vw;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

/* ---------------- Responsive ---------------- */

@media (max-width: 1080px) {
  .app { grid-template-columns: 1fr 1fr; }
  .panel-settings { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .topbar-inner { padding: 12px 18px; }
  .topbar-right { gap: 12px; }
  .link-muted { display: none; }
  .app { grid-template-columns: 1fr; padding: 18px; gap: 14px; }
  .panel-settings { grid-column: auto; }
  .history-section { padding: 0 18px 18px; }
  .footer-inner { grid-template-columns: 1fr; padding: 26px 18px 32px; }
  .text-input { min-height: 200px; }
  .voice-list { max-height: 360px; }
}
