/* ===== Токены в стиле iOS ===== */
:root {
  --bg: #f2f2f7;              /* systemGroupedBackground */
  --bg-elevated: #ffffff;     /* secondarySystemGroupedBackground */
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.2);
  --label: #000000;
  --label-2: rgba(60, 60, 67, 0.72);
  --label-3: rgba(60, 60, 67, 0.45);
  --separator: rgba(60, 60, 67, 0.18);
  --tint: #007aff;            /* systemBlue */
  --tint-pressed: #0062cc;
  --red: #ff3b30;
  --green: #34c759;
  --bar: rgba(242, 242, 247, 0.78);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius-card: 22px;
  --radius-group: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-strong: rgba(118, 118, 128, 0.36);
  --label: #ffffff;
  --label-2: rgba(235, 235, 245, 0.7);
  --label-3: rgba(235, 235, 245, 0.4);
  --separator: rgba(84, 84, 88, 0.6);
  --tint: #0a84ff;
  --tint-pressed: #409cff;
  --red: #ff453a;
  --green: #30d158;
  --bar: rgba(22, 22, 24, 0.78);
  --glass: rgba(44, 44, 46, 0.72);
  --shadow-card: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--label); }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img, video { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

.view { min-height: 100vh; padding-bottom: calc(32px + var(--safe-bottom)); animation: viewIn 0.42s var(--ease) both; }
.view.back { animation-name: viewInBack; }
@keyframes viewIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes viewInBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* ===== Навигационная панель ===== */
.navbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 52px; padding: calc(4px + var(--safe-top)) 8px 4px;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}
.navbar.scrolled {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--separator);
}
.navbar-title { font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; opacity: 0; transition: opacity 0.2s; }
.navbar.scrolled .navbar-title, .navbar.always .navbar-title { opacity: 1; }
.navbar-left { justify-self: start; display: flex; }
.navbar-right { justify-self: end; display: flex; gap: 4px; }

.bar-btn {
  min-height: 44px; min-width: 44px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  color: var(--tint); font-size: 17px; border-radius: 12px;
  transition: opacity 0.15s;
}
.bar-btn:active { opacity: 0.4; }
.bar-btn[disabled] { color: var(--label-3); cursor: default; }
.bar-btn.bold { font-weight: 600; }
.bar-btn svg { width: 24px; height: 24px; }

.glass-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass); color: var(--label);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 0.5px 0 rgba(255,255,255,0.4) inset, 0 2px 10px rgba(0,0,0,0.12);
  transition: transform 0.2s var(--ease);
  position: relative;
}
.glass-btn::after { content: ""; position: absolute; inset: -4px; } /* зона касания 44px */
.glass-btn:active { transform: scale(0.9); }
.glass-btn svg { width: 18px; height: 18px; stroke-width: 2.4; }

/* ===== Крупный заголовок ===== */
.large-title { padding: 0 20px 4px; }
.large-title h1 { margin: 0; font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; }
.large-title p { margin: 4px 0 0; color: var(--label-2); font-size: 15px; }

/* ===== Поиск ===== */
.search { display: block; margin: 12px 16px 8px; position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--label-3); }
.search input {
  width: 100%; height: 38px; border: 0; border-radius: 10px;
  background: var(--fill); padding: 0 12px 0 34px; font-size: 17px; outline: none;
}
.search input::placeholder { color: var(--label-3); }

/* ===== Карточки каталога ===== */
.cards { display: grid; gap: 20px; padding: 12px 16px 0; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(3, 1fr); max-width: 1200px; margin: 0 auto; } }

.card {
  display: block; width: 100%; text-align: left;
  background: var(--bg-elevated); border-radius: var(--radius-card);
  overflow: hidden; box-shadow: var(--shadow-card);
  transition: transform 0.35s var(--ease);
  animation: cardIn 0.5s var(--ease) both;
}
.card:active { transform: scale(0.97); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--fill); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(0,0,0,0.28)); pointer-events: none; }
.card-badges { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: flex; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px;
  border-radius: 13px; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap;
  background: rgba(0,0,0,0.32); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.badge svg { width: 14px; height: 14px; stroke-width: 2.2; }
.card-body { padding: 14px 16px 16px; }
.card-title { margin: 0; font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.card-desc {
  margin: 6px 0 0; color: var(--label-2); font-size: 15px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== Пустое состояние / скелетон ===== */
.empty { text-align: center; padding: 72px 32px; color: var(--label-2); }
.empty-icon { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 20px; background: var(--fill); display: flex; align-items: center; justify-content: center; color: var(--label-3); }
.empty-icon svg { width: 34px; height: 34px; stroke-width: 1.6; }
.empty h2 { margin: 0 0 6px; font-size: 20px; color: var(--label); font-weight: 600; }
.empty p { margin: 0 0 20px; font-size: 15px; }

.skeleton { background: linear-gradient(90deg, var(--fill) 0%, var(--fill-strong) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { border-radius: var(--radius-card); overflow: hidden; background: var(--bg-elevated); }
.sk-card .sk-media { aspect-ratio: 4/3; }
.sk-line { height: 14px; border-radius: 7px; margin: 14px 16px 0; }
.sk-line.short { width: 55%; margin-bottom: 18px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: 14px;
  background: var(--tint); color: #fff; font-size: 17px; font-weight: 600;
  transition: transform 0.2s var(--ease), background 0.15s;
}
.btn:active { transform: scale(0.97); background: var(--tint-pressed); }
.btn.block { width: 100%; }
.btn.tinted { background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint); }
.btn svg { width: 20px; height: 20px; stroke-width: 2.4; }

.fab {
  position: fixed; right: 20px; bottom: calc(20px + var(--safe-bottom)); z-index: 30;
  width: 56px; height: 56px; border-radius: 50%; background: var(--tint); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--tint) 40%, transparent);
  transition: transform 0.25s var(--ease);
}
.fab:active { transform: scale(0.9); }
.fab svg { width: 26px; height: 26px; stroke-width: 2.6; }

/* ===== Страница мастер-класса ===== */
.detail-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(8px + var(--safe-top)) 16px 8px; pointer-events: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.detail-nav > * { pointer-events: auto; }
.detail-nav .navbar-title { position: absolute; left: 70px; right: 70px; text-align: center; max-width: none; pointer-events: none; }
.detail-nav.scrolled { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 0.5px 0 var(--separator); }
.detail-nav.scrolled .navbar-title { opacity: 1; }
.hero { position: relative; aspect-ratio: 1 / 1; max-height: 70vh; width: 100%; overflow: hidden; background: var(--fill); }
@media (min-width: 640px) { .hero { aspect-ratio: 16 / 9; } }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, var(--bg)); }
.detail-content { max-width: 760px; margin: -28px auto 0; position: relative; padding: 0 20px; }
.detail-title { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.detail-meta { margin: 8px 0 0; color: var(--label-2); font-size: 15px; display: flex; gap: 14px; flex-wrap: wrap; }
.detail-meta span { display: inline-flex; align-items: center; gap: 5px; }
.detail-meta svg { width: 16px; height: 16px; }
.detail-desc { margin: 18px 0 0; font-size: 17px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.section-head { margin: 32px 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.gallery {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery button { flex: 0 0 auto; width: 46%; max-width: 240px; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; background: var(--fill); scroll-snap-align: start; transition: transform 0.25s var(--ease); }
.gallery button:active { transform: scale(0.96); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.videos { display: grid; gap: 14px; }
.videos video { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 16/9; object-fit: contain; }

.admin-actions { margin-top: 36px; }

/* ===== Сгруппированные списки (форма) ===== */
.form { max-width: 680px; margin: 0 auto; padding: 8px 16px 0; }
.group-label { margin: 22px 16px 7px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--label-2); }
.group-label .req { color: var(--red); }
.group-foot { margin: 7px 16px 0; font-size: 13px; color: var(--label-2); }
.group { background: var(--bg-elevated); border-radius: var(--radius-group); overflow: hidden; }
.group + .group { margin-top: 16px; }
.field { display: block; padding: 0 16px; }
.field input, .field textarea {
  width: 100%; border: 0; outline: none; background: transparent;
  font-size: 17px; padding: 13px 0;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
.field input::placeholder, .field textarea::placeholder { color: var(--label-3); }
.field + .field { border-top: 0.5px solid var(--separator); }
.counter { text-align: right; font-size: 12px; color: var(--label-3); padding: 0 16px 8px; }
.field-error { color: var(--red); font-size: 13px; margin: 7px 16px 0; }

.cover-pick {
  position: relative; width: 100%; aspect-ratio: 16/10; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--tint); font-size: 15px; font-weight: 500;
  background: var(--bg-elevated);
}
.cover-pick .plus { width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--tint) 12%, transparent); display: flex; align-items: center; justify-content: center; }
.cover-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-pick .change { position: absolute; right: 12px; bottom: 12px; z-index: 1; }
.cover-pick.has-error { box-shadow: inset 0 0 0 2px var(--red); border-radius: var(--radius-group); }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
@media (min-width: 520px) { .media-grid { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.tile .remove {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tile .remove::after { content: ""; position: absolute; inset: -9px; }
.tile .remove svg { width: 13px; height: 13px; stroke-width: 3; }
.tile .play { position: absolute; left: 6px; bottom: 6px; color: #fff; }
.tile .play svg { width: 18px; height: 18px; fill: #fff; stroke: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }
.tile.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--tint); font-size: 13px; font-weight: 500; background: color-mix(in srgb, var(--tint) 10%, transparent); }
.tile.add:active { opacity: 0.6; }
.tile .new-dot { position: absolute; left: 6px; top: 6px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--tint); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; }

.list-row { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; width: 100%; color: var(--red); font-size: 17px; }
.list-row:active { background: var(--fill); }
.list-row.tint { color: var(--tint); }
.list-row + .list-row { border-top: 0.5px solid var(--separator); }

/* ===== Просмотр фото ===== */
.lightbox { position: fixed; inset: 0; z-index: 100; background: #000; animation: fadeIn 0.25s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.lightbox-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox-track::-webkit-scrollbar { display: none; }
.lightbox-track figure { margin: 0; flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; }
.lightbox-track img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: absolute; top: calc(12px + var(--safe-top)); right: 16px; background: rgba(255,255,255,0.18); color: #fff; }
.lightbox-counter { position: absolute; left: 0; right: 0; bottom: calc(20px + var(--safe-bottom)); text-align: center; color: rgba(255,255,255,0.85); font-size: 15px; font-weight: 500; }

/* ===== Прогресс ===== */
.progress-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.25); animation: fadeIn 0.2s both; }
.progress-card { width: 160px; padding: 24px 16px 18px; border-radius: 22px; text-align: center; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); position: relative; }
.ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--fill-strong); }
.ring-fg { stroke: var(--tint); stroke-dasharray: 150.8; stroke-dashoffset: 150.8; transition: stroke-dashoffset 0.2s; }
.progress-pct { position: absolute; top: 46px; left: 0; right: 0; font-size: 15px; font-weight: 600; }
.progress-label { margin-top: 10px; font-size: 15px; color: var(--label-2); }

/* ===== Тост ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-bottom)); z-index: 110;
  transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 16px; font-size: 15px; font-weight: 500;
  background: var(--glass); color: var(--label);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: toastIn 0.4s var(--ease) both;
}
.toast.error { color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(0.96); } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ===== Статистика (админ) ===== */
:root { --orange: #ff9500; --gray-ico: #8e8e93; }
:root[data-theme="dark"] { --orange: #ff9f0a; --gray-ico: #98989d; }
.view.still { animation: none; }
.admin-body { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.segmented {
  display: flex; margin: 12px 16px 4px; padding: 2px; border-radius: 9px; background: var(--fill);
  max-width: 728px;
}
@media (min-width: 792px) { .segmented { margin-left: auto; margin-right: auto; } }
.segmented button {
  flex: 1; min-height: 32px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--label);
  transition: background 0.2s var(--ease), box-shadow 0.2s;
}
.segmented button[aria-selected="true"] { background: var(--bg-elevated); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 0 0 0.5px rgba(0,0,0,0.04); }
:root[data-theme="dark"] .segmented button[aria-selected="true"] { background: #636366; }
.segmented button::after { content: ""; display: block; margin-top: -38px; height: 44px; } /* зона касания */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile-stat { background: var(--bg-elevated); border-radius: 16px; padding: 14px 14px 12px; min-width: 0; }
.tile-head { display: flex; align-items: center; gap: 6px; color: var(--label-2); font-size: 13px; font-weight: 500; }
.tile-head svg { width: 16px; height: 16px; color: var(--tint); }
.tile-value { margin-top: 8px; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-sub { margin-top: 2px; font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.alert-card {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 12px 14px; text-align: left;
  border-radius: 16px; background: color-mix(in srgb, var(--red) 12%, var(--bg-elevated)); color: var(--label); font-size: 15px;
}
.alert-card > svg:first-child { color: var(--red); width: 26px; height: 26px; flex: none; }
.alert-card span { flex: 1; color: var(--label-2); }
.alert-card b { color: var(--label); }
.alert-card > svg:last-child { color: var(--label-3); width: 18px; height: 18px; }

.chart-card { padding: 14px 12px 8px; overflow: visible; }
.bars-wrap { position: relative; }
.bars { width: 100%; height: auto; display: block; overflow: visible; stroke: none; }
.bars .bar path { fill: var(--tint); transition: opacity 0.15s; }
.bars .bar.zero path { fill: var(--fill-strong); }
.bars .hit { fill: transparent; cursor: pointer; }
.bars.has-active .bar:not(.active) path { opacity: 0.45; }
.bars .bar.active path { opacity: 1; }
.bar-label { fill: var(--label); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.axis-label { fill: var(--label-3); font-size: 10.5px; }
.baseline { stroke: var(--separator); stroke-width: 1; }
.chart-tip {
  position: absolute; top: -8px; transform: translateY(-100%); z-index: 5; pointer-events: none;
  min-width: 150px; padding: 10px 12px; border-radius: 12px; font-size: 13px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
}
.chart-tip > b { display: block; margin-bottom: 4px; font-size: 13px; }
.tip-row { display: flex; justify-content: space-between; gap: 16px; color: var(--label-2); }
.tip-row b { color: var(--label); font-variant-numeric: tabular-nums; }

.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; text-align: left;
  position: relative; color: var(--label);
}
button.row:active { background: var(--fill); }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--separator); }
.row-rank { width: 16px; color: var(--label-3); font-size: 15px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.row-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--fill); flex: none; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-value { display: inline-flex; align-items: center; gap: 4px; color: var(--label-2); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-value svg { width: 15px; height: 15px; }
.row-value.ok { color: var(--green); font-weight: 500; }
.row-value.bad { color: var(--red); font-weight: 500; }
.row > svg:last-child { width: 16px; height: 16px; color: var(--label-3); flex: none; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #a5abb8, #858994); color: #fff; font-size: 15px; font-weight: 600;
}
.prem { color: #af52de; font-size: 13px; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 16px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 34px; padding: 0 14px; border-radius: 17px; font-size: 15px; font-weight: 500;
  background: var(--bg-elevated); color: var(--label); transition: background 0.2s, color 0.2s; position: relative;
}
.chip::after { content: ""; position: absolute; inset: -5px 0; }
.chip.on { background: var(--tint); color: #fff; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 4px 4px 4px 12px; border-radius: 16px;
  background: color-mix(in srgb, var(--tint) 14%, transparent); color: var(--tint); font-size: 15px; font-weight: 500;
}
.filter-pill > svg { width: 16px; height: 16px; }
.filter-pill button { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--tint); position: relative; }
.filter-pill button::after { content: ""; position: absolute; inset: -8px; }
.filter-pill button svg { width: 14px; height: 14px; stroke-width: 2.6; }

.ev { display: flex; gap: 12px; padding: 10px 16px; position: relative; }
.ev + .ev::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; border-top: 0.5px solid var(--separator); }
.ev-icon { width: 28px; height: 28px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; margin-top: 1px; }
.ev-icon svg { width: 16px; height: 16px; stroke-width: 2.2; }
.ev-icon.tint { background: var(--tint); }
.ev-icon.green { background: var(--green); }
.ev-icon.orange { background: var(--orange); }
.ev-icon.red { background: var(--red); }
.ev-icon.gray { background: var(--gray-ico); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ev-text { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.ev.error .ev-text { color: var(--red); }
.ev-meta { font-size: 13px; color: var(--label-2); }
.ev-user { color: var(--tint); font-size: 13px; min-height: 24px; position: relative; }
.ev-user::after { content: ""; position: absolute; inset: -10px -4px; }
.load-more { display: flex; justify-content: center; margin-top: 16px; }

/* ===== Видео: кнопки и полноэкранный режим ===== */
.video-item { margin: 0; }
.video-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn.small { flex: 1; min-height: 44px; padding: 0 12px; font-size: 15px; border-radius: 12px; }
.btn.small svg { width: 18px; height: 18px; stroke-width: 2.2; }
.video-overlay { position: fixed; inset: 0; z-index: 120; background: #000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease both; }
.video-overlay video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-close {
  position: absolute; z-index: 1; right: 16px;
  top: calc(12px + var(--safe-top) + var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  background: rgba(255,255,255,0.18); color: #fff;
}
