:root {
  --bg: #0b0b0c;
  --panel: #101112;
  --panel-soft: #151617;
  --border: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f4f5;
  --muted: #9b9ca1;
  --subtle: #6d6f76;
  --primary: #f5f5f5;
  --primary-text: #080809;
  --accent: #2f81f7;
  --success: #3fb950;
  --danger: #ff6b63;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

html.native-app,
html.native-app body {
  min-height: 100dvh;
  background: var(--bg);
}

html.native-app .auth-screen,
html.native-app .app-shell {
  min-height: 100dvh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 0.9fr);
  background: radial-gradient(circle at 20% 20%, rgba(65, 65, 68, 0.28), transparent 34%), var(--bg);
}

.auth-language-corner {
  position: absolute;
  top: 36px;
  right: 38px;
  z-index: 5;
}

.auth-visual {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.auth-logo,
.sidebar-brand,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0;
}

.auth-logo {
  position: absolute;
  top: 42px;
  left: 48px;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 5px;
  height: 28px;
  align-items: stretch;
}

.brand-mark span {
  display: block;
  width: 6px;
  border-radius: 4px;
  background: var(--text);
}

.sound-card {
  position: absolute;
  border: 1px solid var(--border);
  background: rgba(17, 18, 20, 0.82);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
}

.card-a {
  left: 14%;
  top: 34%;
  width: 430px;
  height: 170px;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 28px;
  border-radius: 18px;
}

.card-a div {
  flex: 1;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8f8f8, #777);
}

.card-a div:nth-child(1) { height: 46%; }
.card-a div:nth-child(2) { height: 78%; }
.card-a div:nth-child(3) { height: 58%; }
.card-a div:nth-child(4) { height: 92%; }
.card-a div:nth-child(5) { height: 38%; }

.card-b {
  right: 12%;
  bottom: 18%;
  width: 260px;
  padding: 22px;
  border-radius: 16px;
}

.card-b p,
.card-b strong {
  margin: 0;
}

.card-b span {
  display: block;
  height: 5px;
  margin-top: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 62%, rgba(255, 255, 255, 0.16) 62%);
}

.sound-orbit {
  position: absolute;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  right: -180px;
  top: 120px;
}

.auth-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.mobile-brand {
  display: none;
}

.login-card {
  width: min(100%, 370px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-card h1 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 26px;
  font-weight: 650;
}

.app-language-select select {
  width: 68px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--panel);
  font-size: 13px;
  font-weight: 700;
}

.oauth-button,
.primary-button,
.ghost-button,
.icon-button,
.nav-item {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--panel);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.oauth-button:hover,
.ghost-button:hover,
.icon-button:hover,
.nav-item:hover {
  border-color: var(--border-strong);
  background: #191a1c;
}

.oauth-button {
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 550;
}

.google-dot,
.apple-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(#4285f4, #34a853, #fbbc04, #ea4335, #4285f4);
}

.apple-dot {
  background: #f4f4f5;
}

.divider {
  height: 1px;
  margin: 10px 0;
  background: var(--border);
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 15px;
}

textarea {
  min-height: 420px;
  resize: vertical;
  padding: 24px;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.42);
}

.primary-button {
  height: 46px;
  border-radius: 12px;
  border: 0;
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 650;
}

.primary-button.compact {
  width: auto;
  padding: 0 18px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.primary-button.loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(8, 8, 9, 0.24);
  border-top-color: var(--primary-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-card footer,
.form-success,
.form-error {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.form-success {
  color: #5ee088;
}

.form-error {
  color: #ff7b72;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 256px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: #09090a;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  height: 48px;
  padding: 0 10px 14px;
  border-bottom: 1px solid var(--border);
}

.mobile-account-button {
  display: none;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 14px;
}

.nav-item {
  height: 38px;
  border: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  color: var(--muted);
  text-align: left;
}

.nav-item.active {
  color: var(--text);
  background: #1b1c1f;
}

svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 14px 8px 2px;
  text-align: left;
  border-radius: 10px;
}

.sidebar-footer:hover,
.sidebar-footer.active {
  background: #151617;
}

.sidebar-footer div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-footer small,
.topbar span,
.muted {
  color: var(--muted);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #25272c;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 11, 12, 0.86);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.topbar div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ghost-button,
.icon-button {
  height: 34px;
  border-radius: 10px;
  padding: 0 12px;
}

.icon-button {
  width: 34px;
  padding: 0;
  display: grid;
  place-items: center;
}

.ghost-button.small {
  height: 30px;
}

.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.danger-button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 107, 99, 0.28);
  border-radius: 10px;
  background: rgba(255, 107, 99, 0.08);
  color: #ffb4ae;
}

.danger-button:not(:disabled):hover {
  background: rgba(255, 107, 99, 0.16);
  border-color: rgba(255, 107, 99, 0.5);
}

.danger-button.tall,
.ghost-button.tall {
  height: 42px;
}

.content {
  padding: 28px;
}

.tts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.audio-result {
  margin-top: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 0.62fr) minmax(340px, 0.95fr);
  align-items: center;
  gap: 16px;
}

.audio-result-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.audio-result-meta span {
  color: var(--muted);
}

.audio-result-controls {
  width: min(100%, 620px);
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.generated-audio-player {
  flex: 1 1 auto;
  min-width: 0;
}

.generated-audio-player .voice-waveform {
  min-width: 180px;
}

.generated-audio-player .voice-time {
  min-width: 76px;
}

.audio-result audio {
  width: 100%;
}

.voices-view {
  width: min(100%, 1160px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 36px;
}

.voice-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.voice-toolbar h1,
.voice-toolbar p,
.voice-section-title h2,
.voice-row h3 {
  margin: 0;
}

.voice-toolbar h1 {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.voice-toolbar p,
.voice-section-title span,
.sample-empty,
.empty-inline {
  color: var(--muted);
}

.voice-eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.voice-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}

.search-field {
  flex: 1;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.search-field input {
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.search-kbd {
  min-width: 31px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.filter-pills {
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

.filter-menu-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.filter-menu-button:hover,
.filter-menu-button.active {
  color: var(--text);
  border-color: var(--border-strong);
  background: #191a1c;
}

.filter-menu-button svg {
  width: 17px;
  height: 17px;
}

.voice-filter-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 12;
  width: min(760px, 100%);
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: #101113;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  display: none;
}

.voice-controls.filters-open .voice-filter-panel {
  display: block;
}

.voice-filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.voice-filter-panel-header button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.voice-filter-panel-header button:hover {
  color: var(--text);
}

.mobile-filter-pills {
  display: none;
}

.voice-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.voice-filter-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voice-filter-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.voice-filter-field select,
.voice-filter-field input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  padding: 0 10px;
}

.filter-pill {
  height: 34px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  font-weight: 650;
}

.filter-pill:hover,
.filter-pill.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.voice-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.voice-pagination {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.voice-section-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.voice-page-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 4px;
  border-radius: 6px;
  font: inherit;
}

.voice-page-link:hover {
  color: var(--text);
}

.voice-page-link:disabled {
  opacity: 0.35;
  cursor: default;
}

.voice-section-title h2 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.voice-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.voice-row {
  min-height: 72px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 13px 12px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(360px, 1.3fr) minmax(148px, auto);
  align-items: center;
  gap: 24px;
  position: relative;
}

.voice-row:hover,
.voice-row.selected {
  background: rgba(255, 255, 255, 0.018);
}

.voice-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-orb {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, #0d1a2d, #657081);
  border: 0;
  position: relative;
}

.voice-orb[data-playing="true"]::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(245, 245, 245, 0.22);
  border-radius: inherit;
  animation: voice-pulse 1.6s ease-out infinite;
}

@keyframes voice-pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.24);
  }
}

.voice-name-block {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.voice-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-row h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.voice-subtitle {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-player {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.voice-player audio {
  display: none;
}

.voice-play-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.voice-play-button:hover {
  transform: scale(1.04);
  background: rgba(255, 255, 255, 0.12);
}

.voice-play-button.is-playing {
  background: var(--text);
  color: #090a0c;
}

.voice-play-button svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  stroke: none;
}

.voice-play-button .pause-icon {
  display: none;
}

.voice-play-button.is-playing .play-icon {
  display: none;
}

.voice-play-button.is-playing .pause-icon {
  display: block;
}

.voice-waveform {
  height: 32px;
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.voice-wave-bar {
  width: 3px;
  min-width: 2px;
  max-width: 3px;
  flex: 1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.voice-wave-bar.played {
  background: var(--text);
}

.voice-waveform:hover .voice-wave-bar {
  background: rgba(255, 255, 255, 0.24);
}

.voice-time {
  min-width: 72px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.sample-empty {
  width: 100%;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.02);
}

.voice-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.favorite-button {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  opacity: 0.74;
}

.favorite-button:hover {
  opacity: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.favorite-button.active {
  color: #ffd166;
  opacity: 1;
  background: rgba(255, 209, 102, 0.08);
}

.favorite-button svg {
  width: 16px;
  height: 16px;
}

.favorite-button.active svg {
  fill: currentColor;
}

.voice-actions .primary-button {
  width: 106px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.voice-actions .primary-button:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
}

.voice-actions .primary-button.selected {
  border-color: transparent;
  background: var(--text);
  color: #050505;
}

.empty-inline {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.history-view {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.history-heading h1,
.history-heading p,
.history-item h3,
.history-prompt {
  margin: 0;
}

.history-heading h1 {
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
}

.history-heading p,
.history-meta span,
.history-empty p {
  color: var(--muted);
}

.history-retention-notice {
  margin-top: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.history-retention-notice svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #b9c6ff;
  opacity: 0.82;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(300px, 1fr) minmax(300px, 0.95fr) max-content;
  align-items: center;
  gap: 16px;
}

.history-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-meta div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-meta h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.history-prompt {
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-player {
  display: contents;
}

.history-audio-player {
  min-width: 0;
  grid-column: 3;
}

.history-audio-player .voice-waveform {
  min-width: 120px;
}

.history-audio-player .voice-time {
  min-width: 76px;
}

.download-link {
  grid-column: 4;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.audio-result-controls .download-link {
  grid-column: auto;
  flex: 0 0 auto;
}

.history-empty {
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
  padding: 28px;
}

.history-empty h2 {
  margin: 0;
}

.editor-panel,
.settings-panel,
.admin-panel,
.empty-state,
.paywall-panel,
.account-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 12px;
}

.panel-heading,
.editor-footer {
  min-height: 54px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.editor-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.editor-panel textarea {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.editor-panel {
  position: relative;
  overflow: hidden;
}

.editor-panel textarea:disabled {
  opacity: 0.55;
}

.generation-loading {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 76px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(20, 21, 23, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  gap: 10px;
}

.generation-loading .spinner {
  border-color: rgba(245, 245, 245, 0.22);
  border-top-color: var(--text);
}

.generation-loading strong {
  font-size: 14px;
}

.generation-loading small {
  color: var(--muted);
}

.settings-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.voice-picker {
  position: relative;
}

.voice-picker-trigger {
  width: 100%;
  height: 46px;
  padding: 0 13px 0 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0d0e0f;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}

.voice-picker-trigger:hover,
.voice-picker.open .voice-picker-trigger {
  border-color: rgba(255, 255, 255, 0.42);
}

.voice-picker-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-picker-trigger svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.voice-picker-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: min(420px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #111214;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
}

.voice-picker-search {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0b0c0d;
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.voice-picker-search svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.voice-picker-search input {
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.voice-picker-list {
  max-height: 320px;
  margin-top: 8px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
}

.voice-picker-option {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 6px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  text-align: left;
}

.voice-picker-option:hover,
.voice-picker-option.selected {
  background: #202124;
}

.voice-picker-select {
  min-width: 0;
  min-height: 38px;
  flex: 1 1 auto;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.voice-option-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-option-star-button {
  width: 24px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
  color: #ffd166;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voice-option-star-button:hover {
  background: rgba(255, 209, 102, 0.12);
}

.voice-option-star-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.voice-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-option-ready {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.voice-picker-empty {
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
}

.settings-panel h2,
.admin-panel h2 {
  margin: 0 0 4px;
  font-size: 15px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--primary);
}

.status-box,
.role-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
}

.status-box strong,
.role-card strong {
  color: var(--text);
}

.admin-danger-zone {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 107, 99, 0.2);
  border-radius: 10px;
  background: rgba(255, 107, 99, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-danger-zone h2,
.admin-danger-zone p {
  margin: 0;
}

.admin-danger-zone p {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #17191c;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

.paywall {
  min-height: calc(100vh - 112px);
  display: grid;
  place-items: center;
}

.paywall-panel {
  width: min(100%, 520px);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.paywall-panel h1,
.paywall-panel p {
  margin: 0;
}

.paywall-panel h1 {
  font-size: 30px;
  line-height: 1.15;
}

.paywall-panel p,
.paywall-panel small,
.billing-note {
  color: var(--muted);
}

.price-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px;
  border-radius: 10px;
  background: var(--panel-soft);
}

.price-line strong {
  font-size: 30px;
}

.price-line span {
  color: var(--muted);
}

.trial-offer {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(245, 245, 245, 0.14);
  border-radius: 14px;
  min-height: 148px;
  padding: 24px 28px;
  background:
    radial-gradient(circle at 88% 20%, rgba(245, 245, 245, 0.1), transparent 34%),
    radial-gradient(circle at 10% 100%, rgba(245, 245, 245, 0.055), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018)),
    #111214;
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(0, 1fr) 220px;
  align-items: center;
  gap: 32px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 18px 52px rgba(0, 0, 0, 0.32);
}

.trial-offer-prices {
  min-width: 0;
  padding-right: 30px;
  border-right: 1px solid rgba(245, 245, 245, 0.12);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.trial-original-price {
  position: relative;
  display: inline-block;
  color: rgba(245, 245, 245, 0.45);
  font-size: 32px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.trial-original-price::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  top: 52%;
  height: 2px;
  border-radius: 999px;
  background: rgba(245, 245, 245, 0.58);
  transform: rotate(-1.5deg);
  transform-origin: center;
}

.trial-offer-prices strong {
  color: var(--text);
  font-size: 44px;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.trial-offer-prices small {
  color: rgba(245, 245, 245, 0.66);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.trial-offer-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trial-offer-badge {
  width: fit-content;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid rgba(245, 245, 245, 0.9);
  border-radius: 999px;
  background: var(--text);
  color: #050505;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.trial-offer-copy p {
  margin: 0;
  color: rgba(245, 245, 245, 0.76);
  font-size: 14px;
  line-height: 1.45;
}

.paywall-panel .trial-offer {
  grid-template-columns: 1fr;
  min-height: 0;
}

.paywall-panel .trial-offer-prices {
  padding-right: 0;
  padding-bottom: 14px;
  border-right: 0;
  border-bottom: 1px solid rgba(245, 245, 245, 0.09);
}

.paywall-panel .trial-offer-art {
  display: none;
}

.trial-offer-art {
  position: relative;
  min-height: 116px;
  display: grid;
  place-items: center;
}

.trial-offer-art::before,
.trial-offer-art::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.trial-offer-art::before {
  width: 190px;
  height: 48px;
  border: 1px solid rgba(245, 245, 245, 0.12);
  border-radius: 999px;
  opacity: 0.75;
  transform: rotate(-14deg);
}

.trial-offer-art::after {
  right: 24px;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text);
  box-shadow:
    -72px 28px 0 rgba(245, 245, 245, 0.72),
    24px 34px 0 rgba(245, 245, 245, 0.5);
}

.trial-premium-card {
  position: relative;
  width: 118px;
  height: 84px;
  border: 1px solid rgba(245, 245, 245, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(245, 245, 245, 0.14), rgba(245, 245, 245, 0.035)),
    #202126;
  color: rgba(245, 245, 245, 0.86);
  display: grid;
  place-items: center;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: rotate(10deg);
}

.trial-premium-card svg {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 10px 18px rgba(255, 255, 255, 0.14));
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-heading h2,
.account-heading p {
  margin: 0;
}

.account-heading p {
  color: var(--muted);
}

.plan-summary {
  min-height: 128px;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  padding: 22px 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 10%, rgba(245, 245, 245, 0.06), transparent 30%),
    var(--panel-soft);
}

.plan-summary-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  color: rgba(245, 245, 245, 0.72);
  display: grid;
  place-items: center;
}

.plan-summary-icon svg {
  width: 34px;
  height: 34px;
}

.plan-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-summary span,
.plan-summary small {
  color: var(--muted);
}

.plan-summary strong {
  font-size: 28px;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.billing-note {
  min-height: 46px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid rgba(245, 245, 245, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.022);
  display: flex;
  align-items: center;
  gap: 14px;
}

.billing-note span {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid rgba(245, 245, 245, 0.3);
  border-radius: 999px;
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 750;
}

.admin-panel {
  padding: 18px;
}

.admin-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-panel-heading h2 {
  margin: 0;
}

.admin-panel-heading span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.admin-user-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 210px);
  gap: 10px;
  margin-bottom: 12px;
}

.admin-search-field,
.admin-plan-filter {
  display: grid;
  gap: 7px;
  align-items: stretch;
}

.admin-search-field span,
.admin-plan-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-search-field input,
.admin-plan-filter select {
  height: 38px;
  border-radius: 10px;
  background: #0d0e0f;
}

.table {
  display: grid;
  gap: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 92px 90px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel-soft);
}

.table-row strong,
.plan-cell strong {
  color: var(--success);
}

.user-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-cell small,
.plan-cell small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-pill {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.status-pill.active {
  color: #9be9a8;
  background: rgba(63, 185, 80, 0.12);
}

.status-pill.blocked {
  color: #ffb4ae;
  background: rgba(255, 107, 99, 0.12);
}

.row-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-empty {
  min-height: 96px;
  margin: 0;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-align: center;
}

.admin-pagination {
  min-height: 42px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-pagination span {
  color: var(--muted);
  font-size: 13px;
  min-width: 112px;
  text-align: center;
}

.empty-state {
  min-height: calc(100vh - 112px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.empty-state h1 {
  margin: 0;
}

.empty-state p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .auth-screen,
  .tts-layout,
  .audio-result,
  .admin-grid,
  .account-grid,
  .voice-row,
  .history-item {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .mobile-brand {
    display: flex;
    position: fixed;
    top: 22px;
    left: 22px;
  }

  .auth-language-corner {
    top: 22px;
    right: 22px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: auto;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px 10px;
  }

  .mobile-account-button {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: var(--text);
    background: transparent;
    padding: 0;
  }

  .mobile-account-button .avatar {
    width: 34px;
    height: 34px;
    background: #25272c;
  }

  .mobile-account-button.active,
  .mobile-account-button:hover {
    background: transparent;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .sidebar-brand {
    height: 44px;
    padding: 0 0 12px;
  }

  .sidebar nav {
    display: flex;
    flex-direction: row;
    gap: 8px;
    padding: 12px 0 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: max-content;
    height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    background: var(--panel);
  }

  .nav-item.active {
    border-color: var(--border);
  }

  .sidebar-footer {
    display: none;
  }

  .workspace {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .topbar {
    height: auto;
    min-height: 56px;
    position: sticky;
    top: 118px;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 16px;
  }

  .topbar div:first-child {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .topbar div:first-child strong,
  .topbar div:first-child span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .content {
    padding: 22px 16px;
  }

  html.native-app .auth-screen,
  html.native-app .app-shell {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  html.native-app .mobile-brand,
  html.native-app .auth-language-corner {
    top: calc(env(safe-area-inset-top) + 22px);
  }
}

@media (max-width: 640px) {
  .auth-panel,
  .content {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .top-actions {
    width: auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
  }

  .topbar div:first-child {
    display: block;
  }

  .topbar div:first-child span {
    display: none;
  }

  .top-actions .app-language-select select {
    width: 62px;
  }

  .top-actions .ghost-button {
    min-width: 0;
    padding: 0 10px;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .admin-panel-heading,
  .admin-user-controls,
  .admin-pagination {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .admin-panel-heading,
  .admin-pagination {
    flex-direction: column;
  }

  .admin-panel-heading span,
  .admin-pagination span {
    text-align: left;
  }

  .admin-pagination {
    justify-content: flex-start;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .voice-toolbar,
  .history-heading,
  .voice-actions,
  .history-player {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  .voice-controls {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
  }

  .filter-menu-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    display: grid;
    place-items: center;
  }

  .filter-menu-button:hover,
  .filter-menu-button.active {
    color: var(--text);
    border-color: var(--border-strong);
    background: #191a1c;
  }

  .filter-menu-button svg {
    width: 17px;
    height: 17px;
  }

  .filter-pills {
    display: none;
  }

  .filter-pill {
    height: 38px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    text-align: left;
  }

  .filter-pill:hover,
  .filter-pill.active {
    background: #202124;
    border-color: transparent;
  }

  .voice-filter-panel {
    top: calc(100% + 8px);
    width: min(360px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 220px));
    overflow: auto;
  }

  .mobile-filter-pills {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }

  .voice-filter-grid {
    grid-template-columns: 1fr;
  }

  .voice-name-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .voice-pagination {
    justify-content: space-between;
  }

  .voice-actions .primary-button {
    width: 100%;
  }

  .audio-result-controls {
    width: 100%;
    justify-self: stretch;
    gap: 10px;
  }

  .generated-audio-player .voice-waveform {
    min-width: 0;
  }

  .generated-audio-player .voice-time {
    min-width: 64px;
  }

  .trial-offer {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 14px;
  }

  .trial-offer-art {
    display: none;
  }

  .trial-offer-prices {
    padding-right: 0;
    padding-bottom: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(245, 245, 245, 0.09);
  }

  .trial-original-price {
    font-size: 30px;
  }

  .trial-offer-prices strong {
    font-size: 42px;
  }

  .plan-summary {
    min-height: 0;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .plan-summary-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .plan-summary-icon svg {
    width: 26px;
    height: 26px;
  }

  .billing-note {
    align-items: flex-start;
    padding: 12px;
  }

  textarea {
    min-height: 320px;
  }

  .editor-footer {
    align-items: stretch;
    gap: 12px;
    flex-direction: column;
  }

  .primary-button.compact {
    width: 100%;
  }
}
