/* ============================================================================
   ВТубе — стили интерфейса
   Тёмная тема, акцент на карточках VTuber'ов и галерее.
   ========================================================================== */

:root {
  --bg: #0b0a11;
  --bg-soft: #100e1a;
  --surface: #16141f;
  --surface-2: #1c1929;
  --surface-3: #232033;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ece9f7;
  --text-dim: #b3aecb;
  --text-muted: #837e9c;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --danger: #ff5f6d;
  --success: #34d399;
  --warning: #fbbf24;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.95);
  --header-h: 68px;
  --font: "Segoe UI", system-ui, -apple-system, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/*
 * Атрибут hidden должен побеждать любые авторские display-правила:
 * у .lightbox и .modal задан display: grid, и без этого они
 * перекрывали бы страницу постоянно.
 */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Мягкое цветное свечение на фоне страницы */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60rem 34rem at 12% -8%, rgba(124, 92, 255, 0.16), transparent 62%),
    radial-gradient(48rem 30rem at 92% 4%, rgba(255, 92, 138, 0.11), transparent 60%);
}

.sprite { display: none; }

a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }

p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

img { display: block; max-width: 100%; }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ каркас */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: rgba(11, 10, 17, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.16rem; letter-spacing: -0.03em; }

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c5cff, #ff5c8a);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(124, 92, 255, 0.9);
}

.header__nav { display: flex; align-items: center; gap: 4px; margin-left: 6px; }

.navlink {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink.is-active { background: var(--surface-3); color: var(--text); }

.header__spacer { flex: 1; }
.header__side { display: flex; align-items: center; gap: 10px; }

.main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 30px 22px 70px;
}

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.86rem;
}
.footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.footer__nav { display: flex; gap: 18px; }
.footer__nav a:hover { color: var(--text); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ff5c8a));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 28px -14px var(--accent);
}
.btn--primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ff5c8a)); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }

.btn--danger { color: #ffc9ce; border-color: rgba(255, 95, 109, 0.4); background: rgba(255, 95, 109, 0.12); }
.btn--danger:hover { background: rgba(255, 95, 109, 0.2); }

.btn--sm { padding: 6px 12px; font-size: 0.84rem; border-radius: 9px; }
.btn--block { width: 100%; }

.btn--liked { color: #ff8fa3; border-color: rgba(255, 92, 138, 0.45); }

/* ---------------------------------------------------------------- элементы */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
/* Подпись бывает и тегом label (когда поле внутри неё), и отдельным span. */
.field > label,
.field > .field__label { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); }
.field__hint { font-size: 0.78rem; color: var(--text-muted); }
.field__error { font-size: 0.8rem; color: #ff9aa3; }

.input, .textarea, .select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.card-panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.is-active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: #ddd4ff; }
.chip--static { cursor: default; }
.chip--static:hover { background: var(--surface-2); color: var(--text-dim); }
.chip--small { padding: 3px 9px; font-size: 0.75rem; }

/* ------------------------------------------------------------------- вики */

.wiki__head { align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.wiki__head h1 { margin-bottom: 8px; }
.wiki__head p { max-width: 62ch; margin: 0; }

.wiki__filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.wiki__search { display: flex; gap: 10px; }
.wiki__search .input { flex: 1; }

.wiki__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.wiki-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.wiki-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.wiki-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wiki-card__title { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.wiki-card__summary { margin: 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; }
.wiki-card__meta { margin-top: auto; color: var(--text-muted); font-size: 0.78rem; }

.wiki-article { max-width: 900px; }
.wiki-article__head { margin-bottom: 18px; }
.wiki-article__head h1 { margin: 10px 0 8px; }
.wiki-article__summary { margin: 0 0 10px; max-width: 70ch; }
.wiki-article__meta { color: var(--text-muted); font-size: 0.82rem; }
.wiki-article__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.wiki-article__body { padding: 26px 30px; }

/* Оформление статей: разметка собирается в обычные элементы */
.md { color: var(--text-dim); line-height: 1.75; font-size: 0.96rem; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }
.md .md-heading { color: var(--text); line-height: 1.3; margin: 28px 0 12px; }
.md h2.md-heading { font-size: 1.35rem; }
.md h3.md-heading { font-size: 1.15rem; }
.md h4.md-heading, .md h5.md-heading { font-size: 1rem; }
.md .md-paragraph { margin: 0 0 14px; }
.md .md-list { margin: 0 0 14px; padding-left: 22px; }
.md .md-list li { margin-bottom: 6px; }
.md .md-quote {
  margin: 0 0 16px;
  padding: 12px 18px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}
.md .md-rule { margin: 24px 0; border: 0; border-top: 1px solid var(--border); }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md strong { color: var(--text); }
.md .md-code {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  overflow-x: auto;
}
.md .md-code code { font-size: 0.86rem; color: var(--text); }
.md .md-code-inline {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.88em;
}

/* Редактор статьи */
.wiki-editor { max-width: 900px; }
.wiki-editor h1 { margin-bottom: 8px; }
.wiki-editor > p { max-width: 70ch; margin-bottom: 20px; }
.wiki-editor__row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.wiki-editor__body { min-height: 380px; font-family: var(--mono, ui-monospace, monospace); font-size: 0.9rem; line-height: 1.6; }
.wiki-editor__actions { margin-top: 20px; }

.wiki-help { margin: 4px 0 18px; font-size: 0.85rem; }
.wiki-help summary { cursor: pointer; color: var(--text-dim); }
.wiki-help__body { padding: 12px 0 0 4px; color: var(--text-dim); }
.wiki-help__body p { margin: 0 0 6px; }
.wiki-help code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.85em;
}

/* История правок */
.revisions { display: flex; flex-direction: column; }
.revision { padding: 14px 0; border-bottom: 1px solid var(--border); }
.revision:last-child { border-bottom: 0; }
.revision--current { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.revision__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.revision__version {
  font-weight: 700;
  color: var(--text);
  min-width: 34px;
}
.revision__author { font-weight: 600; color: var(--text-dim); }
.revision__action { margin-left: auto; }
.revision__comment { margin: 6px 0 0; color: var(--text); font-size: 0.88rem; }
.revision__title { margin: 4px 0 0; color: var(--text-muted); font-size: 0.82rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge--draft { background: rgba(251, 191, 36, 0.14); color: #ffd977; }
.badge--published { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; }
.badge--hidden { background: rgba(255, 95, 109, 0.14); color: #ff9aa3; }
.badge--admin { background: var(--accent-soft); color: #cbbcff; }

/* --------------------------------------------------------------- заголовки */

.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.page-head p { color: var(--text-dim); margin-top: 10px; max-width: 68ch; }

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 16px;
  font-size: 1.12rem;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ------------------------------------------------------------------- герой */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid var(--border);
  background:
    radial-gradient(40rem 20rem at 18% 0%, rgba(124, 92, 255, 0.36), transparent 60%),
    radial-gradient(34rem 18rem at 88% 22%, rgba(255, 92, 138, 0.26), transparent 62%),
    linear-gradient(160deg, #1a1630, #0e0c17 65%);
  padding: 52px 44px 46px;
  box-shadow: var(--shadow-lg);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); max-width: 20ch; }
.hero p { color: var(--text-dim); font-size: 1.04rem; max-width: 56ch; margin-top: 16px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 30px; margin-top: 34px; }
.hero__stat strong { display: block; font-size: 1.6rem; letter-spacing: -0.03em; }
.hero__stat span { font-size: 0.82rem; color: var(--text-muted); }

/* ----------------------------------------------------------------- панель */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}
.search {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 460px;
}
.search .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search .input { padding-left: 40px; border-radius: 999px; }

.segmented { display: inline-flex; padding: 4px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--surface-3); color: var(--text); }

/* ------------------------------------------------------------------- сетка */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}

.vcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
  isolation: isolate;
}
.vcard:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 26px 50px -28px var(--accent), var(--shadow);
}

.vcard__top { position: relative; }

.vcard__cover {
  position: relative;
  aspect-ratio: 16 / 7;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #12101c), #12101c);
  overflow: hidden;
}
.vcard__cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; }
.vcard__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(10, 9, 16, 0.92));
}

.vcard__avatar {
  position: absolute;
  left: 18px;
  bottom: -26px;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border: 3px solid var(--surface);
  background: var(--surface-2);
  object-fit: cover;
  z-index: 2;
}

.vcard__body { padding: 36px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.vcard__name { font-size: 1.08rem; }
.vcard__slug { font-size: 0.8rem; color: var(--text-muted); }
.vcard__tagline { font-size: 0.88rem; color: var(--text-dim); flex: 1; }

.vcard__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid transparent;
}
.tag--accent { background: color-mix(in srgb, var(--accent) 18%, transparent); color: color-mix(in srgb, var(--accent) 65%, #ffffff); }

.vcard__stats {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.vcard__stats span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- страница */

.profile-hero {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 26px;
  background: var(--surface);
}
.profile-hero__banner { height: 260px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #14111f), #14111f); }
.profile-hero__banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 9, 16, 0.15) 30%, rgba(10, 9, 16, 0.95)); }
.profile-hero__content {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  align-items: flex-end;
  padding: 0 30px 26px;
  margin-top: -84px;
}
.profile-hero__avatar {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  border: 4px solid var(--surface);
  object-fit: cover;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}
.profile-hero__meta { flex: 1; min-width: 240px; }
.profile-hero__name { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.profile-hero__tagline { color: var(--text-dim); margin-top: 8px; font-size: 1rem; }
.profile-hero__tags { margin-top: 14px; }
.profile-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-hero__stats { display: flex; gap: 20px; margin-top: 14px; font-size: 0.85rem; color: var(--text-muted); }
.profile-hero__stats span { display: inline-flex; align-items: center; gap: 6px; }

.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
@media (max-width: 900px) { .layout-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 14px; }

.bio { color: var(--text-dim); white-space: pre-wrap; }

.links-list { display: flex; flex-direction: column; gap: 9px; }
.link-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.link-row:hover { background: var(--surface-3); border-color: var(--border-strong); transform: translateX(2px); }
.link-row .icon { color: var(--accent); }
.link-row__label { font-weight: 600; font-size: 0.92rem; }
.link-row__host { margin-left: auto; font-size: 0.78rem; color: var(--text-muted); }

/* ----------------------------------------------------------------- галерея */

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }

.shot {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  padding: 0;
  transition: transform 0.18s, border-color 0.18s;
}
.shot:hover { transform: scale(1.02); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(8, 7, 13, 0.94));
  font-size: 0.82rem;
  text-align: left;
  color: var(--text);
}
.shot__credit { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

.shot--manage { cursor: default; }
.shot__tools {
  position: absolute;
  top: 9px;
  right: 9px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.shot--manage:hover .shot__tools { opacity: 1; }
.iconbtn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: rgba(12, 11, 19, 0.86);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.iconbtn:hover { background: var(--surface-3); }
.iconbtn--danger:hover { background: rgba(255, 95, 109, 0.24); color: #ffc9ce; }
.iconbtn[disabled] { opacity: 0.35; cursor: not-allowed; }

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 30px;
  text-align: center;
  color: var(--text-dim);
  background: var(--bg-soft);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 26px; height: 26px; color: var(--accent); margin-bottom: 10px; }

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

.auth-wrap { max-width: 440px; margin: 40px auto; }
.auth-wrap h1 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-wrap .sub { color: var(--text-dim); margin-bottom: 26px; }
.auth-switch { margin-top: 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.auth-switch a { color: var(--accent); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }

.link-editor { display: flex; flex-direction: column; gap: 12px; }
.link-editor__row {
  display: grid;
  grid-template-columns: 130px 1fr 130px auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
@media (max-width: 760px) { .link-editor__row { grid-template-columns: 1fr; } }

.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type="color"] {
  width: 48px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  cursor: pointer;
}

.preview-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

/* ------------------------------------------------------------------ таблицы */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td .actions { display: flex; gap: 7px; }

/* -------------------------------------------------------------- уведомления */

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}
.toast {
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: toast-in 0.22s ease;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.toast--ok { border-color: rgba(52, 211, 153, 0.45); }
.toast--ok .icon { color: var(--success); }
.toast--err { border-color: rgba(255, 95, 109, 0.45); }
.toast--err .icon { color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------------------- лайтбокс */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  background: rgba(6, 5, 11, 0.94);
  backdrop-filter: blur(10px);
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox__stage { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: 100vh; padding: 24px 0; }
.lightbox__stage img { max-width: min(1200px, 92vw); max-height: 78vh; border-radius: var(--radius); box-shadow: var(--shadow-lg); object-fit: contain; }
.lightbox__stage figcaption { text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.lightbox__stage figcaption strong { color: var(--text); display: block; font-size: 1rem; }
.lightbox__nav, .lightbox__close {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  justify-self: center;
  transition: background 0.15s;
}
.lightbox__nav:hover, .lightbox__close:hover { background: var(--surface-3); }
.lightbox__nav .icon, .lightbox__close .icon { width: 20px; height: 20px; }
.lightbox__close { position: absolute; top: 20px; right: 20px; }

/* -------------------------------------------------------------------- модал */

.modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(6, 5, 11, 0.7); backdrop-filter: blur(6px); }
.modal__panel {
  position: relative;
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease;
}
.modal__title { font-size: 1.15rem; margin-bottom: 12px; }
.modal__body { color: var(--text-dim); font-size: 0.93rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ------------------------------------------------------------ стена и посты */

.wall { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }

.post {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.post:hover { border-color: var(--border-strong); }
.post--hidden { opacity: 0.62; }

.post__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.post__date { display: inline-flex; align-items: center; gap: 6px; }
.post__date .icon { color: #38bdf8; }
.post__author { padding: 2px 8px; border-radius: 6px; background: var(--surface-3); }
.post__edited { font-style: italic; }
.post__origin { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }
.post__origin:hover { color: var(--text); }

.post__text { white-space: pre-wrap; color: var(--text); font-size: 0.93rem; }

.post__media {
  display: block;
  margin-top: 12px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: none;
  cursor: zoom-in;
  max-width: 420px;
}
.post__media img { width: 100%; display: block; transition: transform 0.2s; }
.post__media:hover img { transform: scale(1.02); }

.post__attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 0.88rem;
}
.post__badge {
  margin-top: 10px;
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(251, 191, 36, 0.14);
  color: #ffd977;
  font-size: 0.74rem;
  font-weight: 700;
}
.post__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Лайк и комментарии под постом */
.post__social {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.post-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.post-action:hover { background: var(--surface-2); color: var(--text); }
.post-action .icon { width: 1em; height: 1em; }
.post-action--liked { color: #ff8fa3; border-color: rgba(255, 92, 138, 0.4); background: rgba(255, 92, 138, 0.1); }
.post-action--liked .icon { fill: currentColor; }
.post-action--active { background: var(--surface-3); color: var(--text); }

.post__comments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.comments { display: flex; flex-direction: column; gap: 12px; }

.comment { display: flex; gap: 10px; }
.comment__avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  font-size: 0.8rem;
}
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.82rem; }
.comment__author { font-weight: 600; color: var(--text); }
.comment__author:hover { color: var(--accent); }
.comment__date { color: var(--text-muted); }
.comment__delete {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  display: inline-flex;
}
.comment__delete:hover { color: #ff9aa3; background: rgba(255, 95, 109, 0.12); }
.comment__delete .icon { width: 15px; height: 15px; }
.comment__text { margin-top: 3px; font-size: 0.9rem; color: var(--text-dim); white-space: pre-wrap; }

.comment__form { margin-top: 14px; }
.comment__input { min-height: 72px; font-size: 0.9rem; }

/* Модель и авторы */
.model { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.model__name { font-weight: 600; color: var(--text); text-decoration: none; }
a.model__name:hover { color: var(--accent); }
.credits { display: flex; flex-direction: column; gap: 8px; }
.credit { display: flex; flex-direction: column; }
.credit__role { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.credit__name { color: var(--text); text-decoration: none; }
a.credit__name:hover { color: var(--accent); }

/* Выбор типа учётной записи при регистрации */
.choice { display: flex; flex-direction: column; gap: 10px; }
.choice__item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer;
}
.choice__item:has(input:checked) { border-color: var(--accent); background: rgba(124, 92, 255, 0.07); }
.choice__body { display: flex; flex-direction: column; gap: 3px; }
.choice__body .field__hint { margin: 0; }

/* Догрузка каталога */
.load-more { display: flex; justify-content: center; margin-top: 26px; }
.load-more__done { color: var(--text-muted); font-size: 0.85rem; }

/* --------------------------------------------------------------- жалобы */

.report-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.report-link:hover { color: #ffb3a7; background: rgba(255, 140, 110, 0.12); }
.report-link .icon { width: 14px; height: 14px; }
.report-link--quiet { margin-left: auto; }

/* ------------------------------------------------ юридические документы */

.legal { max-width: 860px; }
.legal h1 { margin-bottom: 18px; }
.legal__body { padding: 26px 30px; }
.legal__footer { margin-top: 16px; }

.notice {
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, 0.08);
}
.notice__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #ffd977;
  font-weight: 600;
}
.notice p { margin: 0 0 10px; color: var(--text-dim); font-size: 0.9rem; }
.notice__list { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: 0.88rem; }
.notice__list li { margin-bottom: 4px; word-break: break-word; }
.notice code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.85em;
}

/* Редактор поста в кабинете */
.composer { display: flex; flex-direction: column; gap: 12px; }
.composer__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.composer__preview {
  position: relative;
  max-width: 220px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.composer__preview img { display: block; width: 100%; }
.composer__preview button { position: absolute; top: 6px; right: 6px; }

.checkbox-row { display: flex; align-items: center; gap: 9px; margin-top: 14px; cursor: pointer; font-size: 0.9rem; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ---------------------------------------------------------------- служебное */

.boot { display: grid; place-items: center; gap: 16px; padding: 90px 0; color: var(--text-muted); }
.boot__spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
}
.empty h1, .empty h3 { color: var(--text); margin-bottom: 8px; font-size: 1.35rem; }

.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 0.88rem; font-weight: 600; }
.user-chip img, .user-chip .avatar-fallback { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #ff5c8a); color: #fff; font-size: 0.8rem; font-weight: 700; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Заглушка-аватар с инициалом вместо картинки */
.vcard__avatar--letter {
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #ff5c8a));
}

/* Подсветка полей с ошибками валидации */
.input.is-invalid, .textarea.is-invalid, .select.is-invalid {
  border-color: rgba(255, 95, 109, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 95, 109, 0.12);
}

/* Пустое состояние списка ссылок */
.link-editor .link-editor__row .select { width: 100%; }

.dim ul li { margin-bottom: 6px; }

.row-between { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.step { padding: 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.step__num { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: #cbbcff; font-weight: 700; margin-bottom: 12px; }
.step h3 { font-size: 1rem; margin-bottom: 7px; }
.step p { color: var(--text-dim); font-size: 0.9rem; }

@media (max-width: 720px) {
  .header__nav { display: none; }
  .hero { padding: 36px 24px; }
  .profile-hero__content { padding: 0 18px 22px; }
  .main { padding: 22px 16px 60px; }
  .header__inner { padding: 0 16px; gap: 12px; }
  .lightbox { grid-template-columns: 1fr; }
  .lightbox__nav { position: absolute; bottom: 22px; }
  .lightbox__nav--prev { left: 20px; }
  .lightbox__nav--next { right: 20px; }
}
