.lyrics-layout {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}
.lyrics-editor {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4);
  min-height: 420px;
}
.lyrics-result {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  font-family: Georgia, serif;
  overflow-y: auto;
}
.lyrics-result:empty::before {
  content: "Здесь появится текст песни. Опиши идею справа и нажми «Создать текст».";
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font);
}
.lyrics-form {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-5);
}
.lyrics-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
@media (max-width: 900px) {
  .lyrics-layout { grid-template-columns: 1fr; }
}

/* ====== МНОГО СТИЛЕЙ ====== */
.style-grid {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.style-chip {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.style-chip:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.style-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ====== ФОНОВОЕ ИЗОБРАЖЕНИЕ В РЕЗУЛЬТАТЕ ====== */
.lyrics-result {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.5s ease;
}

.lyrics-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(0px);
  transition: all 0.5s ease;
  pointer-events: none;
  opacity: 0;
}

.lyrics-result[data-has-text="true"]::before {
  opacity: 1;
  backdrop-filter: blur(8px);
}

.lyrics-result > * {
  position: relative;
  z-index: 1;
}

/* Плейсхолдер когда нет текста */
.lyrics-result:empty::after {
  content: 'Здесь появится сгенерированный текст песни...';
  display: block;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-style: italic;
}

/* ====== ДИНАМИЧЕСКИЕ ФОНЫ ====== */
.lyrics-result {
  transition: background 1s ease, backdrop-filter 0.5s ease;
}

.lyrics-result[data-has-text="true"] {
  background-blend-mode: overlay;
}

.lyrics-result[data-has-text="true"]::before {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  opacity: 1;
}

/* ====== СТИЛИ-ЧИПЫ В ФИРМЕННОМ ДИЗАЙНЕ (золото) ====== */
.lyrics-form .style-chip {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cfc8bb !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.lyrics-form .style-chip:hover {
  border-color: rgba(232, 196, 118, 0.55) !important;
  color: #f0d9a8 !important;
  background: rgba(232, 196, 118, 0.08) !important;
}

.lyrics-form .style-chip.active {
  background: linear-gradient(135deg, #f2d18b 0%, #d9ab52 100%) !important;
  border-color: transparent !important;
  color: #1a1408 !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(217, 171, 82, 0.35) !important;
  text-shadow: none !important;
}

/* ====== FIX ВИДИМОСТИ: текст ПОВЕРХ вуали, вуаль blur'ит только фон ====== */
.lyrics-text {
  position: relative;
  z-index: 2;
  white-space: pre-wrap;
}
.lyrics-result::before {
  z-index: 1 !important;
}

/* ====== СТРУКТУРА ПЕСНИ ====== */
.struct-block { margin-top: var(--space-4); }
.struct-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 0 6px;
}
.struct-chip {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: #cfc8bb;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.struct-chip:hover {
  border-color: rgba(232,196,118,0.55);
  color: #f0d9a8;
}
.struct-chip.active {
  background: linear-gradient(135deg, #f2d18b 0%, #d9ab52 100%);
  border-color: transparent;
  color: #1a1408;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(217,171,82,0.3);
}
.struct-caption {
  font-size: 12px;
  color: #9a917f;
  font-style: italic;
  min-height: 18px;
  margin-top: 4px;
}

/* ====== МОДАЛЬНОЕ ОКНО В ДИЗАЙНЕ SONARO ====== */
.sz-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.sz-modal-overlay.show { opacity: 1; }
.sz-modal {
  width: min(420px, calc(100vw - 32px));
  background: linear-gradient(160deg, #1c1509 0%, #14100a 100%);
  border: 1px solid rgba(232, 196, 118, 0.35);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7), 0 0 40px rgba(217, 171, 82, 0.08);
  transform: scale(0.9) translateY(10px);
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
  text-align: center;
}
.sz-modal-overlay.show .sz-modal { transform: scale(1) translateY(0); }
.sz-modal__icon {
  font-size: 28px;
  color: #e8c476;
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(232, 196, 118, 0.6);
}
.sz-modal__title {
  color: #f0d9a8;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.sz-modal__text {
  color: #cfc8bb;
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 22px;
}
.sz-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ====== БИБЛИОТЕКА ТЕКСТОВ ====== */
.lyrics-library {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}
.lyrics-library__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lyrics-library__title::before {
  content: '✦';
  color: var(--primary);
  font-size: 16px;
}
.lyrics-library__empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.lyrics-library__empty p {
  margin: 12px 0 0;
}

/* Элемент списка */
.lyrics-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.lyrics-item:hover {
  border-color: rgba(232, 196, 118, 0.3);
}
.lyrics-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.lyrics-item__title {
  font-weight: 600;
  color: var(--text);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.lyrics-item__arrow {
  color: var(--text-muted);
  transition: transform 0.3s ease;
  font-size: 12px;
}
.lyrics-item.expanded .lyrics-item__arrow {
  transform: rotate(90deg);
}
.lyrics-item__actions {
  display: flex;
  gap: 6px;
}
.lyrics-item__btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
}
.lyrics-item__btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(232, 196, 118, 0.08);
}
.lyrics-item__btn--delete:hover {
  border-color: #e74c3c;
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.08);
}

.lyrics-item__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-top: 0 solid var(--border);
}
.lyrics-item.expanded .lyrics-item__body {
  max-height: 600px;
  border-top-width: 1px;
}
.lyrics-item__content {
  padding: 18px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
  max-height: 400px;
  overflow-y: auto;
}
.lyrics-item__meta {
  padding: 10px 18px;
  background: rgba(0,0,0,0.02);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--border);
}

/* Модальное окно переименования */
.sz-input-field {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(232,196,118,0.3);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 14px;
  margin: 14px 0;
  outline: none;
  transition: border-color 0.2s;
}
.sz-input-field:focus {
  border-color: var(--primary);
}

/* ====== SVG-ИКОНКИ В СПИСКЕ ТЕКСТОВ ====== */
.lyrics-item__btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}
.lyrics-item__arrow {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}
.lyrics-item__doc {
  width: 16px;
  height: 16px;
  fill: #e8c476;
  opacity: 0.85;
  flex-shrink: 0;
}
.lyrics-item__title {
  gap: 10px;
}
.sz-modal__icon svg {
  width: 26px;
  height: 26px;
  fill: #e8c476;
  filter: drop-shadow(0 0 12px rgba(232, 196, 118, 0.6));
}

/* ====== МУЛЬТИ-ВЫБОР СТИЛЕЙ (до 3) ====== */
.style-counter {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #e8c476;
  background: rgba(232, 196, 118, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-style: normal;
}
.style-counter.maxed {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
}
.style-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
  opacity: 0.7;
}
.style-hint.warn {
  color: #ff6b6b;
  opacity: 1;
}

/* ====== ПУСТОЕ СОСТОЯНИЕ: премиум-иконка как на обложках ====== */
.lyrics-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  z-index: 2;
}
.lyrics-empty__badge {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 32% 26%, rgba(232,196,118,0.20), rgba(232,196,118,0.05) 58%, transparent 72%);
  border: 1px solid rgba(232,196,118,0.45);
  animation: badgePulse 3.2s ease-in-out infinite;
}
.lyrics-empty__badge::after {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(232,196,118,0.28);
  animation: badgeSpin 26s linear infinite;
}
.lyrics-empty__icon {
  width: 38px;
  height: 38px;
  fill: #e8c476;
  filter: drop-shadow(0 0 14px rgba(232,196,118,0.6));
}
.lyrics-empty__title {
  color: #f0d9a8;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.lyrics-empty__sub {
  color: #9a917f;
  font-size: 13px;
  max-width: 330px;
  line-height: 1.55;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 28px rgba(232,196,118,0.12), inset 0 0 20px rgba(232,196,118,0.06); }
  50%      { box-shadow: 0 0 55px rgba(232,196,118,0.28), inset 0 0 32px rgba(232,196,118,0.13); }
}
@keyframes badgeSpin { to { transform: rotate(360deg); } }

/* ====== ГЕНЕРАЦИЯ: карандаш пишет строки ====== */
.lyrics-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 2;
}
.lyrics-loading__scene {
  position: relative;
  width: 230px;
  height: 104px;
}
.lyrics-loading__lines { width: 100%; height: 100%; }
.ll {
  stroke: rgba(232,196,118,0.4);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}
.l1 { animation: dl1 4s linear infinite; }
.l2 { animation: dl2 4s linear infinite; }
.l3 { animation: dl3 4s linear infinite; }
.l4 { animation: dl4 4s linear infinite; }
@keyframes dl1 { 0%{stroke-dashoffset:200} 23%{stroke-dashoffset:0} 92%{stroke-dashoffset:0;opacity:1} 100%{stroke-dashoffset:0;opacity:0} }
@keyframes dl2 { 0%,25%{stroke-dashoffset:200} 48%{stroke-dashoffset:0} 92%{stroke-dashoffset:0;opacity:1} 100%{stroke-dashoffset:0;opacity:0} }
@keyframes dl3 { 0%,50%{stroke-dashoffset:200} 73%{stroke-dashoffset:0} 92%{stroke-dashoffset:0;opacity:1} 100%{stroke-dashoffset:0;opacity:0} }
@keyframes dl4 { 0%,75%{stroke-dashoffset:200} 94%{stroke-dashoffset:0} 96%{opacity:1} 100%{stroke-dashoffset:0;opacity:0} }
.lyrics-loading__pencil {
  position: absolute;
  width: 26px;
  height: 26px;
  fill: #e8c476;
  filter: drop-shadow(0 0 10px rgba(232,196,118,0.75));
  animation: pencilWrite 4s linear infinite;
}
@keyframes pencilWrite {
  0%    { left: 9%;  top: calc(22% - 24px); opacity: 1; }
  23%   { left: 79%; top: calc(22% - 24px); }
  25%   { left: 9%;  top: calc(44% - 24px); }
  48%   { left: 65%; top: calc(44% - 24px); }
  50%   { left: 9%;  top: calc(66% - 24px); }
  73%   { left: 74%; top: calc(66% - 24px); }
  75%   { left: 9%;  top: calc(88% - 24px); }
  94%   { left: 53%; top: calc(88% - 24px); }
  100%  { left: 53%; top: calc(88% - 24px); opacity: 0; }
}
.lyrics-loading__text {
  color: #f0d9a8;
  font-weight: 600;
  font-size: 15px;
}
.lyrics-loading__dots { display: flex; gap: 6px; margin-top: -10px; }
.lyrics-loading__dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #e8c476;
  animation: dotJump 1.2s ease-in-out infinite;
}
.lyrics-loading__dots span:nth-child(2) { animation-delay: 0.15s; }
.lyrics-loading__dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dotJump {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(-6px); opacity: 1; }
}

/* старый плейсхолдер больше не показывается */
.lyrics-result:empty::after { content: none !important; }
