/*
 * ORVEXIS — интерфейс по мотивам Apple Human Interface Guidelines.
 * Слои: контент — непрозрачные поверхности; функциональный слой (боковая
 * панель, таб-бар, панели действий) — материал с размытием.
 * Цвета заданы по ролям и имеют светлый и тёмный вариант. Контраст текста
 * не ниже 4.5:1 (значения рассчитаны, см. docs/DESIGN.md).
 */

:root {
  color-scheme: light dark;

  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --surface-3: #e5e5ea;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #8e8e93;
  --separator: rgba(60, 60, 67, 0.16);
  --separator-strong: rgba(60, 60, 67, 0.29);

  --accent: #6236e0;
  --accent-fill: #6236e0;
  --accent-soft: rgba(98, 54, 224, 0.1);
  --on-accent: #ffffff;

  --green: #1e7f3a;
  --green-soft: rgba(30, 127, 58, 0.12);
  --orange: #a35200;
  --orange-soft: rgba(163, 82, 0, 0.12);
  --red: #d70015;
  --red-soft: rgba(215, 0, 21, 0.1);
  --teal: #0b7285;
  --teal-soft: rgba(11, 114, 133, 0.11);

  --glass: rgba(250, 250, 252, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.16);
  --focus: 0 0 0 4px rgba(98, 54, 224, 0.28);

  --chart-bar: #6236e0;
  --chart-grid: #e5e5ea;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --sidebar-w: 264px;
  --content-max: 1080px;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #8e8e93;
    --separator: rgba(84, 84, 88, 0.6);
    --separator-strong: rgba(120, 120, 128, 0.6);

    --accent: #a98bff;
    --accent-fill: #7650f5;
    --accent-soft: rgba(169, 139, 255, 0.16);

    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.16);
    --red: #ff6961;
    --red-soft: rgba(255, 105, 97, 0.16);
    --teal: #5ac8e0;
    --teal-soft: rgba(90, 200, 224, 0.16);

    --glass: rgba(28, 28, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.6);
    --focus: 0 0 0 4px rgba(169, 139, 255, 0.35);

    --chart-bar: #a98bff;
    --chart-grid: #3a3a3c;
  }
}

/* Тема, выбранная для подкаста: перекрывает системную */
:root[data-theme="dark"] {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --surface-3: #3a3a3c;
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #8e8e93;
    --separator: rgba(84, 84, 88, 0.6);
    --separator-strong: rgba(120, 120, 128, 0.6);

    --accent: #a98bff;
    --accent-fill: #7650f5;
    --accent-soft: rgba(169, 139, 255, 0.16);

    --green: #30d158;
    --green-soft: rgba(48, 209, 88, 0.16);
    --orange: #ff9f0a;
    --orange-soft: rgba(255, 159, 10, 0.16);
    --red: #ff6961;
    --red-soft: rgba(255, 105, 97, 0.16);
    --teal: #5ac8e0;
    --teal-soft: rgba(90, 200, 224, 0.16);

    --glass: rgba(28, 28, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 10px 40px rgba(0, 0, 0, 0.6);
    --focus: 0 0 0 4px rgba(169, 139, 255, 0.35);

    --chart-bar: #a98bff;
    --chart-grid: #3a3a3c;}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-contrast: more) {
  :root {
    --label-2: #3a3a3c;
    --separator: rgba(60, 60, 67, 0.45);
    --glass: var(--surface);
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --label-2: #d1d1d6; --separator: rgba(200, 200, 205, 0.5); }
}

/* ---------- основа ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 400 15px/1.47 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.022em; }
p { margin: 0 0 12px; }
code, pre, kbd { font-family: var(--font-mono); font-size: 13px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--accent-soft); }

.muted { color: var(--label-2); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; }
.skip-link:focus { left: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); }

/* ---------- оболочка панели управления ---------- */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 20px 12px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  backdrop-filter: blur(30px) saturate(1.4);
  border-right: 1px solid var(--separator);
  display: flex; flex-direction: column; gap: 4px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 16px; color: var(--label); font-weight: 600; font-size: 17px; letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--label-2); letter-spacing: 0; }

.nav-section { margin-top: 14px; padding: 0 10px 4px; font-size: 12px; font-weight: 600; color: var(--label-2); }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  min-height: 34px; padding: 6px 10px; border-radius: var(--r-sm);
  color: var(--label); font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: var(--surface-3); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link .thumb { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; flex: none; background: var(--surface-3); }
.nav-link .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--separator); display: flex; flex-direction: column; gap: 2px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent);
}

.main { min-width: 0; padding: 28px 40px 80px; }
.page { max-width: var(--content-max); margin: 0 auto; }

/* Мобильная раскладка: панель превращается в таб-бар внизу экрана. */
.tabbar { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    padding: 6px; border-radius: 28px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(30px) saturate(1.4);
    backdrop-filter: blur(30px) saturate(1.4);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-pop);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 48px; border-radius: 22px; color: var(--label-2); font-size: 11px; font-weight: 500;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
  .tabbar svg { width: 22px; height: 22px; }
  .mobile-brand { display: flex !important; }
}
.mobile-brand { display: none; align-items: center; justify-content: space-between; margin-bottom: 12px; }

@media (prefers-reduced-transparency: reduce) {
  .sidebar, .tabbar, .toolbar-sticky { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- заголовки страниц ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 34px; line-height: 1.12; font-weight: 700; }
.page-head .subtitle { margin-top: 4px; color: var(--label-2); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { display: block; font-size: 13px; font-weight: 600; color: var(--label-2); margin-bottom: 4px; }
.eyebrow a { color: inherit; }
.section-title { font-size: 20px; font-weight: 600; margin: 32px 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-title .link { font-size: 15px; font-weight: 400; }

/* Шапка подкаста с обложкой */
.show-head { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
.show-head .cover { width: 96px; height: 96px; border-radius: var(--r-md); }
.show-head h1 { font-size: 28px; font-weight: 700; line-height: 1.15; }
.show-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .show-head { flex-wrap: wrap; }
  .show-head .cover { width: 72px; height: 72px; }
  .show-head .actions { margin-left: 0; width: 100%; }
}

/* ---------- обложки ---------- */

.cover {
  aspect-ratio: 1; object-fit: cover; background: var(--surface-3);
  border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--separator);
}
.cover-placeholder {
  aspect-ratio: 1; border-radius: var(--r-md); display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-soft), var(--surface-3)); color: var(--accent);
}
.cover-placeholder svg { width: 40%; height: 40%; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 16px; border-radius: 999px;
  border: 0; cursor: pointer; font: 500 15px/1.2 var(--font); letter-spacing: -0.01em;
  background: var(--surface-2); color: var(--accent);
  transition: background-color 0.15s var(--ease), transform 0.1s var(--ease), opacity 0.15s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; background: var(--surface-3); }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn.is-busy { opacity: 0.5; cursor: default; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-fill); filter: brightness(1.08); }
.btn-danger { color: var(--red); }
.btn-danger-fill { background: var(--red); color: #fff; }
.btn-danger-fill:hover { background: var(--red); filter: brightness(1.08); }
.btn-plain { background: transparent; padding-left: 8px; padding-right: 8px; }
.btn-plain:hover { background: var(--accent-soft); }
.btn-lg { min-height: 48px; padding: 12px 24px; font-size: 17px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm { min-height: 30px; padding: 5px 12px; font-size: 13px; }

/* ---------- сегментированный контроль и вкладки ---------- */

.segmented {
  display: inline-flex; padding: 2px; gap: 2px; border-radius: 10px; background: var(--surface-3);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a, .segmented button {
  min-height: 30px; padding: 5px 14px; border-radius: 8px; border: 0; background: transparent;
  color: var(--label); font: 500 13px/1.4 var(--font); white-space: nowrap; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.segmented a:hover { text-decoration: none; background: rgba(127, 127, 127, 0.08); }
.segmented [aria-current="page"], .segmented [aria-selected="true"] {
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}
@media (prefers-color-scheme: dark) { .segmented [aria-current="page"], .segmented [aria-selected="true"] { background: #636366; } }
.segmented .count { color: var(--label-2); font-variant-numeric: tabular-nums; }
.tabs-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- сгруппированные списки и карточки ---------- */

.card {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.card .card-sub { color: var(--label-2); font-size: 13px; margin-bottom: 16px; }

.group { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.group + .group, .group-label + .group { margin-top: 0; }
.group-label { font-size: 13px; color: var(--label-2); padding: 0 16px 6px; margin-top: 28px; text-transform: none; font-weight: 500; }
.group-label:first-child { margin-top: 0; }
.group-footer { font-size: 13px; color: var(--label-2); padding: 8px 16px 0; }

.row {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 10px 16px;
  position: relative; color: var(--label);
}
.row + .row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--separator);
}
.row.has-thumb + .row.has-thumb::before { left: 76px; }
a.row:hover { background: var(--surface-2); text-decoration: none; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--label-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row .thumb { width: 44px; height: 44px; border-radius: var(--r-sm); flex: none; }
.row .end { display: flex; align-items: center; gap: 10px; color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.chevron { width: 8px; height: 13px; color: var(--label-3); flex: none; }
.dot-sep::before { content: "·"; margin-right: 6px; }

/* ---------- статусы (цвет + текст + значок) ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
  background: var(--surface-2); color: var(--label-2);
}
.badge svg { width: 12px; height: 12px; }
.badge-published { background: var(--green-soft); color: var(--green); }
.badge-scheduled { background: var(--orange-soft); color: var(--orange); }
.badge-draft { background: var(--surface-2); color: var(--label-2); }
.badge-error { background: var(--red-soft); color: var(--red); }
.badge-admin { background: var(--accent-soft); color: var(--accent); }
.badge-trailer { background: var(--accent-soft); color: var(--accent); }
.badge-bonus { background: var(--teal-soft); color: var(--teal); }

/* ---------- уведомления в интерфейсе ---------- */

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md);
  margin-bottom: 16px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px;
}
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner-success svg { color: var(--green); }
.banner-error { background: var(--red-soft); box-shadow: none; }
.banner-error svg { color: var(--red); }
.banner-warning svg { color: var(--orange); }
.banner-info svg { color: var(--accent); }
.banner .banner-body { flex: 1; }
.banner .banner-close { margin: -4px -8px -4px 0; }
.flash-stack { position: relative; }

/* ---------- формы ---------- */

.form-grid { display: grid; gap: 0; }
.field { padding: 12px 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--separator); }
.field label, .field .label { display: block; font-size: 13px; font-weight: 500; color: var(--label-2); margin-bottom: 6px; }
.field .hint { font-size: 13px; color: var(--label-2); margin-top: 6px; }
.field .error { font-size: 13px; color: var(--red); margin-top: 6px; font-weight: 500; }
.field.is-invalid input, .field.is-invalid textarea, .field.is-invalid select { box-shadow: inset 0 0 0 1.5px var(--red); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field-row > .field + .field::before { display: none; }
.field-row { position: relative; }
.field + .field-row::before, .field-row + .field::before, .field-row + .field-row::before, .field-row + .switch-row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--separator);
}
@media (min-width: 641px) {
  .field-row > .field + .field { border-left: 1px solid var(--separator); }
}

input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"],
input[type="datetime-local"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 10px;
  background: var(--surface-2); color: var(--label); font: 400 15px/1.4 var(--font);
  transition: box-shadow 0.15s var(--ease);
  appearance: none; -webkit-appearance: none;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
select {
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--label-3); }
input[type="file"] { font: inherit; font-size: 14px; color: var(--label-2); max-width: 100%; }
input[type="file"]::file-selector-button {
  font: 500 14px var(--font); border: 0; border-radius: 999px; padding: 7px 14px; margin-right: 10px;
  background: var(--surface-2); color: var(--accent); cursor: pointer;
}

/* Переключатель в стиле iOS: checkbox с role="switch". */
.switch-row { display: flex; align-items: center; gap: 16px; padding: 12px 16px; position: relative; cursor: pointer; min-height: 52px; }
.switch-row + .switch-row::before, .field + .switch-row::before, .switch-row + .field::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--separator);
}
.switch-row .grow { flex: 1; }
.switch-row .title { font-weight: 500; }
.switch-row .hint { font-size: 13px; color: var(--label-2); margin-top: 2px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; cursor: pointer;
  width: 51px; height: 31px; border-radius: 999px; background: var(--surface-3); margin: 0;
  transition: background-color 0.2s var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s var(--ease);
}
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { box-shadow: var(--focus); }

/* Выбор из нескольких вариантов карточками */
.choice-list { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-2); cursor: pointer; border: 1.5px solid transparent;
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.choice .title { font-weight: 500; }
.choice .hint { font-size: 13px; color: var(--label-2); }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap;
  margin-top: 24px;
}
.toolbar-sticky {
  position: sticky; bottom: 16px; z-index: 20; padding: 10px; border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-pop);
}
@media (max-width: 860px) { .toolbar-sticky { bottom: calc(88px + env(safe-area-inset-bottom)); } }
.form-actions .spacer { flex: 1; }

details.disclosure > summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 500; display: flex; align-items: center; gap: 8px;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after {
  content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--label-3); border-bottom: 2px solid var(--label-3);
  transform: rotate(-45deg); transition: transform 0.2s var(--ease);
}
details.disclosure[open] > summary::after { transform: rotate(45deg); }
details.disclosure > .disclosure-body { border-top: 1px solid var(--separator); }

/* Две колонки: основная форма и боковая панель */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.split > aside { position: sticky; top: 24px; display: grid; gap: 16px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .split > aside { position: static; } }

/* ---------- загрузка аудио ---------- */

.dropzone {
  border: 1.5px dashed var(--separator-strong); border-radius: var(--r-lg); padding: 28px 20px; text-align: center;
  background: var(--surface-2); transition: border-color 0.15s, background-color 0.15s; cursor: pointer; display: block;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 36px; height: 36px; color: var(--accent); margin: 0 auto 8px; }
.dropzone .title { font-weight: 600; font-size: 16px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-file { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); }
.upload-file .icon { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.upload-file .icon svg { width: 22px; height: 22px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent-fill); border-radius: inherit; transition: width 0.2s linear; }
audio { width: 100%; height: 40px; margin-top: 10px; }

/* ---------- статистика ---------- */

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .stat-label { font-size: 13px; color: var(--label-2); font-weight: 500; }
.stat .stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .stat-delta { font-size: 13px; margin-top: 2px; color: var(--label-2); }
.stat .delta-up { color: var(--green); font-weight: 600; }
.stat .delta-down { color: var(--red); font-weight: 600; }
.stat.hero .stat-value { font-size: 48px; line-height: 1.05; }
.stat.hero { grid-column: span 2; }
@media (max-width: 640px) { .stat.hero { grid-column: auto; } .stat.hero .stat-value { font-size: 40px; } }

.chart-card { margin-top: 16px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-wrap { position: relative; }
.chart-wrap { overflow-x: auto; }
.chart-svg { width: 100%; min-width: 560px; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: var(--chart-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-baseline { stroke: var(--separator-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { fill: var(--label-2); font-size: 11px; font-family: var(--font); }
.chart-bar { fill: var(--chart-bar); }
.chart-hit { fill: transparent; }
.chart-col { cursor: default; outline: none; }
.chart-col:hover .chart-hit, .chart-col:focus .chart-hit { fill: var(--accent-soft); }
.chart-tip {
  position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 10px));
  padding: 6px 10px; border-radius: var(--r-sm); background: var(--label); color: var(--surface);
  font-size: 12px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow-pop); z-index: 5;
}
.chart-empty { height: 220px; display: grid; place-items: center; color: var(--label-2); text-align: center; }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hbar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-track { height: 8px; border-radius: 999px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; background: var(--chart-bar); min-width: 2px; }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--label-2); padding: 10px 16px; border-bottom: 1px solid var(--separator); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--separator); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* ---------- фид ---------- */

.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field input { font-family: var(--font-mono); font-size: 13px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; gap: 12px; padding: 12px 16px; position: relative; }
.checklist li + li::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 1px; background: var(--separator); }
.checklist .ic { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.checklist .ok .ic { color: var(--green); }
.checklist .warning .ic { color: var(--orange); }
.checklist .error .ic { color: var(--red); }
.checklist .hint { font-size: 13px; color: var(--label-2); }
pre.code {
  margin: 0; padding: 16px; max-height: 520px; overflow: auto; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--label); white-space: pre; line-height: 1.55; tab-size: 2;
}
.directory-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.directory { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--label); }
.directory:hover { text-decoration: none; background: var(--surface-3); }
.directory .title { font-weight: 500; }
.directory .hint { font-size: 12px; color: var(--label-2); }

/* ---------- пустые состояния ---------- */

.empty { text-align: center; padding: 48px 24px; }
.empty svg { width: 56px; height: 56px; color: var(--label-3); margin: 0 auto 12px; }
.empty h2 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.empty p { color: var(--label-2); max-width: 420px; margin: 0 auto 18px; }

/* ---------- сетка подкастов ---------- */

.podcast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px 20px; }
.podcast-tile { color: var(--label); display: block; }
.podcast-tile:hover { text-decoration: none; }
.podcast-tile .cover, .podcast-tile .cover-placeholder { width: 100%; transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.podcast-tile:hover .cover, .podcast-tile:hover .cover-placeholder { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.podcast-tile .title { font-weight: 600; margin-top: 10px; line-height: 1.3; }
.podcast-tile .meta { font-size: 13px; color: var(--label-2); margin-top: 2px; }

/* ---------- модальное подтверждение ---------- */

dialog {
  border: 0; padding: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--label);
  width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
dialog .dialog-body { padding: 24px 24px 8px; text-align: center; }
dialog h2 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
dialog p { color: var(--label-2); font-size: 14px; }
dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 16px; }

/* ---------- мастер установки и вход ---------- */

.setup {
  min-height: 100vh; display: grid; grid-template-columns: 300px minmax(0, 1fr);
  background: var(--bg);
}
.setup-aside {
  padding: 40px 28px; border-right: 1px solid var(--separator);
  background: var(--glass); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh;
}
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: step; }
.setup-steps li {
  display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--label-2); font-size: 14px; font-weight: 500; counter-increment: step;
}
.setup-steps li::before {
  content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--label-2); flex: none;
}
.setup-steps li.is-done::before { content: "✓"; background: var(--green-soft); color: var(--green); }
.setup-steps li.is-current { background: var(--accent-soft); color: var(--accent); }
.setup-steps li.is-current::before { background: var(--accent-fill); color: var(--on-accent); }
.setup-credit { margin-top: auto; font-size: 12px; color: var(--label-2); }
.setup-main { padding: 56px 40px 80px; display: flex; justify-content: center; }
.setup-panel { width: 100%; max-width: 640px; }
.setup-panel h1 { font-size: 34px; font-weight: 700; line-height: 1.12; margin-bottom: 8px; }
.setup-panel .lead { font-size: 17px; color: var(--label-2); margin-bottom: 28px; }
.setup-progress { display: none; font-size: 13px; font-weight: 600; color: var(--label-2); margin-bottom: 8px; }
@media (max-width: 860px) {
  .setup { grid-template-columns: 1fr; }
  .setup-aside { position: static; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--separator); flex-direction: row; align-items: center; }
  .setup-steps, .setup-credit { display: none; }
  .setup-main { padding: 24px 16px 64px; }
  .setup-progress { display: block; }
  .setup-panel h1 { font-size: 28px; }
}

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { justify-content: center; padding: 0 0 24px; font-size: 22px; }
.auth-card .brand-mark { width: 44px; height: 44px; }
.auth-card h1 { font-size: 28px; text-align: center; margin-bottom: 24px; }

.hero-icon {
  width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 20px;
  background: linear-gradient(145deg, #7a4dff, #4a1fc4); color: #fff; box-shadow: 0 10px 30px rgba(98, 54, 224, 0.35);
}
.hero-icon svg { width: 40px; height: 40px; }
.hero-icon.success { background: linear-gradient(145deg, #34c759, #1e7f3a); box-shadow: 0 10px 30px rgba(30, 127, 58, 0.3); }

/* ---------- публичные страницы ---------- */

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--separator);
}
.site-header .inner { max-width: 980px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; justify-content: space-between; }
.site-header .brand { padding: 0; font-size: 16px; }
.site-header .brand-mark { width: 26px; height: 26px; }
.site { max-width: 980px; margin: 0 auto; padding: 32px 16px 64px; }
.site-footer { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; color: var(--label-2); font-size: 13px; border-top: 1px solid var(--separator); }

.show-hero { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; margin-bottom: 40px; }
.show-hero .cover, .show-hero .cover-placeholder { width: 100%; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.show-hero h1 { font-size: 40px; font-weight: 700; line-height: 1.08; margin-bottom: 6px; }
.show-hero .author { font-size: 20px; color: var(--accent); margin-bottom: 14px; }
.show-hero .description { color: var(--label); max-width: 60ch; }
.show-hero .description p { margin-bottom: 10px; }
.subscribe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 720px) {
  .show-hero { grid-template-columns: 1fr; gap: 20px; }
  .show-hero .cover, .show-hero .cover-placeholder { max-width: 240px; }
  .show-hero h1 { font-size: 30px; }
}

.episode-list { list-style: none; margin: 0; padding: 0; }
.episode-item { padding: 18px 0; border-top: 1px solid var(--separator); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
.episode-item .date { font-size: 12px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em; }
.episode-item h3 { font-size: 17px; font-weight: 600; margin: 2px 0 4px; letter-spacing: -0.015em; }
.episode-item h3 a { color: var(--label); }
.episode-item .summary { color: var(--label-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.episode-item .side { display: flex; align-items: center; gap: 10px; color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.play-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.play-btn svg { width: 14px; height: 14px; }
.play-btn:hover { background: var(--accent-fill); color: var(--on-accent); }
.episode-item audio { grid-column: 1 / -1; }

.prose { max-width: 68ch; font-size: 16px; line-height: 1.6; }
.prose p { margin-bottom: 14px; }

/* ---------- движение ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- печать ---------- */

@media print {
  .sidebar, .tabbar, .toolbar-sticky, .btn { display: none !important; }
  .app { display: block; }
  .card, .group, .stat { box-shadow: none; border: 1px solid #ccc; }
}
.two-col > .card, .two-col > section { margin-top: 0; }

@media (max-width: 640px) {
  .hide-sm { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stats-grid .stat.hero { grid-column: 1 / -1; }
  .stat .stat-value { font-size: 26px; }
}
.field label.choice { display: flex; margin: 0; font-size: 15px; font-weight: 400; color: var(--label); }
.switch-row .title, .switch-row .hint { display: block; }

/* ---------- ведущие и гости ---------- */
.person-photo { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-3); }
.person-initials { display: grid; place-items: center; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.row .person-photo.thumb { width: 44px; height: 44px; border-radius: 50%; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 20px; }
.people-picker { display: grid; gap: 8px; }
.people-picker .person-option { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1.5px solid transparent; }
.people-picker .person-option:has(input[type=checkbox]:checked) { border-color: var(--accent); background: var(--accent-soft); }
.people-picker .person-option input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.people-picker .person-option .person-photo { width: 36px; height: 36px; font-size: 13px; }
.people-picker .person-option .grow { flex: 1; min-width: 0; font-weight: 500; }
.people-picker .person-option select { width: auto; min-height: 32px; padding: 4px 32px 4px 10px; font-size: 13px; background-color: var(--surface); }
.credits { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 18px 0 0; padding: 0; list-style: none; }
.credits li { display: flex; align-items: center; gap: 10px; }
.credits .person-photo { width: 44px; height: 44px; font-size: 15px; }
.credits .name { font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--label); }
.credits a.name:hover { color: var(--accent); }
.credits .role { font-size: 13px; color: var(--label-2); }
.split > * { min-width: 0; }
@media (max-width: 640px) {
  .people-picker .person-option { flex-wrap: wrap; }
  .people-picker .person-option select { width: 100%; margin-left: 30px; flex-basis: calc(100% - 30px); }
}
input[type="file"] { min-width: 0; }

/* ---------- справочник ведущих ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.person-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 22px 16px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); color: var(--label);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.person-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.person-card__photo { width: 88px; height: 88px; font-size: 28px; margin-bottom: 8px; }
.person-card__name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.person-card__role { font-size: 13px; color: var(--accent); font-weight: 500; }
.person-card__meta { font-size: 13px; color: var(--label-2); margin-top: 4px; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person-card__stats { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--separator); width: 100%; justify-content: center; font-size: 12px; color: var(--label-2); }
.person-card__stats b { color: var(--label); font-variant-numeric: tabular-nums; }
.person-head { display: flex; gap: 22px; align-items: center; margin-bottom: 24px; flex-wrap: wrap; }
.person-head__photo { width: 112px; height: 112px; font-size: 36px; box-shadow: var(--shadow); }
.person-head h1 { font-size: 32px; font-weight: 700; line-height: 1.12; }
.person-head .grow { flex: 1; min-width: 220px; }
.person-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu__panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; width: 280px; display: grid; gap: 6px;
  padding: 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-pop); border: 1px solid var(--separator);
}
.credits a.person-link { display: flex; align-items: center; gap: 10px; color: inherit; }
.credits a.person-link:hover { text-decoration: none; }
.credits a.person-link:hover .name { color: var(--accent); }
@media (max-width: 640px) { .person-head__photo { width: 84px; height: 84px; } .person-head h1 { font-size: 26px; } .people-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }
.person-hero { display: flex; gap: 28px; align-items: center; margin-bottom: 36px; flex-wrap: wrap; }
.person-hero__photo { width: 160px; height: 160px; font-size: 52px; box-shadow: var(--shadow-pop); }
.person-hero h1 { font-size: 40px; font-weight: 700; line-height: 1.08; margin-bottom: 4px; }
.person-hero .author { font-size: 18px; color: var(--accent); margin: 0 0 10px; }
@media (max-width: 640px) { .person-hero__photo { width: 112px; height: 112px; } .person-hero h1 { font-size: 30px; } }

/* Трейлер и бонусные выпуски — отдельно от основной ленты */
.group-label .badge { margin-left: 6px; vertical-align: 1px; text-transform: none; letter-spacing: 0; }
.trailer-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; align-items: center;
  padding: 22px 24px; margin-bottom: 36px; border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--separator); box-shadow: var(--shadow);
}
.trailer-card + .trailer-card { margin-top: -24px; }
.trailer-card .kicker { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--label-2); }
.trailer-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 2px; }
.trailer-card h2 a { color: var(--label); }
.trailer-card p { margin: 0; color: var(--label-2); font-size: 15px; }
.trailer-card .play-btn { width: 52px; height: 52px; }
.bonus-section { margin-top: 44px; padding: 24px; border-radius: var(--r-xl); background: linear-gradient(160deg, var(--teal-soft), transparent 85%), var(--surface-2); }
.bonus-section .section-title { margin-top: 0; justify-content: flex-start; align-items: center; gap: 8px; }
.bonus-section .section-title .muted { margin-left: auto; }
.bonus-section .section-title svg { width: 22px; height: 22px; color: var(--teal); }
.bonus-section > p { margin: -6px 0 16px; color: var(--label-2); font-size: 15px; }
.bonus-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bonus-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.bonus-card .date { font-size: 12px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em; }
.bonus-card h3 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.bonus-card h3 a { color: var(--label); }
.bonus-card .summary { margin: 0; color: var(--label-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bonus-card .side { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .trailer-card { padding: 18px; }
  .bonus-section { padding: 18px 16px; margin-left: -4px; margin-right: -4px; }
}

/* Организации, лимиты, лицензия */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 8px 0 4px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent-fill); }
.meter.is-high > span { background: var(--red); }
.limits-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .limits-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.license-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.license-card__edition { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.org-switch { margin: 0 12px 12px; }
.org-switch select { width: 100%; font-weight: 600; }
.org-switch .label { font-size: 11px; color: var(--label-2); text-transform: uppercase; letter-spacing: .04em; display: block; margin: 0 2px 4px; }
.studio-shelf + .studio-shelf { margin-top: 40px; }

/* Встраиваемый плеер */
.embed-body { margin: 0; background: transparent; }
.embed { font-family: var(--font); background: var(--surface); color: var(--label); border-radius: var(--r-lg); border: 1px solid var(--separator); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.embed__head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.embed__cover { width: 72px; height: 72px; border-radius: var(--r-md); flex: none; object-fit: cover; }
.embed__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.embed__podcast { font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .02em; }
.embed__title { font-size: 16px; font-weight: 600; color: var(--label); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.embed__date { font-size: 13px; color: var(--label-2); }
.embed audio { width: 100%; }
.embed__list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; border-top: 1px solid var(--separator); }
.embed__list a { display: flex; gap: 10px; padding: 9px 4px; color: var(--label); font-size: 14px; border-bottom: 1px solid var(--separator); }
.embed__list a[aria-current="true"] { color: var(--accent); font-weight: 600; }
.embed__list .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed__brand { font-size: 11px; color: var(--label-3); align-self: flex-end; }

/* Страница выпуска: главы, расшифровка, площадки, теги */
.episode-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.episode-body { display: grid; gap: 28px; }
.episode-body.has-chapters { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); align-items: start; }
@media (max-width: 860px) { .episode-body.has-chapters { grid-template-columns: minmax(0, 1fr); } .episode-body .chapters { order: -1; } }
.chapters h2 { font-size: 17px; margin: 0 0 8px; }
.chapters ol { list-style: none; margin: 0; padding: 0; }
.chapters a { display: flex; gap: 12px; padding: 8px 6px; border-radius: var(--r-sm); color: var(--label); align-items: baseline; }
.chapters a:hover { background: var(--surface-2); }
.chapters a.is-current { background: var(--accent-soft); }
.chapters a.is-current .name { color: var(--accent); font-weight: 600; }
.chapters .time { font-variant-numeric: tabular-nums; color: var(--label-2); font-size: 13px; min-width: 44px; }
.tag-list { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--label-2); font-size: 13px; }
.tag:hover, .tag[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.platforms__label { font-size: 13px; color: var(--label-2); margin-right: 4px; }
.platform-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--separator); color: var(--label); font-size: 14px; font-weight: 500; }
.platform-btn svg { width: 16px; height: 16px; color: var(--accent); }
.platform-btn:hover { border-color: var(--accent); }
.platforms.is-compact .platform-btn { padding: 5px 12px; font-size: 13px; }
.transcript { margin-top: 44px; }
.transcript__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.transcript__follow { font-size: 13px; color: var(--label-2); display: flex; gap: 6px; align-items: center; }
.transcript__body { max-height: 70vh; overflow: auto; padding-right: 6px; scroll-behavior: smooth; }
.transcript__p { margin: 0; padding: 10px 12px; border-radius: var(--r-md); line-height: 1.6; transition: background-color .2s var(--ease); }
.transcript__p[data-start] { cursor: pointer; }
.transcript__p[data-start]:hover { background: var(--surface-2); }
.transcript__p.is-current { background: var(--accent-soft); }
.transcript__time { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--label-2); margin-right: 8px; }
.transcript__speaker { margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .transcript__body { scroll-behavior: auto; } }
.color-field input[type=color] { width: 64px; height: 36px; padding: 2px; border-radius: var(--r-sm); border: 1px solid var(--separator); background: var(--surface); cursor: pointer; }
.segmented-radio { position: relative; display: inline-flex; }
.segmented-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented-radio span { display: block; padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--label); }
.segmented-radio input:checked + span { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented-radio input:focus-visible + span { box-shadow: var(--focus); }
@media (prefers-color-scheme: dark) { .segmented-radio input:checked + span { background: #636366; } }

/* История выпуска */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--separator); }
.timeline__item { position: relative; padding: 0 0 18px 22px; }
.timeline__dot { position: absolute; left: -32px; top: 14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--label-2); }
.timeline__dot svg { width: 14px; height: 14px; }
.timeline__dot--published { background: var(--green-soft); color: var(--green); }
.timeline__dot--scheduled { background: var(--orange-soft); color: var(--orange); }
.timeline__dot--created, .timeline__dot--restored { background: var(--accent-soft); color: var(--accent); }
.timeline__card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.timeline__head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.timeline__details summary { cursor: pointer; color: var(--accent); }

/* Аналитика: удержание, тепловая карта, страны */
.chart-line { fill: none; stroke: var(--chart-bar); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-area { fill: var(--accent-soft); }
.heatmap-wrap { overflow-x: auto; position: relative; }
.heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 560px; table-layout: fixed; }
.heatmap th { font-size: 11px; font-weight: 500; color: var(--label-2); text-align: center; padding: 0; }
.heatmap tbody th { text-align: left; width: 28px; }
.heatmap td { height: 22px; border-radius: 4px; background: var(--surface-2); }
.heatmap td.hm-1 { background: color-mix(in srgb, var(--chart-bar) 25%, var(--surface-2)); }
.heatmap td.hm-2 { background: color-mix(in srgb, var(--chart-bar) 50%, var(--surface-2)); }
.heatmap td.hm-3 { background: color-mix(in srgb, var(--chart-bar) 75%, var(--surface-2)); }
.heatmap td.hm-4 { background: var(--chart-bar); }
.heatmap-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--label-2); margin-top: 8px; justify-content: flex-end; }
.heatmap-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.stat-grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--separator); }
.plain-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Двухфакторный вход */
.qr-box { background: #fff; border-radius: var(--r-md); padding: 8px; display: inline-block; line-height: 0; }
.qr-box svg { width: 220px; height: 220px; }
.otp-input { font-family: var(--font-mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.recovery-codes { columns: 2; gap: 24px; margin: 0; padding-left: 24px; font-size: 17px; line-height: 2; }

.audit-table tr.is-warning td { background: var(--orange-soft); }
.nowrap { white-space: nowrap; }

.monitor-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px; }
.monitor-card__body { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-width: 0; }

/* Реклама и спонсоры */
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-row .choice { flex: 0 1 auto; }
.row-detail > summary { list-style: none; cursor: pointer; }
.row-detail > summary::-webkit-details-marker { display: none; }
.row-detail[open] > summary .chevron { transform: rotate(90deg); }
.row-detail + .row-detail { border-top: 1px solid var(--separator); }

.partner-links { display: grid; gap: 8px; }
.partner-link { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 0.9fr) auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .partner-link { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .partner-link input[type=url] { grid-column: 1 / -1; order: 3; } }
.sponsor-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--separator); margin-top: 16px; }
.sponsor-card .cover { width: 48px; height: 48px; border-radius: var(--r-sm); }
.sponsor-card .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.partner-list { list-style: none; margin: 0; padding: 0; }
.partner-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--separator); flex-wrap: wrap; }
.promo-code { font-family: var(--font-mono); font-size: 13px; padding: 3px 10px; border-radius: 6px; border: 1px dashed var(--accent); color: var(--accent); background: var(--accent-soft); cursor: copy; }

/* Подписка и оплата */
.paywall-hero { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 24px; }
.paywall-hero .cover { width: 160px; height: 160px; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.paywall-hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 8px; }
@media (max-width: 640px) { .paywall-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; } .paywall-hero .cover { width: 96px; height: 96px; } .paywall-hero h1 { font-size: 24px; } }
.paywall-form { max-width: 560px; }
.plans { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan { position: relative; display: block; cursor: pointer; }
.plan input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plan__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px solid var(--separator-strong); background: var(--surface); height: 100%; }
.plan input:checked + .plan__body { border-color: var(--accent); background: var(--accent-soft); }
.plan input:focus-visible + .plan__body { box-shadow: var(--focus); }
.plan__name { font-size: 13px; color: var(--label-2); font-weight: 500; }
.plan__price { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.plan .badge { align-self: flex-start; }
.app-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pay-result svg { width: 48px; height: 48px; }
.paywall { margin: 20px 0; padding: 20px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--accent-soft), transparent 75%), var(--surface); border: 1px solid var(--separator); }
.paywall h2 { font-size: 19px; margin: 0 0 6px; }
.lock-badge { display: inline-flex; align-items: center; gap: 4px; }
.paid-cta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--accent-soft); }
.premium-section { background: linear-gradient(160deg, var(--accent-soft), transparent 85%), var(--surface-2); } .premium-section .section-title svg { color: var(--accent); }

/* Аудиостудия */
.studio-wave-card { padding: 16px; }
.studio-status { font-size: 13px; color: var(--label-2); margin-bottom: 8px; }
.studio-wave { position: relative; height: 160px; border-radius: var(--r-md); background: var(--surface-2); overflow-x: auto; overflow-y: hidden; cursor: crosshair; outline: none; }
.studio-wave:focus-visible { box-shadow: var(--focus); }
.studio-wave canvas { display: block; height: 160px; }
.studio-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.studio-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }
.studio-tools .card { margin: 0; }
.studio-tools h2 { font-size: 16px; margin: 0 0 10px; }
.studio-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.asset-player { height: 32px; width: 220px; }
@media (max-width: 640px) { .asset-player { width: 150px; } }
