@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/unbounded-v12-cyrillic_latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("./assets/fonts/unbounded-v12-cyrillic_latin-800.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./assets/fonts/inter-v20-cyrillic_latin-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./assets/fonts/inter-v20-cyrillic_latin-600.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./assets/fonts/inter-v20-cyrillic_latin-700.woff2") format("woff2");
}

:root {
  --bg: #fbfaf8;
  --surface: #fffefd;
  --surface-soft: #f6f4f0;
  --text: #171717;
  --muted: #686868;
  --line: #dedbd5;
  --line-soft: #ebe7df;
  --black: #141414;
  --green: #8de030;
  --blue: #62aaf0;
  --focus: #2f6fdb;
  --pink: #e84bb2;
  --orange: #ffb482;
  --lime: #d9f8a7;
  --cyan: #bdf4df;
  --shadow: 0 18px 45px rgba(22, 19, 15, 0.08);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Unbounded", var(--sans);
  --shell-max: 1400px;
  --radius-lg: 26px;
  --radius-md: 18px;
  /* Светлая тема: вместо лайм-свечения — мягкая тень, текст-акцент темнее лайма */
  --accent-text: #4f7d12;
  --accent-soft: rgba(141, 224, 48, 0.16);
  --glow: 0 18px 45px rgba(22, 19, 15, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  /* Тёмная подложка под body: не даёт белым полосам пробиваться в адаптиве/PWA
     (overscroll, safe-area вырезы под статус-бар на телефоне). */
  background: #0a0b0c;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 52% 28%, rgba(255, 255, 255, 0.92), transparent 36rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
}

#app {
  width: 100%;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  background: none;
  color: inherit;
}

.icon {
  width: 22px;
  height: 22px;
  display: block;
}

.app-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 100vh;
}

.standalone-shell {
  display: block;
}

.desktop-sidebar {
  align-self: stretch;
  min-height: 100vh;
  padding: 22px 20px 40px;
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}

.desktop-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  /* The brand is a button now (logo navigates home) — reset button chrome. */
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.brand:focus-visible {
  outline: 2px solid var(--focus, #2563eb);
  outline-offset: 4px;
  border-radius: 12px;
}

/* Slim top bar for pages without the sidebar (scanner / admin / auth). */
.standalone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 6px;
  flex-wrap: wrap;
}

.standalone-header .brand {
  margin-bottom: 0;
}

.standalone-nav {
  display: flex;
  gap: 8px;
}

.standalone-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 44px;
  border: 1px solid var(--line, #e5e5e5);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.standalone-nav-link svg {
  width: 18px;
  height: 18px;
}

.standalone-nav-link:hover {
  border-color: currentColor;
}

.standalone-nav-link.active {
  background: var(--black, #111);
  color: #fff;
  border-color: var(--black, #111);
}

.standalone-nav-link:focus-visible {
  outline: 2px solid var(--focus, #2563eb);
  outline-offset: 2px;
}

@media (max-width: 820px) {
  /* On mobile the bottom nav covers navigation — keep only the logo. */
  .standalone-nav {
    display: none;
  }
}

/* Scanner contribution CTA */
.scanner-cta {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed var(--line, #d8d8d8);
  background: var(--surface, #fff);
}

.scanner-cta-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(120, 200, 80, 0.16);
}

.scanner-cta-icon svg {
  width: 22px;
  height: 22px;
}

.scanner-cta strong {
  display: block;
  margin-bottom: 4px;
}

.scanner-cta p {
  margin: 0;
  color: var(--muted, #666);
  line-height: 1.55;
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ach-badge {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line, #e5e5e5);
  background: var(--surface, #fff);
  text-align: center;
}

.ach-badge .ach-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(120, 200, 80, 0.18);
}

.ach-badge .ach-icon svg {
  width: 22px;
  height: 22px;
}

.ach-badge .ach-title {
  font-weight: 700;
  font-size: 14px;
}

.ach-badge .ach-progress {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #777);
}

.ach-badge.locked {
  opacity: 0.55;
}

.ach-badge.locked .ach-icon {
  background: rgba(120, 120, 120, 0.12);
}

.ach-badge.unlocked .ach-progress {
  color: #3a8f3a;
  font-weight: 600;
}

.logo-mark {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: url("assets/favicon.png") center / cover no-repeat;
  flex: 0 0 auto;
}

.logo-mark::before,
.logo-mark::after {
  content: none;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.search {
  position: relative;
  margin-bottom: 24px;
}

.search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 0 42px 0 15px;
  color: var(--text);
  outline: none;
}

.search .icon {
  position: absolute;
  right: 13px;
  top: 11px;
}

.desktop-profile-button {
  width: 100%;
  min-height: 44px;
  margin: -4px 0 26px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 780;
  cursor: pointer;
}

.desktop-profile-button.active {
  background: var(--black);
  border-color: var(--black);
  color: #fff;
}

.profile-desktop-sidebar {
  gap: 0;
}

.profile-desktop-sidebar .brand {
  margin-bottom: 28px;
}

.profile-side-link {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--text);
  font-weight: 760;
  cursor: pointer;
}

.admin-side-link {
  margin-top: 10px;
  margin-bottom: 20px;
}

.profile-side-card {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.profile-side-card strong,
.profile-side-card span {
  display: block;
}

.profile-side-card strong {
  font-size: 15px;
}

.profile-side-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.profile-side-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  font: 800 19px/1 var(--sans);
}

.profile-side-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-stats {
  margin-top: auto;
}

.filter-section {
  margin: 0 0 27px;
}

.filter-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.chip {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  transition: 160ms ease;
}

.chip.active,
.segmented .active {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.13);
}

.range-control {
  display: grid;
  gap: 9px;
}

.range-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.range-meta strong {
  color: var(--text);
  font-size: 13px;
}

.abv-range {
  width: 100%;
  accent-color: var(--black);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: #555;
  font-size: 14px;
  cursor: pointer;
}

.box {
  width: 16px;
  height: 16px;
  border: 1px solid #c8c5bf;
  border-radius: 4px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pref-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pref-check:checked + .box {
  background: var(--black);
  border-color: var(--black);
}

.pref-check:checked + .box::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: white;
}

.segmented button {
  min-height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
}

.recent-list {
  display: grid;
  gap: 9px;
}

.recent-item,
.similar-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.thumb {
  width: 38px;
  height: 48px;
  border-radius: 7px;
  border: 1px solid var(--line-soft);
  background: #f7f5f1;
  display: flex;
  justify-content: center;
  align-items: end;
  overflow: hidden;
}

.thumb img {
  max-height: 44px;
  max-width: 28px;
  object-fit: contain;
}

/* Can/bottle visuals are full-size (116×222) — shrink them to fit the small thumb.
   flex-shrink:0 keeps their real proportions before the transform scales them down. */
.thumb .can-shape,
.thumb .bottle-alt {
  flex: 0 0 auto;
  transform: scale(0.21);
  transform-origin: center bottom;
}

.recent-name,
.similar-name {
  display: block;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-style,
.similar-style {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.mini-rating,
.rating-pill {
  min-width: 44px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 800;
}

.stats-strip {
  margin: 12px 0 18px;
  position: static;
  order: 6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
}

.desktop-sidebar .filter-section:nth-of-type(5) {
  order: 7;
}

.stat {
  padding: 12px 8px;
  text-align: center;
  border-right: 1px solid var(--line-soft);
}

.stat:last-child {
  border-right: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 5px;
  font-size: 22px;
  font-weight: 850;
}

.profile-stats {
  margin-top: auto;
}

.main {
  min-width: 0;
  padding: 42px 34px 52px;
}

.section-label {
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(48px, 5vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

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

.sort-select {
  appearance: none;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86)
    url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 18px center;
  padding: 0 48px 0 14px;
  font-weight: 650;
  width: 100%;
}

.mobile-top,
.mobile-search,
.mobile-controls,
.mobile-chip-row,
.weekly-signal,
.bottom-nav,
.floating-filter {
  display: none;
}

.product-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 20px;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--text);
  font-size: 22px;
}

.empty-state span {
  margin-top: 8px;
}

.open-candidate-button {
  height: 42px;
  margin-top: 18px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
  font-weight: 850;
}

.candidate-panel {
  max-width: 1180px;
  margin: 24px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 22px;
}

.candidate-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.candidate-head h2 {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 28px;
}

.candidate-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
}

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

.candidate-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.candidate-grid input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 0 13px;
  color: var(--text);
}

.candidate-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.submit-candidate-button {
  height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
  font-weight: 850;
}

.candidate-actions span {
  color: var(--muted);
}

.admin-page,
.scanner-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px clamp(20px, 4vw, 54px) 120px;
}

.admin-card,
.scanner-card {
  margin-top: 22px;
}

.admin-toolbar,
.scanner-actions,
.scanner-input-row,
.admin-row,
.admin-actions {
  display: flex;
  align-items: center;
}

.admin-toolbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-toolbar h2 {
  margin: 0;
}

.admin-refresh,
.admin-verify,
.admin-reject,
.scanner-lookup-button,
.scanner-camera-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 820;
}

.admin-refresh,
.scanner-camera-button {
  background: rgba(255, 255, 255, 0.76);
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.admin-barcode-attach {
  flex: 1 0 100%;
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.admin-barcode-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.admin-attach-button {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.admin-row strong,
.admin-row span,
.admin-row small {
  display: block;
}

.admin-row span,
.admin-row small {
  margin-top: 4px;
  color: var(--muted);
}

.admin-actions {
  gap: 8px;
  flex: 0 0 auto;
}

.admin-review-row > div:first-child {
  min-width: 0;
}

.admin-review-row span {
  max-width: 620px;
}

.admin-photo-row {
  align-items: center;
}

.admin-photo-row img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  flex: 0 0 auto;
}

.admin-verify,
.scanner-lookup-button {
  background: var(--black);
  color: #fff;
}

.admin-reject {
  color: #b12f2f;
}

.scanner-input-row {
  gap: 12px;
  align-items: end;
}

.scanner-input-row .profile-field {
  flex: 1;
}

.scanner-actions {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.scanner-camera-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.photo-form {
  display: grid;
  gap: 12px;
}

.photo-upload {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-weight: 820;
  cursor: pointer;
}

.photo-upload input {
  display: none;
}

.product-card {
  position: relative;
  min-width: 0;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  /* Продолжение градиента фото-зоны: без резкого обрыва над бутылкой. */
  background: rgba(255, 255, 255, 0.4);
}

.tag {
  height: 30px;
  min-width: 0;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  color: #151515;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag.ipa {
  background: var(--lime);
}

.tag.stout {
  background: #b9dcff;
}

.tag.lager {
  background: var(--cyan);
}

.tag.sour {
  background: #f5a5d9;
}

.tag.dark {
  background: #c7b29a;
}

.tag.wheat {
  background: #ffe08a;
}

.tag.fruit {
  background: #ff9e7a;
}

.tag.cider {
  background: #ffd166;
}

.product-card .rating-pill {
  flex: 0 0 auto;
}

.save-button {
  position: absolute;
  right: 18px;
  top: 62px;
  display: none;
  z-index: 2;
}

.product-media {
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  background:
    radial-gradient(ellipse at 50% 84%, rgba(0, 0, 0, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(240, 236, 228, 0.92));
}

.product-media img {
  /* Единая ВЫСОТА для всех фото: узкие бутылки и широкие банки выстраиваются
     в один рост (как на полке), без «мелких» из-за разного аспекта PNG. */
  height: 240px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.18));
}

.can-shape {
  width: 116px;
  height: 222px;
  border-radius: 18px 18px 11px 11px;
  position: relative;
  box-shadow: 0 18px 18px rgba(0, 0, 0, 0.17);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 28%, rgba(255, 255, 255, 0.42) 55%, rgba(0, 0, 0, 0.2)), var(--can-bg);
}

.can-shape::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 12px;
  border-radius: 0 0 12px 12px;
  background: rgba(255, 255, 255, 0.7);
}

.can-label {
  position: absolute;
  left: 11px;
  right: 11px;
  top: 62px;
  text-align: center;
  font-weight: 950;
  line-height: 0.95;
  text-transform: uppercase;
  font-size: 29px;
  color: var(--label);
}

.can-sub {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 24px;
  color: var(--label);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.bottle-alt {
  width: 96px;
  height: 238px;
  border-radius: 42px 42px 18px 18px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent 24%, rgba(255, 255, 255, 0.45) 58%, rgba(0, 0, 0, 0.24)),
    var(--can-bg);
  position: relative;
  box-shadow: 0 18px 18px rgba(0, 0, 0, 0.18);
}

.bottle-alt::before {
  content: "";
  position: absolute;
  left: 29px;
  top: -74px;
  width: 38px;
  height: 92px;
  border-radius: 14px 14px 8px 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent 35%, rgba(255, 255, 255, 0.42) 60%, rgba(0, 0, 0, 0.22)),
    var(--neck);
}

.bottle-alt::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  top: 70px;
  height: 92px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8);
}

.bottle-alt .can-label {
  z-index: 1;
  top: 84px;
  font-size: 18px;
}

.product-info {
  min-width: 0;
  padding: 18px 18px 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 850;
  overflow-wrap: anywhere;
  /* fixed 3-line block so style/volume/verdict align across cards regardless
     of title length (no "pryzhki", no волюм впритык к вердикту) */
  height: calc(1.2em * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-style {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-hook {
  display: none;
  color: #555;
  font-size: 14px;
  line-height: 1.38;
}

/* Мета featured-карточки видна только в её десктопной (2x2) версии. */
.product-meta {
  display: none;
}

.volume {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.verdict {
  margin-top: auto;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 680;
  background: rgba(255, 255, 255, 0.68);
}

.star-icon {
  width: 14px;
  height: 14px;
}

.list-mode {
  grid-template-columns: 1fr;
}

.list-mode .product-card {
  min-height: 172px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: stretch;
  padding-right: 220px;
}

.list-mode .product-media {
  height: 100%;
  min-height: 172px;
  padding: 18px 10px 12px;
}

.list-mode .product-media img {
  max-height: 124px;
  max-width: 74px;
}

.list-mode .product-media .can-shape {
  width: 76px;
  height: 116px;
}

.list-mode .product-media .bottle-alt {
  width: 58px;
  height: 130px;
}

.list-mode .product-media .bottle-alt::before {
  left: 18px;
  top: -42px;
  width: 24px;
  height: 56px;
}

.list-mode .product-media .bottle-alt .can-label {
  top: 45px;
  font-size: 12px;
}

.list-mode .product-info {
  min-height: 172px;
  padding: 22px 18px 20px;
  display: grid;
  grid-template-columns: minmax(220px, 0.5fr) minmax(260px, 1fr);
  grid-template-rows: auto auto 1fr auto;
  column-gap: 24px;
  align-content: start;
}

.list-mode .product-name {
  grid-column: 1;
  min-height: 0;
}

.list-mode .product-hook {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: -webkit-box;
  margin: 2px 0 0;
  max-width: 640px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.list-mode .product-style {
  grid-column: 1;
  margin-top: 12px;
}

.list-mode .volume {
  grid-column: 1;
  margin-top: 10px;
}

.list-mode .verdict {
  position: absolute;
  right: 18px;
  bottom: 22px;
  width: 180px;
  max-width: 180px;
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
  white-space: nowrap;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  text-align: left;
}

.list-mode .verdict .dot {
  justify-self: center;
}

/* В списке плашки лежат поверх карточки одной строкой: тег слева, рейтинг справа. */
.list-mode .card-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  padding: 0;
  background: none;
  pointer-events: none;
}

.detail-shell {
  display: block;
}

.detail-shell .main {
  padding: 34px 34px 52px;
}

.listing-view.detail-open {
  display: none;
}

.detail-view.active {
  display: block;
  max-width: 1180px;
  margin: 0 auto;
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.back-button,
.detail-icons button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.desktop-back-label {
  color: var(--muted);
  font-size: 14px;
}

.detail-icons {
  display: flex;
  gap: 20px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.detail-product {
  display: grid;
  grid-template-columns: minmax(280px, 0.86fr) minmax(320px, 1fr);
  gap: 30px;
  align-items: center;
}

.hero-product {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 34px 16px 52px;
}

.hero-product img {
  max-height: 520px;
  max-width: 230px;
  filter: drop-shadow(0 22px 24px rgba(0, 0, 0, 0.18));
}

.hero-product .can-shape {
  width: 170px;
  height: 330px;
}

.hero-product .bottle-alt {
  width: 138px;
  height: 340px;
}

.hero-rating {
  position: absolute;
  right: 0;
  top: 86px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.rating-circle {
  width: 82px;
  height: 82px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  place-items: center;
  color: var(--black);
  font-size: 30px;
  font-weight: 800;
}

.star-gold {
  color: #ffae00;
  font-size: 18px;
  line-height: 1;
}

.style-pill {
  display: inline-flex;
  height: 34px;
  align-items: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: #5d5d5d;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-copy h1 {
  margin-top: 14px;
  font-size: clamp(54px, 5vw, 76px);
}

.brewery {
  margin-top: 16px;
  color: var(--muted);
  font-size: 20px;
}

.description {
  max-width: 520px;
  margin: 18px 0 0;
  color: #555;
  font-size: 19px;
  line-height: 1.35;
}

.spec-grid {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: -18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.spec-card {
  min-height: 74px;
  display: grid;
  place-items: center;
  align-content: center;
  border-right: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.64);
}

.spec-card:last-child {
  border-right: 0;
}

.spec-card strong {
  margin-top: 6px;
  color: var(--black);
  font-size: 21px;
}

.taste-card {
  grid-column: 2;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.taste-title {
  font-size: 16px;
  font-weight: 850;
  margin-bottom: 14px;
}

.taste-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
  font-size: 13px;
}

.taste-bar {
  height: 5px;
  border-radius: 99px;
  background: #ebe9e5;
  overflow: hidden;
}

.taste-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--black);
}

.choice-actions {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}

.choice-actions button {
  height: 58px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 850;
  background: white;
}

.choice-actions .primary {
  background: var(--black);
  color: white;
}

.detail-side {
  display: grid;
  gap: 16px;
}

.detail-panel,
.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.detail-panel {
  padding: 18px;
}

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

.panel-head h2,
.detail-panel h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
}

.panel-head button {
  color: #555;
  font-size: 13px;
}

.similar-list {
  display: grid;
  gap: 12px;
}

.review-stars {
  margin: 18px 0;
  color: #888;
  font-size: 34px;
  letter-spacing: 8px;
}

.review-form textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px;
  resize: vertical;
}

.publish-button {
  width: 100%;
  height: 46px;
  margin-top: 12px;
  border-radius: 7px;
  background: var(--black);
  color: white;
  font-weight: 850;
}

.review-card {
  margin-top: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #74a7ba, #e3c4ad);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.review-head {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.review-name {
  font-weight: 850;
  font-size: 18px;
}

.stars {
  color: #f7a900;
  letter-spacing: 3px;
}

.review-time {
  margin-left: auto;
  color: #888;
}

.review-text {
  margin: 14px 0 0;
  color: #555;
  font-size: 17px;
  line-height: 1.42;
}

.similar-mobile-head,
.similar-row {
  display: none;
}

.detail-shell .main {
  padding: 16px 16px 18px;
}

.detail-view.active {
  max-width: none;
  margin: 0;
}

.detail-desktop-shell {
  min-height: calc(100vh - 32px);
  display: grid;
  grid-template-columns: 220px 330px minmax(0, 1fr);
  gap: 14px;
}

.detail-nav,
.detail-search-panel,
.detail-workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
}

.detail-nav {
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.compact-brand {
  margin-bottom: 6px;
}

.compact-brand .logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.compact-brand .logo-mark::before {
  inset: 6px;
}

.compact-brand .logo-mark::after {
  inset: 13px;
}

.compact-brand .brand-title {
  font-family: var(--serif);
  font-size: 25px;
}

.rail-menu {
  display: grid;
  gap: 13px;
}

.rail-menu button {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #555;
  font-size: 15px;
  text-align: left;
}

.rail-note {
  margin-top: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
  color: #4e4e4e;
  font-size: 12px;
  line-height: 1.45;
}

.rail-note strong {
  color: var(--black);
  font-size: 14px;
  line-height: 1.35;
}

.rail-note .signal-icon {
  width: 34px;
  height: 34px;
  border-width: 1px;
}

.theme-button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: #555;
}

.detail-search-panel {
  padding: 18px;
}

.detail-search-panel h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 18px;
}

.panel-label {
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.detail-style-chips .chip {
  min-width: 64px;
}

.recent-panel {
  margin-top: 18px;
  padding: 16px;
}

.detail-workspace {
  padding: 18px;
}

.detail-top {
  margin-bottom: 12px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.detail-product {
  position: relative;
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(400px, 1.3fr);
  gap: 24px;
  align-items: center;
}

.hero-product {
  min-height: 520px;
  padding: 26px 10px 36px;
}

.hero-product img {
  max-height: 500px;
  max-width: 220px;
}

.hero-product .can-shape {
  width: 165px;
  height: 315px;
}

.hero-product .bottle-alt {
  width: 132px;
  height: 322px;
}

.detail-copy {
  max-width: 580px;
  text-align: left;
}

.detail-copy h1 {
  margin-top: 12px;
  font-size: clamp(32px, 2.8vw, 46px);
  line-height: 1.04;
}

.brewery {
  margin-top: 14px;
  font-size: 18px;
}

.description {
  max-width: 56ch;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.55;
}

.hero-rating {
  top: 86px;
  right: 14px;
  width: 84px;
  font-size: 13px;
}

.rating-circle {
  width: 74px;
  height: 74px;
  margin: 0 auto 6px;
  font-size: 25px;
  line-height: 1;
}

.rating-circle small {
  display: block;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 650;
}

.spec-grid {
  grid-column: auto;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 0;
}

.spec-card {
  min-height: 66px;
}

.quick-verdict {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
}

.quick-verdict > span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--black);
  color: white;
  display: grid;
  place-items: center;
}

.quick-verdict p {
  margin: 4px 0 0;
  color: #555;
  font-size: 13px;
}

.mark-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mark-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 760;
}

.mark-actions button.active {
  background: var(--black);
  color: white;
  border-color: var(--black);
}

/* Saved (bookmark) colours only the flag icon, not the button background. */
.detail-save.active {
  background: transparent;
  color: var(--green);
}

.taste-card {
  grid-column: auto;
  margin-top: 14px;
  padding: 14px;
}

.taste-row {
  grid-template-columns: 86px minmax(0, 1fr) 38px;
  gap: 10px;
  margin: 8px 0;
  font-size: 12px;
}

.detail-side {
  gap: 14px;
}

.detail-panel {
  padding: 16px;
}

.panel-head h2,
.detail-panel h2 {
  font-size: 22px;
}

.review-form p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.review-stars {
  margin: 12px 0 14px;
  font-size: 29px;
  letter-spacing: 6px;
}

.review-form textarea {
  min-height: 92px;
}

.review-card {
  margin-top: 14px;
  min-height: 74px;
  padding: 12px 14px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
}

.load-more {
  display: block;
  width: min(380px, 100%);
  height: 48px;
  margin: 34px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  font-weight: 760;
}

.detail-view {
  display: none;
}

.hidden {
  display: none !important;
}

.profile-page {
  width: min(1320px, 100%);
  max-width: 1320px;
  margin: 0 auto;
}

.profile-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.profile-hero h1 {
  max-width: 860px;
}

.profile-back {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 760;
  white-space: nowrap;
  flex: 0 0 auto;
}

.profile-back span {
  white-space: nowrap;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.25fr) minmax(380px, 0.75fr);
  gap: 22px;
  align-items: start;
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 26px;
}

.profile-main-card {
  align-self: start;
}

.profile-card h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.avatar-editor {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 26px;
}

.profile-avatar {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(135deg, #74a7ba, #e3c4ad);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: 48px;
  font-weight: 900;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-editor p,
.profile-muted {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.avatar-upload {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-weight: 760;
}

.avatar-upload input {
  display: none;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: end;
}

.password-grid {
  grid-template-columns: 1fr;
}

.profile-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.profile-field input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 0 14px;
  color: var(--text);
}

.save-profile-button,
.save-password-button {
  height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
  font-weight: 850;
}

.profile-message {
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 11px 12px;
  color: #555;
  background: rgba(255, 255, 255, 0.62);
}

.theme-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-switch button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.theme-switch button.active {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}

body.dark-theme {
  --bg: #0d0f10;
  --surface: #17191b;
  --surface-soft: #202326;
  --text: #f4f2ec;
  --muted: #a5a7aa;
  --line: #2b2f33;
  --line-soft: #24272b;
  --focus: #7db3ff;
  --black: #b9f347;
  --lime: #b9f347;
  --cyan: #67d8bd;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
  --accent-text: #b9f347;
  --accent-soft: rgba(185, 243, 71, 0.14);
  --glow: 0 0 90px rgba(185, 243, 71, 0.16);
  background:
    radial-gradient(circle at 62% 18%, rgba(185, 243, 71, 0.08), transparent 30rem),
    linear-gradient(180deg, #111315 0%, #0a0b0c 100%);
}

body.dark-theme .desktop-sidebar,
body.dark-theme .profile-card,
body.dark-theme .product-card,
body.dark-theme .detail-panel,
body.dark-theme .review-card,
body.dark-theme .detail-search-panel,
body.dark-theme .detail-workspace,
body.dark-theme .profile-back,
body.dark-theme .desktop-profile-button,
body.dark-theme .profile-side-link,
body.dark-theme .profile-side-card,
body.dark-theme .stats-strip,
body.dark-theme .candidate-panel,
body.dark-theme .candidate-close,
body.dark-theme .candidate-grid input,
body.dark-theme .admin-row,
body.dark-theme .admin-refresh,
body.dark-theme .admin-reject,
body.dark-theme .scanner-camera-button,
body.dark-theme .scanner-barcode-input,
body.dark-theme .search input,
body.dark-theme .profile-field input,
body.dark-theme .theme-switch button,
body.dark-theme .avatar-upload,
body.dark-theme .sort-select {
  background-color: rgba(23, 25, 27, 0.86);
  color: var(--text);
}

body.dark-theme .product-card {
  border-color: rgba(95, 104, 108, 0.42);
  box-shadow: none;
}

body.dark-theme .product-grid.list-mode .product-card {
  border-color: rgba(95, 104, 108, 0.36);
  box-shadow: none;
}

body.dark-theme .product-media {
  background:
    radial-gradient(ellipse at 50% 84%, rgba(185, 243, 71, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(34, 37, 40, 0.72), rgba(18, 20, 22, 0.92));
}

body.dark-theme .card-top {
  background: rgba(34, 37, 40, 0.72);
}

body.dark-theme .list-mode .card-top {
  background: none;
}

body.dark-theme .segmented,
body.dark-theme .control-button,
body.dark-theme .view-toggle,
body.dark-theme .weekly-signal,
body.dark-theme .similar-card,
body.dark-theme .similar-section,
body.dark-theme .taste-card,
body.dark-theme .review-form textarea,
body.dark-theme .load-more {
  background: rgba(23, 25, 27, 0.9);
  border-color: var(--line);
  color: var(--text);
}

body.dark-theme .rating-pill,
body.dark-theme .mini-rating {
  background: rgba(23, 25, 27, 0.96);
  border-color: rgba(185, 243, 71, 0.42);
  color: #b9f347;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

body.dark-theme .rating-circle {
  background: rgba(23, 25, 27, 0.94);
  border-color: rgba(185, 243, 71, 0.58);
  color: #b9f347;
}

body.dark-theme .rating-circle small,
body.dark-theme .hero-rating,
body.dark-theme .panel-head button {
  color: var(--muted);
}

body.dark-theme .taste-bar {
  background: rgba(255, 255, 255, 0.14);
}

body.dark-theme .taste-fill {
  background: #b9f347;
}

body.dark-theme .review-form textarea::placeholder,
body.dark-theme .search input::placeholder,
body.dark-theme .profile-field input::placeholder,
body.dark-theme .candidate-grid input::placeholder {
  color: #787d82;
}

body.dark-theme .load-more {
  border-color: rgba(185, 243, 71, 0.36);
  color: #b9f347;
}

body.dark-theme .stat {
  border-color: var(--line);
}

body.dark-theme .stat-label {
  color: #858a8e;
}

body.dark-theme .chip,
body.dark-theme .verdict,
body.dark-theme .spec-card,
body.dark-theme .quick-verdict,
body.dark-theme .mark-actions button,
body.dark-theme .profile-message {
  background: rgba(28, 31, 34, 0.86);
  color: var(--text);
}

body.dark-theme .chip.active,
body.dark-theme .segmented .active,
body.dark-theme .theme-switch button.active,
body.dark-theme .mark-actions button.active,
body.dark-theme .desktop-profile-button.active,
body.dark-theme .save-profile-button,
body.dark-theme .save-password-button,
body.dark-theme .publish-button,
body.dark-theme .open-candidate-button,
body.dark-theme .submit-candidate-button,
body.dark-theme .admin-verify,
body.dark-theme .scanner-lookup-button {
  background: #b9f347;
  color: #101112;
  border-color: #b9f347;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }
}

@media (max-width: 820px) {
  html,
  body,
  #app {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    background: #fffefd;
  }

  .app-shell {
    display: block;
    padding-bottom: 92px;
  }

  .desktop-sidebar,
  .load-more {
    display: none;
  }

  .desktop-topbar,
  .desktop-hero,
  .desktop-filterbar {
    display: none;
  }

  .profile-shell .desktop-sidebar {
    display: none;
  }

  .main {
    padding: 26px 14px 20px;
    width: 100%;
    max-width: 402px;
    margin: 0 auto;
    overflow-x: hidden;
  }

  .detail-shell .main {
    padding: 0;
    max-width: 414px;
  }

  .listing-view,
  .detail-view {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .mobile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
  }

  .mobile-top .brand-title {
    font-size: 22px;
  }

  .mobile-actions button,
  .detail-icons button,
  .back-button {
    width: 28px;
    height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
  }

  .mobile-search {
    display: block;
  }

  .mobile-actions {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
  }

  .mobile-search {
    margin: 0 0 17px;
  }

  .mobile-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 86px;
    gap: 8px;
    margin-bottom: 17px;
  }

  .control-button,
  .view-toggle {
    height: 56px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 760;
  }

  .view-toggle {
    padding: 5px;
    gap: 5px;
    overflow: hidden;
  }

  .view-toggle button {
    width: 50%;
    min-width: 0;
    height: 46px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }

  .view-toggle button span {
    display: none;
  }

  .view-toggle .active {
    background: var(--black);
    color: #fff;
  }

  .mobile-chip-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 16px;
    scrollbar-width: none;
  }

  .mobile-chip-row .chip {
    flex: 0 0 auto;
    white-space: nowrap;
    height: 46px;
    padding: 0 18px;
    border-radius: 11px;
    font-size: 16px;
    background: white;
  }

  .mobile-chip-row .chip.active {
    background: var(--black);
    color: #fff;
    border-color: var(--black);
  }

  .weekly-signal {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px 16px;
    margin: 0 0 18px;
    background: linear-gradient(95deg, #f8fcf0, #fffdfa);
  }

  .weekly-head {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .weekly-head > svg:last-child {
    margin-left: auto;
  }

  .signal-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid #63ba28;
    color: #249012;
    display: grid;
    place-items: center;
  }

  .weekly-title {
    font-size: 18px;
    font-weight: 850;
  }

  .weekly-body {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
  }

  .weekly-copy {
    flex: 1;
    min-width: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.45;
  }

  .weekly-img {
    width: 64px;
    height: 88px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
  }

  .weekly-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .weekly-img .can-shape,
  .weekly-img .bottle-alt {
    transform: scale(0.62);
    transform-origin: center;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .product-grid.list-mode {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-grid.list-mode .product-card {
    min-height: 176px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    border-radius: 12px;
    padding-right: 0;
  }

  .product-grid.list-mode .product-media {
    height: 100%;
    min-height: 176px;
    padding: 30px 10px 14px;
  }

  .product-grid.list-mode .product-media img {
    max-height: 128px;
    max-width: 70px;
  }

  .product-grid.list-mode .product-media .can-shape {
    width: 66px;
    height: 116px;
  }

  .product-grid.list-mode .product-media .bottle-alt {
    width: 56px;
    height: 124px;
  }

  .product-grid.list-mode .product-media .bottle-alt::before {
    left: 17px;
    top: -38px;
    width: 22px;
    height: 52px;
  }

  .product-grid.list-mode .product-media .bottle-alt .can-label {
    top: 45px;
    font-size: 11px;
  }

  .product-grid.list-mode .product-info {
    min-height: 176px;
    padding: 44px 12px 14px;
    display: flex;
    flex-direction: column;
  }

  .product-grid.list-mode .product-name {
    min-height: 0;
    font-size: 17px;
    line-height: 1.12;
    padding-right: 48px;
  }

  .product-grid.list-mode .product-style {
    margin-top: 8px;
  }

  .product-grid.list-mode .product-hook {
    display: -webkit-box;
    margin: 7px 0 0;
    color: #555;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .product-grid.list-mode .volume {
    display: none;
  }

  .product-grid.list-mode .verdict {
    position: static;
    width: fit-content;
    min-width: 154px;
    max-width: 100%;
    min-height: 34px;
    margin: 14px 0 0;
    padding: 0 12px;
    align-self: flex-start;
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    column-gap: 9px;
    text-align: left;
  }

  .product-grid.list-mode .card-top {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .product-grid.list-mode .save-button {
    display: none;
  }

  .listing-view:has(.product-grid.list-mode) .floating-filter {
    display: none;
  }

  .product-grid > * {
    min-width: 0;
  }

  .product-card {
    min-height: 386px;
    border-radius: 12px;
  }

  .product-media {
    height: 196px;
    padding: 10px 12px;
    background:
      radial-gradient(ellipse at 50% 88%, rgba(0, 0, 0, 0.12), transparent 36%),
      #fffefa;
  }

  .card-top {
    padding: 10px 12px;
    background: #fffefa;
  }

  /* Узкая карточка: компактная плашка, чтобы "Пшеничн."/"Пилснер" влезали целиком. */
  .card-top .tag {
    font-size: 10px;
    padding: 0 8px;
    letter-spacing: 0;
    height: 26px;
  }

  .product-media img {
    height: 168px;
    width: auto;
    max-width: 100%;
    max-height: none;
  }

  .can-shape {
    width: 86px;
    height: 164px;
  }

  .can-label {
    top: 46px;
    font-size: 20px;
  }

  .can-sub {
    bottom: 18px;
    font-size: 9px;
  }

  .bottle-alt {
    width: 76px;
    height: 174px;
  }

  .bottle-alt::before {
    left: 23px;
    top: -55px;
    width: 30px;
    height: 70px;
  }

  .bottle-alt .can-label {
    top: 60px;
    font-size: 14px;
  }

  .product-info {
    padding: 14px 14px 12px;
    min-height: 172px;
  }

  .product-name {
    font-size: 18px;
  }

  .product-style,
  .product-hook,
  .volume,
  .verdict {
    font-size: 13px;
  }

  .product-style {
    margin-top: 11px;
  }

  .verdict {
    margin-top: 12px;
    min-height: 36px;
  }

  .product-hook {
    display: none;
  }

  .save-button {
    display: block;
  }

  .floating-filter {
    display: grid;
    position: fixed;
    right: 16px;
    bottom: 86px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--black);
    color: #fff;
    place-items: center;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
    z-index: 9;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: auto;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    height: 78px;
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    z-index: 10;
  }

  .nav-item {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6f6c68;
    font-size: 12px;
    min-width: 0;
    overflow: hidden;
  }

  .nav-item span {
    max-width: 100%;
    white-space: nowrap;
  }

  body.dark-theme .bottom-nav {
    background: rgba(17, 19, 21, 0.94);
  }

  .nav-item.active {
    color: var(--black);
    font-weight: 800;
  }

  .nav-item.scan {
    margin-top: -24px;
  }

  .scan-circle {
    width: 62px;
    height: 62px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #f8f7f4;
    display: grid;
    place-items: center;
  }

  .listing-view.detail-open {
    display: none;
  }

  .detail-view.active {
    display: block;
    padding: 28px 8px 96px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .detail-desktop-shell,
  .detail-workspace,
  .detail-layout,
  .detail-product {
    display: block;
    min-height: 0;
  }

  .detail-nav,
  .detail-search-panel,
  .detail-side {
    display: none;
  }

  .detail-workspace {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .desktop-back-label {
    display: none;
  }

  .detail-icons {
    display: flex;
    gap: 14px;
  }

  .hero-product {
    position: relative;
    min-height: 438px;
    display: flex;
    align-items: end;
    justify-content: center;
    padding-bottom: 18px;
  }

  .hero-product img {
    max-height: 390px;
    max-width: 170px;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.18));
  }

  .hero-rating {
    position: absolute;
    right: 12px;
    top: 56px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
  }

  .rating-circle {
    width: 60px;
    height: 60px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.78);
    display: grid;
    place-items: center;
    color: var(--black);
    font-size: 23px;
    font-weight: 700;
  }

  .star-gold {
    color: #ffae00;
    font-size: 18px;
    line-height: 1;
  }

  .detail-copy {
    text-align: center;
  }

  .style-pill {
    display: inline-flex;
    height: 38px;
    align-items: center;
    padding: 0 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    color: #5d5d5d;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .detail-copy h1 {
    margin-top: 13px;
    font-size: 34px;
    line-height: 0.98;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .brewery {
    margin-top: 18px;
    color: var(--muted);
    font-size: 21px;
  }

  .description {
    max-width: 650px;
    margin: 16px auto 0;
    color: #676767;
    font-size: 18px;
    line-height: 1.36;
  }

  .spec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 24px 0;
  }

  .spec-card {
    min-height: 72px;
    border: 0;
    border-right: 1px solid var(--line-soft);
    border-radius: 0;
    display: grid;
    place-items: center;
    align-content: center;
    background: rgba(255, 255, 255, 0.66);
    font-size: 14px;
    color: var(--muted);
  }

  .spec-card:last-child {
    border-right: 0;
  }

  .spec-card strong {
    margin-top: 6px;
    color: var(--black);
    font-size: 22px;
  }

  .taste-card,
  .review-card,
  .similar-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
  }

  .taste-card {
    padding: 18px;
  }

  .taste-title {
    font-size: 21px;
    font-weight: 850;
    margin-bottom: 18px;
  }

  .taste-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) 44px;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
  }

  .taste-bar {
    height: 5px;
    border-radius: 99px;
    background: #ebe9e5;
    overflow: hidden;
  }

  .taste-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--black);
  }

  .choice-actions {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    margin: 24px 0;
  }

  .choice-actions button {
    height: 66px;
    border-radius: 12px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 850;
    background: white;
  }

  .choice-actions .primary {
    background: var(--black);
    color: white;
  }

  .review-card {
    padding: 18px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
  }

  .avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #74a7ba, #e3c4ad);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
  }

  .review-head {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-wrap: wrap;
  }

  .review-name {
    font-weight: 850;
    font-size: 18px;
  }

  .stars {
    color: #f7a900;
    letter-spacing: 3px;
  }

  .review-time {
    margin-left: 0;
    color: #888;
  }

  .review-text {
    margin: 14px 0 0;
    color: #555;
    font-size: 17px;
    line-height: 1.42;
  }

  .similar-mobile-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 28px 0 14px;
  }

  .similar-mobile-head h2 {
    margin: 0;
    font-size: 23px;
  }

  .similar-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .similar-card {
    flex: 0 0 210px;
    min-height: 130px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    min-width: 0;
  }

  .similar-card .thumb {
    width: 58px;
    height: 88px;
  }

  .similar-card .thumb img {
    max-height: 82px;
  }

  .profile-page {
    padding-bottom: 88px;
  }

  .profile-shell .main {
    max-width: 430px;
    padding-inline: 12px;
  }

  .profile-hero {
    display: block;
    margin-bottom: 18px;
  }

  .profile-hero h1 {
    font-size: 38px;
  }

  .profile-back {
    margin-top: 16px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .profile-card {
    border-radius: 14px;
    padding: 20px;
  }

  .admin-page,
  .scanner-page {
    padding: 26px 14px 110px;
  }

  .admin-row,
  .scanner-input-row {
    display: grid;
    gap: 12px;
  }

  .admin-actions,
  .scanner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .admin-actions button,
  .scanner-actions button,
  .scanner-lookup-button {
    width: 100%;
  }

  /* Both scanner action buttons fill the row and align text identically.
     height:auto lets the grid's align-items:stretch equalise their heights. */
  .scanner-actions button {
    height: auto;
    min-height: 56px;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
  }

  .avatar-editor {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 16px;
  }

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

  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .save-profile-button,
  .save-password-button {
    width: 100%;
  }

  .candidate-panel {
    margin-top: 18px;
    border-radius: 14px;
    padding: 18px;
  }

  .candidate-head h2 {
    font-size: 24px;
  }

  .candidate-grid {
    grid-template-columns: 1fr;
  }

  .candidate-actions {
    display: grid;
    gap: 10px;
  }

  .submit-candidate-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .bottom-nav {
    width: min(430px, 100vw);
  }
}

@media (max-width: 430px) {
  .main {
    padding-inline: 10px;
    max-width: 402px;
  }

  .detail-shell .main {
    padding-inline: 0;
    max-width: 414px;
  }

  .profile-shell .main {
    padding-inline: 8px;
    max-width: 430px;
  }

  .listing-view,
  .detail-view,
  .product-grid {
    width: 100%;
    max-width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-controls {
    grid-template-columns: 1fr 1fr 104px;
    gap: 8px;
  }

  .control-button {
    font-size: 15px;
  }

  .product-grid {
    gap: 10px;
  }

  .product-card {
    min-height: 366px;
  }

  .product-media {
    height: 194px;
  }

  .product-name {
    font-size: 16px;
  }

  .hero-product {
    min-height: 360px;
  }

  .hero-product img {
    max-height: 315px;
  }

  .detail-copy h1 {
    font-size: 30px;
  }

  .description {
    font-size: 17px;
  }

  .choice-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 821px) {
  .detail-shell .main {
    padding: 16px 16px 18px;
  }

  .detail-desktop-shell {
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 14px;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px;
  }

  .detail-product {
    position: relative;
    min-height: 650px;
    grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1fr);
    gap: 34px;
  }

  .detail-copy {
    max-width: 430px;
    text-align: left;
  }

  .detail-copy h1 {
    font-size: clamp(48px, 4.2vw, 66px);
  }

  .description {
    max-width: 390px;
    font-size: 16px;
  }

  .hero-rating {
    top: 86px;
    right: 14px;
    width: 84px;
    font-size: 13px;
  }

  .rating-circle {
    width: 74px;
    height: 74px;
    margin: 0 auto 6px;
    font-size: 25px;
    line-height: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }

  .rating-circle small {
    display: block;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 650;
  }

  .mark-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .mark-actions button {
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    font-weight: 760;
  }

  .mark-actions button.active {
    background: var(--black);
    color: white;
    border-color: var(--black);
  }

  .review-stars {
    margin: 12px 0 14px;
    display: flex;
    gap: 15px;
    letter-spacing: 0;
  }

  .review-stars button {
    color: #7f7f7f;
    font-size: 32px;
    line-height: 1;
  }

  .review-stars button.active {
    color: #ffae00;
  }

  .review-form p {
    margin: 5px 0 12px;
    color: var(--muted);
    font-size: 13px;
  }

  .review-form textarea {
    min-height: 92px;
  }

  .form-feedback {
    margin-top: 10px;
    min-height: 18px;
    color: #555;
    font-size: 13px;
  }
}

body.dark-theme .segmented,
body.dark-theme .control-button,
body.dark-theme .view-toggle,
body.dark-theme .weekly-signal,
body.dark-theme .similar-card,
body.dark-theme .similar-section,
body.dark-theme .taste-card,
body.dark-theme .review-form textarea,
body.dark-theme .load-more,
body.dark-theme .mark-actions button {
  background: rgba(23, 25, 27, 0.92);
  border-color: var(--line);
  color: var(--text);
}

body.dark-theme .view-toggle .active,
body.dark-theme .segmented .active,
body.dark-theme .mark-actions button.active,
body.dark-theme .mobile-chip-row .chip.active {
  background: #b9f347;
  border-color: #b9f347;
  color: #101112;
}

body.dark-theme .detail-save.active {
  background: transparent;
  color: #b9f347;
}

body.dark-theme .rating-pill,
body.dark-theme .mini-rating,
body.dark-theme .similar-card .mini-rating {
  background: rgba(23, 25, 27, 0.98);
  border-color: rgba(185, 243, 71, 0.48);
  color: #b9f347;
}

body.dark-theme .rating-circle {
  background: rgba(23, 25, 27, 0.96);
  border-color: rgba(185, 243, 71, 0.62);
  color: #b9f347;
}

body.dark-theme .taste-bar {
  background: rgba(255, 255, 255, 0.16);
}

body.dark-theme .taste-fill {
  background: #b9f347;
}

body.dark-theme .spec-card strong,
body.dark-theme .review-stars button.active {
  color: #ffae00;
}

body.dark-theme .quick-verdict > span {
  background: #b9f347;
  color: #101112;
}

body.dark-theme .load-more {
  border-color: rgba(185, 243, 71, 0.38);
  color: #b9f347;
}

/* Accessibility: visible keyboard focus.
   Mouse/touch users keep clean visuals via :focus-visible; keyboard users get a ring. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Accessibility: respect users who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Interactive rating stars rendered as SVG (no glyph icons). */
.review-stars {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0;
  letter-spacing: 0;
}

.review-stars button {
  padding: 4px;
  color: #cfcdc8;
  line-height: 0;
}

.review-stars button .icon {
  width: 30px;
  height: 30px;
}

.review-stars button.active {
  color: #ffae00;
}

body.dark-theme .review-stars button {
  color: #3a3f44;
}

/* Read-only stars inside review cards. */
.stars {
  display: inline-flex;
  gap: 2px;
  letter-spacing: 0;
}

.static-star {
  color: #d9d6d0;
  line-height: 0;
}

.static-star .icon {
  width: 14px;
  height: 14px;
}

.static-star.filled {
  color: #f7a900;
}

body.dark-theme .static-star {
  color: #3a3f44;
}

body.dark-theme .static-star.filled {
  color: #b9f347;
}

/* Honest empty / meta states (replacing former placeholder data). */
.taste-empty {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.taste-note {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

.review-card-empty {
  display: block;
  margin-top: 18px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.review-card-empty .review-text {
  margin: 0;
}

/* Weekly signal is now an interactive button. */
.weekly-signal {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}

/* Scanner live camera preview (mobile only). */
.scanner-camera-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 62vh;
  margin: 14px 0;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-frame {
  position: absolute;
  inset: 20% 12%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* Бегущая линия — даёт понять, что камера активно «ищет» штрихкод. */
.scanner-line {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #b9f347, transparent);
  box-shadow: 0 0 12px rgba(185, 243, 71, 0.7);
  animation: scanSweep 1.8s ease-in-out infinite;
}

@keyframes scanSweep {
  0% { top: 8%; opacity: 0.25; }
  50% { top: 88%; opacity: 1; }
  100% { top: 8%; opacity: 0.25; }
}

/* Плавная отдача при найденном товаре: зелёная вспышка + рисуем галочку. */
.scanner-success {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(185, 243, 71, 0.26), rgba(10, 11, 12, 0.78));
  animation: scanFlash 0.4s ease both;
}

.scanner-success svg {
  width: 84px;
  height: 84px;
}

.scanner-success .sc-ring {
  stroke: #b9f347;
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: scanRing 0.5s ease-out 0.04s forwards;
}

.scanner-success .sc-tick {
  stroke: #b9f347;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: scanTick 0.34s cubic-bezier(0.3, 0.8, 0.4, 1) 0.28s forwards;
}

@keyframes scanFlash {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scanRing {
  to { stroke-dashoffset: 0; }
}

@keyframes scanTick {
  to { stroke-dashoffset: 0; }
}

.scanner-stop-button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
}

.scanner-hint {
  margin: 8px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* PWA (установлено на телефон, без адресной строки): опускаем контент ниже
   выреза/статус-бара, иначе лого и хедер липнут к самому верху экрана.
   Стоит ПОСЛЕ мобильного @media (max-width:820px), чтобы переопределить его. */
@media (display-mode: standalone) {
  .main {
    padding-top: calc(26px + env(safe-area-inset-top));
  }

  .standalone-header {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .detail-shell .main {
    padding-top: env(safe-area-inset-top);
  }

  .bottom-nav {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

/* Auth screen + account controls. */
.auth-card {
  max-width: 460px;
}

.auth-tabs {
  margin-bottom: 16px;
}

.auth-card .profile-field {
  margin-bottom: 12px;
}

.auth-submit-button,
.go-auth-button {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
  font-weight: 850;
}

.logout-button {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

body.dark-theme .auth-submit-button,
body.dark-theme .go-auth-button {
  background: #b9f347;
  color: #101112;
}

/* ---- UI polish pass ---------------------------------------------------- */

/* Auth form centered on wide screens. */
.auth-card {
  margin-left: auto;
  margin-right: auto;
}

/* Auth heading: smaller serif so "С возвращением." doesn't break with a lone "С". */
.auth-page .profile-hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.1;
  max-width: 100%;
}

/* Empty-state readable in dark mode (was near-white). */
body.dark-theme .empty-state {
  background: rgba(23, 25, 27, 0.86);
  border-color: var(--line);
}

/* Bottom-nav scanner circle adapts to dark mode (was hardcoded near-white). */
body.dark-theme .scan-circle {
  background: var(--surface-soft);
  border-color: var(--line);
}

/* Mobile filters drawer (toggled by the "Фильтры" button). */
.mobile-filters {
  display: none;
}

@media (max-width: 820px) {
  .mobile-filters {
    display: grid;
    gap: 18px;
    margin: 0 0 17px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .mobile-filters .filter-title {
    margin: 0 0 10px;
  }

  /* Scanner action buttons: smaller, non-wrapping text. */
  .scanner-actions button,
  .scanner-lookup-button,
  .scanner-stop-button {
    font-size: 15px;
  }

  .scanner-camera-button {
    justify-content: center;
    gap: 6px;
  }

  .scanner-camera-button .icon {
    width: 18px;
    height: 18px;
  }
}

/* ---- Review modal ------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 12, 14, 0.55);
  backdrop-filter: blur(2px);
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 460px;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 40px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-label {
  margin: 16px 0 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}

.modal-body .modal-label:first-child {
  margin-top: 0;
}

.modal-body .review-stars {
  margin: 0;
}

.modal-body .review-textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  resize: vertical;
}

.taste-sliders {
  display: grid;
  gap: 14px;
}

.taste-slider {
  display: grid;
  gap: 6px;
}

.taste-slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}

.taste-slider-label b {
  color: var(--muted);
  font-weight: 700;
}

.taste-slider input[type="range"] {
  width: 100%;
  accent-color: var(--black);
}

.modal-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
}

.modal-cancel {
  flex: 0 0 auto;
  padding: 0 18px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.modal-actions .publish-button {
  flex: 1;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
  font-weight: 850;
}

body.dark-theme .modal-actions .publish-button {
  background: #b9f347;
  color: #101112;
}

/* Dark theme: --black becomes lime, so active pills need dark text for contrast. */
body.dark-theme .standalone-nav-link.active {
  color: #10130a;
}

body.dark-theme .ach-badge.unlocked .ach-progress {
  color: #b9f347;
}

/* ===== Desktop redesign ===== */
.shelf-shell {
  display: block;
}

.shelf-shell .main {
  padding: 28px clamp(24px, 4vw, 56px) 64px;
}

.desktop-topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--shell-max);
  margin: 0 auto 44px;
}

.desktop-topbar .brand {
  margin-bottom: 0;
}

.topbar-search {
  flex: 1;
  max-width: 460px;
  margin-left: auto;
}

.topbar-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-link,
.topbar-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 600;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.topbar-link:hover,
.topbar-profile:hover {
  border-color: var(--accent-text);
  transform: translateY(-1px);
}

.topbar-link.active {
  background: var(--accent-soft);
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.topbar-link svg,
.topbar-profile svg {
  width: 18px;
  height: 18px;
}

.desktop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
  gap: 40px;
  align-items: end;
  max-width: var(--shell-max);
  margin: 0 auto 30px;
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(40px, 4.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 12px 0 16px;
}

.hero-accent {
  color: var(--accent-text);
}

.desktop-hero .lead {
  font-size: 18px;
  max-width: 560px;
}

.hero-stats {
  display: flex;
  gap: 30px;
  margin-top: 26px;
  padding: 0;
  border: 0;
  background: none;
}

.hero-stats .stat {
  text-align: left;
  padding: 0 30px 0 0;
  border-right: 1px solid var(--line);
}

.hero-stats .stat:last-child {
  border-right: 0;
  padding-right: 0;
}

.hero-stats .stat-value {
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
}

/* Сигнал недели возвращается на десктоп как акцентный лайм-блок
   (базовое правило прячет .weekly-signal на десктопе — перекрываем). */
.desktop-hero .weekly-signal {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent-text);
  background: var(--accent-soft);
  box-shadow: var(--glow);
  text-align: left;
}

.desktop-hero .weekly-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.desktop-hero .weekly-head > svg:last-child {
  margin-left: auto;
}

.desktop-hero .signal-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--accent-text);
  color: var(--accent-text);
  display: grid;
  place-items: center;
}

.desktop-hero .weekly-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
}

.desktop-hero .weekly-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.desktop-hero .weekly-copy {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.desktop-hero .weekly-img {
  width: 72px;
  flex: 0 0 auto;
}

body.dark-theme .desktop-hero .weekly-signal {
  border-color: var(--accent-text);
  background-color: transparent;
  background: var(--accent-soft);
}

.desktop-filterbar {
  position: sticky;
  top: 14px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: var(--shell-max);
  margin: 0 auto 34px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
}

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

.filterbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.filterbar-range {
  min-width: 220px;
}

.filterbar-prefs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.filterbar-controls .sort-select {
  margin-left: auto;
}

.product-grid {
  max-width: var(--shell-max);
}

@media (min-width: 821px) {
  .product-card {
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }

  .product-card:hover,
  .product-card:focus-visible {
    transform: translateY(-4px);
    border-color: var(--accent-text);
    box-shadow: var(--glow);
  }
}

@media (min-width: 1181px) {
  .product-grid:not(.list-mode) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: dense;
  }

  .product-card.featured {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
  }

  .product-card.featured .product-media {
    flex: 1;
    min-height: 320px;
  }

  .product-card.featured .product-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: 28px;
    line-height: 1.15;
  }

  .product-card.featured .rating-pill {
    font-family: var(--display);
    font-size: 22px;
    height: auto;
    padding: 10px 18px;
  }

  .product-card.featured .card-top {
    padding: 18px 20px;
  }

  .product-card.featured .tag {
    height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    font-size: 14px;
  }
}

/* ===== Desktop redesign: detail page ===== */
@media (min-width: 821px) {
  .detail-shell .main {
    padding: 28px clamp(24px, 4vw, 56px) 64px;
  }

  .detail-view.active {
    max-width: var(--shell-max);
    margin: 0 auto;
  }

  .detail-workspace {
    border: 0;
    background: none;
    padding: 0;
  }

  /* Hero занимает всю ширину workspace; боковые панели уходят bento-рядом вниз */
  .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .detail-side {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
  }

  /* Hero: постамент с бутылкой слева, имя + гигантский рейтинг справа */
  .detail-product {
    position: relative;
    display: grid;
    /* Текст - главный: картинке хватает 320px, описанию нужна ширина строки. */
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(120px, auto);
    gap: 32px;
    align-items: start;
    min-height: auto;
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
  }

  .hero-product {
    display: grid;
    place-items: center;
    min-height: 440px;
    border-radius: var(--radius-md);
    background:
      radial-gradient(ellipse at 50% 78%, var(--accent-soft), transparent 62%),
      var(--surface-soft);
  }

  .detail-copy h1 {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(28px, 2.4vw, 40px);
    line-height: 1.12;
    letter-spacing: -0.01em;
  }

  /* Характеристики и действия выше, описание ниже них. */
  .detail-copy {
    display: flex;
    flex-direction: column;
  }

  .detail-copy .description {
    order: 10;
    margin-top: 20px;
  }

  .hero-rating {
    position: static;
    /* Сбрасываем width: 84px из старого правила (~строка 1944) — иначе
       гигантская цифра рейтинга живёт в зажатом контейнере. */
    width: auto;
    font-size: inherit;
    text-align: right;
    justify-self: end;
  }

  .hero-rating .rating-circle {
    width: auto;
    height: auto;
    border: 0;
    background: none;
    font-family: var(--display);
    font-weight: 800;
    font-size: 72px;
    line-height: 1;
    color: var(--accent-text);
  }

  .hero-rating .rating-circle small {
    display: block;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 14px;
    color: var(--muted);
  }

  /* Bento-блоки под hero */
  .detail-side .detail-panel,
  .similar-section,
  .taste-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
  }
}

@media (min-width: 821px) {
  body.dark-theme .detail-workspace {
    background-color: transparent;
  }

  body.dark-theme .hero-rating .rating-circle {
    background: none;
    border: 0;
  }

  /* Статистика в hero полки: гасим плашку из body.dark-theme .stats-strip. */
  body.dark-theme .hero-stats {
    background: none;
    background-color: transparent;
    border: 0;
    box-shadow: none;
  }
}

/* ===== Desktop redesign: типографика остальных страниц ===== */
@media (min-width: 821px) {
  .profile-hero h1,
  .auth-page h1,
  .admin-page h1,
  .scanner-page h1 {
    font-family: var(--display);
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  .section-label {
    color: var(--accent-text);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    font-size: 12px;
  }
}

/* Картинка «Сигнала недели»: ограничения размеров заданы только в мобильных
   медиа-блоках, на десктопе фото рендерилось натуральным размером (1200px+). */
.desktop-hero .weekly-img {
  height: 72px;
  overflow: hidden;
  border-radius: 12px;
}

.desktop-hero .weekly-img img,
.desktop-hero .weekly-img .can-shape,
.desktop-hero .weekly-img .bottle-alt {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* На узком десктопе (левая поисковая панель 330px съедает ширину workspace)
   трёхколоночный hero карточки не помещается — складываем его в одну колонку. */
@media (min-width: 821px) and (max-width: 1240px) {
  .detail-product {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-product {
    min-height: 320px;
  }

  .hero-rating {
    justify-self: start;
    text-align: left;
  }
}

/* Десктоп-блоки полки объявлены выше с display:flex/grid ПОЗЖЕ мобильного
   правила скрытия (~строка 2480) — повторяем скрытие в конце файла,
   чтобы каскад снова прятал их на мобилке. */
@media (max-width: 820px) {
  .desktop-topbar,
  .desktop-hero,
  .desktop-filterbar {
    display: none;
  }
}

/* === UI fix pass (2026-06-11): отступы, размеры, сердечко CTA === */

/* Карточка товара: иконки и стрелка не липнут к краям. */
.detail-top { padding: 14px 16px 0; }

/* Характеристики (Крепость/Объём/Страна): умеренный размер, страна не вылезает. */
.spec-card strong { font-size: 18px; overflow-wrap: anywhere; }
@media (max-width: 820px) { .spec-card strong { font-size: 16px; } }

/* Сердечко в CTA сканера — зелёное, в стиле радара. */
.cta-heart { color: #b9f347; }

/* Auth/standalone: подзаголовок-лейбл не липнет к лого. */
.standalone-header + section .section-label,
.auth-page .section-label { margin-top: 14px; }

/* Похожие сорта: рейтинг не липнет к строке стиля. */
.similar-card .mini-rating {
  margin-top: 8px;
}

/* Фикс шапки: поиск и «Профиль» наследовали сайдбарные отступы и съезжали по вертикали. */
.desktop-topbar .search {
  margin: 0 0 0 auto;
}

.desktop-topbar .desktop-profile-button {
  width: auto;
  margin: 0;
  border-radius: 999px;
  background: var(--surface);
}

/* Auth на деске: hero по центру, «На полку» не дублируем (есть «Полка» в шапке). */
@media (min-width: 821px) {
  .auth-page .profile-hero {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 34px;
  }

  .auth-page .profile-hero .profile-back {
    display: none;
  }

  .auth-page .lead {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Сигнал недели: даже короткий текст страхуем клампом в 3 строки. */
.weekly-signal .weekly-copy {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Featured-карточка: крупное фото и реальная инфа вместо пустоты. */
@media (min-width: 821px) {
  .product-card.featured .product-media {
    min-height: 380px;
  }

  .product-card.featured .product-media img {
    height: 400px;
    width: auto;
    max-width: 100%;
    max-height: none;
  }

  .product-card.featured .product-meta {
    display: block;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 14px;
  }

  .product-card.featured .product-hook {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
  }
}

/* === Privacy policy + consent (152-ФЗ) === */
.link-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-text);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 4px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  text-align: left;
}

.auth-consent input {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--accent-text);
}

.auth-legal {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.legal-page {
  width: min(820px, 100%);
  margin: 0 auto;
}

.legal-card {
  margin-top: 8px;
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 16px);
  background: var(--surface);
}

.legal-meta {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
}

.legal-card h2 {
  margin: 26px 0 8px;
  font-size: 18px;
  font-weight: 800;
}

.legal-card h2:first-of-type {
  margin-top: 0;
}

.legal-card p {
  margin: 0 0 10px;
  line-height: 1.6;
  color: var(--text);
}

.legal-card ul {
  margin: 0 0 10px;
  padding-left: 22px;
  line-height: 1.6;
}

.legal-card li {
  margin-bottom: 4px;
}

body.dark-theme .legal-card {
  background: rgba(23, 25, 27, 0.86);
  border-color: var(--line);
}

/* === Раздел «Моё пиво»: вкладки по личным отметкам === */
.marks-header {
  max-width: var(--shell-max, 1320px);
  margin: 0 auto 24px;
}

.marks-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 44px);
  margin: 0 0 16px;
}

.marks-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.marks-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.marks-tab:hover {
  transform: translateY(-1px);
}

.marks-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.marks-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.marks-tab.active .marks-count {
  background: var(--accent-text);
  color: #101112;
}

body.dark-theme .marks-tab {
  background: rgba(23, 25, 27, 0.86);
  border-color: var(--line);
}

body.dark-theme .marks-tab.active {
  background: var(--accent-soft);
  border-color: var(--accent-text);
}

@media (max-width: 820px) {
  .marks-header {
    padding: 8px 4px 0;
  }
  .marks-title {
    font-size: 26px;
  }
}
