/* ---------- Первый экран календаря ---------- */
.cal-hero { background-color: var(--sea-100); background-image: url("grain.png"); background-size: 384px; border-bottom: 1.5px solid var(--ink); overflow: hidden; }
.cal-hero__inner { position: relative; padding-top: 72px; padding-bottom: 64px; }
.cal-hero__kicker { margin: 0 0 22px; color: var(--ink); max-width: calc(100% - 220px); }
.cal-hero__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(60px, 8vw, 112px); line-height: .95; letter-spacing: -.015em; }
.cal-hero__scribble { display: block; width: min(560px, 62%); height: 16px; margin: 14px 0 26px -4px; }
.cal-hero__lead { margin: 0; max-width: 56ch; font-size: 20px; line-height: 1.5; }
.stamp-big { position: absolute; right: var(--gutter); top: 50%; width: 200px; height: 200px; margin-top: -96px; transform: rotate(12deg); opacity: .92; overflow: visible; }
@media (max-width: 759px) {
  .cal-hero__inner { padding-top: 32px; padding-bottom: 40px; }
  .cal-hero__kicker { max-width: calc(100% - 100px); font-size: 11px; }
  .cal-hero__title { font-size: 44px; line-height: 1; }
  .cal-hero__title span { display: block; }
  .cal-hero__scribble { width: 72%; }
  .cal-hero__lead { font-size: 17px; }
  .stamp-big { width: 92px; height: 92px; top: 20px; margin-top: 0; right: 12px; }
}

/* ---------- Фильтры ---------- */
.filters { border-bottom: 1.5px solid var(--ink); background: var(--paper); background-image: url("grain.png"); background-size: 384px; }
.filters__inner { padding-top: 18px; padding-bottom: 14px; display: grid; gap: 10px; }
.filters__row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 12px; min-width: 0; }
.filters__label { font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; margin: -4px -2px; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 16px; border-radius: var(--radius-round); border: 1.5px solid var(--ink); background: var(--paper-raised);
  font-family: var(--font-mono); font-size: 14px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper-raised); }
.chip:hover:not([aria-pressed="true"]) { background: var(--sea-100); }
.filters__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-top: 6px; border-top: 1px dashed var(--paper-line); margin-top: 4px; }
.toggle { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 14px; color: var(--sun-deep); font-weight: 500; }
.toggle__track { width: 46px; height: 26px; border-radius: 999px; border: 1.5px solid var(--sun-deep); position: relative; background: var(--paper-raised); transition: background .2s; }
.toggle__dot { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--sun-deep); transition: transform .2s; }
.toggle[aria-pressed="true"] .toggle__track { background: var(--sun-deep); }
.toggle[aria-pressed="true"] .toggle__dot { background: var(--paper-raised); transform: translateX(20px); }
.counter { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); }
@media (max-width: 759px) {
  .filters__row { grid-template-columns: 1fr; gap: 6px; }
  .chips { margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
}

/* ---------- Идёт сейчас ---------- */
.now { padding: 48px 0 8px; }
.now__head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.now__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 40px; line-height: 1; }
.now__note { margin: 0 0 2px; font-size: 26px; display: inline-flex; align-items: flex-end; gap: 4px; transform: rotate(-3deg); }
.now__rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 12px; margin: 0 -4px; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.now-card { flex: none; width: 272px; min-height: 150px; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  background: var(--sea-900); color: var(--paper-raised); text-decoration: none; padding: 16px 18px 18px; border-radius: var(--radius-paper); box-shadow: var(--shadow-paper); position: relative; }
.now-card::after { content: ""; position: absolute; inset: 0; background: url("grain.png"); background-size: 384px; opacity: .3; mix-blend-mode: multiply; pointer-events: none; }
.now-card:hover { transform: translate(-1px, -2px); box-shadow: 3px 5px 0 rgba(30,59,52,.25); }
.now-card__until { align-self: flex-start; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  background: var(--paper-raised); color: var(--ink); padding: 5px 16px 5px 9px;
  clip-path: polygon(0 3%, 96% 0, 97.5% 20%, 95.5% 40%, 98.5% 60%, 96% 80%, 98% 100%, 1% 97%); transform: rotate(-2deg); }
.now-card__name { font-family: var(--font-display); font-size: 22px; line-height: 1.15; margin: 0; }
.now-card__place { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.4; color: var(--sea-100); margin: 6px 0 0; }

/* ---------- Лента ---------- */
.feed { padding-top: 24px; }
.feed__status { padding: 48px 0; font-family: var(--font-mono); color: var(--ink-muted); }
.month { margin-top: 56px; }
.month__head { display: flex; align-items: baseline; gap: 16px; border-bottom: 1.5px solid var(--ink); padding-bottom: 10px; }
.month__name { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 64px; line-height: 1; }
.month__year { font-family: var(--font-mono); font-size: 14px; color: var(--ink-muted); }
.ev { border-bottom: 1px solid var(--paper-line); scroll-margin-top: 64px; }
.ev h3 { margin: 0; font: inherit; }
.ev__btn { width: 100%; display: grid; grid-template-columns: 150px minmax(0, 1fr) minmax(0, 260px) 64px 44px; align-items: center; gap: 20px;
  text-align: left; background: none; border: 0; padding: 22px 0; cursor: pointer; }
.ev__btn:hover .ev__name { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }
.ev__date { font-family: var(--font-mono); font-weight: 500; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; line-height: 1.35; align-self: start; padding-top: 6px; }
.ev__type { display: block; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 4px; }
.ev__name { font-family: var(--font-display); font-weight: 500; font-size: 27px; line-height: 1.15; }
.ev__hand { display: inline-block; font-family: var(--font-hand); font-weight: 700; color: var(--sun); font-size: 24px; line-height: 1; margin-left: 10px; transform: rotate(-4deg); white-space: nowrap; }
.ev__place { font-family: var(--font-mono); font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.ev__place b { display: block; font-weight: 500; color: var(--ink); }
.ev__stamp { width: 60px; height: 60px; transform: rotate(10deg); }
.ev__pm { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; justify-self: end; background: var(--paper-raised); }
.ev__pm::before, .ev__pm::after { content: ""; grid-area: 1 / 1; width: 14px; height: 1.5px; background: var(--ink); transition: transform .2s; }
.ev__pm::after { transform: rotate(90deg); }
.ev__btn[aria-expanded="true"] .ev__pm { background: var(--ink); }
.ev__btn[aria-expanded="true"] .ev__pm::before, .ev__btn[aria-expanded="true"] .ev__pm::after { background: var(--paper-raised); }
.ev__btn[aria-expanded="true"] .ev__pm::after { transform: rotate(0deg); }

.ev__body { padding: 4px 0 32px; margin-left: 170px; }
.ev__body[hidden] { display: none; }
.ev__card { background: var(--paper-raised); border: var(--frame); border-radius: var(--radius-paper); box-shadow: var(--shadow-paper); padding: 28px 30px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px 40px; }
.ev__card h4 { margin: 0 0 6px; font-family: var(--font-mono); font-weight: 500; font-size: 13px; color: var(--ink-muted); }
.ev__card p { margin: 0; max-width: 62ch; }
.ev__remark { grid-column: 1 / -1; position: relative; background: var(--sea-100); padding: 22px 22px 18px; border-radius: var(--radius-paper); margin-top: 8px; }
.ev__remark .note { position: absolute; top: -18px; left: 14px; font-size: 26px; transform: rotate(-4deg); }
.ev__price { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 14px; margin: 0; }
.ev__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

.invite { margin: 48px 0 8px; display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: center;
  background: var(--sand); border: var(--frame); border-radius: var(--radius-paper); padding: 28px 30px; box-shadow: var(--shadow-paper); transform: rotate(-.4deg); }
.invite p { margin: 0; font-family: var(--font-display); font-size: 24px; line-height: 1.3; max-width: 40ch; }
.empty { padding: 56px 0; max-width: 44ch; font-size: 20px; }

@media (max-width: 979px) {
  .ev__btn { grid-template-columns: 110px minmax(0, 1fr) 56px 44px; }
  .ev__place { grid-column: 2; grid-row: 2; }
  .ev__stamp { grid-column: 3; grid-row: 1 / span 2; }
  .ev__pm { grid-column: 4; grid-row: 1 / span 2; }
  .ev__body { margin-left: 0; }
}
@media (max-width: 759px) {
  .now { padding-top: 32px; }
  .now__title { font-size: 30px; }
  .now__note { font-size: 22px; }
  .now-card { width: 236px; }
  .now__rail { margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .month { margin-top: 40px; }
  .month__name { font-size: 38px; }
  .ev__btn { grid-template-columns: 66px minmax(0, 1fr) 44px; gap: 6px 12px; padding: 16px 0; align-items: start; }
  .ev__date { font-size: 12px; padding-top: 3px; }
  .ev__name { font-size: 19px; }
  .ev__hand { font-size: 20px; margin-left: 6px; }
  .ev__place { font-size: 12px; grid-column: 2; grid-row: 2; }
  .ev__stamp { grid-column: 3; grid-row: 2; width: 46px; height: 46px; margin: 0 -1px; }
  .ev__pm { grid-column: 3; grid-row: 1; }
  .ev__card { grid-template-columns: 1fr; padding: 22px 18px; }
  .ev__actions .btn { flex: 1 1 100%; }
  .invite { grid-template-columns: 1fr; padding: 22px 18px; }
  .invite p { font-size: 20px; }
}

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  background: var(--ink); color: var(--paper-raised); font-family: var(--font-mono); font-size: 14px; padding: 12px 18px; border-radius: var(--radius-soft); z-index: 50; }
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

/* Превью календаря на главной */
.ev__btn--link { text-decoration: none; color: inherit; }
.ev__arrow { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; justify-self: end; background: var(--paper-raised); font-family: var(--font-mono); }
@media (max-width: 979px) { .ev__arrow { grid-column: 4; grid-row: 1 / span 2; } }
@media (max-width: 759px) { .ev__arrow { grid-column: 3; grid-row: 1; } }

/* ---------- Добавить в календарь ---------- */
.addcal { position: relative; }
.addcal > summary { list-style: none; user-select: none; }
.addcal > summary::-webkit-details-marker { display: none; }
.addcal__menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 5; min-width: 230px; display: grid; background: var(--paper-raised); border: var(--frame); border-radius: var(--radius-paper); box-shadow: var(--shadow-paper); }
.addcal__menu a, .addcal__menu button { display: flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 0; background: none; text-align: left; text-decoration: none; font-family: var(--font-mono); font-size: 14px; color: var(--ink); cursor: pointer; }
.addcal__menu a:hover, .addcal__menu button:hover { background: var(--sand); }
@media (max-width: 759px) { .addcal { flex: 1 1 100%; } .addcal > summary { width: 100%; } .addcal__menu { right: 0; } }

/* ---------- Списки по датам в карточке ---------- */
.ev__card p + p, .ev__card ul + p { margin-top: .7em; }
.ev__days { list-style: none; margin: .7em 0 0; padding: 0; max-width: 72ch; }
.ev__days:first-of-type:first-child { margin-top: 0; }
.ev__days li { display: grid; grid-template-columns: 6.6em minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid rgba(30, 59, 52, .18); line-height: 1.45; }
.ev__days li:first-child { border-top: 0; }
.ev__days b { font-family: var(--font-mono); font-weight: 500; font-size: 14px; line-height: 1.7; }
@media (max-width: 759px) { .ev__days li { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Города: на компьютере переносятся по строкам ---------- */
.chip--more { border-style: dashed; font-weight: 500; }
@media (min-width: 760px) {
  #city-chips, #type-chips { flex-wrap: wrap; overflow: visible; }
}

/* ---------- Переключатель месяцев ---------- */
.months { position: sticky; top: var(--header-h); z-index: 30; display: flex; gap: 2px 18px; flex-wrap: wrap; padding: 10px 0; background-color: var(--paper); background-image: url("grain.png"); background-size: 384px; border-bottom: 1.5px solid var(--ink); }
.months__item { padding: 6px 0; font-family: var(--font-mono); font-size: 14px; white-space: nowrap; text-decoration: none; }
.months__item:hover { color: var(--sun-deep); }
.months__item[aria-current] { font-weight: 500; color: var(--sun-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.month { scroll-margin-top: 64px; }
@media (max-width: 759px) {
  .months { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); }
  .months::-webkit-scrollbar { display: none; }
  .months__item { min-height: 32px; }
}
.addcal__hint { margin: 0; padding: 10px 14px 12px; max-width: 260px; font-family: var(--font-body); font-size: 14px; line-height: 1.4; color: var(--ink-muted); border-top: 1px solid var(--paper-line); }
