/* ============================================================
   Kadriko — приложение: кабинет и студии. Светлая тёплая тема.
   ============================================================ */

body.app {
  background: radial-gradient(860px 480px at 92% -6%, #fde7d9 0%, transparent 64%),
    radial-gradient(720px 440px at -4% 18%, #eef4e9 0%, transparent 60%), var(--bg);
}

.app-root,
#app {
  min-height: 100vh;
}

/* ---------- заставка ---------- */
.boot-splash {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

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

.boot-bar {
  width: 180px;
  height: 4px;
  border-radius: 4px;
  background: var(--bg-soft);
  overflow: hidden;
}

.boot-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--grad);
  border-radius: 4px;
  animation: boot-slide 1.2s ease-in-out infinite;
}

@keyframes boot-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(340%);
  }
}

.view-loading {
  display: grid;
  place-items: center;
  padding: 100px 0;
}

/* ---------- каркас ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 60;
}

.side-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #ffe3d3, #ffd0bd);
  border: 1.5px solid #ffc4ad;
  color: #a83f2a;
  box-shadow: 0 6px 16px rgba(242, 107, 78, 0.16);
  flex: 0 0 auto;
}

.logo-mark svg {
  width: 23px;
  height: 23px;
}

.logo-word {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.logo-ai {
  margin-left: 5px;
  font-family: var(--font);
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  vertical-align: middle;
  background: var(--coral-soft);
  color: var(--coral-dark);
  border: 1px solid rgba(242, 107, 78, 0.22);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.side-nav-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-item:hover {
  background: var(--panel-3);
  color: var(--ink);
}

.nav-item.active {
  background: var(--coral-soft);
  border-color: #f6d2c4;
  color: var(--coral-dark);
  font-weight: 700;
}

.nav-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.nav-item.active .nav-icon {
  color: var(--coral);
}

.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.credits-card {
  padding: 15px;
  border-radius: var(--radius);
  border: 1.5px solid #f3dfb4;
  background: radial-gradient(240px 130px at 15% 0%, #fdf0d2 0%, transparent 72%), #fffaf0;
}

.credits-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mini-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--coral-dark);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
}

.mini-link:hover {
  text-decoration: underline;
}

.credits-value {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.credits-value b {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.credits-value span {
  font-size: 11.5px;
  color: var(--muted);
}

.credits-plan {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.credits-card.is-free {
  border-color: #f0d6a8;
  background: radial-gradient(240px 130px at 15% 0%, #fcebcf 0%, transparent 72%), #fffaf0;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(84, 60, 32, 0.04);
}

.side-user:hover {
  border-color: var(--line-strong);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffd9c8, #f8b79c);
  color: #8a3520;
  font-weight: 800;
  font-size: 12.5px;
  flex: 0 0 auto;
}

.side-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.side-user-info b {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-info i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  flex: 0 0 auto;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn:hover {
  background: var(--panel-3);
  color: var(--ink);
  border-color: var(--line);
}

.sidebar-scrim {
  display: none;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 30px;
  background: rgba(250, 246, 239, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-burger {
  display: none;
}

.crumb {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1.5px solid #f3dfb4;
  background: #fffaf0;
  color: #8a6420;
  font-size: 14px;
  font-weight: 700;
}

.credits-pill b {
  font-size: 14px;
}

.credits-pill:hover {
  background: #fdf2dc;
}

.plan-pill {
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
}

.plan-pill-paid {
  border-color: #cfe5d7;
  background: var(--green-soft);
  color: #3f7655;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffd9c8, #f8b79c);
  color: #8a3520;
  font-weight: 800;
  font-size: 13px;
}

.app-view {
  width: 100%;
  max-width: 1360px;
  padding: 28px 30px 60px;
  margin: 0 auto;
}

/* ---------- заголовок страницы ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.6vw, 33px);
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.page-sub {
  margin-top: 7px;
  font-size: 14px;
  color: var(--muted);
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.error-panel {
  padding: 30px;
}

.error-panel h3 {
  margin-bottom: 8px;
}

/* ---------- панели, дашборд ---------- */
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat-credits {
  border-color: #f3dfb4;
  background: radial-gradient(240px 140px at 100% 0%, #fdf0d2 0%, transparent 72%), #fffdf7;
}

.stat-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #3f7655;
  background: var(--green-soft);
  border: 1px solid #cfe5d7;
}

.stat-credits .stat-icon {
  color: #9c7324;
  background: var(--gold-soft);
  border-color: #f3dfb4;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 8px;
  line-height: 1;
  color: var(--ink);
}

.stat-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.dash-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gen-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gen-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.gen-row:hover {
  background: var(--bg-warm);
  border-color: var(--line);
}

.gen-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.gen-row-main b {
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gen-row-main i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

.gen-row-side {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  flex: 0 0 auto;
}

.gen-tool {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral-dark);
}

.quick-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quick-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-warm);
  color: var(--muted-2);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.quick-tool:hover {
  border-color: #f3c7b5;
  background: #fff6ef;
  transform: translateX(2px);
}

.quick-tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 26%, #fff);
  flex: 0 0 auto;
}

.quick-tool-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.quick-tool-text b {
  font-size: 13.5px;
  color: var(--ink);
}

.quick-tool-text i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 118px;
  padding-top: 6px;
}

.activity-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  height: 100%;
}

.activity-bar {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 6px;
  background: var(--bg-soft);
}

.activity-bar i {
  display: block;
  width: 100%;
  height: var(--h);
  border-radius: 6px;
  background: #e6dccd;
}

.activity-bar.has i {
  background: linear-gradient(180deg, #ffb08d, #f26b4e);
}

.activity-label {
  font-size: 10px;
  color: var(--muted-2);
  text-transform: capitalize;
}

.upgrade-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: var(--radius);
  border: 1.5px solid #f3dfb4;
  background: radial-gradient(300px 160px at 100% 0%, #fdf0d2 0%, transparent 72%), #fffdf6;
}

.upgrade-card h3 {
  font-size: 17px;
  margin: 10px 0 6px;
  color: var(--ink);
}

.upgrade-card p {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 14px;
  line-height: 1.55;
}

/* ---------- карточки генераций ---------- */
.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 16px;
}

.gen-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gen-card:hover {
  transform: translateY(-3px);
  border-color: #e8d5c4;
  box-shadow: var(--shadow-hover);
}

.gen-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-soft);
  overflow: hidden;
}

.gen-thumb {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.gen-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gen-card:hover .gen-thumb img {
  transform: scale(1.04);
}

.gen-thumb-sm {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid var(--line);
}

.gen-thumb-sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gen-thumb-music {
  position: relative;
  background: radial-gradient(200px 140px at 30% 20%, #fbe0e8 0%, transparent 72%),
    linear-gradient(150deg, #fdf1e8, #f6efe4);
  color: #b5546f;
  overflow: hidden;
}

.music-glyph {
  position: relative;
  z-index: 1;
}

.music-bars {
  position: absolute;
  inset: auto 12px 12px;
  height: 38%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  opacity: 0.7;
}

.music-bars i {
  flex: 1;
  height: var(--h);
  background: linear-gradient(180deg, #e88ca8, #f7c9b8);
  border-radius: 3px;
}

.gen-thumb-music.sm {
  width: 58px;
  height: 58px;
  border-radius: 12px;
}

.gen-media-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  z-index: 2;
}

.badge-dark {
  background: rgba(255, 253, 249, 0.9);
  border-color: rgba(84, 60, 32, 0.12);
  color: var(--text-dim);
  backdrop-filter: blur(6px);
}

.gen-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(84, 60, 32, 0.1);
  color: var(--coral-dark);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(84, 60, 32, 0.14);
}

.gen-card:hover .gen-play {
  opacity: 1;
  transform: none;
}

.gen-body {
  padding: 12px 14px 14px;
}

.gen-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  margin: 4px 0 6px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gen-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.chip.active {
  border-color: #f6c4b0;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-weight: 700;
}

.chip b {
  font-weight: 700;
  font-size: 13px;
}

.chip span {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}

.chip-count {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(242, 107, 78, 0.12);
}

.library-count {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- пустые состояния ---------- */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--coral-dark);
  background: var(--coral-soft);
  border: 1px solid #f6d3c5;
  margin-bottom: 4px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--ink);
}

.empty-state p {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 420px;
  line-height: 1.55;
}

.empty-state .btn {
  margin-top: 8px;
}

/* ---------- модалка просмотра ---------- */
.preview-media {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #211c17;
  border: 1px solid var(--line);
}

.preview-video {
  width: 100%;
  max-height: 62vh;
  background: #000;
}

.preview-photo-wrap {
  max-height: 62vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f4eee5;
}

.preview-photo {
  max-height: 62vh;
  width: auto;
  max-width: 100%;
}

.preview-music {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  flex-wrap: wrap;
  background: #fff8f1;
}

.preview-music-cover {
  width: 90px;
  height: 90px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #b5546f;
  background: radial-gradient(120px 90px at 30% 20%, #fbe0e8 0%, transparent 72%),
    linear-gradient(150deg, #fdf1e8, #f7e9dc);
  border: 1px solid #f2d5c8;
  flex: 0 0 auto;
}

.preview-music-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 200px;
}

.preview-music audio {
  width: 100%;
  margin-top: 6px;
}

.preview-placeholder {
  padding: 50px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-warm);
}

.preview-details {
  margin-top: 18px;
}

.preview-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--line);
}

.preview-params > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  background: var(--bg-warm);
  font-size: 12.5px;
}

.preview-params span {
  color: var(--muted);
}

.preview-params b {
  text-align: right;
  font-weight: 700;
  color: var(--ink);
}

.preview-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ---------- биллинг ---------- */
.billing-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.current-plan {
  background: radial-gradient(480px 240px at 100% 0%, #ffeadf 0%, transparent 72%), #fffdf9;
  border-color: #f6d8c8;
}

.current-plan-body {
  display: flex;
  gap: 28px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.current-plan-name {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.current-plan-price {
  font-size: 15px;
  color: var(--muted);
  margin: 3px 0 18px;
}

.current-plan-price span {
  font-size: 12.5px;
}

.current-plan-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.balance-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #f3dfb4;
  background: #fffaf0;
  min-width: 200px;
}

.balance-box span {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.balance-box b {
  font-family: var(--font-display);
  font-size: 29px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.packs-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack-mini {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'top top' 'price btn';
  align-items: center;
  gap: 6px 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-warm);
}

.pack-mini.highlighted {
  border-color: #c8e6d4;
  background: #f3faf5;
}

.pack-mini-top {
  grid-area: top;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.pack-mini-top b {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
}

.pack-mini-top span {
  font-size: 11.5px;
  color: var(--muted);
}

.pack-mini-top .badge {
  margin-left: auto;
}

.pack-mini-price {
  grid-area: price;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.pack-mini .btn {
  grid-area: btn;
  width: auto;
}

.plans-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.plan-mini {
  position: relative;
  padding: 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-mini.highlighted {
  border-color: #f6c4b0;
  background: radial-gradient(280px 150px at 50% 0%, #ffeadf 0%, transparent 74%), #fffdf9;
}

.plan-mini.current {
  border-color: #cfe5d7;
  background: #f7fcf8;
}

.plan-mini-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  white-space: nowrap;
}

.plan-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-mini-head h4 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.plan-mini-price {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 8px;
  color: var(--ink);
}

.plan-mini-price span {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.plan-mini-credits {
  font-size: 11.5px;
  color: var(--coral-dark);
  font-weight: 700;
  margin-bottom: 8px;
}

.plan-mini .plan-features {
  font-size: 12px;
  margin-bottom: 14px;
}

.plan-mini .btn {
  margin-top: auto;
}

.tx-table {
  display: flex;
  flex-direction: column;
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
}

.tx-row:first-child {
  border-top: none;
}

.tx-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.tx-in {
  color: #3f7655;
  background: var(--green-soft);
}

.tx-out {
  color: #9c7324;
  background: var(--gold-soft);
}

.tx-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.tx-main b {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.tx-main i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.tx-amount {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}

.tx-credits {
  font-size: 12.5px;
  font-weight: 700;
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
}

.plus {
  color: #3f7655 !important;
}

.minus {
  color: var(--muted);
}

.pricing-note {
  margin-top: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px dashed #c8e6d4;
  background: #f4fbf6;
}

.pricing-note p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
}

.billing-note {
  margin-top: 20px;
}

/* ---------- настройки ---------- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-form .btn {
  align-self: flex-start;
  margin-top: 4px;
}

.settings-plan {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.settings-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.settings-plan-row:first-child {
  border-top: none;
}

.settings-plan-row span {
  color: var(--muted);
}

.settings-plan-row b {
  color: var(--ink);
}

.settings-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--line);
}

.settings-facts > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-warm);
}

.settings-facts span {
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.settings-facts b {
  font-size: 12.5px;
  color: var(--ink);
}

/* ---------- авторизация ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 42px 52px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: radial-gradient(620px 420px at 18% 0%, #ffe1d1 0%, transparent 66%),
    radial-gradient(520px 420px at 92% 92%, #e8f1e4 0%, transparent 66%), #fff9f2;
}

.auth-visual-glow {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(120, 96, 70, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 70% 60% at 40% 30%, #000 20%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 40% 30%, #000 20%, transparent 72%);
  pointer-events: none;
  opacity: 0.65;
}

.auth-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-visual-copy {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: 26px;
  max-width: 520px;
}

.auth-visual-copy h2 {
  margin: 16px 0 18px;
  font-size: clamp(32px, 3.4vw, 47px);
  line-height: 1.08;
  color: var(--ink);
}

.auth-visual-copy p {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 420px;
}

.auth-features {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.auth-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.auth-features svg {
  color: var(--green);
  flex: 0 0 auto;
  margin-top: 3px;
}

.auth-mini-slides {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
}

.auth-mini-card {
  position: relative;
  width: 116px;
  height: 200px;
  border-radius: 18px;
  overflow: hidden;
  border: 7px solid #fffdf9;
  background-color: #f6efe4;
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 34px rgba(84, 60, 32, 0.14);
  animation: mini-float 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -1.5s);
}

.auth-mini-inner {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36, 31, 25, 0.04) 30%, rgba(36, 31, 25, 0.5) 100%),
    radial-gradient(circle at 30% 20%, rgba(242, 107, 78, 0.16), transparent 45%);
}

.auth-mini-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(84, 60, 32, 0.1);
  color: var(--text);
}

@keyframes mini-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-9px) rotate(1.5deg);
  }
}

.auth-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 24px;
  background: var(--bg);
}

.auth-form-card {
  width: min(430px, 100%);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  height: 40px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tab.active {
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-weight: 700;
}

.auth-title {
  font-size: 31px;
  margin-bottom: 8px;
  color: var(--ink);
}

.auth-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 26px;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-error {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #f2cfca;
  background: var(--red-soft);
  color: #a83a34;
  font-size: 13px;
}

.password-wrap {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.demo-login {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #f3c7b5;
  background: #fff6ef;
}

.demo-login-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--coral-dark);
  background: var(--coral-soft);
  border: 1px solid #f6d3c5;
  flex: 0 0 auto;
}

.demo-login > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.demo-login b {
  font-size: 13px;
  color: var(--ink);
}

.auth-legal {
  margin-top: 20px;
  line-height: 1.5;
}

.auth-link-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.auth-link-row a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--coral-dark);
}

.auth-link-row a:hover {
  text-decoration: underline;
}

.auth-note {
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #f3c7b5;
  background: #fff6ef;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

.auth-note b {
  color: var(--coral-dark);
}

.auth-code {
  margin-top: 7px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  word-break: break-all;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
}

.renew-box {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-warm);
}

.renew-info {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.renew-info > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.renew-info b {
  font-size: 12.5px;
  color: var(--ink);
}

.renew-info i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.renew-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex: 0 0 auto;
  background: var(--green);
}

.renew-dot.off {
  background: var(--muted-2);
}

.invoice-table {
  display: flex;
  flex-direction: column;
}

.invoice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.invoice-row:first-child {
  border-top: none;
}

.invoice-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #9c7324;
  background: var(--gold-soft);
}

.invoice-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.invoice-main b {
  font-size: 13px;
  color: var(--ink);
}

.invoice-main i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-credits {
  color: #3f7655;
  font-weight: 700;
  white-space: nowrap;
}

.invoice-amount {
  font-weight: 700;
  min-width: 86px;
  text-align: right;
  color: var(--ink);
  white-space: nowrap;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-top: 1px solid var(--line);
}

.session-row:first-child {
  border-top: none;
}

.session-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--coral-dark);
  background: var(--coral-soft);
  border: 1px solid #f6d3c5;
  flex: 0 0 auto;
}

.session-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.session-main b {
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.session-main i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.danger-zone {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #f0c9c3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.danger-zone b {
  font-size: 13px;
  color: #a83a34;
}

.danger-zone p {
  margin-top: 2px;
  max-width: 340px;
  line-height: 1.5;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.auth-back:hover {
  color: var(--ink);
}

/* ============================================================
   Студии
   ============================================================ */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}

.studio-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.studio-side {
  position: sticky;
  top: 94px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.studio-step {
  padding: 22px;
}

.studio-step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.studio-step-head > div {
  flex: 1;
  min-width: 0;
}

.studio-step-head h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}

.studio-step-head p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.studio-step-num {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  color: var(--coral-dark);
  background: var(--coral-soft);
  border: 1px solid #f6d3c5;
  flex: 0 0 auto;
  margin-top: 1px;
}

/* зона загрузки */
.dropzone {
  position: relative;
  border: 1.5px dashed #e2d3c1;
  border-radius: var(--radius);
  background: var(--bg-warm);
  transition: border-color 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--coral);
  background: #fff4ec;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 30px 18px;
  text-align: center;
}

.dropzone-inner b {
  font-size: 14px;
  color: var(--ink);
}

.dropzone-icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--coral-dark);
  background: var(--coral-soft);
  border: 1px solid #f6d3c5;
  margin-bottom: 4px;
}

.dropzone-sm .dropzone-inner {
  padding: 22px 16px;
}

.dropzone-sm .dropzone-icon {
  width: 44px;
  height: 44px;
}

/* фото */
.photo-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(94px, 1fr));
  gap: 10px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  cursor: grab;
}

.photo-item.dragging {
  opacity: 0.45;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.photo-item.uploading img {
  opacity: 0.4;
}

.photo-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 249, 0.5);
}

.photo-index {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 21px;
  height: 21px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(84, 60, 32, 0.12);
  font-size: 10.5px;
  font-weight: 800;
  padding: 0 5px;
  color: var(--text);
}

.photo-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(84, 60, 32, 0.12);
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.photo-item:hover .photo-remove {
  opacity: 1;
}

.photo-remove:hover {
  background: var(--red-soft);
  color: #a83a34;
}

.photo-add {
  aspect-ratio: 1;
  border-radius: 13px;
  border: 1.5px dashed #ddcdb9;
  background: var(--bg-warm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.photo-add:hover {
  border-color: var(--coral);
  color: var(--coral-dark);
  background: #fff4ec;
}

/* музыка */
.seg-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.seg-tab {
  height: 36px;
  padding: 0 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

.seg-tab:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.seg-tab.active {
  background: var(--coral-soft);
  border-color: #f6d2c4;
  color: var(--coral-dark);
  font-weight: 700;
}

.seg-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--coral-dark);
}

.seg-link:hover {
  text-decoration: underline;
}

.music-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow: auto;
  padding-right: 2px;
}

.music-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-align: left;
  width: 100%;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.music-row:hover {
  background: var(--bg-warm);
  border-color: var(--line);
}

.music-row.selected {
  background: #fff4ec;
  border-color: #f6c4b0;
}

.music-cover {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(150deg, #fbe4d6, #f6efe4);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
  border: 1px solid var(--line);
}

.music-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.music-info b {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-info i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.music-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.music-play:hover {
  color: var(--coral-dark);
  border-color: #f6c4b0;
}

.music-check {
  color: var(--green);
  opacity: 0;
  flex: 0 0 auto;
}

.music-row.selected .music-check {
  opacity: 1;
}

.music-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.music-empty p {
  max-width: 340px;
  line-height: 1.55;
}

.selected-upload {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid #f6c4b0;
  background: #fff6ef;
}

.selected-upload > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.selected-upload b {
  font-size: 13px;
  color: var(--ink);
}

.selected-upload i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

/* пресеты */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-warm);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.preset-card:hover {
  border-color: var(--line-strong);
}

.preset-card.active {
  border-color: #f2b69e;
  background: #fff4ec;
  box-shadow: 0 0 0 3px rgba(242, 107, 78, 0.08);
}

.preset-thumb {
  height: 44px;
  border-radius: 8px;
  display: block;
  border: 1px solid rgba(84, 60, 32, 0.12);
}

.preset-name {
  font-size: 12px;
  font-weight: 700;
  padding: 1px 2px 0;
  color: var(--ink);
}

.preset-desc {
  font-size: 9.5px;
  line-height: 1.3;
  color: var(--muted);
  padding: 0 2px 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.option-block {
  margin-top: 16px;
}

.option-block .label {
  display: block;
  margin-bottom: 9px;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-row .chip {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-height: 36px;
  padding: 6px 12px;
}

.switch-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  cursor: pointer;
  border-top: 1px solid var(--line);
}

.switch-row:first-child {
  border-top: none;
}

.switch-row > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.switch-row b {
  font-size: 13px;
  color: var(--ink);
}

.switch-row i {
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e7dccd;
  border: 1px solid #d9ccba;
  flex: 0 0 auto;
  transition: background 0.18s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(84, 60, 32, 0.25);
  transition: transform 0.18s ease;
}

.switch-row input:checked + .switch {
  background: var(--coral);
  border-color: var(--coral);
}

.switch-row input:checked + .switch::after {
  transform: translateX(18px);
}

/* диапазон */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: #eadfd1;
  outline: none;
  margin: 10px 0 6px;
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(242, 107, 78, 0.4);
}

.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid #fff;
}

.range-sm {
  height: 5px;
}

/* превью */
.preview-panel {
  padding: 16px;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--coral);
}

.phone-preview-wrap {
  display: flex;
  justify-content: center;
}

.phone-preview {
  position: relative;
  width: min(100%, 292px);
  border-radius: 30px;
  overflow: hidden;
  border: 8px solid #2b251f;
  background: var(--bg-soft);
  aspect-ratio: 9 / 16;
  box-shadow: 0 24px 50px rgba(84, 60, 32, 0.2);
}

.phone-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  background: radial-gradient(300px 200px at 50% 40%, #fff3ea 0%, #f8f1e6 70%);
}

.preview-empty b {
  font-size: 14px;
  color: var(--text-dim);
}

.preview-empty span {
  font-size: 11.5px;
  color: var(--muted-2);
}

.preview-empty svg {
  color: var(--coral);
  opacity: 0.85;
  margin-bottom: 4px;
}

.preview-meta {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.preview-meta > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.preview-meta span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--muted-2);
}

.preview-meta b {
  font-size: 12px;
  color: var(--ink);
}

/* генерация */
.generate-panel {
  padding: 18px;
}

.generate-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.generate-cost {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.generate-cost b {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.generate-cost span {
  font-size: 12px;
  color: var(--muted);
}

.generate-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.generate-balance b {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.generate-note {
  margin-top: 10px;
  text-align: center;
  line-height: 1.5;
}

/* прогресс */
.progress-bar {
  height: 7px;
  border-radius: 7px;
  background: var(--bg-soft);
  overflow: hidden;
  margin: 12px 0;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 7px;
  background: var(--grad);
  transition: width 0.25s ease;
}

.render-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--ink);
}

.render-stages {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 12px 0;
}

.render-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.render-stage.done {
  color: var(--text-dim);
}

.render-stage.active {
  color: var(--ink);
}

.render-stage-icon {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  flex: 0 0 auto;
  background: var(--surface);
}

.render-stage.done .render-stage-icon {
  color: #3f7655;
  background: var(--green-soft);
  border-color: #cfe5d7;
}

.render-stage.active .render-stage-icon {
  border-color: #f2b69e;
  background: #fff1e9;
}

.progress-error {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--red);
}

.progress-error b {
  color: var(--ink);
  font-size: 13.5px;
}

/* результат */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.result-video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 440px;
  margin-inline: auto;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid var(--line);
}

.result-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 440px;
  margin-inline: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-warm);
  border: 1px solid var(--line);
}

.result-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 8px;
  flex-wrap: wrap;
}

/* ============================================================
   AI-фото
   ============================================================ */
.photo-source {
  display: flex;
  align-items: center;
  gap: 14px;
}

.photo-source img {
  width: 86px;
  height: 86px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

.photo-source-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.photo-source-meta b {
  font-size: 13px;
  color: var(--ink);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.style-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg-warm);
  text-align: left;
}

.style-card:hover {
  border-color: var(--line-strong);
}

.style-card.active {
  border-color: #f2b69e;
  background: #fff4ec;
  box-shadow: 0 0 0 3px rgba(242, 107, 78, 0.08);
}

.style-thumb {
  position: relative;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  display: block;
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
}

.style-color {
  position: absolute;
  inset: 0;
  mix-blend-mode: overlay;
}

.style-name {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 1px 0;
  color: var(--ink);
}

.style-desc {
  font-size: 8.5px;
  line-height: 1.25;
  color: var(--muted);
  padding: 0 1px 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.compare-wrap {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f4eee5;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
}

.compare-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.compare-empty b {
  font-size: 14px;
  color: var(--text-dim);
}

.compare-empty span {
  font-size: 11.5px;
  color: var(--muted-2);
}

.compare-empty svg {
  color: var(--coral);
  opacity: 0.8;
  margin-bottom: 4px;
}

.compare-stage {
  position: absolute;
  inset: 0;
}

.compare-before,
.compare-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f4eee5;
}

.compare-after-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 52%);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 52%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 12px rgba(84, 60, 32, 0.35);
  z-index: 3;
  pointer-events: none;
}

.compare-handle span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fffdf9;
  border: 1px solid var(--line-strong);
  color: var(--coral-dark);
  box-shadow: 0 4px 12px rgba(84, 60, 32, 0.2);
}

.compare-tag {
  position: absolute;
  top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(84, 60, 32, 0.12);
  color: var(--text);
  z-index: 4;
}

.compare-tag-before {
  left: 10px;
}

.compare-tag-after {
  right: 10px;
  color: var(--coral-dark);
  border-color: #f6c4b0;
}

/* ============================================================
   AI-музыка
   ============================================================ */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.genre-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--bg-warm);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.genre-card:hover {
  border-color: var(--line-strong);
}

.genre-card.active {
  border-color: color-mix(in srgb, var(--c) 55%, #fff);
  background: color-mix(in srgb, var(--c) 9%, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 12%, transparent);
}

.genre-emoji {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 24%, #fff);
  margin-bottom: 6px;
}

.genre-card b {
  font-size: 12.5px;
  color: var(--ink);
}

.genre-card span {
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--muted);
}

.genre-card i {
  font-style: normal;
  font-size: 10px;
  color: var(--c);
  font-weight: 800;
  margin-top: 6px;
}

.how-mini {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.how-mini-item {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--coral);
}

.how-mini-item div {
  display: flex;
  flex-direction: column;
}

.how-mini-item b {
  font-size: 12.5px;
  color: var(--ink);
}

.how-mini-item span {
  font-size: 11px;
  color: var(--muted);
}

.music-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
}

.music-player-cover {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: #b5546f;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #fbe4d6, #f6efe4);
}

.music-cover-glow {
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 120deg, rgba(242, 107, 78, 0.24), rgba(127, 182, 217, 0.24), rgba(161, 132, 214, 0.22), rgba(242, 107, 78, 0.24));
  filter: blur(22px);
  animation: cover-spin 9s linear infinite;
}

@keyframes cover-spin {
  to {
    transform: rotate(360deg);
  }
}

.music-player-cover svg {
  position: relative;
  z-index: 1;
}

.music-player-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  margin-top: 8px;
  text-align: center;
  color: var(--ink);
}

.music-player-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: -4px;
}

.waveform {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin: 8px 0 2px;
}

.waveform i {
  flex: 1;
  height: var(--h);
  min-height: 3px;
  border-radius: 3px;
  background: #e7dccd;
  transition: background 0.12s ease;
}

.waveform i.played {
  background: linear-gradient(180deg, #ffb08d, #f26b4e);
}

.waveform-lg {
  height: 62px;
  margin-bottom: 12px;
}

.music-player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
}

.play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(242, 107, 78, 0.3);
}

.play-btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 240px;
  color: var(--muted-2);
}

.volume-row .range {
  margin: 0;
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 1200px) {
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

  .plans-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 278px;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 24px 0 60px rgba(84, 60, 32, 0.18);
    z-index: 90;
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(60, 46, 30, 0.28);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 80;
  }

  .sidebar-scrim.open {
    opacity: 1;
    pointer-events: auto;
  }

  .app-burger {
    display: grid;
  }

  .studio-layout {
    grid-template-columns: 1fr;
  }

  .studio-side {
    position: static;
  }

  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-view {
    padding: 20px 16px 50px;
  }

  .app-topbar {
    padding: 12px 16px;
  }

  .plan-pill {
    display: none;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .genre-grid {
    grid-template-columns: 1fr 1fr;
  }

  .style-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .preset-grid {
    grid-template-columns: 1fr 1fr;
  }

  .plans-row {
    grid-template-columns: 1fr;
  }

  .preview-params {
    grid-template-columns: 1fr;
  }

  .gen-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-head {
    align-items: flex-start;
  }

  .settings-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .gen-grid {
    grid-template-columns: 1fr;
  }

  .style-grid {
    grid-template-columns: 1fr 1fr;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .chips {
    gap: 5px;
  }

  .chip {
    font-size: 12px;
  }
}
