:root {
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(212, 161, 90, 0.12), transparent 25%),
    var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
}

.notice-panel {
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface-alt);
}

.donate-contacts {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.donate-contacts a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.donate-contacts a:hover,
.donate-contacts a:focus {
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

.donate-contacts-name {
  font-family: var(--font-heading);
  color: var(--color-text);
}

.donate-contacts-note {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-strong);
}

img {
  max-width: 100%;
  display: block;
}

.container,
.container-fluid {
  max-width: var(--container-width);
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1020;
  backdrop-filter: blur(12px);
  background: rgba(11, 13, 16, 0.88);
  border-bottom: 1px solid var(--color-border);
}

.navbar {
  min-height: var(--header-height);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text);
}

.navbar-brand .brand-name {
  max-width: 5.5rem;
  line-height: 1.15;
  white-space: normal;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: rgba(212, 161, 90, 0.08);
  box-shadow: inset 0 0 0 1px rgba(212, 161, 90, 0.18);
}

.brand-mark img {
  width: 1.35rem;
  height: 1.35rem;
}

.navbar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
}

.nav-link {
  color: var(--color-text-muted);
  font-size: 0.96rem;
  padding: 0.8rem 0.7rem;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-text);
}

.navbar-toggler {
    border-color: var(--color-border);
    color: var(--color-text);
    /* Иконка меню: у Bootstrap она тёмная и на тёмной шапке не видна. */
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(245, 243, 239, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 132px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
}

.navbar-search input {
  background: transparent;
  border: 0;
  color: var(--color-text);
  outline: none;
  width: 100%;
  font: inherit;
}

.navbar-search input::placeholder {
  color: var(--color-text-muted);
}

.navbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.navbar-actions .btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
  white-space: nowrap;
}

.dropdown-menu {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.dropdown-item {
  color: var(--color-text);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-text);
}

.icon-button,
.btn {
  border-radius: var(--radius-pill);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover,
.btn:hover {
  transform: translateY(-1px);
}

.btn {
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.8rem 1.2rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-strong));
  color: #130f0b;
  box-shadow: 0 18px 28px rgba(212, 161, 90, 0.22);
}

.btn-primary:hover {
  color: #130f0b;
}

.btn-outline {
  border-color: var(--color-border);
  background: transparent;
  color: var(--color-text);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

.page-shell {
  padding: var(--space-12) 0 var(--space-16);
}

.page-header {
  margin-bottom: var(--space-8);
}

.page-kicker {
  color: var(--color-accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.7em;
  font-family: var(--font-heading);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.1rem);
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
}

.lead {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.text-muted,
.muted {
  color: var(--color-text-muted) !important;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 var(--space-6);
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  padding-right: 0.5rem;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

/* Bootstrap красит текущий пункт в тёмно-серый — на тёмном фоне его не видно. */
.breadcrumb-item.active {
  color: var(--color-text);
}

.site-card,
.panel,
.card,
.info-block,
.product-card,
.auth-panel,
.checkout-panel,
.filter-panel,
.form-panel {
  background: linear-gradient(180deg, rgba(13, 17, 21, 0.95), rgba(18, 24, 29, 0.92));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.product-card {
  overflow: hidden;
  height: 100%;
}

.product-card .card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-surface-alt);
}

.product-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .card-body {
  padding: 1.2rem;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.product-card .badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(125, 167, 125, 0.12);
  color: var(--color-success);
}

.product-card .badge.out {
  background: rgba(216, 107, 93, 0.1);
  color: var(--color-danger);
}

.product-title {
  margin-bottom: 0.3rem;
  font-size: 1.2rem;
}

.price {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--color-accent-strong);
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.filter-panel {
  padding: 1.2rem;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.filter-link {
  display: block;
  padding: 0.75rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  background: transparent;
}

.filter-link.active {
  background: var(--color-accent-soft);
  border-color: rgba(212, 161, 90, 0.25);
  color: var(--color-text);
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.01);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.gallery-frame {
  display: grid;
  gap: 1rem;
}

.gallery-main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
}

.gallery-main img {
  width: 100%;
  height: 480px;
  object-fit: cover;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.gallery-thumb {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-alt);
}

.gallery-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.shop-specs {
  display: grid;
  gap: 0.75rem;
  margin: 1.3rem 0;
}

.shop-spec {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.shop-spec strong {
  color: var(--color-text);
}

.form-panel,
.auth-panel,
.checkout-panel {
  padding: 1.4rem;
}

.form-control,
.form-select,
textarea {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: 0.75rem 0.9rem;
}

.form-control::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

.form-group {
  margin-bottom: 1rem;
}

.form-errorlist {
  padding-left: 1rem;
  color: var(--color-danger);
}

.account-layout,
.contacts-grid,
.info-grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-block {
  padding: 1.3rem;
}

.table-wrap {
  overflow-x: auto;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--color-text);
}

.cart-table th,
.cart-table td {
  padding: 1rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.cart-table th {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.cart-product img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.total-box {
  padding: 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.02);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border);
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 800;
  border-bottom: 0;
}

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1090;
}

.toast {
  background: rgba(18, 24, 29, 0.96);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.page-list {
  display: grid;
  gap: 0.75rem;
}

.footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  background: rgba(11, 13, 16, 0.72);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 2rem;
  padding: 2.5rem 0 1.6rem;
}

.footer-link-list {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-link-list a {
  color: var(--color-text-muted);
}

.footer small,
.footer p {
  color: var(--color-text-muted);
}

@media (max-width: 991.98px) {
  .product-grid,
  .contact-grid,
  .summary-grid,
  .info-grid,
  .account-layout,
  .product-detail-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .navbar-search {
    width: 100%;
    min-width: 0;
  }

  .navbar-collapse {
    padding-top: 0.75rem;
  }

  /* Шапка на телефоне: название сжимается, а переключатель языка и кнопка
     меню остаются в одной строке справа — раньше они переносились и были
     недоступны. */
  .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .navbar-brand .brand-name {
    max-width: 6.5rem;
    font-size: 0.82rem;
  }

  .lang-switch {
    flex: 0 0 auto;
    align-self: center;
  }

  .navbar-toggler {
    flex: 0 0 auto;
    margin-left: 0.35rem;
  }

  .navbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 575.98px) {
  .page-shell {
    padding-top: 3rem;
  }

  .gallery-main img {
    height: 320px;
  }

  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }
}

.cms-doc > p,
.cms-doc > ul,
.cms-doc > ol {
  margin-bottom: 1rem;
}

.cms-doc > p:last-child,
.cms-doc > ul:last-child,
.cms-doc > ol:last-child {
  margin-bottom: 0;
}

.cms-doc h2,
.cms-doc h3,
.cms-doc h4 {
  margin-top: 1.6rem;
}

.cms-doc h2:first-child,
.cms-doc h3:first-child,
.cms-doc h4:first-child {
  margin-top: 0;
}

.cms-doc ul,
.cms-doc ol {
  display: grid;
  gap: 0.35rem;
  padding-left: 1.2rem;
}

.cms-doc a {
  color: var(--color-accent-strong);
}

.cms-doc-lead > p:first-child {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.block-heading.text-center {
  text-align: center;
}

.block-heading.text-left {
  text-align: left;
}

.block-image {
  margin: 0;
}

.block-image img {
  width: 100%;
  border-radius: var(--radius-lg);
}

.block-image figcaption {
  margin-top: 0.6rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.block-cta {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(212, 161, 90, 0.11), rgba(255, 255, 255, 0.02));
}

/* Форум: голосование, бейдж «От автора», карма */
.vote-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
  min-width: 2.25rem;
  text-align: center;
}

.vote-btn {
  background: transparent;
  border: none;
  padding: 0;
  line-height: 1;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.vote-btn:hover {
  color: var(--color-accent-strong);
}

.vote-btn.is-active {
  color: var(--color-accent-strong);
  transform: scale(1.15);
}

.vote-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.vote-score {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-text);
}

.vote-label {
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.author-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}

.karma {
  color: var(--color-accent);
}

/* Медиа в текстах и вложениях: фото — миниатюрой, гиф — по нажатию. */
.content-image {
  max-width: 100%;
  height: auto;
  max-height: 460px;
  border-radius: var(--radius-md);
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.attachment-thumb img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 180px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

/* Лайтбокс форума: по клику миниатюра открывается поверх страницы. */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(4, 5, 7, 0.88);
  backdrop-filter: blur(4px);
}

.lightbox-image {
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: rgba(11, 13, 16, 0.85);
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

.gif-holder {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 8rem;
  min-height: 5rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
  cursor: pointer;
}

.gif-holder .gif-open {
  font-weight: 700;
  text-decoration: none;
  color: var(--color-accent-strong);
}

.gif-holder .gif-hint {
  font-size: 0.72rem;
}

.gif-holder.is-playing {
  padding: 0;
  border-style: solid;
}

.gif-holder img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--radius-md);
}

/* Регистрация: капча и галочка согласия */
.form-captcha img {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.form-captcha input {
  max-width: 12rem;
}

.form-check-block {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.form-check-block .form-label {
  margin: 0;
  font-size: 0.92rem;
}

.form-check-block .form-label a {
  color: var(--color-accent-strong);
}

.form-check-input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.confirm-notice {
  padding: 1rem 1.15rem;
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-md);
  background: rgba(212, 161, 90, 0.08);
}

/* Статусы заказа в личном кабинете */
.order-status-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.order-status-steps li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.order-status-steps li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--color-border);
}

.order-status-steps li.is-current {
  color: var(--color-text);
  font-weight: 700;
}

.order-status-steps li.is-current::before {
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(212, 161, 90, 0.18);
}

/* Избранное: сердечко на карточке товара */
.product-card {
  position: relative;
}

.product-card-wrap {
  position: relative;
  height: 100%;
}

.favorite-form {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 3;
  margin: 0;
}

.favorite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: rgba(13, 17, 21, 0.78);
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.favorite-btn:hover {
  color: var(--color-accent-strong);
  border-color: var(--color-accent);
  transform: scale(1.05);
}

.favorite-btn.is-active {
  color: #e0567a;
  border-color: rgba(224, 86, 122, 0.6);
}

.panel .favorite-form {
  position: static;
  display: inline-block;
  margin-top: 0.5rem;
}

/* Счётчик корзины и непрочитанных сообщений в шапке */
.cart-count,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: #1a1206;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

/* Личные сообщения */
.pm-thread {
  display: grid;
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.pm-message {
  max-width: 75%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
}

.pm-message.is-mine {
  margin-left: auto;
  border-color: rgba(212, 161, 90, 0.45);
  background: rgba(212, 161, 90, 0.08);
}

.pm-meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}

.pm-text {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Реакции на сообщениях форума */
.reaction-row {
  margin-top: 0.6rem;
}

.reaction-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.reaction-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-text);
}

.reaction-btn.is-active {
  border-color: var(--color-accent);
  background: rgba(212, 161, 90, 0.14);
  color: var(--color-text);
}

.reaction-btn.is-static {
  cursor: default;
}

.reaction-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent-strong);
}

/* Управление количеством в корзине */
.qty-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-btn {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.qty-btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

.qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-value {
  min-width: 1.6rem;
  text-align: center;
  font-weight: 700;
}

.qty-hint {
  margin-top: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.avatar-mini {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--color-border);
  vertical-align: middle;
  margin-right: 0.25rem;
}

/* Главная: лента форума */
.topic-list {
  display: grid;
  gap: 0.75rem;
}

.topic-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}

.topic-row:hover {
  border-color: var(--color-accent);
}

.topic-row-main {
  min-width: 0;
}

.topic-row-title {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.topic-row-meta {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.topic-score {
  font-weight: 700;
  color: var(--color-accent-strong);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Эмодзи-панель и вложения форума */
.emoji-toggle {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.emoji-panel {
  position: absolute;
  z-index: 1050;
  right: 0;
  bottom: 2.6rem;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-width: 320px;
  box-shadow: var(--shadow-card);
}

.emoji-item {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.15rem;
  line-height: 1;
}

.emoji-item:hover {
  background: var(--color-surface-alt);
  border-radius: 4px;
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.attachment-list img {
  max-height: 220px;
  max-width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

/* Панель инструментов rich-текста */
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
}

.toolbar-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.toolbar-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

.emoji-category-label {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.emoji-category-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.15rem;
}

.emoji-panel {
  max-height: 320px;
  overflow-y: auto;
}

/* Компоненты Bootstrap по умолчанию светлые: приводим их к тёмной теме. */
.pagination {
  --bs-pagination-color: var(--color-text-muted);
  --bs-pagination-bg: transparent;
  --bs-pagination-border-color: var(--color-border);
  --bs-pagination-hover-color: var(--color-accent-strong);
  --bs-pagination-hover-bg: rgba(255, 255, 255, 0.06);
  --bs-pagination-hover-border-color: var(--color-accent);
  --bs-pagination-active-color: #1a1206;
  --bs-pagination-active-bg: var(--color-accent);
  --bs-pagination-active-border-color: var(--color-accent);
  --bs-pagination-disabled-color: var(--color-text-muted);
  --bs-pagination-disabled-bg: transparent;
  --bs-pagination-disabled-border-color: var(--color-border);
}

.alert {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-text);
}

.alert-success {
  border-color: rgba(125, 167, 125, 0.45);
  background: rgba(125, 167, 125, 0.16);
  color: #cfe6cf;
}

.alert-danger {
  border-color: rgba(216, 107, 93, 0.45);
  background: rgba(216, 107, 93, 0.16);
  color: #f3c0b8;
}

.alert-warning {
  border-color: rgba(215, 161, 77, 0.45);
  background: rgba(215, 161, 77, 0.16);
  color: #f2d6a4;
}

.alert-info {
  border-color: rgba(125, 160, 200, 0.45);
  background: rgba(125, 160, 200, 0.16);
  color: #cddff2;
}

.form-check-input {
  border-color: var(--color-border);
  background-color: rgba(255, 255, 255, 0.06);
}

.form-check-input:checked {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
}

.form-check-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 0.2rem rgba(212, 161, 90, 0.25);
}

input[type="file"] {
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
}

input[type="file"]::file-selector-button {
  margin-right: 0.6rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  cursor: pointer;
}

.modal-content {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
}

.btn-close {
  filter: invert(1) grayscale(1) brightness(1.6);
  opacity: 0.65;
}

/* Переключатель языковой версии: аккуратный сегмент RU | EN (без флажков).
 * Обе буквы видны, активный язык подсвечен; клик по другой переключает. */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
}

.lang-form {
  margin: 0;
  display: inline-flex;
}

.lang-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 1.6rem;
  padding: 0 0.45rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.lang-opt:hover,
.lang-opt:focus-visible {
  color: var(--color-text);
}

.lang-opt.is-active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-border);
  cursor: default;
}

/* В шапке переключатель стоит самым правым, после меню профиля. */
.site-header .container > .lang-switch {
  margin: 0 0 0 0.55rem;
}

/* Шапка: на телефонах и планшетах сворачиваем её до кнопки меню — иначе она
 * съедает верх экрана. Переключатель языка в этом случае переезжает в панель
 * меню (его копия в разметке). */
.lang-switch-panel {
  display: none;
}

/* Развёрнутая панель меню: значки (поиск, профиль, корзина) и переключатель
 * языка — сверху справа, пункты меню — под ними. */
.site-header .navbar-collapse.show,
.site-header .navbar-collapse.collapsing {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.3rem 0.5rem;
}

.site-header .navbar-collapse.show .navbar-actions,
.site-header .navbar-collapse.collapsing .navbar-actions {
  order: 1;
}

.site-header .navbar-collapse.show .lang-switch-panel,
.site-header .navbar-collapse.collapsing .lang-switch-panel {
  order: 2;
}

.site-header .navbar-collapse.show .navbar-nav,
.site-header .navbar-collapse.collapsing .navbar-nav {
  order: 3;
  flex: 0 0 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 0.1rem;
  margin: 0.35rem 0 0;
}

@media (max-width: 991.98px) {
  /* В свёрнутой шапке язык живёт в панели меню — рядом со значками. */
  .site-header .container > .lang-switch {
    display: none;
  }

  .lang-switch-panel {
    display: inline-flex;
  }
}

@media (max-width: 767.98px) {
  .site-header .navbar-brand {
    display: none;
  }

  .site-header .navbar-toggler {
    margin-left: auto;
  }
}

@media (min-width: 992px) and (max-width: 1400px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  .site-header .navbar-brand,
  .site-header .container > .lang-switch {
    display: none;
  }

  .site-header .navbar-expand-lg .navbar-toggler {
    display: flex;
    margin-left: auto;
  }

  .site-header .navbar-expand-lg .navbar-collapse {
    display: none !important;
  }

  .site-header .navbar-expand-lg .navbar-collapse.show {
    display: flex !important;
  }

  .site-header .navbar-expand-lg .navbar-collapse.show .navbar-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .site-header .navbar-expand-lg .navbar-collapse.show .navbar-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .lang-switch-panel {
    display: inline-flex;
  }
}

/* Полосы сверху нет совсем: на телефонах и на планшетах в горизонтальной
 * ориентации кнопка меню — отдельный плавающий блок сбоку, а страница
 * начинается от самого верха экрана. Открытая панель меню выезжает под
 * кнопкой поверх содержимого и страницу не сдвигает. */
@media (max-width: 767.98px),
       (min-width: 992px) and (max-width: 1400px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  .site-header {
    position: static;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
  }

  .site-header .navbar {
    min-height: 0;
    padding: 0;
    flex-wrap: nowrap;
  }

  .site-header .navbar-toggler {
    position: fixed;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 1031;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0.45rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(11, 13, 16, 0.82);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  }

  .site-header .navbar-collapse.show,
  .site-header .navbar-collapse.collapsing {
    position: fixed;
    top: 3.6rem;
    right: 0.6rem;
    left: 0.6rem;
    z-index: 1030;
    max-height: calc(100vh - 4.4rem);
    overflow-y: auto;
    background: rgba(11, 13, 16, 0.96);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.7rem 0.9rem 0.9rem;
    box-shadow: var(--shadow-card);
  }

  /* Небольшой запас сверху, чтобы плавающая кнопка не ложилась на заголовок. */
  .page-shell {
    padding-top: 4rem;
  }
}

/* Компактная шапка: кнопки-иконки, раскрывающийся поиск и меню профиля. */
.nav-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-icon-btn:hover,
.nav-icon-btn:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.nav-icon-btn.dropdown-toggle::after {
  display: none;
}

.nav-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon-btn .count-pill,
.nav-icon-btn .cart-count {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  margin: 0;
  min-width: 1.15rem;
  height: 1.15rem;
  font-size: 0.68rem;
  line-height: 1;
}

/* Поиск: кнопка-лупа раскрывает маленькое окно ввода. */
.nav-search {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-search .navbar-search {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 1045;
  display: none;
  min-width: 15rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.nav-search.is-open .navbar-search {
  display: flex;
}

/* Инструменты автора: компактная шестерёнка внизу слева, видна только staff. */
.staff-tools {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 1030;
}

.staff-tools .dropdown-menu {
  margin-bottom: 0.4rem;
}

/* Подвал: заголовки — кнопки, содержимое открывается разом у всех колонок. */
.footer-heading-wrap {
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.footer-heading {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.footer-heading:hover,
.footer-heading:focus-visible {
  color: var(--color-accent-strong);
}

.footer-reveal {
  display: none;
}

.footer.is-open .footer-reveal {
  display: block;
}

/* Счётчик посетителей: справа внизу, подпись — по клику. */
.footer-visitors {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
}

.footer-visitors-btn {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.footer-visitors-btn:hover,
.footer-visitors-btn:focus-visible {
  color: var(--color-text);
  border-color: var(--color-accent);
}

.footer-visitors-hint {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.45rem);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Суточный счётчик владельца: рядом с общим, только для staff. */
.footer-visitors-day {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-accent);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* В панели меню (телефон, планшет) поиск всегда развёрнут и без окна. */
@media (max-width: 991.98px) {
  .nav-search .navbar-search {
    position: static;
    display: flex;
    width: 100%;
    min-width: 0;
    box-shadow: none;
  }

  .nav-search-toggle {
    display: none;
  }
}

@media (min-width: 992px) and (max-width: 1400px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  .nav-search .navbar-search {
    position: static;
    display: flex;
    width: 100%;
    min-width: 0;
    box-shadow: none;
  }

  .nav-search-toggle {
    display: none;
  }
}

/* ---------------------------------------------------------------------
 * Плашка «технические работы»: тонкая полоса поверх всего сайта.
 * Владелец включает её в шестерёнке или в приложении-мониторе; посетитель
 * может закрыть («ОК») — тогда она не показывается до следующего включения.
 * Чтобы полоса не закрывала шапку, страница сдвигается вниз, а липкая
 * шапка держится под плашкой.
 * --------------------------------------------------------------------- */
.maintenance-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.35rem 0.9rem;
  background: #f2c14e;
  color: #2f2400;
  font-size: 0.88rem;
  line-height: 1.35;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.maintenance-bar[hidden] {
  display: none;
}

.maintenance-bar-text {
  text-align: center;
}

.maintenance-bar-ok {
  flex: none;
  padding: 0.05rem 0.7rem;
  border: 1px solid rgba(47, 36, 0, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.maintenance-bar-ok:hover {
  background: rgba(255, 255, 255, 0.6);
}

body.maintenance-on .site-shell {
  padding-top: 2.3rem;
}

body.maintenance-on .site-header {
  top: 2.3rem;
}

@media (max-width: 767.98px),
       (min-width: 992px) and (max-width: 1400px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  body.maintenance-on .site-header .navbar-toggler {
    top: 2.9rem;
  }

  body.maintenance-on .site-header .navbar-collapse.show,
  body.maintenance-on .site-header .navbar-collapse.collapsing {
    top: 5.9rem;
    max-height: calc(100vh - 6.7rem);
  }
}

/* ---------------------------------------------------------------------
 * Разовое уведомление от владельца (приходит из приложения-монитора):
 * заметная плашка во всю ширину, показывается адресату, пока не нажмёт «ОК».
 * --------------------------------------------------------------------- */
.user-notice {
  background: linear-gradient(90deg, #2b3f8f, #4c5fd7);
  color: #f2f3ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.user-notice-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.user-notice-text {
  line-height: 1.4;
  text-align: center;
}

.user-notice-ok {
  flex: none;
  padding: 0.1rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.user-notice-ok:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---------------------------------------------------------------------
 * Каталог: заглушка «Скоро в продаже» вместо пустой сетки товаров.
 * --------------------------------------------------------------------- */
.catalog-placeholder {
  border: 1px dashed var(--color-border);
  background: var(--color-surface);
}

.catalog-placeholder .product-title {
  margin-top: 0.35rem;
}

.catalog-placeholder .muted {
  line-height: 1.5;
}

/* ---------------------------------------------------------------------
 * Главная: табличка «Попробовать Kharin Stensil» под баннером.
 * --------------------------------------------------------------------- */
.stencil-promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
  align-items: center;
  gap: 1.5rem 2rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--color-border);
  background:
    radial-gradient(120% 160% at 85% 0%, rgba(212, 161, 90, 0.16), transparent 55%),
    var(--color-surface);
}

.stencil-promo h2 {
  margin: 0.2rem 0 0.6rem;
}

.stencil-promo-lead {
  margin: 0 0 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 46rem;
}

.stencil-promo-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  max-width: 46rem;
}

.stencil-promo-list li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.stencil-promo-icon {
  flex: none;
  width: 1.7rem;
  color: var(--color-accent);
}

.stencil-promo-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0.15rem auto 0;
}

.stencil-promo-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.stencil-promo-shot {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stencil-promo-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.stencil-promo-shot figcaption {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  text-align: center;
}

.footer-sales-geo {
  margin: 0.5rem 0 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* Панель соцсетей на странице «Контакты» — на всю ширину сетки. */
.contacts-socials {
  grid-column: 1 / -1;
}

/* ---------------------------------------------------------------------
 * Профиль: кадрирование аватара перед загрузкой (выбор кадра и масштаб).
 * --------------------------------------------------------------------- */
.avatar-crop {
  margin: 0.5rem 0 1rem;
}

.avatar-crop-stage {
  width: 260px;
  max-width: 100%;
}

.avatar-crop-stage canvas {
  display: block;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: var(--color-surface-alt);
  cursor: grab;
  touch-action: none;
}

.avatar-crop-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.avatar-crop-controls input[type="range"] {
  width: 180px;
}

.avatar-crop-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

.avatar-crop-result img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-accent);
}

@media (max-width: 767px) {
  .stencil-promo {
    grid-template-columns: 1fr;
  }

  .stencil-promo-shot {
    max-width: 420px;
    margin: 0 auto;
  }
}


/* Лента «Новости»: посты владельца и реакции читателей (как в ВК/Telegram). */
.feed-page { max-width: 720px; margin: 0 auto; }
.feed-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.feed-sub { color: var(--color-muted, #9aa7b1); margin: 0.35rem 0 0; }
.feed-post { background: var(--color-surface, #171d24); border: 1px solid var(--color-border, #26313a); border-radius: 14px; padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; }
.feed-post-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.7rem; }
.feed-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--color-accent, #e6b34a); color: #14181d; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.feed-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.feed-post-who { display: flex; flex-direction: column; line-height: 1.2; }
.feed-date { color: var(--color-muted, #9aa7b1); font-size: 0.82rem; }
.feed-post-title { font-size: 1.25rem; margin: 0.2rem 0 0.5rem; }
.feed-post-title a { color: inherit; text-decoration: none; }
.feed-post-title a:hover { color: var(--color-accent, #e6b34a); }
.feed-post-body { color: var(--color-text, #e7edf3); }
.feed-post-image { margin: 0.8rem 0 0.2rem; }
.feed-post-image img { width: 100%; height: auto; border-radius: 12px; display: block; }
.feed-reactions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; position: relative; }
.react-chip, .react-add { display: inline-flex; align-items: center; gap: 0.3rem; border: 1px solid var(--color-border, #26313a); background: transparent; color: inherit; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.95rem; cursor: pointer; }
.react-chip.is-mine { border-color: var(--color-accent, #e6b34a); background: rgba(230, 179, 74, 0.14); }
.react-add { font-weight: 700; }
.react-picker { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 5; background: var(--color-surface, #171d24); border: 1px solid var(--color-border, #26313a); border-radius: 12px; padding: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.25rem; max-width: 320px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.react-pick { border: 1px solid transparent; background: transparent; font-size: 1.25rem; line-height: 1; padding: 0.2rem 0.3rem; border-radius: 8px; cursor: pointer; }
.react-pick.is-mine { border-color: var(--color-accent, #e6b34a); background: rgba(230, 179, 74, 0.14); }
.feed-pager { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1.2rem; }
.feed-pager-info { color: var(--color-muted, #9aa7b1); font-size: 0.9rem; }
.feed-form p { margin-bottom: 0.9rem; }
.feed-form label { display: block; margin-bottom: 0.25rem; }
.feed-form input[type=text], .feed-form textarea { width: 100%; }

/* Участник закрытого чата: кролик внизу слева вместо шестерёнки. */
.rabbit-tools { position: fixed; left: 1rem; bottom: 1rem; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; border: 2px solid var(--color-accent, #e6b34a); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); z-index: 1040; display: block; }
.rabbit-tools img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rabbit-tools:hover { border-color: #fff; }

/* Памятка студии: поддержка автора — тонкая спокойная ссылка, не кнопка. */
.stencil-intro-support { display: inline-block; padding: 0.26rem 0.85rem; border-radius: 8px; background: #2b333c; color: #c3ccd6; font-size: 0.84rem; line-height: 1.2; text-decoration: none; border: 1px solid #3a444f; }
.stencil-intro-support:hover { background: #343e48; color: #fff; }

/* Форма отзывов: скрытое поле-ловушка для спам-ботов (человеку не видно). */
.review-feedback-hp { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }


/* Мини-приложение Телеграма: внутри него сайт выглядит как приложение —
   убираем свою шапку (навигация через кнопку «назад» Телеграма и карточки
   разделов на экране /tg/) и слегка уменьшаем верхний отступ страницы. */
html.tg-context .site-header {
    display: none;
}

html.tg-context .page-shell {
    padding-top: 1rem;
}

/* Нижняя навигация приложения Телеграма: показывается только внутри него
   (html.tg-context ставит shared/telegram-boot.js). На сайте скрыта. */
.tg-tabbar {
    display: none;
}

html.tg-context .tg-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: rgba(20, 26, 33, .97);
    border-top: 1px solid var(--color-border, #3a4550);
    /* Домашняя полоска iPhone: поднимаем панель, чтобы она не перекрывала подписи. */
    padding-bottom: calc(0.4rem + max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px)));
}

html.tg-context body {
    padding-bottom: calc(4.1rem + max(env(safe-area-inset-bottom, 0px), var(--tg-safe-bottom, 0px)));
}

html.tg-context .tg-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    padding: .45rem .2rem .5rem;
    font-size: .72rem;
    line-height: 1.1;
    color: var(--color-text-muted, #93a1ad);
    text-decoration: none;
}

html.tg-context .tg-tab-icon {
    font-size: 1.15rem;
    line-height: 1;
}

html.tg-context .tg-tab.is-active {
    color: var(--color-accent, #e6b34a);
}

/* Внутри приложения страницы появляются мягко — ощущение «как приложение». */
@media (prefers-reduced-motion: no-preference) {
    html.tg-context .page-shell {
        animation: tg-page-in .18s ease-out both;
    }
}

@keyframes tg-page-in {
    from { opacity: .4; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

/* Внутри приложения Телеграма — только пользовательская часть: служебная
   шестерёнка владельца (редактор, монитор, настройки) там не нужна, иначе
   человек в приложении видит «настройки», которых у него быть не должно. */
html.tg-context .staff-tools,
html.tg-context .rabbit-tools,
html.tg-context body.editor-mode [data-editable]::after {
    display: none !important;
}

/* Владельцу шестерёнка в приложении нужна (управление сайтом) — поднимаем её
   над нижней панелью, чтобы не перекрывала вкладки. */
html.tg-context .staff-tools[data-owner="1"] {
    display: block !important;
    bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px));
}

/* Спрятанное атрибутом hidden всегда скрыто, даже если у класса свой display.
   (Так уже ловили утечки: .tg-skeleton { display: flex } показывал служебный
   блок, который должен был быть спрятан.) */
[hidden] {
    display: none !important;
}

/* Переключатель языка в нижней панели приложения: шапка сайта там скрыта,
   поэтому RU/EN живёт отдельным пунктом панели. */
html.tg-context .tg-tab-lang {
    margin: 0;
    padding: 0;
    border: 0;
}

html.tg-context .tg-tab-btn {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    width: 100%;
    height: 100%;
    padding: .45rem .2rem .5rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: .72rem;
    line-height: 1.1;
    color: var(--color-text-muted, #93a1ad);
    cursor: pointer;
}

html.tg-context .tg-tab-btn:hover { color: var(--color-accent, #e6b34a); }

/* Цвета графика в профиле: свой цвет и цвета людей (палитра 50 цветов). */
#profile-colors { position: relative; }
.cal-color-rows { display: grid; gap: .5rem; margin-top: .5rem; }
.cal-color-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.cal-color-name { font-weight: 600; }
.cal-color-current {
  width: 2rem; height: 2rem; flex: 0 0 auto; padding: 0;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25);
  background: var(--c, transparent); cursor: pointer;
}
.cal-color-current.is-empty { background: transparent; border-style: dashed; border-color: rgba(255, 255, 255, .45); }
.cal-color-palette {
  position: absolute; z-index: 20; display: grid;
  grid-template-columns: repeat(10, 1.6rem); gap: .35rem; padding: .6rem;
  background: #14161a; border: 1px solid rgba(255, 255, 255, .15);
  border-radius: .6rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.cal-color-palette[hidden] { display: none; }
.cal-swatch {
  width: 1.6rem; height: 1.6rem; padding: 0; cursor: pointer;
  border-radius: .35rem; border: 2px solid rgba(255, 255, 255, .2);
  background: var(--c, transparent);
}
.cal-swatch.is-none { background: transparent; border-style: dashed; }
.cal-swatch:hover { border-color: #fff; }
@media (max-width: 575px) { .cal-color-palette { grid-template-columns: repeat(8, 1.5rem); } }

/* Узкий телефон: длинные русские заголовки не должны вылезать за экран. */
@media (max-width: 575.98px) {
  .page-header h1 {
    font-size: 2rem;
    overflow-wrap: break-word;
  }
}
