:root {
  --bg: linear-gradient(180deg, #f9faff 0%, #eef1f6 100%);
  --card: rgba(255,255,255,0.85);
  --muted: #9aa0a6;
  --text: #1a1c23;
  --accent: #2b6ef6;
  --accent-2: #6097ff;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(15,23,42,0.06);
  --blur: 20px;
}

.voice-language-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
  font-size: 12px;
  color: #64748b;
}
.voice-language-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.voice-language-badge.is-unknown {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}
.cs-options li { gap: 8px; }
.cs-options li > span:first-child { min-width: 0; overflow-wrap: anywhere; }

* {
  box-sizing: border-box;
  transition: 0.2s ease;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

#root {
  min-width: 400px;
  max-width: 650px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.app {
  flex: 1;
  padding: 10px;
  padding-bottom: 100px;
  overflow-y: auto;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select .options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  z-index: 100;
}

.custom-select.open .options {
  display: block;
}

.card {
  background: var(--card);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.5);
  margin-bottom: 16px;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.title {
  font-size: 18px;
  font-weight: 700;
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* ------------------------- */
/*  Текстовые input и textarea */
/* ------------------------- */
textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
  resize: none;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
      caret-color: #000000 !important; /* Чёрный курсор */
    color: #000000 !important; /* Чёрный текст */
    background: #ffffff !important; /* Белый фон */
  font-size: 15px;
  color: #111;
  margin-top: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

textarea:focus,
input:focus {
      caret-color: #000000 !important;
    -webkit-text-fill-color: #000000 !important;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* Цвет выделенного текста */
textarea::selection {
    background-color: #4b5cff; /* Цвет фона выделения */
    color: #ffffff; /* Цвет текста */
}

textarea::-moz-selection {
    background-color: #4b5cff;
    color: #ffffff;
}

/* ------------------------- */
/*  Select */
/* ------------------------- */
select {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #e6e9ef;
  background: #fff;
  font-size: 15px;
  color: var(--text);
  margin-top: 10px;
  outline: none;
  max-height: 180px;
  overflow-y: auto;
}

/* ------------------------- */
/*  Кнопки */
/* ------------------------- */
.btn {
  width: 100%;
  background: linear-gradient(90deg,var(--accent),var(--accent-2));
  color: white;
  border: none;
  padding: 13px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(43,110,246,0.15);
}

.btn.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(43,110,246,0.25);
}

/* ------------------------- */
/*  Настройки блока */
/* ------------------------- */
.settings-block {
  margin-top: 10px;
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(var(--blur));
  box-shadow: 0 4px 16px rgba(15,23,42,0.05);
}

/* ------------------------- */
/*  Слайдеры */
/* ------------------------- */
.slider-line input[type="range"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  box-sizing: content-box;
  overflow: visible;
  cursor: pointer;
}

/* WebKit: трек */
.slider-line input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
}

/* WebKit: thumb */
.slider-line input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(15,23,42,0.15);
  margin-top: calc((4px - 18px) / 2);
  cursor: pointer;
}

/* Firefox: трек */
.slider-line input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
}

/* Firefox: thumb */
.slider-line input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 6px rgba(15,23,42,0.15);
  cursor: pointer;
}

/* IE/Edge */
.slider-line input[type="range"]::-ms-track {
  height: 4px;
  background: transparent;
  border-color: transparent;
}
.slider-line input[type="range"]::-ms-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
}

/* Контейнер slider */
.slider-line {
  overflow: visible;
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 5px;
  width: 100%;
}

.slider-label {
  display: flex;
  gap: 3px;
  font-size: 14px;
    margin-bottom: 5px;
  color: var(--muted);
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
}

.val {
  width: 42px;
  text-align: right;
  font-weight: 600;
  color: var(--accent);
}

/* ------------------------- */
/*  Toggle switch */
/* ------------------------- */

.toggle-label {
	  display: flex;
  gap: 3px;
  font-size: 14px;
  color: var(--text, #1a1c23);
  font-weight: 500;
}
/* Контейнер: метка слева, переключатель справа */
.checkbox-wrapper-14 {
  display: flex;
  justify-content: space-between; /* метка слева, переключатель справа */
  align-items: center;
  margin-top: 5px;
}

/* Метка */
.checkbox-wrapper-14 .toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1a1c23);
  margin-right: 10px;
}

/* Основной стиль чекбокса */
@supports (-webkit-appearance: none) or (-moz-appearance: none) {
  .checkbox-wrapper-14 input[type=checkbox] {
    --active: #275EFE;
    --active-inner: #fff;
    --focus: 2px rgba(39, 94, 254, .3);
    --border: #BBC1E1;
    --border-hover: #275EFE;
    --background: #fff;
    --disabled: #F6F8FF;
    --disabled-inner: #E1E6F9;

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    width: 38px;
    height: 21px;
    border-radius: 11px;
    border: 1px solid var(--bc, var(--border));
    background: var(--b, var(--background));
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
  }

  /* Кнопка внутри переключателя */
  .checkbox-wrapper-14 input[type=checkbox].switch:after {
    content: '';
    position: absolute;
    left: 2px;
    top: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--ab, var(--border));
    transition: transform 0.3s cubic-bezier(.2,.85,.32,1.2), background 0.3s;
  }

  /* Состояние checked */
  .checkbox-wrapper-14 input[type=checkbox].switch:checked {
    --ab: var(--active-inner);
    --b: var(--active);
    --bc: var(--active);
  }

  .checkbox-wrapper-14 input[type=checkbox].switch:checked:after {
    transform: translateX(17px);
  }

  /* Disabled */
  .checkbox-wrapper-14 input[type=checkbox].switch:disabled {
    cursor: not-allowed;
    background: var(--disabled);
    border-color: var(--border);
    opacity: 0.8;
  }

  .checkbox-wrapper-14 input[type=checkbox].switch:disabled:after {
    background: var(--disabled-inner);
  }
}

/* ------------------------- */
/*  Input wrapper и char counter */
/* ------------------------- */
.input-wrapper {
  position: relative;
}

.char-counter {
  font-size: 12px;
  color: #666;
  text-align: right;
  margin-top: 3px;
}

/* ------------------------- */
/*  Bottom navigation */
/* ------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 15px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.nav-card {
  width: calc(100% - 32px);
  max-width: 430px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(var(--blur));
  border-radius: 16px;
  padding: 5px 8px;
  display: flex;
  justify-content: space-around;
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  pointer-events: auto;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  gap: 4px;
  cursor: pointer;
}

.nav-btn.active {
  color: var(--accent);
  font-weight: 700;
  transform: scale(1.08);
}

.nav-btn div:first-child {
  font-size: 20px;
}

/* ------------------------- */
/*  Screens и voice cards */
/* ------------------------- */

#voiceSelect {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e6e9ef;
  font-size: 15px;
  color: #111;
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: 0.2s ease;
  background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
#voiceSelect:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.screen {
  display: none;
}

.screen.active-screen {
  display: block;
}

.voice-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.8);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 10px;
  box-shadow: 0 3px 10px rgba(15,23,42,0.05);
  border: 1px solid rgba(255,255,255,0.4);
}

.voice-info {
  display: flex;
  flex-direction: column;
}

.voice-name {
  font-weight: 600;
  font-size: 15px;
}

.voice-desc {
  font-size: 13px;
  color: var(--muted);
}

.play-btn {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(43,110,246,0.25);
}

/* ------------------------- */
/*  Audio player */
/* ------------------------- */
.audio-player {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.audio-player.active {
  display: flex;
}

.audio-player audio {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

/* ------------------------- */
/*  Вкладки записи / выбора файла */
/* ------------------------- */
.clone-tabs {
  display: flex;
  justify-content: space-around;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.clone-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  color: var(--muted);
}

.clone-tab.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}

/* ------------------------- */
/*  Контейнер для контента вкладок */
/* ------------------------- */
.clone-content {
  display: none;
  background: var(--card);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.4s ease;
}

.clone-content.active {
  display: block;
}

/* Секции внутри вкладок */
.record-section, .file-section, .preview-section, .upload-section {
  margin-bottom: 16px;
}

/* Кнопки */
#recordBtn, #stopRecordBtn, #fileBtn, #uploadVoiceBtn {
  width: 100%;
  border-radius: var(--radius);
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(43,110,246,0.15);
  transition: transform 0.1s ease;
}

#recordBtn:hover, #stopRecordBtn:hover, #fileBtn:hover, #uploadVoiceBtn:hover {
  transform: scale(1.03);
}

#stopRecordBtn {
  background: #ff5e5e;
  color: white;
}

#recordBtn, #fileBtn, #uploadVoiceBtn {
  background: linear-gradient(90deg,var(--accent),var(--accent-2));
  color: white;
}

/* Превью аудио */
#previewAudio {
  width: 100%;
  border-radius: 12px;
  margin-top: 10px;
  box-shadow: var(--shadow);
}

/* Поле ввода имени голоса */
#cloneVoiceName {
  margin-top: 10px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: var(--radius);
  border: 1px solid #d1d5db;
  width: 100%;
  font-size: 15px;
}

/* Статус */
#cloneStatus {
  text-align: center;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}


.inline-msg-container {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}
.inline-msg-container.info {
    background: rgba(235,250,235,0.9);
    color: #0a8000;
}
.inline-msg-container.error {
    background: rgba(255,230,230,0.9);
    color: #A10000;
}

.voice-card {
    padding: 12px;
    border-radius: 10px;
    background: #f3f4f9;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.voice-info {
    width: 100%;
    overflow: hidden;
}

.voice-name {
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.voice-desc {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Кнопка — уменьшена */
.play-btn {
    width: 38px;
    height: 38px;

    min-width: 38px;
    min-height: 38px;

    border-radius: 50%;
    border: none;

    background: #4b5cff;
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: 0.2s;
    color: white;
    padding: 0;
}

.play-btn:hover {
    background: #3d4ce0;
}

/* Иконки уменьшены */
.icon {
    width: 18px;
    height: 18px;
    fill: white;
}

.hidden {
    display: none !important;
}

/* Прогресс-бар */
.progress {
    flex: 1;
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 4px;
    background: #d3d3d3;
    cursor: pointer;
}

.progress::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: #4b5cff;
    border-radius: 50%;
}

.progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #4b5cff;
    border-radius: 50%;
}

.manage-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.rename-btn,
.delete-btn {
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: 0.2s;
}

.rename-btn {
    background: #4b5cff;
}

.rename-btn:hover {
    background: #3949d6;
}

.delete-btn {
    background: #ff4b4b;
}

.delete-btn:hover {
    background: #d63a3a;
}



.profile-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-top img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-info #profileName {
  font-weight: 600;
  font-size: 18px;
}

.profile-info #profileUsername {
  font-size: 12px;
  color: #666;
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #333;
}

.detail-label {
  font-weight: 500;
  color: #666;
}

.profile-plan {
  margin-top: 8px;
  font-size: 14px;
}

.plan-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-voices .section-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-actions .btn {
  font-size: 14px;
  padding: 10px;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-size: 32px;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

.nav-btn.active .material-symbols-outlined {
  font-weight: 700;
  font-variation-settings: 'FILL' 1;
}

.nav-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #65676b;
}

.nav-btn:hover {
    background: #e4e6eb;
}

.nav-btn.active {
    background: linear-gradient(135deg, #0084ff 0%, #0073e6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.35);
}


/* ------------------------- */
/*  Custom Select */
/* ------------------------- */
.custom-select { 
  width: 100%; 
  position: relative; 
  margin-top: 10px;
}

.cs-control {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 12px 14px; 
  border: 1px solid #e6e9ef; 
  border-radius: 12px; 
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cs-control:hover {
  border-color: #3b82f6;
}

.cs-placeholder { 
  flex: 1; 
  color: #111;
  font-size: 15px;
}

.cs-placeholder.empty {
  color: #9aa0a6;
}

.cs-caret { 
  font-size: 12px; 
  color: #666;
  transition: transform 0.2s;
}

.cs-dropdown.open .cs-caret {
  transform: rotate(180deg);
}

.cs-dropdown {
  position: absolute; 
  left: 0; 
  right: 0; 
  top: calc(100% + 8px); 
  z-index: 100;
  background: #fff; 
  border: 1px solid #e6e9ef; 
  border-radius: 12px; 
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  max-height: 400px; 
  overflow: auto; 
  padding: 12px; 
  box-sizing: border-box; 
  display: none;
}

.cs-dropdown.open { 
  display: block; 
}

.cs-search { 
  width: 100%; 
  padding: 10px 12px; 
  box-sizing: border-box; 
  border-radius: 8px; 
  border: 1px solid #e6e9ef; 
  font-size: 14px; 
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.cs-search:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cs-filters { 
  display: flex; 
  flex-direction: column; 
  gap: 8px; 
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.cs-filter-row { 
  display: flex; 
  gap: 2px; 
  flex-wrap: wrap;
}

.cs-filter-btn { 
  padding: 6px 12px; 
  border-radius: 8px; 
  border: 1px solid #e6e9ef; 
  background: #fafafa; 
  cursor: pointer; 
  font-size: 13px; 
  transition: all 0.2s; 
  flex: 1;
  min-width: 80px;
  font-weight: 500;
}

.cs-filter-btn:hover { 
  background: #f0f0f0; 
  border-color: #d1d5db;
}

.cs-filter-btn.active { 
  background: var(--accent); 
  color: #fff; 
  border-color: var(--accent);
  font-weight: 600;
}

.cs-filter-label { 
  font-size: 12px; 
  color: #666; 
  font-weight: 600; 
  margin-bottom: 4px; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}

.cs-filter-row select { 
  padding: 8px 12px; 
  border-radius: 8px; 
  border: 1px solid #e6e9ef; 
  font-size: 13px; 
  cursor: pointer; 
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
  flex: 1;
  outline: none;
  transition: border-color 0.2s;
}

.cs-filter-row select:hover {
  background-color: #f9f9f9; 
  border-color: #3b82f6;
}

.cs-filter-row select:focus {
  border-color: #3b82f6; 
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background-color: #fff;
}

.cs-options { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
}

.cs-optgroup-label {
  font-size: 11px;
  color: #9aa0a6;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px 4px;
  margin-top: 3px;
}

.cs-optgroup-label:first-child {
  margin-top: 0;
}

.cs-options li { 
  padding: 10px 12px; 
  border-radius: 8px; 
  cursor: pointer; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  transition: background 0.15s;
  font-size: 14px;
}

.cs-options li:hover { 
  background: #f3f4f9; 
}

.cs-options li.selected {
  background: rgba(43, 110, 246, 0.1);
  color: var(--accent);
  font-weight: 600;
}

.cs-empty { 
  color: #9aa0a6; 
  padding: 16px 12px; 
  text-align: center; 
  font-size: 14px; 
}

.small-muted { 
  font-size: 12px; 
  color: #9aa0a6;
  padding: 2px 8px;
  background: #f3f4f9;
  border-radius: 4px;
}


  /* MODAL */
  
.info-circle-btn {
    border: none;
    background: transparent;
    color: #4b5cff;
    font-size: 16px;
    padding: 0 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.info-circle-btn i {
	line-height: 1; 
    pointer-events: none;
}
.info-circle-btn:hover {
    color: #3244ff;
}



  #infoModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    z-index: 999999;
  }

  #infoModal .modal-content {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    width: 85%;
    max-width: 340px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    position: relative;
  }

  #infoModal h3 {
    margin: 0 0 10px;
    font-size: 17px;
    color: #222;
  }

  #infoModal p {
    font-size: 14px;
    color: #444;
    line-height: 1.45;
  }

  .modal-close-btn {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
/* Профиль - чистый минималистичный дизайн */
.profile-card {
    padding: 0 !important;
}

/* Блок пользователя */
.profile-user-block {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 24px 20px;
    background: #fff;
    border-bottom: 1px solid #e6e9ef;
}

.profile-user-block img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #4b5cff;
}

.profile-user-text {
    flex: 1;
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
    line-height: 1.2;
}

.profile-username {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 6px;
}

.profile-user-id {
    font-size: 13px;
    color: #9ca3af;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.profile-user-id::before {
    content: "ID: ";
    font-weight: 600;
}

/* Секции */
.profile-section {
    padding: 20px;
    border-bottom: 1px solid #e6e9ef;
    background: #fff;
}

.profile-section:last-child {
    border-bottom: none;
}

.section-label {
    font-size: 14px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 1px;
}

/* Секция тарифа */
.tariff-section {
    background: #fafbfc;
}

.tariff-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.plan-badge {
    padding: 6px 16px;
    background: #4b5cff;
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Блок ресурсов */
.resources-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
}

.resource-item {
    background: white;
	text-align: center;
    padding: 10px 8px;
    border-radius: 10px;
    border: 1px solid #e6e9ef;
    transition: all 0.2s;
}

.resource-item:hover {
    border-color: #4b5cff;
    box-shadow: 0 2px 8px rgba(75, 92, 255, 0.1);
}

.resource-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.resource-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    display: block;
}

/* Блок истечения */
.expires-block {
    background: #fffbeb;
    border: 1px solid #fde047;
    border-left: 4px solid #eab308;
    padding: 12px 14px;
    font-size: 13px;
    color: #a16207;
    border-radius: 8px;
    font-weight: 600;
}

/* Список информации */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-item:last-child {
    border-bottom: none;
}

.item-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.item-value {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 700;
}

/* Настройки */
.setting-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-row label {
    font-size: 14px;
    color: #374151;
    font-weight: 600;
}

.setting-row select {
    width: 100%;
    padding: 13px 15px;
    border-radius: 8px;
    border: 2px solid #e6e9ef;
    background: white;
    font-size: 15px;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5cff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.setting-row select:hover {
    border-color: #4b5cff;
}

.setting-row select:focus {
    outline: none;
    border-color: #4b5cff;
    box-shadow: 0 0 0 4px rgba(75, 92, 255, 0.1);
}






.plans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-card {
    background: #f3f4f9;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plan-name {
    font-weight: 600;
    font-size: 16px;
}

.plan-meta {
    font-size: 13px;
    color: #555;
}

.plan-btn {
    background: #4b5cff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
}

/* ===== ТАРИФЫ КАРУСЕЛЬ ===== */
.carousel-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plans-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 0 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.plans-carousel::-webkit-scrollbar {
    display: none;
}

.plan-card {
    background: rgba(255,255,255,0.9);
    border: 1.5px solid #e6e9ef;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(15,23,42,0.04);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: calc(100% - 20px);
    flex-shrink: 0;
}

.plan-card:hover {
    border-color: #4b5cff;
    box-shadow: 0 4px 10px rgba(75, 92, 255, 0.1);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.plan-price {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
}

.plan-features {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.feature-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.feature-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: lowercase;
    font-weight: 600;
}

.feature-value {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.plan-button {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(90deg, #4b5cff, #6097ff);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(75, 92, 255, 0.2);
}

.plan-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(75, 92, 255, 0.3);
}

.plan-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Точки навигации */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.carousel-dot.active {
    background: #4b5cff;
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background: #9ca3af;
}

.plans-loading {
    text-align: center;
    padding: 24px 16px;
    font-size: 13px;
    color: #6b7280;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    padding: 12px 14px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}
/* Удобный выбор последнего голоса на небольшом экране. */
.cs-dropdown {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-block: 12px;
  transition: none;
}
.cs-dropdown.open-above {
  top: auto;
  bottom: calc(100% + 8px);
}
.cs-options {
  padding-bottom: 12px;
}
.cs-options li {
  min-height: 48px;
  touch-action: pan-y;
}

/* Высота развёрнутого Telegram Mini App; прокручивается только содержимое. */
html, body {
  overflow: hidden;
  overscroll-behavior-y: none;
}
#root {
  height: var(--tg-viewport-stable-height, 100vh);
  height: var(--tg-viewport-stable-height, 100dvh);
}
.app {
  min-height: 0;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

/* В fullscreen содержимое не перекрывается вырезом экрана и кнопками Telegram. */
html.tg-fullscreen {
  --app-safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --app-safe-bottom: calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px));
  --app-safe-left: calc(var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px));
  --app-safe-right: calc(var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px));
}
.tg-fullscreen #root {
  padding-top: var(--app-safe-top);
  padding-left: var(--app-safe-left);
  padding-right: var(--app-safe-right);
}
.tg-fullscreen .app {
  padding-bottom: calc(100px + var(--app-safe-bottom));
}
.tg-fullscreen .bottom-nav {
  bottom: calc(15px + var(--app-safe-bottom));
  left: var(--app-safe-left);
  right: var(--app-safe-right);
}

/* В fullscreen верхняя панель Telegram прозрачна: возвращаем прежний фон. */
html.tg-fullscreen body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--app-safe-top, 0px);
  background: #0078d7;
  pointer-events: none;
  z-index: 1000;
}

/* Заголовок приложения в полноэкранной синей панели. */
.fullscreen-app-title { display: none; }
.tg-fullscreen .fullscreen-app-title {
  position: fixed;
  top: var(--tg-safe-area-inset-top, 0px);
  left: calc(80px + var(--app-safe-left, 0px));
  right: calc(80px + var(--app-safe-right, 0px));
  height: var(--tg-content-safe-area-inset-top, 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
  z-index: 1001;
}
.field-label,
.setting-row.language-field label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.setting-row.language-field {
  gap: 0;
  margin-top: 14px;
  margin-bottom: 16px;
}
.setting-row.language-field select {
  margin-top: 10px;
  padding: 12px 40px 12px 14px;
  border-width: 1px;
  border-color: #d1d5db;
  border-radius: 10px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 400;
}
.language-field + .upload-section input[type="text"] {
  margin-top: 0;
}


/* Бесплатные варианты под готовым аудио */
.variant-panel {
  width: 100%;
  box-sizing: border-box;
  margin-top: 18px;
  padding: 18px 16px;
  border: 1px solid rgba(43,110,246,0.13);
  border-radius: 16px;
  background: #f7f9ff;
  text-align: left;
}
.variant-panel[hidden] { display: none; }
.variant-header, .variant-seed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.variant-header { margin-bottom: 18px; }
.variant-title { font-size: 15px; font-weight: 600; color: #1e293b; }
.variant-counter {
  padding: 5px 9px;
  border-radius: 20px;
  background: #e8efff;
  color: #365fba;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.variant-seed-row label { font-size: 13px; color: #64748b; }
.variant-random {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #e8efff;
  color: #365fba;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}
.variant-panel .variant-slider { gap: 14px; margin: 10px 0 18px; min-height: 36px; }
.variant-panel .variant-slider input[type="range"] { flex: 1; min-width: 0; height: 28px; }
.variant-seed-value {
  flex: 0 0 48px;
  padding: 8px 0;
  border-radius: 9px;
  background: #fff;
  text-align: center;
  color: #365fba;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.variant-panel .variant-btn { margin: 0; box-shadow: none; }
.variant-hint { margin-top: 12px; font-size: 12px; line-height: 1.5; color: #64748b; }
.variant-panel button:disabled, .variant-panel input:disabled { opacity: 0.5; cursor: default; }
.variant-panel button:focus-visible, .variant-panel input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


/* Нижняя навигация вне прокручиваемой области: не перекрывает контент. */
#root { box-sizing: border-box; }
.app, .tg-fullscreen .app { padding-bottom: 20px; }
.bottom-nav, .tg-fullscreen .bottom-nav {
  position: relative;
  bottom: auto;
  left: auto;
  right: auto;
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  z-index: 30;
  padding: 8px 8px calc(8px + max(var(--app-safe-bottom, 0px), env(safe-area-inset-bottom, 0px)));
  border-radius: 20px 20px 0 0;
  border-top: 1px solid #e6ecf5;
  background: #fff;
  box-shadow: 0 -6px 24px rgba(31,55,91,0.07);
  pointer-events: auto;
}
.bottom-nav .nav-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.bottom-nav .nav-btn {
  width: 100%;
  height: auto;
  min-height: 58px;
  min-width: 0;
  padding: 8px 2px;
  gap: 5px;
  border-radius: 13px;
  color: #758298;
  background: transparent;
  box-shadow: none;
  transform: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav .nav-btn .material-symbols-outlined { font-size: 23px; line-height: 24px; }
.bottom-nav .nav-label { font-size: 10px; line-height: 14px; font-weight: 600; white-space: nowrap; }
.bottom-nav .nav-btn.active { color: #2765d8; background: #edf3ff; box-shadow: none; transform: none; }
.bottom-nav .nav-btn:focus-visible { outline: 2px solid #2765d8; outline-offset: -2px; }
@media (hover: hover) {
  .bottom-nav .nav-btn:hover { background: #f3f6fb; }
  .bottom-nav .nav-btn.active:hover { background: #e5eeff; }
}
@media (min-width: 370px) {
  .bottom-nav .nav-label { font-size: 11px; }
}


/* Образец каждого голоса в выпадающем списке. */
.voice-option-details { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.voice-option-name { overflow-wrap: anywhere; line-height: 1.4; }
.voice-option-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.voice-option-badges:empty { display: none; }
.voice-option-preview { flex: 0 0 44px; display: flex; align-items: center; justify-content: center; }
/* Визуальная кнопка 28 px, область нажатия 44 px. */
.voice-preview-player .play-btn {
  position: relative;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent !important;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.voice-preview-player .play-btn::before {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #edf2fa;
  border: 1px solid #e2e9f4;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.voice-preview-player .play-btn svg {
  position: relative;
  width: 14px;
  height: 14px;
  fill: #5275aa;
}
.voice-preview-player .play-btn:active::before { transform: scale(0.92); }
@media (hover: hover) {
  .voice-preview-player .play-btn:hover::before { background: #e1eafa; }
}
.voice-preview-player .play-btn[aria-busy="true"] { opacity: 0.55; }
.voice-preview-player .play-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


/* Карточки только в мобильном списке выбора голоса. */
.cs-options li {
  gap: 10px;
  min-height: 76px;
  margin: 0 0 8px;
  padding: 12px 10px 12px 14px;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  background: #fff;
  color: #24344c;
  box-shadow: 0 2px 5px rgba(30,50,80,0.025);
  -webkit-tap-highlight-color: transparent;
}
.cs-options li.selected {
  background: #f3f7ff;
  border-color: #b8cff7;
  box-shadow: inset 3px 0 0 #4b83e5;
  color: #24344c;
  font-weight: 400;
}
.cs-options .voice-option-details { gap: 8px; }
.cs-options .voice-option-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cs-options .voice-option-badges { gap: 5px; align-items: flex-start; }
.cs-options .voice-option-badges .voice-language-badge,
.cs-options .voice-option-badges .small-muted {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 3px 7px;
  border: 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.cs-options .voice-option-badges .voice-language-badge { color: #456d9e; background: #edf3fb; }
.cs-options .voice-option-badges .small-muted { color: #778294; background: #f2f4f7; }
.cs-options .voice-option-preview {
  flex: 0 0 51px;
  min-height: 44px;
  padding-left: 6px;
  border-left: 1px solid #e9eef5;
}
.cs-options li.selected .voice-option-preview { border-left-color: #dce7f8; }
.cs-options li:active { background: #f3f6fb; }
@media (hover: hover) {
  .cs-options li:hover { background: #f8faff; border-color: #cbdaf0; }
  .cs-options li.selected:hover { background: #edf4ff; }
}
@media (max-width: 360px) {
  .cs-options li { gap: 8px; padding-left: 11px; padding-right: 7px; }
  .cs-options .voice-option-name { font-size: 13px; }
}
