/* Balsamiq Sans — self-hosted (Google Fonts may be blocked) */
@font-face {
  font-family: 'Balsamiq Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/balsamiq-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD
}

@font-face {
  font-family: 'Balsamiq Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/balsamiq-400-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116
}

@font-face {
  font-family: 'Balsamiq Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/balsamiq-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD
}

@font-face {
  font-family: 'Balsamiq Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/balsamiq-700-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116
}

@font-face {
  font-family: 'Balsamiq Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/balsamiq-400i-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD
}

@font-face {
  font-family: 'Balsamiq Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/balsamiq-400i-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116
}

@font-face {
  font-family: 'Balsamiq Sans';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/balsamiq-700i-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD
}

@font-face {
  font-family: 'Balsamiq Sans';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/balsamiq-700i-cyr.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116
}

:root {
  --ink: #1b1a24;
  --muted: #75727f;
  --line: #eae6f3;
  --card: #ffffff;
  --accent: #a435f0;
  --accent-2: #c13bf0;
  --pink: #ff3db0;
  --cyan: #33c9ff;
  --soft: #f2e8fd;
  --radius: 22px;
  --shadow: 0 14px 38px rgba(94, 40, 160, .10);
  --shadow-sm: 0 6px 18px rgba(94, 40, 160, .08);
  --page-bg: #f6f2fd;
  --input-bg: #faf8fe;
  --glass-bg: rgba(255, 255, 255, .30);
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0
}

html {
  scrollbar-width: none
}

html::-webkit-scrollbar {
  display: none
}

body {
  font-family: 'Balsamiq Sans', 'Onest', -apple-system, system-ui, sans-serif;
  color: var(--ink);
  /* безграничный фон: SVG повторяется по вертикали (начало стыкуется с концом) */
  background-color: var(--page-bg);
  background-image: url('/static/backgrounds/pc-light-bg.svg');
  background-repeat: repeat-y;
  background-position: top center;
  background-size: 100% auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* фон сайта теперь задаётся на body — старый декоративный слой отключён */
.bg-deco {
  display: none
}

a {
  color: inherit;
  text-decoration: none
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px
}

/* ── Шапка ─────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 18px 0 26px;
  transition: transform .32s cubic-bezier(.4, 0, .2, 1), background-color .3s, border-color .25s
}

.topbar.nav-hidden {
  transform: translateY(-110%)
}

.nav {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 15px 26px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .7)
}

.brand {
  display: flex;
  align-items: center;
  flex: none
}

.brand-logo {
  height: 56px;
  width: auto;
  display: block;
  object-fit: contain
}

/* логотип переключается по теме */
.brand-logo-dark {
  display: none
}

html.dark-eff .brand-logo-light {
  display: none
}

html.dark-eff .brand-logo-dark {
  display: block
}

.blob {
  flex: none
}

.user {
  flex: none
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px;
  border-radius: 10px;
  flex: none;
  order: 5
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: .22s
}

.burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg)
}

.burger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0)
}

.burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg)
}

.blob {
  position: relative;
  display: inline-grid;
  place-items: center
}

.blob .blob-path {
  fill: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  stroke: var(--ink);
  stroke-width: 3;
  transition: fill .25s
}

.blob span {
  position: absolute;
  font-family: 'Comic Sans MS', 'Comic Sans', cursive;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  transition: color .25s;
  pointer-events: none;
  letter-spacing: .3px;
  margin-left: 12px
}

.blob:hover .blob-path {
  fill: url(#bg1)
}

.blob:hover span {
  color: #fff
}

.menu {
  display: flex;
  align-items: center;
  gap: 26px
}

.menu a {
  font-weight: 700;
  font-size: 17px;
  position: relative;
  padding: 4px 0;
  transition: color .18s;
  display: flex;
  align-items: center;
  gap: 6px
}

.menu a:hover {
  color: var(--accent)
}

.menu a.active {
  color: var(--accent)
}

.menu a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px
}

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 9px;
  padding: 1px 6px
}

.spacer {
  flex: 1
}

.user {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative
}

.uname {
  font-weight: 700;
  font-size: 17px
}

.uname.guest {
  color: #9a97a6
}

.btn-login {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: 13px;
  padding: 10px 22px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(164, 53, 240, .32);
  transition: .15s
}

.btn-login:hover {
  filter: brightness(1.07);
  transform: translateY(-1px)
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex: none;
  border: none;
  cursor: default
}

a.user {
  cursor: pointer
}

a.user .avatar,
a.user .uname {
  cursor: pointer
}

a.user:hover .uname {
  color: var(--accent)
}

.avatar.mini {
  width: 30px;
  height: 30px;
  font-size: 11px
}

#userBtn {
  cursor: pointer
}

.av-cyber {
  background: conic-gradient(from 220deg, #33c9ff, #a435f0, #ff3db0, #33c9ff)
}

.av-sunset {
  background: linear-gradient(135deg, #ff8a3d, #ff3d77, #a435f0)
}

.av-mint {
  background: linear-gradient(135deg, #23e3a0, #33c9ff, #7b2fff)
}

.av-grape {
  background: linear-gradient(135deg, #a435f0, #6e2be0, #33c9ff)
}

.av-candy {
  background: linear-gradient(135deg, #ff5ab0, #ff8a3d, #ffd34e)
}

.av-guest {
  background: #eee9f5;
  color: #a39fb0;
  border: 1.5px dashed #cdc6db
}

.dropdown {
  position: absolute;
  top: 56px;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  min-width: 160px;
  padding: 6px;
  display: none;
  flex-direction: column;
  z-index: 70
}

.dropdown.open {
  display: flex
}

.dropdown a,
.dropdown button {
  text-align: left;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  width: 100%
}

.dropdown a:hover,
.dropdown button:hover {
  background: var(--soft)
}

.dropdown form {
  margin: 0
}

/* ── Hero / заголовки ─────────────────────────── */
/* main.wrap, а не main: иначе .wrap{padding:0 24px} перебивает нижний отступ
   по специфичности и последний блок (напр. .comments) прилипает к низу */
main.wrap {
  padding-bottom: 90px
}

/* ── Блюр-панель, объединяющая шапку раздела ──── */
.hero-panel {
  position: relative;
  z-index: 20;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, .30);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 24px;
  padding: 18px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm)
}

.hero-panel>:first-child {
  margin-top: 0
}

.hero-panel>:last-child {
  margin-bottom: 0
}

html.dark-eff .hero-panel {
  background: rgba(28, 23, 48, .38);
  border-color: rgba(255, 255, 255, .08)
}

.hero {
  margin: 8px 0 18px
}

.hero h1 {
  font-family: 'Balsamiq Sans';
  font-weight: 800;
  font-size: clamp(26px, 4vw, 38px);
  margin: 0;
  letter-spacing: -.5px
}

.hero p {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 15px
}

.flash {
  background: #e8fbef;
  border: 1px solid #b9f0cc;
  color: #1c7a43;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 600;
  margin-bottom: 16px
}

.back {
  display: inline-block;
  color: var(--muted);
  font-weight: 600;
  margin: 2px 0 14px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: var(--shadow-sm)
}

.back:hover {
  color: var(--accent)
}

/* ── Тулбар: поиск/сортировка/теги ───────────── */
.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px
}

.search {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 15px;
  box-shadow: var(--shadow-sm)
}

.search svg {
  width: 19px;
  height: 19px;
  stroke: #9a97a6;
  fill: none;
  stroke-width: 2;
  flex: none
}

.search input {
  border: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  width: 100%;
  background: transparent;
  color: var(--ink)
}

.sorts {
  display: flex;
  gap: 8px
}

.pill {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: .15s
}

.pill:hover {
  border-color: var(--accent)
}

.pill.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.tagbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 26px
}

.tagbar .chip {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 13px;
  color: #5a5766;
  transition: .15s
}

.tagbar .chip:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.tagbar .chip.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink)
}

/* ── Лента / карточки ────────────────────────── */
.feed {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px
}

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

.work {
  position: relative;
  background: transparent;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .8);
  transition: transform .18s, box-shadow .18s
}

/* стекло на псевдоэлементе — чтобы backdrop-filter не ломал hover-анимацию transform */
.work::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: -1
}

.work:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(94, 40, 160, .16)
}

.cover {
  position: relative;
  height: 230px;
  display: grid;
  place-items: center;
  overflow: hidden
}

.cover.mini {
  height: 160px
}

.cover .ctitle {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 22px;
  font-family: 'Balsamiq Sans';
  font-weight: 800;
  color: #fff;
  font-size: clamp(24px, 3.4vw, 38px);
  line-height: .96;
  text-shadow: 0 4px 26px rgba(0, 0, 0, .45)
}

/* матовая подложка позади заголовка — чтобы текст читался поверх обложки */
.cover .ctitle::before {
  content: "";
  position: absolute;
  inset: -14px -22px;
  z-index: -1;
  border-radius: 18px;
  background: rgba(18, 8, 38, .26);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, .14)
}

.cover.mini .ctitle::before {
  inset: -10px -16px;
  border-radius: 14px
}

/* на светлых обложках с тёмным текстом — светлая подложка */
.cv-holo .ctitle::before,
.cv-candy .ctitle::before,
.cv-lime .ctitle::before {
  background: rgba(255, 255, 255, .32);
  border-color: rgba(255, 255, 255, .5)
}

.cover.mini .ctitle {
  font-size: clamp(18px, 2.5vw, 24px)
}

.cover .ctitle small {
  display: block;
  font-size: .42em;
  opacity: .9;
  margin-top: 7px;
  font-weight: 600
}

.cover canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1
}

.cv-purple {
  background: linear-gradient(135deg, #a435f0, #6e2be0 60%, #2a1452)
}

.cv-holo {
  background: linear-gradient(120deg, #7ef0d0, #7bb6ff, #c79bff, #ff9bd8, #ffd28a);
  background-size: 220% 220%;
  animation: holo 9s ease infinite
}

.cv-holo .ctitle {
  color: #241a33;
  text-shadow: 0 2px 14px rgba(255, 255, 255, .5)
}

.cv-crimson {
  background: radial-gradient(140% 120% at 20% 10%, #5a1620, #2a0c12 60%, #120608)
}

.cv-noir {
  background: linear-gradient(135deg, #2b2b34, #0e0e12)
}

.cv-matrix {
  background: #020a02
}

.cv-sunset {
  background: linear-gradient(135deg, #ff8a3d, #ff3d77 55%, #a435f0)
}

.cv-ocean {
  background: linear-gradient(135deg, #1fb6ff, #3a47d5 70%, #1a1a4e)
}

.cv-candy {
  background: linear-gradient(135deg, #ff5ab0, #ff8a3d, #ffd34e)
}

.cv-candy .ctitle {
  color: #3a1530
}

.cv-lime {
  background: linear-gradient(135deg, #aef34e, #1fd6a0 70%, #0e5a4e)
}

.cv-lime .ctitle {
  color: #0e2a18
}

@keyframes holo {
  0% {
    background-position: 0 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0 50%
  }
}

.work-body {
  padding: 14px 16px
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px
}

.tag {
  background: var(--soft);
  color: #7a35c8;
  font-weight: 700;
  font-size: 11px;
  border-radius: 7px;
  padding: 3px 9px
}

.workbar {
  display: flex;
  align-items: center;
  gap: 14px
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 15px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
  font-family: inherit
}

.stat svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.9;
  stroke-linejoin: round
}

.stat.like svg {
  fill: none;
  stroke: #ff3b5b
}

.stat.like.on svg {
  fill: #ff3b5b;
  stroke: #ff3b5b
}

.stat.like:hover svg {
  stroke: #ff3b5b
}

.stat.save svg {
  stroke: #8a8695
}

.stat.save.on svg {
  fill: var(--accent);
  stroke: var(--accent)
}

.stat.comment svg {
  stroke: #8a8695
}

.stat.share svg {
  stroke: #8a8695
}

.stat:hover {
  transform: translateY(-1px)
}

.work-author {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 13.5px
}

.feed-end {
  text-align: center;
  margin: 48px 0 6px
}

.feed-end .grey {
  color: #9c98aa;
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 20px;
  opacity: .75
}

.feed-end a {
  display: inline-block;
  margin-top: 4px;
  color: var(--accent-2);
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 20px
}

.feed-end a:hover {
  text-decoration: underline
}

/* ── Детальная страница ──────────────────────── */
.detail {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 860px;
  margin: 0 auto
}

.detail .cover {
  height: 360px
}

.detail-body {
  padding: 24px 28px 28px
}

.detail-body h1 {
  font-family: 'Balsamiq Sans';
  font-weight: 800;
  font-size: 30px;
  margin: 10px 0 8px;
  letter-spacing: -.5px
}

.detail-body h1 .sub {
  color: var(--muted);
  font-weight: 600;
  font-size: .6em
}

.desc {
  color: #43404e;
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 18px
}

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 18px
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 18px
}

.comments {
  max-width: 860px;
  margin: 30px auto 0;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 24px 28px
}

.comments h3 {
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 16px
}

.ccount {
  background: var(--soft);
  color: #7a35c8;
  border-radius: 9px;
  font-size: 13px;
  padding: 2px 9px;
  margin-left: 4px;
  font-family: 'Balsamiq Sans'
}

.comment-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px
}

.comment-form input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 11px 14px;
  font: inherit;
  font-size: 15px;
  outline: none;
  background: var(--input-bg)
}

.comment-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(164, 53, 240, .14)
}

.comment-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 13px;
  padding: 11px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: .15s
}

.comment-form button:hover {
  filter: brightness(1.07)
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.comment {
  display: flex;
  gap: 11px;
  align-items: flex-start
}

.comment b {
  font-size: 14px
}

.comment p {
  margin: 3px 0 0;
  color: #43404e;
  font-size: 14.5px;
  line-height: 1.45
}

/* ── Пустые состояния ────────────────────────── */
.empty {
  background: rgba(255, 255, 255, .30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius);
  padding: 52px 40px;
  text-align: center;
  max-width: 640px;
  margin: 24px auto;
  box-shadow: var(--shadow-sm)
}

.empty.soft {
  box-shadow: none;
  background: rgba(255, 255, 255, .6)
}

.empty .emoji {
  font-size: 50px
}

.empty h2 {
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 22px;
  margin: 14px 0 8px
}

.empty p {
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto 22px;
  line-height: 1.5
}

.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(164, 53, 240, .34);
  transition: .15s;
  border: none;
  font: inherit;
  font-size: 15px;
  cursor: pointer
}

.cta:hover {
  filter: brightness(1.07);
  transform: translateY(-1px)
}

.cta.ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  box-shadow: none
}

.cta.ghost.danger {
  color: #e0484f;
  border-color: #f3c2c4
}

/* ── Профиль ─────────────────────────────────── */
.profile-wrap {
  max-width: 720px;
  margin: 0 auto 48px
}

.profile-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 28px;
  padding: 28px 32px;
  display: flex;
  gap: 26px;
  align-items: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(164, 53, 240, .10), transparent 40%, rgba(51, 201, 255, .10))
}

.big-av {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  flex: none;
  font-size: 36px;
  position: relative
}

.pc-text {
  position: relative
}

.pc-text h2 {
  font-family: 'Balsamiq Sans';
  font-weight: 900;
  font-size: 34px;
  margin: 0 0 6px;
  line-height: .95
}

.bio {
  color: #3a3744;
  font-weight: 600;
  font-size: 15px;
  max-width: 360px;
  line-height: 1.45
}

.pc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: center
}

.pc-actions form {
  margin: 0
}

.sticker {
  position: absolute;
  font-size: 26px;
  z-index: 2
}

.sticker.s1 {
  top: 14px;
  right: 26px;
  transform: rotate(12deg)
}

.sticker.s2 {
  bottom: 18px;
  right: 74px;
  transform: rotate(-9deg)
}

.sticker.s3 {
  top: 54px;
  right: 18px;
  transform: rotate(6deg)
}

/* ── Формы ───────────────────────────────────── */
.card-form {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 30px 34px;
  max-width: 660px;
  margin: 18px auto 48px;
  box-shadow: var(--shadow)
}

.card-form h2 {
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 22px;
  margin: 0 0 4px
}

.card-form .lead {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px
}

.field {
  margin-bottom: 18px
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 7px
}

.opt {
  color: #aaa5b5;
  font-weight: 500
}

.field input[type=text],
.field textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  background: var(--input-bg);
  transition: .15s
}

.field textarea {
  min-height: 90px;
  resize: vertical
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(164, 53, 240, .14)
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 9px
}

.choice {
  position: relative
}

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer
}

.choice .chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 8px 13px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px)
}

.choice .swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px
}

.choice .dot {
  width: 20px;
  height: 20px;
  border-radius: 50%
}

.choice input:checked+.chip {
  border-color: var(--accent);
  background: var(--soft);
  color: #7a35c8
}

.submit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 28px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(164, 53, 240, .32);
  transition: .15s;
  margin-top: 4px
}

.submit:hover {
  filter: brightness(1.07);
  transform: translateY(-1px)
}

.mini-card .workbar {
  justify-content: space-between
}

.del {
  margin: 0
}

.del button {
  background: none;
  border: none;
  font-size: 17px;
  cursor: pointer;
  opacity: .6
}

.del button:hover {
  opacity: 1
}

/* ── LXP заглушка ────────────────────────────── */
.lxp-card {
  max-width: 560px;
  margin: 60px auto;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 44px 40px;
  text-align: center;
  box-shadow: var(--shadow)
}

.lxp-logo {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 8px
}

.lxp-card h1 {
  font-family: 'Balsamiq Sans';
  font-weight: 800;
  margin: 0 0 12px
}

.lxp-card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 22px
}

/* ── Индикатор прокрутки-волна ───────────────── */
.scroll-wave-wrap {
  position: fixed;
  right: 5px;
  top: 0;
  width: 20px;
  height: 100vh;
  z-index: 55;
  pointer-events: none;
  opacity: 0;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .3s
}

.scroll-wave-wrap.visible {
  opacity: 1
}

.scroll-wave-svg {
  width: 100%;
  height: 100%;
  overflow: visible
}

.scroll-wave-track {
  fill: none;
  stroke: rgba(164, 53, 240, .12);
  stroke-width: 3;
  stroke-linecap: round
}

.scroll-wave-fill {
  fill: none;
  stroke: #8839ef;
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(136, 57, 239, .55))
}

.scroll-wave-dot {
  fill: #fff;
  stroke: #8839ef;
  stroke-width: 2.5;
  pointer-events: auto;
  cursor: grab;
  filter: drop-shadow(0 2px 6px rgba(136, 57, 239, .55));
  transition: r .15s
}

.scroll-wave-wrap.dragging {
  pointer-events: auto
}

.scroll-wave-wrap.dragging .scroll-wave-dot {
  cursor: grabbing
}

@media(max-width:860px) {
  .scroll-wave-dot {
    r: 9
  }
}

/* ── Спасательный круг / поддержка ───────────── */
.support {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90
}

.lifebuoy {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(255, 90, 77, .35), 0 4px 10px rgba(0, 0, 0, .12);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s
}

.lifebuoy img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
  pointer-events: none
}

/* ── Настройки темы (в профиле) ───────────────── */
.settings-card {
  display: block;
  margin-top: 18px;
  margin-bottom: 20px
}

.settings-title {
  font-family: 'Balsamiq Sans';
  font-weight: 800;
  font-size: 20px;
  margin: 0 0 14px;
  position: relative
}

.settings-hint {
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 0;
  position: relative
}

.theme-switch {
  position: relative;
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px
}

.theme-switch button {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  background: none;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: .15s
}

.theme-switch button:hover {
  background: rgba(120, 80, 180, .10)
}

.theme-switch button.on {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm)
}

/* ── Плавный переход при смене темы ──────────── */
body,
.nav,
.work,
.detail,
.comments,
.card-form,
.profile-card,
.dropdown,
.lifebuoy,
.lxp-card,
.empty,
.search,
.pill,
.field input[type=text],
.field textarea,
.comment-form input {
  transition: background-color .3s, border-color .25s, color .2s, box-shadow .3s;
}

/* ── Тёмная тема ──────────────────────────────── */
html.dark-eff {
  --ink: #ece8ff;
  --muted: #9b96b5;
  --line: #2d2847;
  --card: #1c1730;
  --accent: #b855f5;
  --accent-2: #cc5df5;
  --pink: #ff5bc4;
  --cyan: #40d4ff;
  --soft: #261d3e;
  --shadow: 0 14px 38px rgba(0, 0, 0, .50);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .35);
  --page-bg: #100d1c;
  --input-bg: #1a1530;
  --glass-bg: rgba(28, 23, 48, .38);
}

html.dark-eff body {
  background-image: url('/static/backgrounds/pc-dark-bg.svg')
}

/* стеклянные блоки в тёмной теме (фон из --glass-bg, блюр уже задан выше) */
html.dark-eff .work,
html.dark-eff .detail,
html.dark-eff .comments,
html.dark-eff .card-form,
html.dark-eff .profile-card,
html.dark-eff .empty,
html.dark-eff .lifebuoy,
html.dark-eff .lxp-card,
html.dark-eff .dropdown,
html.dark-eff .search,
html.dark-eff .pill,
html.dark-eff .choice .chip {
  background: var(--glass-bg)
}

html.dark-eff .empty,
html.dark-eff .back {
  background: rgba(28, 23, 48, .38);
  border-color: rgba(255, 255, 255, .08)
}

html.dark-eff .work {
  background: transparent;
  border-color: rgba(255, 255, 255, .08)
}

html.dark-eff .tagbar .chip {
  background: var(--glass-bg);
  color: var(--muted)
}

html.dark-eff .nav {
  border-color: rgba(255, 255, 255, .07)
}

/* вторичный текст */
html.dark-eff .desc,
html.dark-eff .comment p,
html.dark-eff .bio {
  color: var(--muted)
}

/* flash-сообщение */
html.dark-eff .flash {
  background: #1a3d2a;
  border-color: #2a6045;
  color: #7de8b0
}

/* scroll-wave dot чуть ярче */
html.dark-eff .scroll-wave-track {
  stroke: rgba(184, 85, 245, .20)
}

/* ── Топбар → мобильный режим при ширине окна < 900px ── */
@media(max-width:900px) {

  .nav {
    flex-wrap: wrap;
    gap: 0;
    padding: 10px 14px;
    position: relative;
    align-items: center;
    /* стекло переносим на ::before, чтобы у .nav не было backdrop-filter
       и блюр выпадающего меню (вложенный backdrop-filter) заработал */
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none
  }

  .nav::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 22px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: -1
  }

  .blob {
    display: none
  }

  .brand-logo {
    height: 34px
  }

  .uname {
    font-size: 13px
  }

  .btn-login {
    font-size: 13px;
    padding: 7px 14px
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px
  }

  .user {
    gap: 7px
  }

  .menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    z-index: 65;
    opacity: 0;
    transform: translateY(-8px) scale(.98);
    transform-origin: top center;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  .nav.menu-open .menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .menu a {
    padding: 11px 4px;
    font-size: 15px;
    border-bottom: 1px solid var(--line)
  }

  .menu a:last-child {
    border-bottom: none
  }

  .menu a.active::after {
    display: none
  }

  .burger {
    display: flex;
    order: 4
  }

  .spacer {
    order: 2;
    min-width: 8px
  }

  .user {
    order: 3
  }
}

/* ── Адаптив контента (фон/лента/профиль) при ширине < 860px ── */
@media(max-width:860px) {

  /* на телефонах — вертикальный phone-фон */
  body {
    background-image: url('/static/backgrounds/phone-light-bg.svg')
  }

  html.dark-eff body {
    background-image: url('/static/backgrounds/phone-dark-bg.svg')
  }

  .feed {
    grid-template-columns: 1fr
  }

  .profile-card {
    flex-direction: column;
    text-align: center
  }

  .pc-actions {
    justify-content: center
  }
}

/* ── Телефоны в ландшафте: топбар компактно, всё прижато влево ── */
@media (orientation: landscape) and (max-height: 500px) {
  .nav {
    gap: 12px;
    flex-wrap: nowrap
  }

  .blob {
    display: inline-grid
  }

  .spacer {
    display: none
  }

  .menu {
    gap: 16px
  }

  .user {
    gap: 7px
  }

  .uname {
    font-size: 13px
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px
  }
}

/* ───────────────────────────────────────────────────────────
   Загруженные аватары / обложки, авторизация, медиа, загрузка
   ─────────────────────────────────────────────────────────── */
.avatar.img {
  background-size: cover;
  background-position: center;
  color: transparent
}

.cover.has-img {
  background-size: cover;
  background-position: center
}

.cover.has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(20, 8, 36, 0) 40%, rgba(20, 8, 36, .55))
}

/* ── страницы входа / регистрации ── */
.auth-body {
  min-height: 100vh;
  display: flex
}

.auth-wrap {
  margin: auto;
  width: 100%;
  max-width: 560px;
  padding: 40px 18px;
  display: flex;
  flex-direction: column;
  align-items: center
}

.auth-brand {
  display: block;
  margin-bottom: 22px
}

.auth-brand img {
  height: 46px
}

.auth-card {
  width: 100%;
  margin: 0
}

.auth-card.wide {
  max-width: 560px
}

.auth-alt {
  text-align: center;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px
}

.auth-alt a {
  color: var(--accent);
  font-weight: 700
}

.flash.err {
  background: #fdecec;
  border-color: #f4bcbc;
  color: #b33232
}

.field input[type=password] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  background: var(--input-bg);
  transition: .15s
}

.field input[type=password]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(164, 53, 240, .14)
}

.row.two {
  display: flex;
  gap: 14px;
  flex-wrap: wrap
}

.row.two .field {
  flex: 1 1 200px
}

/* ── выбор аватара ── */
.avatar-pick {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap
}

.avatar-preview {
  flex: none
}

.avatar-preview .big-av {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  font-size: 30px
}

.avatar-preview img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block
}

.avatar-pick-controls {
  flex: 1 1 260px;
  min-width: 240px
}

.avatar-pick-controls .choices {
  margin-bottom: 12px
}

/* ── кнопки загрузки файлов ── */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px dashed var(--line);
  border-radius: 13px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: .15s
}

.upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent)
}

.upload-btn input[type=file] {
  display: none
}

.upload-btn.mt {
  margin-top: 10px
}

.upload-btn.block {
  display: flex;
  justify-content: center
}

.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px
}

.upload-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 8px 6px 11px;
  border-radius: 10px;
  background: var(--soft);
  color: #7a35c8;
  max-width: 100%
}

.upload-chip .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.upload-chip .x {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 6px;
  background: rgba(122, 53, 200, .14);
  color: #7a35c8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s, color .15s
}

.upload-chip .x:hover {
  background: #e0454f;
  color: #fff
}

.upload-total {
  margin-top: 9px
}

.upload-total.over {
  color: #d23b46;
  font-weight: 600
}

/* ── галерея медиа на странице работы ── */
.media-gallery,
.media-links {
  max-width: 980px;
  margin: 26px auto 0
}

.media-gallery h3,
.media-links h3 {
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 14px
}

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

.media-item {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  background: #00000010;
  box-shadow: var(--shadow)
}

.media-item img,
.media-item video {
  width: 100%;
  display: block;
  border-radius: 16px
}

video.media-item {
  background: #000;
  max-height: 360px
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 9px
}

.link-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  transition: .15s
}

.link-pill:hover {
  border-color: var(--accent);
  background: var(--soft)
}

.link-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6b5b86
}

html.dark-eff .auth-card,
html.dark-eff .upload-btn,
html.dark-eff .link-pill {
  background: rgba(30, 24, 46, .55)
}

html.dark-eff .link-pill span {
  color: #c8bfe0
}

/* ───────────────────────────────────────────────────────────
   Модерация и админ-панель
   ─────────────────────────────────────────────────────────── */
.admin-link {
  color: var(--accent) !important;
  font-weight: 800
}

/* метки «на модерации» */
.mod-badge {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  background: rgba(20, 8, 36, .72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 9px
}

.mini-card.pending .cover,
.work.pending .cover {
  opacity: .82
}

.mod-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #b07400;
  background: #fff3d6;
  border-radius: 7px;
  padding: 2px 7px;
  vertical-align: middle
}

.comment.pending {
  opacity: .72
}

.comment-hint {
  margin: 4px 0 16px
}

/* вкладки */
.admin-tabs {
  display: flex;
  gap: 10px;
  margin: 6px 0 22px
}

.admin-tabs .pill {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.badge.soft {
  background: var(--soft);
  color: #7a35c8
}

/* блоки */
.admin-block {
  max-width: 920px;
  margin: 0 auto 30px
}

.admin-block > h2 {
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 10px
}

.admin-block .count {
  font-size: 13px;
  font-weight: 700;
  color: #7a35c8;
  background: var(--soft);
  border-radius: 8px;
  padding: 2px 9px
}

.admin-block > .muted {
  margin: 0 0 14px
}

.muted {
  color: var(--muted);
  font-size: 13.5px
}

.empty-line {
  padding: 14px 0
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm)
}

.admin-thumb {
  flex: none;
  width: 92px;
  border-radius: 12px;
  overflow: hidden
}

.admin-thumb .cover {
  height: 64px
}

.admin-thumb .cover .ctitle {
  font-size: 12px;
  padding: 0 6px
}

.admin-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px
}

.admin-row-main b {
  font-size: 15px
}

.comment-text {
  color: #4a4458;
  font-size: 14px;
  margin-top: 2px
}

.clamp {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.admin-row-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end
}

.admin-row-actions form {
  margin: 0
}

.cta.sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 11px;
  box-shadow: none
}

.role-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 6px;
  padding: 2px 7px;
  margin-left: 7px;
  vertical-align: middle
}

.role-tag.admin {
  background: #efe2ff;
  color: #7a35c8
}

.role-tag.blocked {
  background: #fde3e3;
  color: #c23b3b
}

.role-tag.teacher {
  background: #e1f1ff;
  color: #1f74b5
}

.role-tag.employer {
  background: #e6f7ec;
  color: #1c8a4b
}

/* селекты ролей в админке */
.adm-select,
.role-form select {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 9px 12px;
  background: var(--input-bg);
  color: var(--ink);
  cursor: pointer
}

.adm-select {
  width: 100%;
  max-width: 280px
}

.role-form {
  margin: 0
}

.role-form select {
  padding: 8px 10px;
  font-size: 13px
}

.user-row.blocked {
  opacity: .65
}

/* мини-поповеры с формами */
.adm-pop {
  position: relative
}

.adm-pop > summary {
  list-style: none;
  cursor: pointer
}

.adm-pop > summary::-webkit-details-marker {
  display: none
}

.adm-pop .pop-form {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  min-width: 230px
}

.adm-pop .pop-form.col {
  flex-direction: column;
  align-items: stretch
}

.adm-pop .pop-form input[type=text] {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 14px;
  background: var(--input-bg);
  flex: 1
}

.choices.sm {
  gap: 6px
}

.choices.sm .chip {
  padding: 6px 8px
}

.adm-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
  margin: 4px 0 18px;
  cursor: pointer
}

.adm-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent)
}

.admin-create {
  margin: 14px 0 0;
  max-width: 100%
}

@media (max-width: 640px) {
  .admin-row {
    flex-wrap: wrap
  }
  .admin-row-actions {
    width: 100%;
    justify-content: flex-start
  }
  /* на телефонах кнопка «Отправить» переносится под поле, во всю ширину */
  .comment-form {
    flex-wrap: wrap
  }
  .comment-form button {
    flex: 1 0 100%
  }
}

html.dark-eff .admin-row,
html.dark-eff .adm-pop .pop-form {
  background: rgba(30, 24, 46, .6)
}

/* ───────────────────────────────────────────────────────────
   Поиск: мультивыбор тегов, последние работы, публичный профиль
   ─────────────────────────────────────────────────────────── */
button.pill {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink)
}

button.pill.on {
  color: #fff
}

/* выпадающий выбор тегов */
.tag-select {
  position: relative
}

.tag-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 15px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: .15s
}

.tag-select-btn:hover {
  border-color: var(--accent)
}

.tag-select-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none
}

.tag-select-btn .badge {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 1px 8px;
  min-width: 20px;
  text-align: center
}

.tag-select-btn .caret {
  font-size: 11px;
  opacity: .65;
  transition: transform .18s
}

.tag-select.open .tag-select-btn .caret {
  transform: rotate(180deg)
}

.tag-menu {
  position: fixed;
  z-index: 85;
  top: 0;
  left: 0;
  width: 360px;
  max-width: 86vw;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(22px) saturate(1.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(94, 40, 160, .22), inset 0 1px 0 rgba(255, 255, 255, .6);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .16s, transform .16s, visibility .16s
}

.tag-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0)
}

.tag-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 14px
}

.tag-clear {
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer
}

.tag-clear:hover {
  color: var(--accent)
}

.tag-menu-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
  margin: 0 -4px 12px;
  padding: 0 4px
}

.tag-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: .12s
}

.tag-opt:hover {
  background: var(--soft)
}

.tag-opt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0
}

.tag-opt .tick {
  width: 19px;
  height: 19px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  flex: none;
  display: grid;
  place-items: center;
  transition: .12s
}

.tag-opt input:checked + .tick {
  background: var(--accent);
  border-color: var(--accent)
}

.tag-opt input:checked + .tick::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 900
}

.tag-opt input:checked ~ .tname {
  color: #7a35c8
}

.tag-apply {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 13px;
  padding: 11px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(164, 53, 240, .3)
}

/* выбранные теги под тулбаром */
.active-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px
}

.active-tags .at-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted)
}

.active-tags .chip {
  background: var(--soft);
  color: #7a35c8;
  border-radius: 999px;
  padding: 5px 13px;
  font-weight: 700;
  font-size: 13px
}

.active-tags .at-reset {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted)
}

.active-tags .at-reset:hover {
  color: var(--accent)
}

/* последние работы в профиле */
.recent-card {
  display: block;
  margin-top: 18px
}

.recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px
}

.recent-head .settings-title {
  margin: 0
}

.recent-all {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px
}

.recent-item {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: .15s
}

.recent-item:hover {
  transform: translateY(-3px)
}

.recent-item .cover {
  height: 96px
}

.recent-item .cover .ctitle {
  font-size: 14px;
  padding: 0 8px
}

.recent-item.pending .cover {
  opacity: .8
}

.recent-item .mod-badge {
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  font-size: 12px
}

/* публичный профиль */
.pub-card .pub-meta {
  margin-top: 10px;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px
}

.pub-works-title {
  font-family: 'Balsamiq Sans';
  font-weight: 700;
  font-size: 22px;
  max-width: 1200px;
  margin: 26px auto 16px
}

.pc-text h2 .role-tag {
  vertical-align: middle
}

@media (max-width: 560px) {
  .recent-item .cover {
    height: 76px
  }
}

html.dark-eff .tag-menu {
  background: rgba(34, 27, 52, .55);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .08)
}

/* ───────────────────────────────────────────────────────────
   Кроппер аватара
   ─────────────────────────────────────────────────────────── */
.crop-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px
}

.crop-wrap[hidden] {
  display: none
}

.crop-stage {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  background: #14081f;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 10px 30px rgba(94, 40, 160, .25);
  user-select: none
}

.crop-stage.grab {
  cursor: grabbing
}

.crop-img {
  position: absolute;
  max-width: none;
  pointer-events: none;
  user-select: none
}

.crop-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9),
              inset 0 0 0 4px rgba(164, 53, 240, .35)
}

.crop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px;
  max-width: 100%
}

.crop-ic {
  font-weight: 900;
  font-size: 18px;
  color: var(--muted);
  width: 16px;
  text-align: center;
  user-select: none
}

.crop-zoom {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  outline: none
}

.crop-zoom::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(164, 53, 240, .5);
  cursor: pointer
}

.crop-zoom::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(164, 53, 240, .5);
  cursor: pointer
}

.crop-hint {
  margin: 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 260px
}

/* в компактном поповере админки кроппер чуть меньше */
.adm-pop .crop-stage {
  width: 170px;
  height: 170px
}

/* ───────────────────────────────────────────────────────────
   Баннер профиля и редактор эмодзи-стикеров
   ─────────────────────────────────────────────────────────── */
.banner {
  container-type: inline-size;
}

.bs-emoji {
  position: absolute;
  line-height: 1;
  font-size: calc(9cqw * var(--s, 1));
  white-space: nowrap;
}

/* карточка профиля с баннером */
.profile-head {
  display: block;
  padding: 0;
  overflow: hidden;
}

.profile-head .pc-inner {
  display: flex;
  gap: 26px;
  align-items: center;
  padding: 28px 32px;
  position: relative;
}

.profile-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  background: #2a1452 center/cover no-repeat;
  overflow: hidden;
}

.profile-banner .bs-emoji {
  pointer-events: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.profile-head.has-banner .pc-inner {
  padding-top: 16px;
}

.profile-head.has-banner .big-av {
  margin-top: -74px;
  box-shadow: 0 0 0 5px var(--card);
  position: relative;
  z-index: 2;
}

html.dark-eff .profile-head.has-banner .big-av {
  box-shadow: 0 0 0 5px #241c38;
}

/* редактор */
.banner-studio {
  max-width: 560px;
}

.bs-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #14081f center/cover no-repeat;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

.bs-bg {
  position: absolute;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.bs-emojis {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bs-emojis .bs-emoji {
  pointer-events: auto;
  cursor: grab;
}

.bs-emoji.sel {
  outline: 2px dashed rgba(255, 255, 255, .85);
  outline-offset: 3px;
  border-radius: 6px;
}

.bs-emoji .bs-handle,
.bs-emoji .bs-del {
  display: none;
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  place-items: center;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .35)
}

.bs-emoji.sel .bs-handle,
.bs-emoji.sel .bs-del {
  display: grid;
}

.bs-emoji .bs-handle {
  right: -11px;
  bottom: -11px;
  color: #7a35c8;
  cursor: nwse-resize
}

.bs-emoji .bs-del {
  right: -11px;
  top: -11px;
  color: #e0484f;
  cursor: pointer
}

.bs-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .82);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 0 14px;
  pointer-events: none
}

.bs-empty[hidden] {
  display: none
}

.bs-tools {
  margin-top: 12px
}

.bs-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap
}

.bs-clear {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer
}

.bs-zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 260px;
  max-width: 100%;
  margin-top: 12px
}

.bs-zoom-row[hidden] {
  display: none
}

.emoji-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  max-height: 168px;
  overflow-y: auto;
  padding: 8px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 14px
}

.emo-btn {
  font-size: 22px;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: .12s
}

.emo-btn:hover {
  background: var(--soft);
  transform: scale(1.18)
}

/* ── кроппер обложки работы (прямоугольный) ── */
.cover-crop {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px
}

.cover-crop[hidden] {
  display: none
}

.cover-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  overflow: hidden;
  background: #14081f;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: 0 10px 30px rgba(94, 40, 160, .22)
}

.cover-stage.grab {
  cursor: grabbing
}

.cover-cimg {
  position: absolute;
  max-width: none;
  pointer-events: none;
  user-select: none
}
