/* Cakra — OFL 1.1, лицензия в /fonts/OFL.txt. Одно начертание, поэтому везде weight 400 */
@font-face {
  font-family: 'Cakra';
  src: url('/fonts/Cakra-Normal.woff2') format('woff2'),
       url('/fonts/Cakra-Normal.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  color-scheme: light;
  --font: 'Cakra', 'Helvetica Neue', Arial, sans-serif;
  --line: clamp(6px, 0.62vw, 11px);     /* толщина рамок */
  --gap: clamp(14px, 1.6vw, 28px);
  --grid-max: 1800px;                   /* шире сетка не растёт */
  /* Раскладку плиток считает /layout.js по реальной ширине сетки и ставит --unit (клетка) и --cap (высота подписи) */
  --unit: 40px;
  --cap: 100px;
  --side: clamp(20px, 6.8vw, 130px);    /* поля по бокам */
  --track: -0.045em;
}

/* Тёмная тема — те же два цвета наоборот. Тему ставит /theme.js; без него — по настройке устройства */
:root[data-theme='dark'] { --ink: #fff; --paper: #000; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --ink: #fff; --paper: #000; color-scheme: dark; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.modal-open { overflow: hidden; }
.wish, .theme-btn, .acct-btn, .dd-btn, .dd-list li, .modal-close, .modal-go, .peek-btn, .stat-jump, .bar-back { -webkit-tap-highlight-color: transparent; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--track);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 4px solid var(--ink); outline-offset: 4px; }

.box { border: var(--line) solid var(--ink); background: var(--paper); }

/* ---------- список ---------- */
.wishes { max-width: var(--grid-max); margin-inline: auto; padding: 0 var(--side) calc(var(--gap) * 4); }

.grid {
  position: relative;      /* плитки расставляет /layout.js, сюда он пишет и высоту */
  gap: var(--gap);         /* промежуток читает JS: так он один и тот же в CSS и в раскладке */
}
.grid.animate .wish { transition: left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { .grid.animate .wish { transition: none; } }

.wish {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  container-type: size;
  cursor: pointer;
}

.wish-pic { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; }
.wish img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wish-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: clamp(6px, 4cqi, 16px) clamp(8px, 5cqi, 20px);
  background: var(--paper);
}
.wish-title {
  font-size: clamp(16px, 10cqi, 64px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}
.wish-price { font-size: clamp(14px, 6cqi, 32px); line-height: 1; }
.wish-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: clamp(13px, 4.2cqi, 18px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* без картинки: текст занимает всю плитку, как в блоках статистики */
.wish:not(.has-image) .wish-text { flex: 1 1 auto; min-height: 0; overflow: hidden; background: transparent; }
/* описание заполняет всё свободное место плитки, а не обрывается на 3-й строке (1.5.1);
   если не влезает — плавно гаснет внизу. Дата и прочее остаются под ним */
.wish:not(.has-image) .wish-note {
  display: block;
  -webkit-line-clamp: unset;
  flex: 0 1 auto;
  min-height: 1.35em;
  overflow: hidden;
  font-size: clamp(13px, 4.6cqi, 22px);
}
.wish:not(.has-image) .wish-note.is-clipped {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.2em), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 2.2em), transparent);
}
.wish:not(.has-image) .wish-meta { flex: none; }

/* с картинкой: подпись — отдельная полоса внизу плитки (высоту --cap задаёт раскладка).
   Картинка занимает всё остальное, то есть ровно столько, сколько занимала бы без подписи */
.wish.has-image .wish-text {
  flex: none;
  justify-content: center;
  gap: 0.15em;
  height: var(--cap);
  box-sizing: border-box;
  overflow: hidden;
  padding: 0 clamp(8px, 3cqi, 18px);
  border-top: var(--line) solid var(--ink);
}
.wish.has-image .wish-title {
  font-size: clamp(13px, min(9cqi, calc(var(--cap) * 0.3)), 34px);
  line-height: 1.05;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wish.has-image .wish-price { font-size: clamp(11px, min(6cqi, calc(var(--cap) * 0.19)), 24px); }
/* заметка и подробности — в открывшейся карточке */
.wish.has-image .wish-note,
.wish.has-image .wish-meta { display: none; }

/* исполнено: плитка перечёркнута */
.wish.is-fulfilled img { filter: grayscale(1); opacity: 0.55; }
.wish.is-fulfilled .wish-text { opacity: 0.55; }
.cross {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cross path { stroke: var(--ink); stroke-width: var(--line); vector-effect: non-scaling-stroke; }

.empty { text-align: center; font-size: clamp(20px, 2.4vw, 40px); }

/* ---------- адаптив ---------- */

/* ---------- тема и язык ---------- */
.hero { position: relative; }
.controls {
  --ctl-line: clamp(3px, 0.4vw, 5px);
  --ctl-h: clamp(36px, 2.7vw, 46px);
  position: absolute;
  top: var(--gap);
  right: var(--side);
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.theme-btn {
  width: var(--ctl-h);
  height: var(--ctl-h);
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--ctl-line) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.theme-btn svg { width: 56%; height: 56%; }
.theme-btn:hover { background: var(--ink); color: var(--paper); }

/* выпадающий список (язык и сортировка): кнопка с текущим значением, список открывается светлым */
.dd { --ctl-line: clamp(3px, 0.4vw, 5px); --ctl-h: clamp(36px, 2.7vw, 46px); position: relative; }
.dd[hidden] { display: none; }
.dd-btn {
  height: var(--ctl-h);
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0 0.8em 0 0.95em;
  border: var(--ctl-line) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: clamp(16px, 1.3vw, 22px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
}
.dd-btn.is-outline { background: var(--paper); color: var(--ink); letter-spacing: var(--track); }
.dd-btn.is-outline:hover { background: var(--ink); color: var(--paper); }
.dd-btn svg {
  width: 0.7em;
  height: 0.7em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
  transition: transform 0.15s;
}
.dd-btn[aria-expanded='true'] svg { transform: rotate(180deg); }

.dd-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  min-width: max(100%, 12.5em);
  margin: 0;
  padding: 0;
  list-style: none;
  border: var(--ctl-line) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.dd-list[hidden] { display: none; }
.dd-list li {
  display: flex;
  align-items: baseline;
  gap: 0.8em;
  padding: 0.5em 0.9em 0.4em;
  font-size: clamp(16px, 1.3vw, 22px);
  line-height: 1.15;
  letter-spacing: var(--track);
  white-space: nowrap;
  cursor: pointer;
}
.dd-list li:hover,
.dd-list li:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.dd-code { width: 1.9em; letter-spacing: 0.02em; }
.dd-list li[aria-selected='true']::after {
  content: '';
  width: 0.5em;
  height: 0.5em;
  margin-left: auto;
  align-self: center;
  background: currentColor;
}

/* ---------- дата добавления и счётчики на карточке ---------- */
.wish-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.9em;
  font-size: clamp(12px, 3.8cqi, 16px);
  line-height: 1.3;
  letter-spacing: 0;
  opacity: 0.7;
}

/* ---------- сколько зашли на сайт ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.3em 1em;
  padding: 0 var(--side) calc(var(--gap) * 3);
  font-size: clamp(16px, 1.7vw, 30px);
  line-height: 1.2;
  text-align: center;
}
.foot[hidden] { display: none; }
.foot-dot { width: 0.4em; height: 0.4em; align-self: center; background: var(--ink); }
.foot b { font-weight: 400; font-variant-numeric: tabular-nums; }

/* ---------- открытая карточка желания ---------- */
.modal {
  position: fixed;
  width: min(760px, calc(100vw - var(--gap) * 2));
  max-width: none;
  max-height: calc(100svh - var(--gap) * 2);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: var(--line) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
  letter-spacing: var(--track);
}
.modal::backdrop { background: rgb(0 0 0 / 0.72); }
.modal-scroll { max-height: calc(100svh - var(--gap) * 2 - var(--line) * 2); overflow-y: auto; overscroll-behavior: contain; }

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 4px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.modal-close svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: square; }
.modal-close:hover { background: var(--ink); color: var(--paper); }

.modal-pic { border-bottom: var(--line) solid var(--ink); background: var(--paper); }
.modal-pic img { display: block; width: 100%; max-height: 55svh; object-fit: contain; }
.modal.is-fulfilled .modal-pic img { filter: grayscale(1); opacity: 0.55; }

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6em;
  padding: clamp(16px, 3vw, 32px);
}
.modal-title {
  margin: 0;
  padding-right: 56px; /* место под крестик, когда картинки нет */
  font-size: clamp(28px, 4vw, 56px);
  font-weight: 400;
  line-height: 1.02;
  overflow-wrap: anywhere;
}
.modal-pic:not([hidden]) + .modal-body .modal-title { padding-right: 0; }
.modal-price { margin: 0; font-size: clamp(22px, 2.6vw, 40px); line-height: 1; }
.modal-note {
  margin: 0;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.4;
  overflow-wrap: anywhere;
  width: 100%;
}
.modal-note > :first-child { margin-top: 0; }
.modal-note > :last-child { margin-bottom: 0; }
.modal-note p { margin: 0.7em 0; }
.modal-note h3, .modal-note h4 { margin: 1em 0 0.35em; font-size: 1.25em; line-height: 1.15; font-weight: 400; text-transform: uppercase; letter-spacing: var(--track); }
.modal-note h4 { font-size: 1.05em; }
.modal-note ul, .modal-note ol { margin: 0.6em 0; padding-left: 1.3em; }
.modal-note li { margin: 0.2em 0; }
.modal-note strong { font-weight: 700; }
.modal-note a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.modal-note a:hover { text-decoration-thickness: 4px; }
.modal-note code { padding: 0.05em 0.3em; border: 2px solid var(--ink); font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; }
.modal-note blockquote { margin: 0.7em 0; padding: 0.1em 0 0.1em 0.9em; border-left: var(--line) solid var(--ink); }
.modal-note hr { border: 0; border-top: 3px solid var(--ink); margin: 1em 0; }
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2em 1em;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(13px, 1.2vw, 17px);
  letter-spacing: 0;
  opacity: 0.7;
}
.modal-meta:empty { display: none; }
.modal-go {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  margin-top: 0.4em;
  padding: 0.5em 0.9em 0.4em;
  border: var(--line) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(20px, 2vw, 32px);
  line-height: 1.05;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.modal-go[hidden] { display: none; }
.modal-go:hover { background: var(--paper); color: var(--ink); }

.modal-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.modal-chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.3em 0.6em 0.22em;
  border: 3px solid var(--ink);
  font-size: clamp(13px, 1.2vw, 17px);
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.chip b { font-weight: 400; letter-spacing: 0.04em; }
.chip.is-solid { background: var(--ink); color: var(--paper); }

/* ---------- бронирование в карточке ---------- */
.modal-rsv { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; padding-top: 0.6em; border-top: 3px solid var(--ink); margin-top: 0.4em; }
.modal-rsv[hidden] { display: none; }
.rsv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rsv-btn {
  padding: 0.5em 0.9em 0.4em;
  border: var(--line) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: clamp(18px, 1.7vw, 26px);
  line-height: 1.05;
  letter-spacing: var(--track);
  text-transform: uppercase;
  cursor: pointer;
}
.rsv-btn:hover { background: var(--ink); color: var(--paper); }
.rsv-btn.is-solid { background: var(--ink); color: var(--paper); }
.rsv-btn.is-solid:hover { background: var(--paper); color: var(--ink); }
.rsv-btn[disabled] { opacity: 0.5; cursor: progress; }
.rsv-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: clamp(13px, 1.15vw, 16px); letter-spacing: 0; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; opacity: 0.75; }
.rsv-link:hover { opacity: 1; }

dialog.rsv { width: min(520px, calc(100vw - var(--gap) * 2)); }
.rsv .modal-title { font-size: clamp(24px, 3vw, 40px); }
.rsv .modal-note { font-size: clamp(15px, 1.4vw, 19px); }
.rsv-input {
  width: 100%;
  padding: 0.55em 0.7em 0.45em;
  border: calc(var(--line) * 0.6) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: clamp(16px, 1.5vw, 22px);
  letter-spacing: 0;
  text-transform: none;
}
.rsv-input:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.rsv-label { font-size: clamp(13px, 1.15vw, 16px); letter-spacing: 0; opacity: 0.75; }
.rsv-error { margin: 0; min-height: 1.2em; font-size: clamp(14px, 1.2vw, 17px); letter-spacing: 0; text-transform: none; }
.rsv-stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translate(-50%, 20px);
  max-width: min(90vw, 520px);
  padding: 0.6em 1em 0.5em;
  border: 4px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(14px, 1.3vw, 18px);
  letter-spacing: 0;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================== 1.4 ============================== */
[hidden] { display: none !important; }

/* ---------- две страницы: встречающая и лента ---------- */
.view.enter-from-right { animation: enter-right 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
.view.enter-from-left { animation: enter-left 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes enter-right { from { transform: translateX(6vw); opacity: 0; } }
@keyframes enter-left { from { transform: translateX(-6vw); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .view.enter-from-right, .view.enter-from-left { animation: none; } }

/* ---------- встречающая страница ---------- */
.hero {
  min-height: calc(100svh - 4.5em);
  padding: calc(var(--gap) * 3.2) var(--side) var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--gap);
}
.hero-title { margin: 0; font-size: clamp(52px, 7.3vw, 140px); line-height: 1.36; font-weight: 400; }
.hero-title span { display: block; white-space: nowrap; }

.stats { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: dense; gap: var(--gap); }
.stat {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: clamp(130px, 13vw, 250px);
  padding: 0.12em clamp(10px, 0.9vw, 18px) 0.35em;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  text-align: left;
}
.num { display: block; font-size: clamp(56px, 6.2vw, 116px); line-height: 1; font-weight: 400; font-variant-numeric: tabular-nums; }
.label { display: block; font-size: clamp(20px, 2.3vw, 44px); line-height: 1.12; overflow-wrap: anywhere; }
.stat-tall { grid-row: span 2; justify-content: flex-start; gap: 0.25em; }
.stat-tall .label { line-height: 1.45; }
.stat-tall .label span { display: block; }
.stat-wide-text { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: baseline; flex-wrap: wrap; justify-content: flex-start; column-gap: 0.5em; padding-block: 0.2em 0.3em; }

/* отсчёт до дня рождения — во всю ширину, числа крупно, единицы мельче */
.stat-countdown { grid-column: 1 / -1; min-height: 0; padding-block: 0.15em 0.4em; gap: 0.2em; }
.stat-countdown .num { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.28em; }
.cd-u { font-size: 0.42em; letter-spacing: var(--track); }
.cd-n + .cd-u { margin-left: 0.08em; }

.stat-jump { align-items: center; justify-content: center; cursor: pointer; }
.stat-jump svg { width: 30%; height: auto; fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: square; transition: transform 0.2s; }
.stat-jump:hover, .stat-jump:focus-visible { background: var(--ink); }
.stat-jump:hover svg, .stat-jump:focus-visible svg { stroke: var(--paper); transform: translateX(12%); }

.acct-btn {
  height: var(--ctl-h);
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0 0.85em;
  border: var(--ctl-line) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: clamp(16px, 1.3vw, 22px);
  text-transform: uppercase;
  letter-spacing: var(--track);
  cursor: pointer;
}
.acct-btn.has-avatar { padding-left: 4px; }
.acct-btn:hover { background: var(--ink); color: var(--paper); }
.acct-nick { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; }

.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.4em;
  height: 2.4em;
  background: var(--ink) center / cover no-repeat;
  color: var(--paper);
  text-transform: uppercase;
}
.avatar.is-small { width: calc(var(--ctl-h, 40px) - 14px); height: calc(var(--ctl-h, 40px) - 14px); font-size: 0.8em; }
.avatar.is-big { width: 96px; height: 96px; font-size: 44px; border: var(--line) solid var(--ink); }

/* что нового */
.changelog { padding: 0 var(--side) calc(var(--gap) * 2); }
.changelog details { border-top: var(--line) solid var(--ink); }
.changelog summary {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 0 0.4em;
  font-size: clamp(18px, 1.7vw, 28px);
  cursor: pointer;
  list-style: none;
}
.changelog summary::-webkit-details-marker { display: none; }
.changelog summary svg { width: 0.6em; height: 0.6em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; transition: transform 0.15s; }
.changelog details[open] summary svg { transform: rotate(180deg); }
.changelog-body {
  max-width: 62em;
  padding-bottom: var(--gap);
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.45;
}
.changelog-body h3, .changelog-body h4 { margin: 1.4em 0 0.4em; font-weight: 400; text-transform: uppercase; letter-spacing: var(--track); font-size: 1.6em; line-height: 1.1; }
.changelog-body h4 { font-size: 1.15em; margin-top: 1em; }
.changelog-body > :first-child { margin-top: 0.4em; }
.changelog-body ul { margin: 0.4em 0; padding-left: 1.2em; }
.changelog-body li { margin: 0.25em 0; }
.changelog-body strong { font-weight: 700; }
.changelog-body code { padding: 0 0.25em; border: 2px solid var(--ink); font-family: ui-monospace, Menlo, monospace; font-size: 0.88em; }

/* ---------- лента: полоса сверху ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1vw, 16px) clamp(10px, 1.2vw, 20px);
  margin: 0 calc(var(--side) * -1) var(--gap);
  padding: clamp(10px, 1.2vw, 20px) var(--side);
  background: var(--paper);
}
.bar-back {
  --ctl-line: clamp(3px, 0.4vw, 5px);
  flex: none;
  width: clamp(40px, 3.3vw, 58px);
  height: clamp(40px, 3.3vw, 58px);
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--ctl-line) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.bar-back svg { width: 62%; fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: square; }
.bar-back:hover { background: var(--ink); color: var(--paper); }
.bar-title { flex: 1 1 12em; min-width: 0; margin: 0; font-size: clamp(24px, 3vw, 56px); line-height: 1.05; font-weight: 400; text-align: left; }
.bar-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.bar-tools .dd-list { max-height: min(60vh, 28em); overflow-y: auto; }

.guest-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px var(--gap);
  margin: 0 0 var(--gap);
  padding: 0.6em 0.9em;
  border: calc(var(--line) * 0.6) solid var(--ink);
  font-size: clamp(14px, 1.15vw, 18px);
  letter-spacing: 0;
  text-transform: none;
}
.guest-note p { margin: 0; flex: 1 1 24em; line-height: 1.35; }

/* ---------- плитка ---------- */
.wish-link { position: absolute; inset: 0; z-index: 1; }
.wish-text { pointer-events: none; }
.wish.has-image .wish-text { height: var(--cap); }
.wish-status { font-size: clamp(12px, 4cqi, 18px); letter-spacing: 0; opacity: 0.75; }

.wish-prio {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  min-width: 1.6em;
  padding: 0.12em 0.4em 0;
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(14px, 6cqi, 28px);
  line-height: 1;
  text-align: center;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.wish-tags { position: absolute; top: 0; left: 0; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; max-width: 78%; pointer-events: none; }
.wish-tag {
  padding: 0.3em 0.5em 0.2em;
  background: var(--ink);
  color: var(--paper);
  font-size: clamp(10px, 3.2cqi, 15px);
  line-height: 1.05;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.wish-tag.is-rsv { background: var(--paper); color: var(--ink); outline: 3px solid var(--ink); outline-offset: -3px; }
.wish-tag.is-mine { background: var(--ink); color: var(--paper); }
.wish.is-fulfilled .wish-prio, .wish.is-fulfilled .wish-tags { display: none; }
/* у плитки без фото метки стоят в общем потоке над названием, а не поверх него */
.wish:not(.has-image) .wish-tags { position: relative; order: -1; flex-direction: row; flex-wrap: wrap; max-width: calc(100% - 2.6em); padding: clamp(6px, 4cqi, 16px) 0 0 clamp(8px, 5cqi, 20px); }
.wish:not(.has-image) .wish-text { padding-right: 2.4em; }

/* подробности при наведении (на телефоне — по первому касанию): закрывают картинку целиком */
.wish-peek {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s, visibility 0s 0.14s;
}
.wish.has-image .wish-peek { bottom: var(--cap); }
@media (hover: hover) {
  .wish:hover .wish-peek { opacity: 1; visibility: visible; transition: opacity 0.14s; }
}
.wish.is-peek .wish-peek, .wish:focus-within .wish-peek { opacity: 1; visibility: visible; transition: opacity 0.14s; }
@media (prefers-reduced-motion: reduce) { .wish-peek { transition: none; } }

.peek-info {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: clamp(8px, 5cqi, 20px) clamp(10px, 5cqi, 22px) 0.5em;
  pointer-events: none;
}
.peek-title { font-size: clamp(15px, 8cqi, 40px); line-height: 1.02; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: none; }
.peek-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.7em; font-size: clamp(13px, 5.5cqi, 26px); line-height: 1.1; flex: none; }
.peek-prio { letter-spacing: 0.06em; }
.peek-status, .peek-meta { font-size: clamp(11px, 3.8cqi, 16px); letter-spacing: 0; line-height: 1.2; opacity: 0.8; flex: none; }
.peek-note {
  min-height: 0;
  overflow: hidden;
  text-transform: none;
  letter-spacing: -0.01em;
  font-size: clamp(12px, 4.2cqi, 17px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.peek-note::after { content: ''; }

.peek-actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: auto; border-top: calc(var(--line) * 0.5) solid var(--paper); }
.peek-actions.is-single { grid-template-columns: 1fr; }
.peek-btn {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-width: 0;
  min-height: clamp(38px, 16cqi, 64px);
  padding: 0.5em 0.4em 0.4em;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: clamp(12px, 5cqi, 22px);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--track);
  cursor: pointer;
}
.peek-btn + .peek-btn { border-left: calc(var(--line) * 0.5) solid var(--paper); }
.peek-btn svg { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; }
.peek-btn:hover:not(:disabled), .peek-btn:focus-visible { background: var(--paper); color: var(--ink); outline: none; }
.peek-btn:disabled { opacity: 0.45; cursor: default; }
.peek-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- кнопки владельца ---------- */
.owner-bar {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  border: 4px solid var(--ink);
  background: var(--paper);
}
.owner-bar button {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.55em 0.85em 0.45em;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: var(--track);
  cursor: pointer;
}
.owner-bar button + button { border-left: 3px solid var(--ink); }
.owner-bar button:hover { background: var(--ink); color: var(--paper); }
.owner-bar svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: square; }
@media (max-width: 700px) { .owner-bar span { display: none; } .owner-bar button { padding: 0.7em; } }

.panel-frame {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
}
.panel-frame::backdrop { background: rgb(0 0 0 / 0.5); }
.panel-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- карточка: набор, действия ---------- */
.modal-up {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: clamp(13px, 1.15vw, 16px);
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.modal-up svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2.4; }
.bundle-items { display: flex; flex-direction: column; gap: 8px; width: 100%; margin: 0.3em 0 0; padding: 0; list-style: none; }
.bi { display: flex; align-items: center; gap: 10px; border: 3px solid var(--ink); }
.bi.is-fulfilled .bi-open { opacity: 0.5; text-decoration: line-through; text-decoration-thickness: 3px; }
.bi-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-transform: uppercase; letter-spacing: var(--track); cursor: pointer; }
.bi-open:hover .bi-title { text-decoration: underline; text-underline-offset: 0.15em; }
.bi-thumb { flex: none; width: 64px; height: 64px; background: var(--ink) center / cover no-repeat; }
.bi-text { display: flex; flex-direction: column; gap: 0.2em; min-width: 0; }
.bi-title { font-size: clamp(16px, 1.5vw, 22px); line-height: 1.05; overflow-wrap: anywhere; }
.bi-price { font-size: clamp(14px, 1.2vw, 17px); }
.bi-state { font-size: 13px; letter-spacing: 0; opacity: 0.75; }
.bi-actions { flex: none; padding-right: 8px; }

.modal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; padding-top: 0.7em; margin-top: 0.4em; border-top: 3px solid var(--ink); }
.rsv-btn.is-small { padding: 0.4em 0.7em 0.3em; font-size: clamp(14px, 1.2vw, 17px); border-width: 3px; }
.rsv-btn.is-disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.rsv-hint { flex-basis: 100%; margin: 0; font-size: clamp(13px, 1.1vw, 16px); letter-spacing: 0; text-transform: none; opacity: 0.8; }

/* ---------- вход, профиль, друзья ---------- */
dialog.auth { width: min(560px, calc(100vw - var(--gap) * 2)); }
.auth .modal-title { font-size: clamp(26px, 3.2vw, 44px); padding-right: 56px; }
.auth .modal-note { font-size: clamp(15px, 1.4vw, 19px); }
.f { display: flex; flex-direction: column; gap: 6px; }
.f-label { font-size: clamp(13px, 1.1vw, 16px); letter-spacing: 0; opacity: 0.8; }
.f-hint { font-size: 13px; letter-spacing: 0; text-transform: none; opacity: 0.7; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: clamp(14px, 1.2vw, 17px); letter-spacing: 0; text-transform: none; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--ink); }
.guest-warn {
  margin: 0;
  padding: 0.6em 0.8em;
  border-left: var(--line) solid var(--ink);
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}
.auth .rsv-stack > .rsv-btn { width: 100%; text-align: center; }
.acct-photo { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.acct-photo label { cursor: pointer; }
.acct-pass summary { cursor: pointer; font-size: clamp(14px, 1.2vw, 17px); letter-spacing: 0; padding: 0.2em 0; }
.acct-pass .rsv-stack { padding-top: 10px; }
.acct-foot { padding-top: 0.6em; border-top: 3px solid var(--ink); width: 100%; }
.friends { display: flex; flex-direction: column; gap: 10px; width: 100%; padding-top: 0.8em; border-top: 3px solid var(--ink); }
.friends-title { margin: 0; font-size: clamp(20px, 2vw, 30px); font-weight: 400; }
.friends-h { margin: 0.4em 0 0; font-size: 15px; font-weight: 400; letter-spacing: 0; opacity: 0.8; }
.friend-add { flex-wrap: nowrap; }
.friend-add .rsv-input { flex: 1; min-width: 0; }
.friend-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.friend { display: flex; align-items: center; gap: 10px; }
.friend .avatar { --ctl-h: 44px; }
.friend-nick { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; font-size: 17px; }

/* ---------- день рождения: бегущие строки по краям ---------- */
:root { --bday: clamp(28px, 2.4vw, 40px); }
html.is-bday body { padding: var(--bday); }
html.is-bday .owner-bar { right: calc(var(--bday) + 10px); bottom: calc(var(--bday) + 10px); }
.bday { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.bday-strip {
  position: absolute;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: calc(var(--bday) * 0.56);
  line-height: 1;
  white-space: nowrap;
}
.bday-top, .bday-bottom { left: 0; right: 0; height: var(--bday); }
.bday-top { top: 0; }
.bday-bottom { bottom: 0; }
.bday-left, .bday-right { top: var(--bday); bottom: var(--bday); width: var(--bday); writing-mode: vertical-rl; justify-content: center; }
.bday-left { left: 0; transform: rotate(180deg); }
.bday-right { right: 0; }
.bday-track { display: flex; flex: none; animation: bday-run 38s linear infinite; }
.bday-bottom .bday-track, .bday-left .bday-track { animation-direction: reverse; }
.bday-left .bday-track, .bday-right .bday-track { animation-name: bday-run-v; animation-duration: 30s; } /* в вертикальном письме строка и так идёт сверху вниз */
.bday-run { display: flex; flex: none; align-items: center; }
.bday-run span { padding: 0.15em 0.9em 0; }
.bday-left .bday-run span, .bday-right .bday-run span { padding: 0.9em 0 0.9em 0.1em; }
.bday-run i { width: 0.45em; height: 0.45em; flex: none; background: var(--paper); }
@keyframes bday-run { to { transform: translateX(-50%); } }
@keyframes bday-run-v { to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .bday-track { animation: none; } }

/* ---------- адаптив ---------- */
@media (max-width: 1000px) {
  :root { --grid-max: 100vw; }
  .hero { grid-template-columns: 1fr; align-content: center; padding-block: calc(var(--gap) * 4.5) var(--gap); }
  .hero-title { font-size: clamp(44px, 11vw, 110px); line-height: 1.2; }
}
@media (max-width: 600px) {
  .hero-title span { white-space: normal; }
  .controls { left: var(--side); justify-content: flex-end; }
  .bar-title { flex-basis: calc(100% - 60px); font-size: clamp(20px, 6vw, 30px); }
  .bar-tools { width: 100%; justify-content: flex-start; }
  .bar-tools .dd-list { right: auto; left: 0; }
  .bar-tools .dd + .dd .dd-list { left: auto; right: 0; }
}
/* узкая плитка: на кнопках только значки */
@container (max-width: 210px) { .peek-text { display: none; } .peek-btn svg { width: 1.4em; height: 1.4em; } }
/* в Cakra только заглавные — в полях ввода, где важен регистр (почта, ник, пароль), берём обычный шрифт */
.rsv-input { font-family: 'Helvetica Neue', Arial, sans-serif; letter-spacing: 0; }
.acct-nick, .friend-nick { font-family: 'Helvetica Neue', Arial, sans-serif; }
.wishes .foot { padding-top: calc(var(--gap) * 1.5); }

/* плитка набора: картинки входящих желаний прямо в ленте */
.wish-pic.is-collage { display: grid; gap: 2px; background: var(--ink); }
.wish-pic.is-collage .cc { position: relative; overflow: hidden; background: var(--paper); min-width: 0; min-height: 0; }
.wish-pic.is-collage .cc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wish-pic.is-collage .cc-more { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: clamp(16px, 9cqi, 40px); background: var(--ink); color: var(--paper); }

/* 1.5.1: рамка фото может немного отличаться от пропорций снимка (так раскладка держит размеры
   по важности). Фото вписывается целиком, без обрезки; по краям — светлые поля, как у фото товаров */
.wish-pic { background: #fff; }
.wish .wish-pic:not(.is-collage) img { object-fit: contain; }
/* в коллаже набора ячейки по-прежнему заполняются картинкой целиком (как в 1.5.0) */
