/* YSM CLOTHES — общий стиль сайта и Telegram Mini App */
@font-face { font-family: "Montserrat"; src: url("/static/fonts/Montserrat.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/Inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #08090b;
  --bg-2: #0f1013;
  --surface: #15161a;
  --surface-2: #1d1e23;
  --surface-3: #26272d;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f5f7;
  --muted: #9a9ca6;
  --faint: #6b6d77;
  --accent: #4f7dff;
  --accent-2: #7aa0ff;
  --accent-soft: rgba(79, 125, 255, .14);
  --on-accent: #fff;
  --ok: #3ecf8e;
  --warn: #f5a524;
  --danger: #f04438;
  /* фон под фото товаров: средне-тёмный градиент, чтобы и белые, и чёрные вещи не сливались */
  --photo-bg: radial-gradient(120% 90% at 50% 35%, #2a2c33 0%, #1a1b20 55%, #131418 100%);
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --r-lg: 26px;
  --r: 18px;
  --r-sm: 12px;
  --tabbar-h: 68px;
  --header-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f3f4f7;
  --bg-2: #eceef2;
  --surface: #ffffff;
  --surface-2: #f2f3f6;
  --surface-3: #e7e9ee;
  --line: rgba(10, 12, 20, .08);
  --line-2: rgba(10, 12, 20, .14);
  --text: #0d0f14;
  --muted: #5f636e;
  --faint: #8d919c;
  --accent: #3d6bf0;
  --accent-2: #2f59d6;
  --accent-soft: rgba(61, 107, 240, .1);
  --photo-bg: radial-gradient(120% 90% at 50% 35%, #e9ebf0 0%, #dfe2e8 60%, #d6d9e0 100%);
  --shadow: 0 10px 30px rgba(15, 20, 35, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
h1, h2, h3, .display { font-family: "Montserrat", "Inter", sans-serif; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; line-height: 1.05; }
h2 { font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; line-height: 1.15; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.accent { color: var(--accent-2); }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .container { padding: 0 28px; } }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.section { margin: 28px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.header .container { height: 100%; display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; height: 100%; }
.logo img { height: 34px; width: auto; }
[data-theme="light"] .logo .lw, .logo .lb { display: none; }
[data-theme="light"] .logo .lb { display: block; }
.header-nav { display: none; gap: 4px; margin-left: 24px; }
.header-nav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; }
.header-nav a:hover, .header-nav a.active { color: var(--text); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: transparent; color: var(--text); border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg, .tab svg { width: 22px; height: 22px; }
.dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
@media (min-width: 900px) {
  .header-nav { display: flex; }
  .logo img { height: 38px; }
}

/* ---------- Нижнее меню (телефон и Mini App) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 500; position: relative; }
.tab.active { color: var(--text); }
.tab.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.tab .dot { top: 6px; right: calc(50% - 22px); }
@media (min-width: 900px) { .tabbar { display: none; } body.has-tabbar { padding-bottom: 0; } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: 600 15px/1 "Inter", sans-serif; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, background .2s ease, opacity .2s;
  background: var(--surface-2); color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-light { background: var(--text); color: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.btn-avito { background: #00aaff; color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.round-btn {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 0; cursor: pointer;
  background: var(--text); color: var(--bg); flex: none;
}
.round-btn svg { width: 22px; height: 22px; }
.link { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-tight { padding: 14px; }
.card + .card { margin-top: 12px; }
.panel { background: var(--surface-2); border-radius: var(--r); padding: 16px; }

/* Главная: баннер-слайдер */
.hero { position: relative; margin-top: 16px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; scrollbar-width: none; border-radius: var(--r-lg); }
.slides::-webkit-scrollbar { display: none; }
.slide {
  scroll-snap-align: start; flex: 0 0 100%; min-height: 220px; border-radius: var(--r-lg); overflow: hidden;
  position: relative; background: var(--surface); display: flex; align-items: flex-end; padding: 24px;
  border: 1px solid var(--line);
}
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.75), rgba(0,0,0,.15) 70%); }
.slide-body { position: relative; z-index: 1; max-width: 520px; color: #fff; }
.slide-body p { color: rgba(255,255,255,.75); }
.slide h2 { font-size: clamp(24px, 4vw, 38px); }
.dots { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line-2); transition: width .2s; }
.dots i.on { width: 18px; background: var(--accent); }
@media (min-width: 900px) { .slide { min-height: 360px; padding: 44px; } }

/* Главная: плитки */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile {
  position: relative; border-radius: var(--r-lg); padding: 20px; min-height: 168px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between;
}
.tile h3 { font-size: 22px; font-family: "Montserrat"; font-weight: 800; }
.tile p { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; max-width: 70%; }
.tile .round-btn { width: 40px; height: 40px; }
.tile.wide { grid-column: span 2; }
.tile.blue { background: linear-gradient(135deg, #3d6bf0 0%, #23409a 100%); border: 0; color: #fff; }
.tile.blue p { color: rgba(255,255,255,.8); }
.tile.blue .round-btn { background: #fff; color: #23409a; }
.tile.light { background: linear-gradient(135deg, #f5f6f8, #d9dce3); color: #0d0f14; border: 0; }
.tile.light p { color: #4a4e58; }
.tile.light .round-btn { background: #0d0f14; color: #fff; }
.tile-art { position: absolute; right: -10px; bottom: -10px; width: 55%; opacity: .95; pointer-events: none; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } .tile.wide { grid-column: span 2; } .tile { min-height: 200px; } }

/* Бегущая строка брендов */
.brands { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; padding: 6px 0; }
.brands::-webkit-scrollbar { display: none; }
.brands a { font: 800 17px "Montserrat"; letter-spacing: .02em; color: var(--muted); white-space: nowrap; text-transform: uppercase; }
.brands a:hover { color: var(--text); }

/* ---------- Сетка товаров ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.pcard:hover { border-color: var(--line-2); }
.pcard-photo { position: relative; aspect-ratio: 4/5; background: var(--photo-bg); }
.pcard-photo img { width: 100%; height: 100%; object-fit: cover; }
.pcard-photo .badges { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.pcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard-cat { font-size: 11.5px; color: var(--faint); }
.pcard-title { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pcard-sizes { display: flex; gap: 4px; flex-wrap: wrap; }
.pcard-sizes span { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pcard-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; font-size: 16px; white-space: nowrap; }
.price s { color: var(--faint); font-weight: 400; font-size: 13px; margin-left: 6px; }
.fav-btn {
  position: absolute; top: 8px; right: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(0,0,0,.35); color: #fff; backdrop-filter: blur(8px);
}
.fav-btn svg { width: 20px; height: 20px; }
.fav-btn.on { color: #ff4d6d; }
.fav-btn.on svg { fill: currentColor; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text); white-space: nowrap; }
.badge-stock { background: rgba(62, 207, 142, .16); color: var(--ok); }
.badge-preorder { background: var(--accent-soft); color: var(--accent-2); }
.badge-booking { background: rgba(245, 165, 36, .16); color: var(--warn); }
.badge-off { background: var(--surface-3); color: var(--faint); }
.badge-sale { background: #ff3b5c; color: #fff; }
.pcard-photo .badge { backdrop-filter: blur(8px); background: rgba(10,10,12,.6); }
.pcard-photo .badge-stock { color: #5ee0a6; }
.pcard-photo .badge-preorder { color: #9db8ff; }
.pcard-photo .badge-booking { color: #ffc35c; }
.pcard-photo .badge-sale { background: #ff3b5c; color: #fff; }

/* ---------- Категории ---------- */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat {
  position: relative; border-radius: var(--r-lg); overflow: hidden; min-height: 170px;
  background: var(--photo-bg); border: 1px solid var(--line); display: flex; align-items: flex-end; padding: 18px;
}
.cat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.72), transparent 60%); }
.cat-body { position: relative; z-index: 1; width: 100%; display: flex; align-items: flex-end; justify-content: space-between; color: #fff; }
.cat h3 { font-size: 22px; font-family: "Montserrat"; font-weight: 800; }
.cat:first-child { grid-column: span 2; min-height: 210px; }
@media (min-width: 900px) { .cats { grid-template-columns: repeat(3, 1fr); } .cat { min-height: 240px; } .cat:first-child { grid-column: span 2; min-height: 240px; } }

/* ---------- Фильтры ---------- */
.search { position: relative; }
.search input[type=search] { padding-left: 48px; height: 52px; border-radius: 999px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; font-weight: 500; font-size: 14px; cursor: pointer; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg a, .seg button { height: 44px; border-radius: 999px; display: grid; place-items: center; color: var(--muted); font-weight: 600; background: none; border: 0; cursor: pointer; font-size: 15px; }
.seg .on { background: var(--text); color: var(--bg); }

/* ---------- Товар ---------- */
.product { display: grid; gap: 20px; margin-top: 16px; }
@media (min-width: 900px) { .product { grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; } .product-info { position: sticky; top: calc(var(--header-h) + 20px); } }
.gallery { position: relative; }
.gallery-main { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r-lg); scrollbar-width: none; background: var(--photo-bg); border: 1px solid var(--line); }
.gallery-main::-webkit-scrollbar { display: none; }
.gallery-main > * { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.thumbs button { flex: 0 0 64px; height: 80px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--photo-bg); cursor: pointer; }
.thumbs button.on { border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-title { font-size: clamp(24px, 3.6vw, 34px); }
.product-price { font: 800 28px "Montserrat"; }
.product-price s { font: 400 17px "Inter"; color: var(--faint); margin-left: 10px; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.size {
  min-width: 58px; height: 52px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line-2);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.1; font-size: 15px;
}
.size small { font-size: 10.5px; font-weight: 500; color: var(--faint); margin-top: 3px; }
.size.on { border-color: var(--accent); background: var(--accent-soft); }
.size.m-in_stock small { color: var(--ok); }
.size.m-preorder small { color: var(--accent-2); }
.size.m-booking small { color: var(--warn); }
.size.m-off { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.buy-box { display: grid; gap: 10px; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); font-size: 13.5px; color: var(--muted); }
.note svg { flex: none; width: 20px; height: 20px; color: var(--accent-2); margin-top: 1px; }
.note b { color: var(--text); }
.note.warn svg { color: var(--warn); }
.attrs { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 14px; }
.attrs dt { color: var(--muted); }
.attrs dd { margin: 0; }
.desc { white-space: pre-line; color: var(--muted); }

/* ---------- Аккордеон (FAQ) ---------- */
.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 600; font-size: 16px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary .plus { width: 34px; height: 34px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; flex: none; transition: transform .2s; }
.acc details[open] .plus { transform: rotate(45deg); }
.acc .answer { padding: 0 0 18px; color: var(--muted); white-space: pre-line; }

/* ---------- Формы ---------- */
label.field { display: block; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search],
input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font: 15px "Inter", sans-serif; outline: none;
  transition: border-color .15s, background .15s;
}
textarea { height: auto; min-height: 100px; padding: 14px 16px; resize: vertical; line-height: 1.45; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239a9ca6' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; margin-top: 1px; }
.radio-cards { display: grid; gap: 8px; }
@media (min-width: 700px) { .radio-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.radio-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--surface-2); cursor: pointer; font-weight: 600; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; font-size: 18px; flex: none; }

/* ---------- Корзина / заказ ---------- */
.line-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .thumb { width: 84px; height: 104px; border-radius: 14px; overflow: hidden; background: var(--photo-bg); flex: none; }
.line-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.qty { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 999px; height: 36px; }
.qty button { width: 36px; height: 36px; border: 0; background: none; color: var(--text); font-size: 18px; cursor: pointer; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }
.summary { display: grid; gap: 10px; }
.summary .row { justify-content: space-between; }
.summary .total { font: 800 22px "Montserrat"; }
.layout-2 { display: grid; gap: 20px; }
@media (min-width: 900px) { .layout-2 { grid-template-columns: 1fr 380px; align-items: start; } .layout-2 > aside { position: sticky; top: calc(var(--header-h) + 20px); } }

/* Статусы и таймлайн */
.status-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--c, var(--accent)); white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.timeline li { list-style: none; position: relative; padding-bottom: 16px; }
.timeline li::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--bg); }
.timeline li:first-child::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline ul { margin: 0; padding: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.media-grid a, .media-grid .m { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--photo-bg); display: block; }
.media-grid img, .media-grid video { width: 100%; height: 100%; object-fit: cover; }
.media-grid .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.25); font-size: 28px; }

/* ---------- Профиль ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font: 800 20px "Montserrat"; overflow: hidden; flex: none; border: 2px solid var(--line-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-list { padding: 6px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; width: 100%; background: none; border: 0; color: var(--text); font: 500 15.5px "Inter"; cursor: pointer; text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); }
.menu-list .mi { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.menu-list .mi svg { width: 20px; height: 20px; }
.menu-list .chev { margin-left: auto; color: var(--faint); }
.menu-list .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.back-pill { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px 0 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.back-pill i { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-style: normal; }
.page-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 14px; }
.page-ico svg { width: 26px; height: 26px; }
.empty { text-align: center; padding: 40px 20px; }
.empty .big { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.empty .big svg { width: 38px; height: 38px; }
.notif { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.notif.unread .ndot { background: var(--accent); }
.ndot { width: 9px; height: 9px; border-radius: 50%; background: transparent; margin-top: 7px; flex: none; }

/* ---------- Подвал ---------- */
.footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 36px 0 28px; font-size: 14px; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.4fr; } }
.footer h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.socials { display: flex; gap: 8px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--text); }
.socials svg { width: 19px; height: 19px; }
.legal { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.legal b { color: var(--text); font-weight: 600; }
.copyright { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

/* ---------- Модальное окно ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal.open { display: flex; }
.modal-box { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + var(--safe-b)); animation: up .22s ease; border: 1px solid var(--line); }
@media (min-width: 700px) { .modal { align-items: center; } .modal-box { border-radius: 26px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.copy-box { background: var(--surface-2); border-radius: 16px; padding: 16px; white-space: pre-line; font-size: 15px; line-height: 1.6; }
table.sizes-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sizes-table th, .sizes-table td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.sizes-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.sizes-table tr td:first-child { font-weight: 700; }
.table-wrap { overflow-x: auto; }

/* ---------- Уведомления (тосты) ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: 76px; z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--text); color: var(--bg); padding: 14px 18px; border-radius: 16px; font-weight: 500; box-shadow: var(--shadow); animation: up .2s ease; }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Авторизация ---------- */
.auth { max-width: 440px; margin: 32px auto; }
.auth .card { padding: 26px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.legal-page { max-width: 820px; }
.legal-page h2 { margin: 28px 0 10px; font-size: 20px; }
.legal-page p, .legal-page li { color: var(--muted); }

/* ---------- Админка ---------- */
.admin-body { background: var(--bg); }
.admin { display: grid; min-height: 100vh; }
@media (min-width: 1000px) { .admin { grid-template-columns: 250px 1fr; } }
.admin-side { background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 12px; display: none; }
@media (min-width: 1000px) { .admin-side { display: block; position: sticky; top: 0; height: 100vh; overflow: auto; } }
.admin-side .logo { height: 48px; padding: 0 10px; margin-bottom: 14px; }
.admin-side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; }
.admin-side nav a:hover { background: var(--surface); color: var(--text); }
.admin-side nav a.active { background: var(--surface-2); color: var(--text); }
.admin-side nav a svg { width: 19px; height: 19px; }
.admin-side nav .sep { height: 1px; background: var(--line); margin: 10px 8px; }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); }
@media (min-width: 1000px) { .admin-top .mob { display: none; } }
.admin-main { padding: 20px 16px 100px; max-width: 1280px; width: 100%; min-width: 0; }
@media (min-width: 1000px) { .admin-main { padding: 28px 32px 60px; } }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
@media (min-width: 1000px) { .admin-tabs { display: none; } }
.admin-tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; font-weight: 500; }
.admin-tabs a.active { background: var(--text); color: var(--bg); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat .v { font: 800 24px "Montserrat"; margin-top: 4px; }
.stat .l { color: var(--muted); font-size: 13px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; color: var(--faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.t .thumb { width: 44px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--photo-bg); }
.t .thumb img { width: 100%; height: 100%; object-fit: cover; }
.t a.rowlink { font-weight: 600; }
.vtable input, .vtable select { height: 42px; border-radius: 10px; font-size: 14px; padding: 0 10px; }
.vtable select { padding-right: 30px; background-position: right 10px center; }
.vtable td { padding: 6px 4px; }
.img-list { display: flex; flex-wrap: wrap; gap: 10px; }
.img-item { position: relative; width: 96px; height: 120px; border-radius: 14px; overflow: hidden; background: var(--photo-bg); border: 1px solid var(--line); }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item label { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; border-radius: 8px; padding: 2px 6px; font-size: 11px; display: flex; gap: 4px; align-items: center; cursor: pointer; }
.img-item .first { position: absolute; left: 6px; bottom: 6px; background: var(--accent); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 6px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 16px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; display: block; }
.drop:hover { border-color: var(--accent); color: var(--text); }
.drop input { display: none; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.charge { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.charge + .charge { margin-top: 8px; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bar .track { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 5px; }
.bar .fill.exp { background: var(--warn); }
.link svg, .badge svg, .small svg { width: 16px; height: 16px; vertical-align: -3px; display: inline-block; }
svg:not([class]) { max-width: 100%; }
html, body { overflow-x: hidden; }
.attrs { margin: 0; }
[hidden] { display: none !important; }
.layout-2 > * { min-width: 0; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
