/* ============================================================
   «Tinkr» — базовая дизайн-система
   Тёплая бумага, чернила, терракота. Редакционная типографика.
   ============================================================ */

:root {
  --paper: #faf7f0;
  --paper-2: #f3ede2;
  --paper-3: #ece4d5;
  --card: #fffdf8;
  --ink: #1b1815;
  --ink-soft: #423a31;
  --muted: #776c5e;
  --muted-2: #9a8e7e;
  --line: #e5dccc;
  --line-strong: #d3c5ae;
  --accent: #b45309;
  --accent-dark: #8a3e06;
  --accent-soft: #f7e6d1;
  --accent-ink: #74300a;
  --green: #3f6212;
  --green-soft: #eaf1dc;
  --red: #a92a1f;
  --red-soft: #fae5e1;
  --blue: #1d4ed8;
  --player: #0c0a09;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(43, 32, 20, .06), 0 2px 6px rgba(43, 32, 20, .04);
  --shadow-md: 0 10px 30px -12px rgba(43, 32, 20, .22), 0 2px 8px rgba(43, 32, 20, .05);
  --shadow-lg: 0 30px 70px -30px rgba(43, 32, 20, .35);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#view { flex: 1; outline: none; }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -.015em; }
h1 { font: 600 clamp(2rem, 3.6vw, 3.1rem)/1.08 var(--font-display); letter-spacing: -.02em; }
h2 { font: 600 clamp(1.5rem, 2.4vw, 2rem)/1.15 var(--font-display); }
h3 { font: 600 1.18rem/1.3 var(--font-ui); }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
strong { font-weight: 650; }

.container { width: min(1240px, 100% - 48px); margin-inline: auto; }
.page { padding: 38px 0 80px; }
.page--tight { padding-top: 22px; }
.stack { display: grid; gap: 18px; }
.stack--sm { gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.eyebrow {
  font: 600 11.5px/1 var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}
.serif { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* --- Кнопки ------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink);
  font: 600 14.5px/1 var(--font-ui); letter-spacing: .005em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .16s var(--ease), color .16s, border-color .16s, transform .16s, box-shadow .16s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--primary:hover { background: #352d25; border-color: #352d25; }
.btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--ghost { border-color: var(--line-strong); background: transparent; }
.btn--ghost:hover { background: var(--paper-2); border-color: var(--muted-2); }
.btn--soft { background: var(--paper-2); border-color: transparent; }
.btn--soft:hover { background: var(--paper-3); }
.btn--danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn--danger:hover { background: #8c2119; }
.btn--sm { min-height: 34px; padding: 0 13px; font-size: 13.5px; border-radius: 8px; }
.btn--lg { min-height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--link { min-height: auto; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.btn--link:hover { color: var(--accent-dark); }
.btn .icon { flex: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; cursor: pointer; color: var(--ink-soft);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn--bordered { border-color: var(--line); background: var(--card); }

/* --- Бейджи и чипы ------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-soft);
  font: 600 11.5px/1.25 var(--font-ui); letter-spacing: .02em;
  white-space: nowrap;
}
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--dark { background: var(--ink); color: var(--paper); }
.badge--outline { background: transparent; border: 1px solid var(--line-strong); }
.badge--ai { background: #efe9fb; color: #5b3fa8; }
.badge--lg { padding: 6px 12px; font-size: 12.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font: 500 13.5px/1 var(--font-ui); color: var(--ink-soft);
  cursor: pointer; white-space: nowrap; transition: .15s var(--ease);
}
.chip:hover { border-color: var(--ink-soft); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip--accent.is-active { background: var(--accent); border-color: var(--accent); }

.pill-toggle { display: flex; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 999px; flex-wrap: wrap; }
.pill-toggle button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 999px;
  font: 600 13.5px/1 var(--font-ui); color: var(--muted); cursor: pointer;
}
.pill-toggle button.is-active { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }

/* --- Формы --------------------------------------------------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label, .label {
  font: 600 13px/1.3 var(--font-ui); color: var(--ink-soft); letter-spacing: .01em;
}
.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: 10px 13px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 9px;
  font: 15px/1.4 var(--font-ui);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(180, 83, 9, .14); }
.input[aria-invalid="true"] { border-color: var(--red); }
.field__hint { font-size: 12.5px; color: var(--muted); }
.field__error { font-size: 12.5px; color: var(--red); }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input--sm { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; color: var(--ink-soft); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check a { color: var(--accent); text-decoration: underline; }
.switch { position: relative; display: inline-flex; width: 44px; height: 25px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(19px); }

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }

/* --- Шапка --------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 240, .88);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex; align-items: center; gap: 26px;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); flex: none; }
.brand__mark { color: var(--accent); }
.brand__word { font: 600 20px/1 var(--font-display); letter-spacing: -.03em; white-space: nowrap; }
.brand__dot { color: var(--accent); }
.nav { display: flex; gap: 3px; }
.nav__link {
  padding: 8px 11px; border-radius: 8px;
  font: 500 14px/1 var(--font-ui); color: var(--ink-soft);
  transition: color .15s, background .15s;
}
.nav__link:hover { color: var(--ink); background: var(--paper-2); }
.nav__link.is-active { color: var(--ink); font-weight: 650; }
.search {
  position: relative; display: flex; align-items: center;
  flex: 1; max-width: 420px; margin-left: auto;
}
.search__icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search__input {
  width: 100%; height: 40px; padding: 0 38px 0 38px;
  background: var(--paper-2); border: 1px solid transparent; border-radius: 9px;
  font: 14px var(--font-ui); color: var(--ink);
}
.search__input::placeholder { color: var(--muted); }
.search__input:focus { outline: none; background: var(--card); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.search__kbd {
  position: absolute; right: 9px; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line-strong); font: 11px var(--font-mono); color: var(--muted);
}
.header__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.header__cta { margin-right: 2px; }
.header__burger { display: none; }

.usermenu { position: relative; }
.usermenu__trigger {
  display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px;
  border: 1px solid transparent; border-radius: 999px; background: transparent; cursor: pointer;
}
.usermenu__trigger:hover { background: var(--paper-2); }
.usermenu__name { font-size: 13.5px; font-weight: 600; }
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 250px; z-index: 200;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 6px; overflow: hidden;
}
.usermenu__panel[hidden] { display: none; }
.usermenu__head { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 4px; }
.usermenu__head strong { font-size: 14px; }
.usermenu__head span { font-size: 12px; color: var(--muted); word-break: break-all; }
.usermenu__panel a, .usermenu__logout {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 12px; border: 0; border-radius: 7px; background: none;
  font: 500 13.5px var(--font-ui); color: var(--ink-soft); cursor: pointer; text-align: left;
}
.usermenu__panel a:hover, .usermenu__logout:hover { background: var(--paper-2); color: var(--ink); }
.usermenu__logout { border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; margin-top: 4px; color: var(--red); }
.header__drawer { display: none; }

/* --- Подвал -------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--paper-2); margin-top: auto; padding: 46px 0 22px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
.footer__brand p { margin: 14px 0; color: var(--muted); font-size: 13.5px; max-width: 320px; }
.footer__note { font: 11px var(--font-mono); color: var(--muted-2); letter-spacing: .08em; text-transform: uppercase; }
.footer__grid h3 { font: 600 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer__grid a { display: block; padding: 5px 0; font-size: 13.5px; color: var(--ink-soft); }
.footer__grid a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted-2); }

/* --- Карточки видео ----------------------------------------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 20px; }
.section-head h2 { font-size: clamp(1.4rem, 2vw, 1.8rem); }
.section-head p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.section-head__link { font-size: 13.5px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.section-head__link:hover { color: var(--accent-dark); }

.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 20px; }
.cards-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid--2 { grid-template-columns: repeat(2, 1fr); }
.video-card { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.video-card__thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 11px; overflow: hidden;
  background: linear-gradient(135deg, #2a241e, #191613);
  border: 1px solid rgba(27, 24, 21, .08);
}
.video-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease), opacity .2s; }
.video-card:hover .video-card__thumb img { transform: scale(1.035); }
.video-card__thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.45));
  opacity: 0; transition: opacity .2s;
}
.video-card:hover .video-card__thumb::after { opacity: 1; }
.video-card__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.86);
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(250, 247, 240, .94); color: var(--ink);
  opacity: 0; transition: opacity .2s, transform .25s var(--ease); z-index: 2;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.video-card:hover .video-card__play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.video-card__duration {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  padding: 3px 7px; border-radius: 5px; background: rgba(12, 10, 9, .82); color: #fff;
  font: 600 11.5px/1 var(--font-mono); letter-spacing: .02em;
}
.video-card__level { position: absolute; left: 8px; top: 8px; z-index: 2; }
.video-card__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.25); z-index: 3; }
.video-card__progress span { display: block; height: 100%; background: var(--accent); }
.video-card__body { display: flex; flex-direction: column; gap: 5px; }
.video-card__title { font: 600 15.5px/1.32 var(--font-ui); color: var(--ink); letter-spacing: -.005em; }
.video-card__title a:hover { color: var(--accent-dark); }
.video-card__meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.video-card__channel { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.video-card__channel:hover { color: var(--ink); }
.video-card__desc { font-size: 13px; color: var(--muted); }

.video-row { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: start; }
.video-row .video-card__thumb { aspect-ratio: 16/9; }

.channel-card {
  display: flex; align-items: center; gap: 13px; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.channel-card__meta { min-width: 0; }
.channel-card__name { font-weight: 650; font-size: 14.5px; }
.channel-card__sub { font-size: 12.5px; color: var(--muted); }
.channel-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: none; color: #fff; font-weight: 650; letter-spacing: .02em; }
.avatar--text { line-height: 1; }

/* --- Секции и утилитарные блоки ----------------------------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel--flush { padding: 0; overflow: hidden; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel__head h3 { font-size: 15px; }
.panel__body { padding: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stat-card__label { font: 600 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat-card__value { font: 600 26px/1.1 var(--font-display); margin-top: 8px; letter-spacing: -.02em; }
.stat-card__hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.stat-card__icon { float: right; color: var(--muted-2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 620px; }
.table th { text-align: left; padding: 11px 14px; background: var(--paper-2); color: var(--muted); font: 600 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: rgba(243, 237, 226, .45); }
.table__num { text-align: right; font-variant-numeric: tabular-nums; }
.table__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 16px; border: 0; border-bottom: 2px solid transparent; background: none;
  font: 600 13.5px var(--font-ui); color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.progress { height: 6px; border-radius: 999px; background: var(--paper-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s var(--ease); }
.progress--green > span { background: var(--green); }

.empty-state { text-align: center; max-width: 480px; margin: 60px auto; display: grid; justify-items: center; gap: 12px; }
.empty-state__art { font: 600 44px/1 var(--font-display); color: var(--line-strong); letter-spacing: -.03em; }
.empty-state h1 { font-size: 26px; }
.empty-state p { color: var(--muted); font-size: 14.5px; }

.loader { display: grid; place-items: center; gap: 14px; padding: 80px 0; color: var(--muted); font-size: 14px; }
.loader__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; margin: 0 3px; animation: pulse 1.1s infinite ease-in-out; }
.loader__dot:nth-child(2) { animation-delay: .15s; }
.loader__dot:nth-child(3) { animation-delay: .3s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.skeleton { background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.notice { display: flex; gap: 11px; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); font-size: 13.5px; color: var(--ink-soft); }
.notice .icon { flex: none; margin-top: 1px; }
.notice--accent { background: var(--accent-soft); border-color: #eccda9; color: var(--accent-ink); }
.notice--green { background: var(--green-soft); border-color: #d4e3bb; color: var(--green); }
.notice--red { background: var(--red-soft); border-color: #f0c6bf; color: var(--red); }

.breadcrumbs { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span.sep { color: var(--line-strong); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 38px; }
.pagination button, .pagination a {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); display: inline-grid; place-items: center;
  font-size: 13.5px; cursor: pointer;
}
.pagination .is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --- Тосты и модалки ---------------------------------------- */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 500; display: grid; gap: 9px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px;
  background: var(--ink); color: var(--paper); border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .28s var(--ease);
}
.toast--error { background: #5f1712; }
.toast--success { background: #263d0d; }
.toast__close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.modal-backdrop { position: fixed; inset: 0; z-index: 400; background: rgba(20, 17, 14, .55); display: grid; place-items: center; padding: 20px; animation: fade-in .18s; }
.modal { width: min(460px, 100%); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-in .22s var(--ease); }
.modal--wide { width: min(760px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 19px; }
.modal__close { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.modal__body { padding: 20px; max-height: 65vh; overflow: auto; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper-2); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }

/* --- Раскладка студии и админки ----------------------------- */
.app-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 34px; padding: 28px 0 70px; align-items: start; }
.side-nav { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 3px; }
.side-nav__title { font: 600 10.5px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); padding: 0 12px 9px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  font: 500 13.5px var(--font-ui); color: var(--ink-soft); background: none; border: 0; text-align: left; cursor: pointer;
}
.side-nav a:hover, .side-nav button:hover { background: var(--paper-2); color: var(--ink); }
.side-nav a.is-active { background: var(--ink); color: var(--paper); font-weight: 600; }
.side-nav__sep { height: 1px; background: var(--line); margin: 10px 8px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.7rem, 2.6vw, 2.2rem); }
.page-head p { color: var(--muted); font-size: 14px; margin: 5px 0 0; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Адаптив ------------------------------------------------ */
@media (max-width: 1120px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .nav { display: none; }
  .header__burger { display: inline-flex; }
  .header__drawer { display: block; border-top: 1px solid var(--line); background: var(--card); padding: 14px 24px 20px; }
  .header__drawer[hidden] { display: none; }
  .drawer__links { display: grid; gap: 2px; margin-top: 12px; }
  .drawer__links a { padding: 11px 8px; border-radius: 8px; font-weight: 600; font-size: 14.5px; }
  .drawer__links a:hover { background: var(--paper-2); }
  .search--drawer { max-width: none; margin: 0; }
  .header__cta { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer__grid > div:last-child { display: none; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; gap: 18px; }
  .side-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .side-nav__title, .side-nav__sep { display: none; }
  .side-nav a, .side-nav button { white-space: nowrap; padding: 8px 12px; background: var(--paper-2); }
  .side-nav a.is-active { background: var(--ink); }
  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 16px; }
  .panel { padding: 18px; }
  .page { padding-top: 26px; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .header__inner { gap: 12px; }
  .search:not(.search--drawer) { display: none; }
  .header__actions .btn--ghost { display: none; }
  .usermenu__name { display: none; }
  .brand__word { font-size: 17.5px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer__brand { grid-column: 1 / -1; }
  .cards-grid { gap: 20px 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .tabs { margin-inline: -16px; padding-inline: 16px; }
}
@media (max-width: 520px) {
  .cards-grid, .cards-grid--3, .cards-grid--2 { grid-template-columns: 1fr; }
  .video-row { grid-template-columns: 140px 1fr; gap: 12px; }
  .video-card__title { font-size: 14.5px; }
  .stat-card__value { font-size: 22px; }
  .btn { min-height: 40px; }
  .toast-root { right: 12px; bottom: 12px; left: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
