@import url("/fonts/plus-jakarta-sans/fonts.css");

:root {
  color-scheme: light;
  /* C3 Playful Stable — см. docs/design/BRAND-BOOK.md */
  --bg: #fff6ed;
  --bg-soft: #ffe8d6;
  --bg-pattern: rgba(240, 122, 99, 0.06);
  --card: #ffffff;
  --card-strong: #ffffff;
  --card-muted: #fff9f4;
  --text: #2b2118;
  --muted: #6b5e56;
  --border: rgba(43, 33, 24, 0.1);
  --accent: #f07a63;
  --accent-strong: #e85d45;
  --accent-soft: #ffe5de;
  --accent-secondary: #b83232;
  --accent-warm: #f07a63;
  --success: #4faf7a;
  --warning: #f5a623;
  --danger: #d64550;
  --poll-going: #4faf7a;
  --poll-maybe: #f5a623;
  --poll-no: #d4cfc9;
  --shadow: 0 12px 36px rgba(43, 33, 24, 0.08);
  --shadow-soft: 0 8px 32px rgba(43, 33, 24, 0.06);
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --z-header: 8;
  --z-sticky: 6;
  --z-tabbar: 20;
  --z-fab: 19;
  --z-sheet: 25;
  --z-modal: 30;
  --z-toast: 10000;
  /* Z-index ladder: base → header(8) → sticky(6) → fab(19) → tabbar(20) → sheet(25) → modal(30) → toast(10000) */
  --radius-xl: 28px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 14px;
  --bp-tabbar-hide: 1100px;
  --tabbar-height: 56px;
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fffbf7 0%, var(--bg) 50%, var(--bg-soft) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

/* Unified chip + tabular numbers (C3 design system) */
.chip,
.stats-chip,
.flexible-poll-meta-chip {
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-muted);
  color: var(--text);
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip:hover,
.stats-chip:hover,
.flexible-poll-meta-chip:hover {
  border-color: rgba(240, 122, 99, 0.35);
  background: var(--card-muted);
}

.chip.is-active,
.stats-chip.is-active,
.flexible-poll-meta-chip.is-active {
  background: var(--accent-soft);
  border-color: rgba(240, 122, 99, 0.35);
  color: var(--accent-strong);
  box-shadow: none;
}

.chip:focus-visible,
.stats-chip:focus-visible,
.flexible-poll-meta-chip:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.nums,
.poll-row-stat,
.stats-kpi-value,
.cal-view .calendar-day {
  font-variant-numeric: tabular-nums;
}

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

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 24px;
}

@media (max-width: 1099px) {
  body.has-tabbar .app-shell {
    padding-bottom: calc(var(--tabbar-height) + 20px + env(safe-area-inset-bottom));
  }
}

/* Hero + маскот (C3) */
.hero-zone {
  min-height: 140px;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(240, 122, 99, 0.12) 1px, transparent 1px);
  background-size: 14px 14px;
}

.calendar-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  min-height: 140px;
  box-sizing: border-box;
}

.hero-zone {
  min-height: 140px;
  box-sizing: border-box;
}

.calendar-hero-mascot {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.calendar-hero-mascot--animate {
  animation: hero-mascot-in 0.55s ease-out both;
}

@keyframes hero-mascot-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calendar-hero-copy {
  min-width: 0;
}

.calendar-hero-title {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 4.5vw, var(--text-2xl));
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.calendar-hero-lede {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .calendar-hero-mascot--animate,
  .activity-mascot-peek {
    animation: none;
  }

  .cal-view .cal-event-dot--open {
    animation: none;
  }
}

.empty-state--mascot {
  border-style: solid;
  background: var(--card-muted);
}

.empty-state-mascot,
.stats-empty-mascot {
  display: block;
  margin: 0 auto 8px;
}

.stats-empty--mascot {
  display: grid;
  gap: 8px;
  justify-items: center;
}

/* Desktop sidebar (C3) */
.app-sidebar {
  display: none;
}

@media (min-width: 1100px) {
  body.has-sidebar .app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 248px;
    padding: 22px 14px 24px;
    border-right: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-soft);
    z-index: var(--z-header);
    box-sizing: border-box;
  }

  body.has-sidebar .app-shell {
    width: auto;
    max-width: none;
    margin-left: 248px;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  body.has-sidebar .topbar {
    display: none;
  }
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 8px;
}

.app-sidebar-emblem {
  border-radius: 14px;
  object-fit: cover;
}

.app-sidebar-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.app-sidebar-nav {
  display: grid;
  gap: 4px;
}

.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.app-sidebar-item:active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.app-sidebar-item.is-selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.app-sidebar-icon-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  color: inherit;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.app-sidebar-item.is-selected .app-sidebar-icon-wrap {
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
}

.app-sidebar-icon-wrap svg {
  display: block;
  width: 20px;
  height: 20px;
}

.app-sidebar-mod {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.app-sidebar-section-label {
  margin: 0;
  padding: 4px 12px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-sidebar-item--moderation.is-selected {
  background: rgba(107, 140, 255, 0.14);
  color: #4a6fd9;
}

.app-sidebar-item--moderation:active {
  background: rgba(107, 140, 255, 0.18);
  color: #4a6fd9;
}

.app-sidebar-item--moderation.is-selected .app-sidebar-icon-wrap {
  background: rgba(255, 255, 255, 0.78);
  color: #4a6fd9;
}

.app-sidebar-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.section-head,
.month-bar,
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head--activity {
  align-items: flex-start;
  width: 100%;
}

.section-head--activity .screen-title {
  flex: 1;
  min-width: 0;
}

.activity-poll-card-wrap--skeleton {
  min-height: 520px;
  pointer-events: none;
  border-style: dashed;
  background: var(--card-muted);
  padding: 12px;
  box-sizing: border-box;
}

.activity-skeleton-block {
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(43, 33, 24, 0.05) 0%, rgba(43, 33, 24, 0.09) 50%, rgba(43, 33, 24, 0.05) 100%);
  background-size: 200% 100%;
  animation: activity-skeleton-shimmer 1.15s ease-in-out infinite;
}

.activity-skeleton-block--hero {
  height: 140px;
  margin-bottom: 12px;
}

.activity-skeleton-block--toolbar {
  height: 44px;
  margin-bottom: 12px;
  max-width: 88%;
}

.activity-skeleton-block--info {
  height: 72px;
  margin-bottom: 14px;
}

.activity-skeleton-block--head {
  height: 96px;
  margin-bottom: 12px;
}

.activity-skeleton-block--meta {
  height: 52px;
  margin-bottom: 14px;
  max-width: 72%;
}

.activity-skeleton-block--poll {
  height: 48px;
  margin-bottom: 8px;
}

@keyframes activity-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }

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

@media (prefers-reduced-motion: reduce) {
  .activity-skeleton-block {
    animation: none;
  }
}

.activity-poll-card-wrap {
  position: relative;
  border: 1px solid rgba(240, 122, 99, 0.16);
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, #fffefb 0%, #fff9f4 52%, #ffffff 100%);
  box-shadow: var(--shadow-soft);
  padding: 18px 14px 16px;
  overflow: visible;
}

.activity-mascot-peek {
  position: absolute;
  top: -20px;
  right: 8px;
  z-index: 3;
  pointer-events: none;
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(43, 33, 24, 0.14));
  animation: mascot-peek-in 0.5s ease-out both;
}

@keyframes mascot-peek-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.activity-poll-card {
  display: grid;
  gap: 14px;
}

.poll-celebrate-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 16px;
  background: rgba(79, 175, 122, 0.12);
  border: 1px solid rgba(79, 175, 122, 0.28);
}

.poll-celebrate-mascot {
  flex-shrink: 0;
}

.poll-celebrate-text {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #1f4d35;
}

.activity-poll-card .activity-summary-card,
.activity-poll-card .poll-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.activity-poll-card .poll-card {
  border-top: 1px solid rgba(240, 122, 99, 0.12);
  padding-top: 12px;
}

.activity-poll-card .activity-info-item {
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(43, 33, 24, 0.06);
  background: rgba(255, 255, 255, 0.72);
}

.activity-summary-card {
  display: grid;
  gap: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.activity-hero-banner {
  position: relative;
  display: block;
  min-height: 116px;
  padding: 12px 14px;
  padding-right: 38%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(240, 122, 99, 0.18);
  background:
    radial-gradient(circle at 1px 1px, rgba(240, 122, 99, 0.09) 1px, transparent 0) 0 0 / 14px 14px,
    linear-gradient(145deg, #fff9f4 0%, #fffefb 55%, #ffffff 100%);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.activity-hero-banner__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.activity-hero-banner__status-chip .activity-poll-badge {
  min-height: 30px;
  padding: 6px 11px;
  font-size: 11px;
  box-shadow: none;
  border: 1px solid transparent;
}

.activity-hero-banner--going .activity-hero-banner__status-chip .activity-poll-badge--going {
  background: rgba(79, 175, 122, 0.18);
  border-color: rgba(79, 175, 122, 0.45);
  color: #1f4d35;
}

.activity-hero-banner--detail {
  cursor: pointer;
  margin-bottom: 4px;
}

.activity-hero-banner--hub {
  min-height: 88px;
  padding-right: 38%;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
}

.activity-hero-banner--upcoming,
.activity-card .activity-hero-banner {
  margin: 0;
  border-radius: var(--radius-md);
  min-height: 112px;
  padding-right: 42%;
}

.activity-card .activity-hero-banner__art-wrap {
  width: min(44%, 180px);
  right: 2px;
}

.activity-card .activity-hero-banner__art {
  height: 100%;
  max-height: none;
}

.activity-hero-banner--pending {
  animation: activity-hero-pulse 2.4s ease-in-out infinite;
}

@keyframes activity-hero-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(240, 122, 99, 0);
  }

  50% {
    box-shadow: 0 0 0 3px rgba(240, 122, 99, 0.14);
  }
}

@media (prefers-reduced-motion: reduce) {
  .activity-hero-banner--pending {
    animation: none;
  }
}

.activity-hero-banner__copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding-top: 2px;
  padding-right: 4px;
}

.activity-hero-banner__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
}

.activity-hero-banner__time-primary {
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.activity-hero-banner__time-rel {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.activity-hero-banner__time-rel--prominent {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  color: #9a2e2e;
  background: linear-gradient(135deg, #ffe8d6 0%, #ffd0bc 100%);
  border: 1px solid rgba(184, 50, 50, 0.35);
  border-radius: 999px;
  box-shadow: none;
}

.activity-hero-banner__title-row {
  display: block;
}

.activity-hero-banner__title {
  margin: 0;
  font-size: clamp(1rem, 4vw, 1.12rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  padding-right: 0;
}

.activity-hero-banner__title--detail {
  font-size: clamp(1.05rem, 4vw, 1.2rem);
}

.activity-hero-banner__place {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.3;
  max-width: 92%;
}

.activity-hero-banner__art-wrap {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(48%, 200px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
  background: transparent;
  contain: layout style paint;
}

.activity-hero-banner__art {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: right bottom;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.activity-hero-banner__art--compact {
  max-width: 100%;
  max-height: 100%;
}

.activity-hero-banner__cta {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-strong);
}

.activity-hero-banner__cta-arrow {
  display: inline-block;
}

.activity-hero-banner--hub .activity-hero-banner__title {
  padding-right: 0;
}

@media (min-width: 640px) {
  .activity-hero-banner {
    min-height: 124px;
    padding-right: 36%;
  }

  .activity-card .activity-hero-banner {
    padding-right: 38%;
  }

  .activity-card .activity-hero-banner__art-wrap {
    width: min(42%, 200px);
    right: 4px;
  }
}

@media (min-width: 960px) {
  .activity-hero-banner {
    min-height: 136px;
  }

  .activity-hero-banner__art-wrap {
    width: min(46%, 260px);
  }
}

.activity-info-time-primary {
  font-weight: 700;
}

.activity-poll-section {
  scroll-margin-top: 12px;
}

.day-poll-chip--pending {
  gap: 8px;
}

.day-poll-chip-hero {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

/* Шапка карточки активности: заголовок отдельно, действия — компактная «пилюля» под ним справа */
.activity-detail-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.activity-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
  width: 100%;
}

.activity-compact-author {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  min-width: 0;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.activity-compact-author:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.activity-actions,
.activity-addon-actions {
  display: flex;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.activity-addon-actions {
  margin-left: auto;
}

.activity-actions .poll-toolbar--compact,
.activity-addon-actions .poll-toolbar--compact {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: 2px 4px;
  background: rgba(255, 251, 246, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn:hover,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn:hover {
  background: rgba(28, 22, 20, 0.06);
}

.activity-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.activity-info-item {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-strong);
  padding: 10px 12px;
}

.activity-info-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.activity-info-value {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Единый абзац для описаний в карточках (активность, гибкий опрос, т.п.) */
.detail-description {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: break-word;
  white-space: pre-wrap;
  word-break: break-word;
}

.activity-description {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.activity-link-row {
  padding-top: 2px;
}

.activity-link-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(107, 28, 40, 0.24);
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 0 14px;
  text-decoration: none;
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn--danger:hover,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn--danger:hover {
  background: rgba(107, 28, 40, 0.12);
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn svg,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn svg {
  width: 16px;
  height: 16px;
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn--danger,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn--danger {
  border: none;
  background: transparent;
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn--addon,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn--addon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 30px;
  max-width: 108px;
  padding: 0 9px 0 5px;
  color: var(--accent-strong);
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn--addon:hover,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn--addon:hover {
  background: rgba(107, 28, 40, 0.1);
}

.activity-actions .poll-toolbar--compact .poll-toolbar-btn-label,
.activity-addon-actions .poll-toolbar--compact .poll-toolbar-btn-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.screen-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar {
  position: relative;
  z-index: var(--z-header);
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

.topbar-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 10px 14px;
  padding: 4px 2px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.topbar-brand {
  flex: 0 1 auto;
  min-width: 0;
}

.topbar-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-badge {
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.brand-badge:hover {
  border-color: rgba(240, 122, 99, 0.35);
  box-shadow: 0 6px 18px rgba(240, 122, 99, 0.12);
}

.brand-badge:active {
  border-color: rgba(240, 122, 99, 0.45);
}

.brand-badge:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.brand-badge-icon {
  display: block;
  line-height: 0;
}

.brand-badge-img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 14px;
}

.brand-badge-title {
  font-size: clamp(16px, 3.6vw, 18px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.topbar-bot-hint {
  margin: 4px 2px 0;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  font-weight: 500;
}

.profile-hint {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-peer-bar {
  margin: 0 0 12px;
}

.profile-card {
  padding: 0;
  overflow: hidden;
}

.profile-hero {
  position: relative;
  padding: 1.1rem 1.15rem 1rem;
  background: linear-gradient(135deg, #fffefb 0%, #ffe5de 42%, #fff6ed 100%);
  border-bottom: 1px solid rgba(240, 122, 99, 0.12);
  overflow: hidden;
}

.profile-hero-deco {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 10% 18%, rgba(240, 122, 99, 0.22) 0, transparent 44%),
    radial-gradient(circle at 92% 6%, rgba(79, 175, 122, 0.12) 0, transparent 36%);
  pointer-events: none;
}

.profile-hero-inner {
  position: relative;
  z-index: 1;
}

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

.profile-hero-top .eyebrow {
  margin: 0;
}

.profile-body {
  padding: 1rem 1.15rem 1.15rem;
}

.profile-about-readonly {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--card-muted);
  border: 1px solid var(--border);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-identity {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.profile-avatar-wrap {
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(43, 33, 24, 0.1);
}

.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-strong);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(43, 33, 24, 0.08);
}

.profile-identity-text {
  flex: 1;
  min-width: 0;
}

.profile-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.profile-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(43, 33, 24, 0.08);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.profile-meta-block {
  display: none;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.profile-section-title {
  margin: 0;
  font-size: clamp(17px, 3.4vw, 22px);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-details-view {
  display: grid;
  gap: 10px;
}

.profile-field {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border-radius: var(--radius-sm);
  background: var(--card-muted);
  border: 1px solid var(--border);
}

.profile-field-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.profile-field-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-field-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.profile-field-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-field-value {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-field-value.is-empty {
  color: var(--muted);
  font-weight: 500;
}

.profile-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(43, 33, 24, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-strong);
  cursor: pointer;
  flex-shrink: 0;
}

.profile-edit-btn:hover {
  background: #fff;
  border-color: rgba(240, 122, 99, 0.28);
}

.profile-edit-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-edit-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

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

.profile-form-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
}

.profile-form-toolbar .secondary-button,
.profile-form-toolbar .primary-button {
  min-height: 44px;
  flex: 1;
}

.profile-form-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--card-muted);
  border: 1px solid var(--border);
}

.profile-form-field {
  display: grid;
  gap: 6px;
}

.profile-form-field-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-birthday-date-input,
.profile-form-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
}

.profile-form-field textarea {
  min-height: 120px;
  resize: vertical;
}

.profile-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-birthday-hide-year {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.profile-birthday-hide-year input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.profile-field-clear-link {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.profile-field-clear-link:hover {
  color: var(--accent);
}

.web-logout-wrap {
  margin-top: 14px;
}

.profile-secondary {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-secondary.is-muted {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}

.profile-about-head {
  margin-bottom: 6px;
}

.header-avatar-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.avatar-img {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  max-width: 100%;
  box-sizing: border-box;
}

.avatar-img--pending {
  opacity: 0;
}

.avatar-img:not(.avatar-img--pending) {
  transition: opacity 0.12s ease;
}

.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  flex-shrink: 0;
}

.header-avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.creator-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.creator-row--compact {
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

button.creator-row--compact {
  width: auto;
  max-width: 100%;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

button.creator-row--compact .creator-avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

button.creator-row {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button.creator-row:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 10px;
}

.creator-row-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.creator-avatar {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.creator-username {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.profile-card-head {
  margin-bottom: 2px;
}

.web-login-steps {
  margin: 12px 0 0;
  padding-left: 1.25rem;
  max-width: 40rem;
  text-align: left;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}

.web-login-steps li {
  margin-bottom: 8px;
}

.web-login-steps li:last-child {
  margin-bottom: 0;
}

.creator-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.creator-about {
  display: block;
  margin: 0;
  max-width: 100%;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.hero-card h2,
.section-head h3,
.month-bar h3,
.sheet-head h2,
.profile-display-name {
  margin: 0;
  line-height: 1.05;
}

.profile-display-name {
  font-size: clamp(14px, 3.5vw, 17px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.28;
  min-width: 0;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.theme-select,
input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-strong);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

.theme-select {
  min-width: 118px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

button,
.flexible-poll-card,
.activity-item,
.activity-card,
.calendar-day,
.poll-row-wrap,
.answer-option,
.fab {
  transition:
    box-shadow 0.14s ease,
    border-color 0.14s ease,
    background-color 0.14s ease,
    color 0.14s ease,
    opacity 0.14s ease,
    filter 0.14s ease;
}

/* C3: active — цвет/яркость, без scale (CLS-safe) */
button:active:not(:disabled):not(.app-tabbar-item):not(.app-sidebar-item):not(.poll-row):not(.chip):not(.stats-chip):not(.primary-button):not(.secondary-button),
.flexible-poll-card:active,
.activity-item:active,
.activity-card:active,
.calendar-day:active:not(:disabled),
.answer-option:active,
.fab:active {
  filter: brightness(0.96);
}

.status-panel,
.hero-card,
.calendar-card,
.day-card,
.detail-card,
.sheet-panel,
.profile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.status-panel {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 420px;
  text-align: center;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* C3: навигация — tab bar (mobile) и sidebar (desktop) */
.main-nav-inline,
.main-nav-menu-wrap {
  display: none !important;
}

@media (min-width: 1100px) {
  .main-nav-menu-wrap {
    display: none !important;
  }
}

@media (max-width: 1099px) {
  .topbar-actions {
    display: none;
  }

  .topbar-inner {
    justify-content: flex-start;
  }
}

.main-nav-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

@media (max-width: 1099px) {
  .main-nav-menu-wrap {
    display: none;
  }
}

/* Bottom tab bar (C3) */
.app-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-tabbar);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  min-height: var(--tabbar-height);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 24px rgba(43, 33, 24, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

@media (min-width: 1100px) {
  .app-tabbar {
    display: none !important;
  }
}

.app-tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 4px 8px;
  text-decoration: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.app-tabbar-item:active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.app-tabbar-item.is-selected {
  color: var(--accent-strong);
}

.app-tabbar-item.is-selected .app-tabbar-icon-wrap {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.app-tabbar-icon-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 28px;
  border-radius: 999px;
  color: inherit;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.app-tabbar-icon-wrap svg {
  display: block;
  width: 22px;
  height: 22px;
}

.app-tabbar-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tabbar-item[data-main-tab="my-activities"] .app-tabbar-label {
  font-size: 10px;
  letter-spacing: -0.02em;
}

.app-tabbar-item[data-main-tab="kindness"] .app-tabbar-label {
  font-size: 10px;
}

.main-app {
  display: grid;
  gap: 16px;
}

.main-nav-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(28, 22, 20, 0.12);
  border-radius: 999px;
  background: rgba(255, 251, 246, 0.92);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(28, 18, 16, 0.07);
}

.main-nav-menu-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.main-nav-menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 20px;
}

.main-nav-menu-icon span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.main-tabs-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  min-width: min(280px, calc(100vw - 48px));
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-strong);
  box-shadow: var(--shadow);
  transform-origin: top right;
}

.main-tabs-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.main-tabs-menu-item:hover,
.main-tabs-menu-item:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.main-tabs-menu-item.is-selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.tab-panel {
  min-width: 0;
}

.flexible-poll-shell {
  display: grid;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.polls-hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.25rem;
}

.poll-hub-card {
  align-items: stretch;
  gap: 12px;
  padding: 10px 12px 10px 10px;
}

.poll-hub-card--calendar,
.poll-hub-card--flexible {
  display: flex;
}

.poll-hub-card-thumb {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  align-self: center;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(240, 122, 99, 0.14);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  contain: layout style paint;
  isolation: isolate;
}

.poll-hub-card-thumb__img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.poll-hub-card-thumb--pending {
  box-shadow: inset 0 0 0 1px rgba(240, 122, 99, 0.2);
}

.poll-hub-card-thumb--going {
  border-color: rgba(79, 175, 122, 0.35);
}

.poll-hub-card-body {
  display: grid;
  gap: 5px;
  align-content: center;
  flex: 1;
  min-width: 0;
}

.poll-hub-type {
  justify-self: start;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.poll-hub-type--muted {
  background: var(--card-muted);
  color: var(--muted);
}

.poll-hub-card--archived {
  opacity: 0.82;
}

.poll-hub-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.poll-hub-status {
  font-size: var(--text-xs);
  font-weight: 800;
}

.poll-hub-status--answered {
  background: rgba(79, 175, 122, 0.14);
  color: #1f4d35;
}

.poll-hub-status--pending {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.poll-hub-status--archived {
  background: var(--card-muted);
  color: var(--muted);
}

.poll-hub-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-variant-numeric: tabular-nums;
}

.poll-hub-meta-line--rel {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: lowercase;
  color: #9a2e2e;
  background: linear-gradient(135deg, #ffe8d6 0%, #ffd0bc 100%);
  border: 1px solid rgba(184, 50, 50, 0.24);
  border-radius: 999px;
}

.poll-hub-meta-line--stats {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
}

.poll-hub-meta-line {
  display: inline;
}

.flexible-poll-card-chevron--hidden-split {
  display: none;
}

.poll-hub-card-title {
  font-size: clamp(1rem, 3.8vw, 1.05rem);
}

@media (max-width: 420px) {
  .poll-hub-card-meta {
    flex-direction: row;
    gap: 6px;
  }

  .poll-hub-card-thumb {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }
}

.poll-create-actions {
  display: grid;
  gap: 0.75rem;
  padding: 0 0 0.5rem;
}

.poll-create-action {
  min-height: 44px;
}

.poll-toolbar-text-btn {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: var(--text-xs);
}

.polls-hub-empty .empty-mascot {
  display: block;
  margin: 0 auto 0.75rem;
}

.flexible-poll-hero {
  margin-bottom: 0.25rem;
}

.flexible-poll-hero .flexible-poll-page-title {
  margin: 0;
  font-size: clamp(1.55rem, 4.5vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.flexible-poll-split {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

@media (min-width: 960px) {
  .flexible-poll-split--active {
    grid-template-columns: minmax(280px, 36%) minmax(0, 1fr);
    align-items: start;
  }

  .flexible-poll-split--active .flexible-poll-layout--list {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 120px);
    overflow: auto;
    align-self: start;
  }
}

.flexible-poll-layout {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.flexible-poll-intro-head .flexible-poll-page-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.flexible-poll-lede {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  max-width: 36rem;
}

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

.flexible-poll-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.flexible-poll-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background 0.14s ease;
}

.flexible-poll-card.is-active {
  border-color: rgba(240, 122, 99, 0.38);
  background: linear-gradient(90deg, rgba(255, 229, 222, 0.55) 0%, var(--card-strong) 32%);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-soft);
}

.flexible-poll-card.is-active::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.flexible-poll-card:hover,
.activity-item:hover,
.calendar-day:hover:not(:disabled),
.answer-option:hover {
  border-color: rgba(184, 50, 50, 0.32);
  box-shadow: var(--shadow-soft);
}

.flexible-poll-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.flexible-poll-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.22;
  color: var(--text);
}

.flexible-poll-card-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  line-height: 1.25;
}

.flexible-poll-card-q {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.flexible-poll-card-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(28, 22, 20, 0.05);
  color: var(--muted);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}

.flexible-poll-detail {
  min-width: 0;
}

.flexible-poll-detail-empty {
  padding: 20px;
  text-align: center;
}

.flexible-poll-detail-card {
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.flexible-poll-detail-header {
  display: grid;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border);
}

.flexible-poll-detail-nav {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.flexible-poll-back-btn {
  flex-shrink: 0;
  margin-top: 2px;
}

.flexible-poll-detail-titles {
  min-width: 0;
  flex: 1;
}

.flexible-poll-detail-titles h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.22;
  font-weight: 800;
}

.flexible-poll-detail-question {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.38;
  font-weight: 650;
}

.flexible-poll-detail-actions {
  display: flex;
  justify-content: flex-start;
}

.flexible-poll-detail-actions .poll-toolbar--compact {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: 2px 4px;
  background: rgba(255, 251, 246, 0.92);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.flexible-poll-detail-actions .poll-toolbar--compact .poll-toolbar-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.flexible-poll-detail-actions .poll-toolbar--compact .poll-toolbar-btn:hover {
  background: rgba(28, 22, 20, 0.06);
}

.flexible-poll-promote-cta-wrap {
  margin-top: 2px;
}

.flexible-poll-promote-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(184, 50, 50, 0.38);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(184, 50, 50, 0.14), rgba(216, 107, 58, 0.08));
  box-shadow:
    0 1px 2px rgba(28, 18, 16, 0.06),
    0 6px 18px rgba(184, 50, 50, 0.12);
  color: var(--accent-strong);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flexible-poll-promote-cta:hover {
  border-color: rgba(184, 50, 50, 0.52);
  background: linear-gradient(135deg, rgba(184, 50, 50, 0.18), rgba(216, 107, 58, 0.1));
}

.flexible-poll-promote-cta:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.flexible-poll-promote-cta-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 4px 12px rgba(184, 50, 50, 0.28);
}

.flexible-poll-promote-cta-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.flexible-poll-promote-cta-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.flexible-poll-promote-cta-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--accent-strong);
}

.flexible-poll-promote-cta-sub {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.32;
  color: var(--muted);
}

.flexible-poll-promote-cta-chevron {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  color: var(--accent-strong);
  opacity: 0.75;
}

.flexible-poll-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.flexible-poll-meta-chip {
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flexible-poll-meta-chip:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.flexible-poll-responsibles-row {
  display: grid;
  gap: 8px;
}

.flexible-poll-responsibles-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flexible-poll-description {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.flexible-poll-attachment-row .poll-attachment-aside {
  width: fit-content;
}

.flexible-poll-poll-vote-card {
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 14px 14px;
}

.flexible-poll-detail-card .flexible-poll-poll-vote-card.poll-card--lean {
  background: transparent;
}

.flexible-poll-schedule-field {
  display: grid;
  gap: 8px;
}

.flexible-poll-schedule-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(28, 22, 20, 0.04);
}

.flexible-poll-schedule-chip {
  border: 0;
  border-radius: 10px;
  padding: 9px 6px;
  font-size: 12px;
  font-weight: 800;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
}

.flexible-poll-schedule-chip:hover {
  color: var(--text);
  background: rgba(255, 251, 246, 0.7);
}

.flexible-poll-schedule-chip.is-active {
  background: var(--card-strong);
  color: var(--accent-strong);
  box-shadow: 0 1px 4px rgba(28, 18, 16, 0.08);
}

.flexible-poll-schedule-select {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.flexible-poll-vote-kind-field,
.flexible-poll-date-mode-field {
  display: grid;
  gap: 8px;
}

.flexible-poll-manual-date-add {
  align-items: end;
}

.flexible-poll-manual-date-add-btn {
  margin-bottom: 2px;
}

.flexible-poll-manual-dates-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.flexible-poll-manual-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--card-strong);
  font-size: 0.9rem;
}

.flexible-poll-manual-date-chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.promote-form-body {
  display: grid;
  gap: 9px;
}

.promote-lede {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.promote-fieldset {
  margin: 0 0 16px;
  padding: 0;
  border: none;
  min-width: 0;
}

.promote-legend {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  padding: 0;
  margin-bottom: 10px;
}

.promote-option-list {
  display: grid;
  gap: 8px;
}

.promote-option-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-strong);
  cursor: pointer;
  font-size: 15px;
  font-weight: 650;
}

.promote-option-row input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.promote-schedule-hint {
  margin: -8px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.flexible-poll-empty {
  margin-top: 8px;
}

.empty-state p,
.activity-meta,
.response-comment {
  color: var(--muted);
}

.mode-badge,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.layout {
  display: grid;
  gap: 16px;
}

.calendar-card,
.day-card,
.detail-card {
  padding: 18px;
}

.profile-card {
  padding: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-strong);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.weekdays {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(50px, 8vw, 68px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-strong);
  color: var(--text);
  font-weight: 800;
  padding: 10px 5px 18px;
}

.calendar-day.is-muted {
  opacity: 0.35;
}

.calendar-day.is-past {
  cursor: not-allowed;
  opacity: 0.42;
}

.calendar-day.is-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 12px 26px rgba(184, 50, 50, 0.22);
}

.calendar-day.has-activities::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
}

.activity-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}

.calendar-day.is-selected .activity-count {
  background: #fff;
  color: var(--accent);
}

.activity-day-title {
  position: absolute;
  right: 5px;
  bottom: 8px;
  left: 5px;
  overflow: hidden;
  color: var(--accent-strong);
  font-size: 8px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day.is-selected .activity-day-title {
  color: #fff;
}

/* ——— Календарь (cal-view) ——— */
.layout--calendar-polls {
  gap: 14px;
}

@media (min-width: 960px) {
  .layout--calendar-polls.layout--split {
    grid-template-columns: minmax(300px, 40%) minmax(0, 1fr);
    align-items: start;
  }

  .layout--calendar-polls.layout--split > #calendarHero {
    grid-column: 1 / -1;
  }

  .layout--calendar-polls.layout--split > #calendarCard {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 96px);
    overflow: auto;
    align-self: start;
  }

  .layout--calendar-polls.layout--split > #dayCard,
  .layout--calendar-polls.layout--split > #activityDetail {
    min-width: 0;
  }
}

.cal-view {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0;
  padding: 0;
  min-height: 0;
}

.cal-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card) 0%, var(--card-muted) 100%);
}

.cal-btn {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-strong);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(28, 18, 16, 0.06);
}

.cal-btn:active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  filter: none;
}

.cal-btn--today {
  min-width: auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--success);
  border-color: rgba(42, 93, 66, 0.28);
  background: rgba(42, 93, 66, 0.08);
}

.cal-toolbar-main {
  min-width: 0;
  text-align: center;
}

.cal-kicker {
  margin: 0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.cal-title {
  margin: 1px 0 0;
  font-size: clamp(1rem, 4.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-transform: capitalize;
}

.cal-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 8px;
  margin-top: 5px;
}

.cal-stats-item {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.cal-stats-item b {
  font-weight: 800;
  color: var(--text);
}

.cal-stats-item--warn b {
  color: var(--accent-strong);
}

.cal-stats-item--ok b {
  color: var(--success);
}

.cal-stats-empty {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.cal-hint {
  margin: 0;
  padding: 6px 12px 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}

.cal-hint-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font: inherit;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.cal-hint-link:hover {
  color: var(--accent);
}

.cal-board {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  min-height: 0;
  flex: 1;
  padding: 8px 10px 6px;
}

.cal-dow,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--cal-gap, 3px);
}

.cal-dow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-dow span:nth-child(6),
.cal-dow span:nth-child(7) {
  color: var(--accent-warm);
}

.cal-grid {
  grid-template-rows: repeat(6, minmax(0, var(--cal-row, 1fr)));
  align-content: stretch;
  min-height: 0;
}

/* Ячейки дней (класс calendar-day — из app.js) */
.cal-view .calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 2px 1px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 800;
}

.cal-view .calendar-day.is-muted {
  opacity: 0.22;
  background: transparent;
  border-color: transparent;
}

.cal-view .calendar-day.is-past:not(.is-selected) {
  opacity: 0.48;
}

.cal-view .calendar-day.is-today:not(.is-selected) {
  border-color: rgba(42, 93, 66, 0.4);
  background: rgba(42, 93, 66, 0.07);
}

.cal-view .calendar-day.is-selected {
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.55);
  background: linear-gradient(155deg, #f5937d 0%, var(--accent) 42%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow:
    0 0 0 2px var(--accent),
    0 8px 22px rgba(240, 122, 99, 0.32);
}

.cal-view .calendar-day.is-selected .calendar-day-num {
  font-weight: 800;
}

.cal-view .calendar-day.is-today.is-selected {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 4px rgba(79, 175, 122, 0.22),
    0 8px 22px rgba(240, 122, 99, 0.32);
}

.cal-view .calendar-day.is-selected .calendar-day-num,
.cal-view .calendar-day.is-today.is-selected .calendar-day-num {
  color: #fff;
}

.cal-view .calendar-day.has-activities:not(.is-selected) {
  background: #fffefb;
  border-color: rgba(28, 22, 20, 0.07);
}

.cal-view .calendar-day.needs-vote:not(.is-selected) {
  border-color: rgba(240, 122, 99, 0.28);
}

.cal-view .calendar-day.all-voted:not(.is-selected) {
  border-color: rgba(42, 93, 66, 0.22);
}

.cal-view .calendar-day .calendar-day-num {
  font-size: clamp(11px, 2.8vw, 14px);
  font-weight: 800;
  line-height: 1;
}

.cal-view .calendar-day.is-today:not(.is-selected) .calendar-day-num {
  color: var(--success);
}

.cal-view .calendar-day-dots {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  min-height: 4px;
}

.cal-view .cal-event-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-warm);
}

.cal-view .cal-event-dot--voted {
  background: var(--success);
}

.cal-view .cal-event-dot--open {
  background: var(--accent);
  animation: cal-dot-pulse 1.6s ease-in-out infinite;
}

@keyframes cal-dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.82);
  }
}

.cal-view .calendar-day.is-selected .cal-event-dot--open {
  animation: none;
}

.cal-view .cal-event-dot-more {
  font-size: 7px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
}

.cal-view .calendar-day.is-selected .cal-event-dot--open,
.cal-view .calendar-day.is-selected .cal-event-dot--voted {
  background: rgba(255, 255, 255, 0.95);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
}

.cal-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.cal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-dot--poll {
  background: var(--accent);
}

.cal-dot--going {
  background: var(--success);
}

.cal-dot--pending {
  background: var(--warning);
}

.cal-foot {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
  background: rgba(255, 251, 246, 0.65);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.cal-foot-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-boost-banner {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-boost-banner-hint {
  margin: 8px 4px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  text-align: center;
}

.cal-boost-banner {
  margin: 0;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: rgba(255, 251, 246, 0.78);
}

.cal-boost-strip--premium {
  --boost-glow: 0 0 40px rgba(240, 122, 99, 0.14);
  position: relative;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(240, 122, 99, 0.18);
  background: linear-gradient(135deg, #fffefb 0%, #ffe5de 42%, #fff6ed 100%);
  box-shadow: var(--shadow-soft), var(--boost-glow);
  overflow: hidden;
  min-height: 112px;
}

.cal-boost-strip-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 18% 30%, rgba(245, 166, 35, 0.16) 0, transparent 44%),
    radial-gradient(circle at 88% 18%, rgba(240, 122, 99, 0.12) 0, transparent 38%),
    radial-gradient(circle at 12% 20%, rgba(240, 122, 99, 0.08) 1px, transparent 1px);
  background-size: auto, auto, 14px 14px;
}

.cal-boost-strip-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(148px, 36%) minmax(0, 1fr);
  align-items: stretch;
  min-height: 112px;
}

.cal-boost-strip-art-slot {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  border-right: 1px solid rgba(240, 122, 99, 0.1);
}

.cal-boost-strip-art {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 112px;
  object-fit: cover;
  object-position: 18% center;
}

.cal-boost-strip-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  min-width: 0;
}

.cal-boost-strip-eyebrow {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.cal-boost-strip-title {
  margin: 0;
  font-size: clamp(1rem, 2.8vw, 1.18rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.cal-boost-strip-lede {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.cal-boost-strip-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.cal-boost-strip-vote {
  min-height: 44px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(240, 122, 99, 0.22);
}

.cal-boost-strip-vote:visited {
  color: #fff;
}

.cal-boost-strip-remind {
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .cal-boost-strip--premium {
    min-height: 0;
  }

  .cal-boost-strip-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .cal-boost-strip-art-slot {
    min-height: 96px;
    max-height: 108px;
    border-right: 0;
    border-bottom: 1px solid rgba(240, 122, 99, 0.1);
  }

  .cal-boost-strip-art {
    min-height: 96px;
    object-position: 12% center;
  }

  .cal-boost-strip-copy {
    padding: 12px 14px 14px;
  }

  .cal-boost-strip-actions {
    width: 100%;
  }

  .cal-boost-strip-vote,
  .cal-boost-strip-remind {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.cal-boost-banner-hint {
  margin: 4px 0 0;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.3;
  text-align: center;
}

.cal-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-mark--event {
  background: var(--accent-warm);
}

.cal-mark--ok {
  background: var(--success);
}

.cal-mark--pending {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

/* ——— Выбранный день и список активностей (mobile-first) ——— */
.day-shell {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.day-hero {
  margin: -2px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(184, 50, 50, 0.12);
  background: linear-gradient(135deg, #fffefb 0%, #fde8e8 52%, #f3ebe0 100%);
  box-shadow: var(--shadow-soft);
}

.day-head {
  align-items: flex-start;
}

.day-head .screen-title h3 {
  margin: 0;
  font-size: clamp(1.15rem, 4.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.day-date-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--muted);
}

.calendar-cta-btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 800;
  font-size: 12px;
  padding: 0 12px;
  min-height: 40px;
}

.day-poll-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 251, 246, 0.9);
}

.day-poll-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  border: 0;
  font-family: inherit;
}

button.day-poll-chip {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button.day-poll-chip:hover {
  filter: brightness(0.98);
}

button.day-poll-chip:active {
  filter: brightness(0.95);
}

.day-poll-chip--pending {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.day-poll-chip--ok {
  background: rgba(79, 175, 122, 0.14);
  color: #1f4d35;
}

.day-poll-chip--going {
  background: rgba(79, 175, 122, 0.12);
  color: #1f4d35;
}

.activity-list--premium {
  gap: 10px;
  margin-top: 0;
}

.activity-card {
  position: relative;
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card-strong);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.activity-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background 0.14s ease;
}

.activity-card.is-active {
  border-color: rgba(184, 50, 50, 0.35);
  background: linear-gradient(90deg, rgba(253, 232, 232, 0.55) 0%, var(--card-strong) 28%);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    var(--shadow-soft);
}

.activity-card.is-active::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.activity-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.activity-card-head--with-theme {
  align-items: center;
}

.activity-card-head-copy {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.activity-card-theme {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--card-muted);
}

.activity-theme-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 0;
}

.activity-theme-preview:empty {
  display: none;
}

.activity-theme-preview-label {
  font-size: var(--text-sm);
  color: var(--muted);
}

.activity-theme-select-wrap select {
  width: 100%;
  min-height: 44px;
}

.my-upcoming-card .activity-card-theme {
  width: 44px;
  height: 44px;
}

.activity-card-head h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.activity-poll-badge {
  flex-shrink: 0;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

.activity-poll-badge--going {
  background: rgba(79, 175, 122, 0.14);
  color: #1f4d35;
}

.activity-poll-badge--maybe {
  background: rgba(245, 166, 35, 0.16);
  color: #6b4a12;
}

.activity-poll-badge--not {
  background: rgba(28, 22, 20, 0.08);
  color: var(--muted);
}

.activity-poll-badge--pending {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.activity-poll-badge--addon {
  background: rgba(216, 107, 58, 0.14);
  color: #8a4020;
}

.activity-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.activity-card-meta > span:first-child {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(28, 22, 20, 0.06);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.activity-poll-preview {
  display: grid;
  gap: 5px;
}

.activity-poll-preview--blind {
  margin: 0;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.28;
}

.activity-poll-preview-bar {
  display: flex;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(28, 22, 20, 0.08);
}

.activity-poll-seg {
  height: 100%;
  min-width: 0;
  transition: width 0.2s ease;
}

.activity-poll-seg--going {
  width: var(--going-pct, 0%);
  background: var(--poll-going);
}

.activity-poll-seg--maybe {
  width: var(--maybe-pct, 0%);
  background: var(--poll-maybe);
}

.activity-poll-seg--not {
  width: var(--not-pct, 0%);
  background: var(--poll-no);
}

.activity-poll-preview-text {
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 800;
  color: var(--muted);
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.empty-state--calendar {
  border-style: solid;
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.95), rgba(253, 232, 232, 0.35));
}

.empty-state-icon {
  font-size: 2rem;
  line-height: 1;
}

@media (min-width: 960px) {
  .cal-view {
    gap: 12px;
    padding: 14px;
    grid-template-rows: auto auto auto 1fr auto;
  }

  .cal-toolbar {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(184, 50, 50, 0.12);
    box-shadow: var(--shadow-soft);
  }

  .cal-hint {
    padding: 0 4px;
    font-size: 12px;
  }

  .cal-board {
    padding: 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(255, 251, 246, 0.72);
  }

  .cal-grid {
    --cal-gap: 6px;
    grid-template-rows: repeat(6, minmax(48px, auto));
  }

  .cal-view .calendar-day {
    min-height: 48px;
    border-radius: 12px;
    padding: 6px 4px 8px;
  }

  .cal-foot {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 11px;
  }
}

.detail-shell {
  min-width: 0;
  min-height: 280px;
}

#activityDetail.detail-shell:not(.hidden) {
  contain: layout style;
  min-height: 520px;
}

body.activity-poll-focus #activityDetail.detail-shell:not(.hidden) {
  min-height: min(88dvh, 960px);
}

@media (max-width: 959px) {
  .layout--calendar-polls #activityDetail:not(.hidden) {
    grid-column: 1 / -1;
  }
}

/* activity.html?activity= — только карточка опроса, без календаря и списка дня */
body.activity-poll-focus .main-nav-inline,
body.activity-poll-focus .main-nav-menu-wrap,
body.activity-poll-focus .app-tabbar,
body.activity-poll-focus #createActivityFab {
  display: none !important;
}

body.activity-poll-focus.has-tabbar .app-shell {
  padding-bottom: 24px;
}

body.activity-poll-focus .layout--calendar-polls.is-poll-focus {
  display: block;
}

body.activity-poll-focus .layout--calendar-polls.is-poll-focus #activityDetail:not(.hidden) {
  max-width: 640px;
  margin: 0 auto;
}

.activity-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.activity-item,
.response-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-strong);
  padding: 14px;
}

.activity-item {
  width: 100%;
  color: var(--text);
  text-align: left;
}

.activity-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.activity-item h4,
.detail-card h2,
.empty-state h4 {
  margin: 0;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}

.empty-state {
  display: grid;
  gap: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.empty-state.compact {
  margin: 12px 0;
  padding: 14px;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(240, 122, 99, 0.28);
}

.primary-button:active:not(:disabled) {
  background: var(--accent-strong);
}

.secondary-button {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.secondary-button:active:not(:disabled) {
  background: #ffd4c8;
  color: var(--accent-strong);
}

.danger-button {
  border: 1px solid rgba(107, 28, 40, 0.38);
  background: rgba(107, 28, 40, 0.09);
  color: var(--danger);
}

input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.detail-card {
  display: grid;
  gap: 18px;
}

.detail-actions,
.link-row,
.response-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-row a {
  color: var(--accent-strong);
  font-weight: 800;
}

.poll-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-strong);
  padding: 14px;
}

.poll-card-head {
  display: grid;
  gap: 6px;
}

.poll-card-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 2px;
}

.poll-card-toolbar .poll-roster-btn {
  margin-left: auto;
}

@media (max-width: 639px) {
  .poll-card-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .poll-card-toolbar .poll-roster-btn {
    margin-left: 0;
    width: 100%;
    min-height: 44px;
  }
}

.poll-card-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.poll-card-titlebar .eyebrow {
  margin: 0;
}

.poll-title-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.poll-card-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  flex: 0 0 auto;
}

.poll-card-titlebar .poll-card-head-actions {
  width: auto;
  margin-left: 0;
}

.poll-card-titlebar .poll-toolbar {
  gap: 4px;
}

.poll-card-badges .poll-attachment-aside {
  gap: 0;
  padding: 3px;
  border-radius: 999px;
}

.poll-card-badges .poll-attachment-thumb,
.poll-card-badges .poll-attachment-aside--form .poll-attachment-thumb {
  width: 28px;
  height: 28px;
}

.poll-card-badges .poll-attachment-thumb-link {
  border-radius: 999px;
}

.poll-card-badges .poll-attachment-aside-caption {
  display: none;
}

.poll-card-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.poll-card-head-row--with-actions {
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.poll-card-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.poll-card-head-actions .poll-toolbar {
  flex-wrap: nowrap;
  gap: 6px;
}

.poll-card-head-row--with-actions .poll-question {
  flex: 1;
  min-width: 0;
}

.poll-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.poll-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.poll-toolbar-btn:hover {
  background: var(--card-strong);
}

.poll-toolbar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.poll-toolbar-btn--danger {
  color: var(--danger);
  border-color: rgba(107, 28, 40, 0.35);
  background: rgba(107, 28, 40, 0.06);
}

.poll-toolbar-btn--danger:hover {
  background: rgba(107, 28, 40, 0.12);
}

.poll-toolbar-btn--accent {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.poll-toolbar-btn--accent:hover {
  filter: brightness(1.05);
}

.poll-toolbar-btn svg {
  display: block;
}

.poll-question {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.28;
  flex: 1;
  min-width: 0;
  /* `anywhere` переносило каждый символ на новую строку в узкой колонке flex */
  overflow-wrap: break-word;
  word-break: normal;
}

.poll-roster-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 13px;
}

.poll-empty-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

.poll-rows {
  display: grid;
  gap: 10px;
}

.poll-row-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "main avatars";
  align-items: center;
  gap: 8px 10px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-muted);
  padding: 12px 14px;
  overflow: hidden;
}

.poll-row-wrap:not(.poll-row-wrap--has-avatars) {
  grid-template-columns: 1fr;
  grid-template-areas: "main";
}

.poll-row {
  grid-area: main;
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
}

.poll-row-avatars {
  grid-area: avatars;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  min-width: max-content;
  padding-left: 2px;
}

.poll-row-wrap--going.is-selected {
  border-color: rgba(79, 175, 122, 0.45);
  background: rgba(79, 175, 122, 0.1);
  color: #1f4d35;
}

.poll-row-wrap--maybe.is-selected {
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.12);
  color: #6b4a12;
}

.poll-row-wrap--not-going.is-selected {
  border-color: var(--border);
  background: rgba(212, 207, 201, 0.35);
  color: var(--text);
}

.poll-row-wrap.is-selected:not(.poll-row-wrap--going):not(.poll-row-wrap--maybe):not(.poll-row-wrap--not-going) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.poll-row:disabled {
  opacity: 0.65;
  cursor: wait;
  pointer-events: none;
}

.poll-row:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 4px;
  border-radius: 10px;
}

.poll-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.poll-row-prop {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--card-muted);
}

.poll-row-label {
  font-weight: 800;
  flex: 1;
  min-width: 0;
  font-size: clamp(13px, 3.6vw, 15px);
  line-height: 1.22;
}

.poll-row-stat {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--text-sm);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.poll-row-wrap.is-selected .poll-row-stat {
  color: inherit;
  opacity: 0.9;
}

.poll-row-bar {
  display: block;
  width: 100%;
}

/* Скрываем полосу доли до ответа пользователя (статистика ещё не показана). */
.poll-row-bar--hidden {
  height: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
}

.poll-avatar-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  box-sizing: border-box;
  border: 2px solid var(--card-strong);
  border-radius: 50%;
  background: var(--card);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

button.poll-avatar-more--btn {
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

button.poll-avatar-more--btn:hover {
  background: var(--card-strong);
}

.poll-row-avatars > * {
  position: relative;
}

.poll-row-avatars > * + * {
  margin-inline-start: -10px;
}

.poll-row-wrap.is-selected .poll-avatar-more {
  border-color: var(--accent-soft);
}

.poll-comment-block {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.poll-comment-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 650;
}

.poll-comment-label {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.poll-comment-input {
  width: 100%;
  box-sizing: border-box;
}

.poll-save-comment-btn {
  margin-top: 8px;
}

.poll-guests-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.poll-guests-head {
  display: grid;
  gap: 4px;
}

.poll-guests-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text);
}

.poll-guests-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 500;
}

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

.activity-guest-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--surface-2, rgba(127, 127, 127, 0.12));
  border: 1px solid var(--border, rgba(127, 127, 127, 0.2));
  font-size: 13px;
  line-height: 1.3;
}

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

.activity-guest-chip-remove {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.activity-guest-chip-remove:hover {
  color: var(--text);
  background: rgba(127, 127, 127, 0.15);
}

.activity-guest-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.activity-guest-add-row .activity-guest-input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

.poll-card--compact .activity-guest-add-btn {
  min-height: 40px;
  margin-top: 0;
  border-radius: 12px;
  padding-inline: 14px;
  white-space: nowrap;
}

.comment-row-guests {
  margin: 4px 0 0;
  padding-left: 44px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.activity-form-extras {
  margin-top: 0;
}

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

.answer-option {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--card-strong);
  padding: 12px 8px;
  text-align: center;
  font-weight: 800;
}

.answer-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.response-list {
  display: grid;
  gap: 8px;
}

.vote-results {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
}

.vote-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-strong);
  padding: 12px;
}

.vote-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.vote-row-stat {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.vote-row-title-cluster {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.vote-row-title-cluster strong {
  font-weight: 800;
}

.vote-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(43, 33, 24, 0.06);
}

.vote-bar span {
  display: block;
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.poll-row-wrap--going .vote-bar span {
  background: var(--poll-going);
}

.poll-row-wrap--maybe .vote-bar span {
  background: var(--poll-maybe);
}

.poll-row-wrap--not-going .vote-bar span {
  background: var(--poll-no);
}

.vote-voters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.poll-responsibles-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poll-responsibles-label {
  font-weight: 700;
  font-size: 14px;
}

.poll-responsibles-hint {
  margin: 0;
}

.poll-responsibles-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.poll-responsibles-display {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.poll-responsibles-names {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.flexible-poll-card-responsibles {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  margin-top: 2px;
}

.poll-responsibles-picker-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  line-height: 1.2;
}

.poll-responsibles-picker-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(184, 50, 50, 0.12);
}

.poll-responsibles-picker-btn:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

.poll-responsibles-block {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.voter-chip:not(.voter-chip--avatar-only),
.muted-chip {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.voter-chip {
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.voter-chip--avatar-only {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid var(--card-strong);
  border-radius: 50%;
  box-sizing: border-box;
  overflow: hidden;
}

.voter-chip--avatar-only .avatar-img.voter-avatar,
.voter-chip--avatar-only .avatar-placeholder.voter-avatar {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
}

button.voter-chip {
  margin: 0;
  padding: 6px 9px;
  border: 0;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button.voter-chip.voter-chip--avatar-only {
  padding: 0;
  border: 2px solid var(--card-strong);
  border-radius: 50%;
}

.poll-row-wrap.is-selected button.voter-chip.voter-chip--avatar-only {
  border-color: var(--accent-soft);
}

button.voter-chip:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  z-index: 2;
}

button.voter-chip--avatar-only:hover {
  z-index: 2;
}

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

.voter-chip-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  min-width: 0;
}

.voter-chip-main {
  font-weight: 800;
  word-break: break-word;
}

.voter-chip-about {
  display: block;
  margin-top: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.muted-chip {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.modal-comments {
  z-index: 25;
}

.modal-comments-panel {
  max-height: min(88vh, 720px);
}

.modal-comments-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-comments-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.modal-comments-option-section {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

.modal-comments-option-section + .modal-comments-option-section {
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.modal-comments-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-comments-option-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
}

.modal-comments-option-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-comments-option-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.modal-vote-reminder {
  z-index: 26;
}

.modal-vote-reminder-panel {
  max-height: min(80vh, 560px);
}

.modal-vote-reminder-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.modal-vote-reminder-hint,
.modal-vote-reminder-loading {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.vote-reminder-topic-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vote-reminder-topic-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vote-reminder-topic-btn:hover:not(:disabled),
.vote-reminder-topic-btn:focus-visible:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  outline: none;
}

.vote-reminder-topic-btn:disabled,
.vote-reminder-topic-btn.is-busy {
  opacity: 0.55;
  cursor: wait;
}

.vote-reminder-topic-btn--rec {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}

.vote-reminder-topic-rec {
  font-weight: 400;
  font-size: 0.8em;
  opacity: 0.7;
}

.comments-icon-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.comments-icon-btn:hover,
.comments-icon-btn:focus-visible {
  opacity: 1;
  color: var(--accent-strong);
  background: var(--accent-soft);
  outline: none;
}

.comments-icon-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-strong);
}

.comments-icon-glyph {
  flex-shrink: 0;
  pointer-events: none;
}

.comment-row {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-strong);
  padding: 12px 14px;
}

.comment-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comment-row-profile {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.comment-row-profile:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 10px;
}

.comment-row-name {
  font-weight: 800;
  font-size: 14px;
  min-width: 0;
  word-break: break-word;
}

.comment-row-username {
  font-weight: 650;
  color: var(--muted);
}

.comment-row-answer {
  flex-shrink: 0;
  font-size: 11px;
}

.comment-row-avatar,
.avatar-img.comment-row-avatar,
.avatar-placeholder.comment-row-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 13px;
}

.avatar-img.comment-row-avatar {
  object-fit: cover;
}

.comment-row-text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-row-empty {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
  font-style: italic;
}

.response-row {
  display: grid;
  gap: 4px;
}

.fab {
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: var(--z-fab);
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 0 20px;
  font-size: var(--text-base);
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(240, 122, 99, 0.35);
}

.fab:active {
  background: var(--accent-strong);
}

@media (max-width: 1099px) {
  body.has-tabbar .fab {
    bottom: calc(var(--tabbar-height) + 12px + env(safe-area-inset-bottom));
  }
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 14px;
  max-height: min(92vh, 780px);
  overflow: auto;
  border-radius: 28px 28px 0 0;
  padding: 18px 16px max(22px, env(safe-area-inset-bottom));
}

.poll-sheet-panel {
  gap: 9px;
}

.poll-form-core,
.poll-form-extras-body {
  display: grid;
  gap: 9px;
}

.field-hint {
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.poll-form-extras {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 251, 246, 0.62);
  padding: 0;
}

.poll-form-extras summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 9px 11px;
  color: var(--accent-strong);
  font-weight: 800;
  -webkit-tap-highlight-color: transparent;
}

.poll-form-extras summary::-webkit-details-marker {
  display: none;
}

.poll-form-extras summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: right;
}

.poll-form-extras-body {
  border-top: 1px solid var(--border);
  padding: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-error {
  margin: 0;
  border-radius: 14px;
  background: rgba(107, 28, 40, 0.09);
  color: var(--danger);
  padding: 12px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(88px, calc(env(safe-area-inset-bottom) + 88px));
  z-index: 30;
  width: min(360px, calc(100% - 32px));
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-strong);
  color: var(--text);
  padding: 14px 18px;
  text-align: center;
  font-weight: 800;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

@media (min-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .sheet-panel {
    left: 50%;
    right: auto;
    bottom: 28px;
    width: min(620px, calc(100% - 32px));
    border-radius: var(--radius-xl);
    transform: translateX(-50%);
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-inline: 12px;
    padding-bottom: 92px;
  }

  .topbar-inner {
    padding: 2px 0 6px;
    gap: 8px;
  }

  .brand-badge {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-badge-img {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .brand-badge-title {
    font-size: 15px;
  }

  .topbar-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-actions {
    flex-shrink: 0;
  }

  .main-nav-menu-wrap {
    flex-shrink: 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .screen-title {
    width: 100%;
  }

  .screen-title > div {
    min-width: 0;
  }

  .screen-title h2,
  .screen-title h3 {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .detail-actions .secondary-button,
  .detail-actions .danger-button {
    width: 100%;
  }

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

  .poll-card-head-row--with-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .poll-card-head-actions {
    margin-left: auto;
    max-width: none;
    width: 100%;
    justify-content: flex-end;
  }

  .poll-card-head-actions .poll-roster-btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
  }

  /* Вопрос опроса и «Участники» — колонкой, иначе кнопка на 100% ширины душила заголовок в одном ряду */
  .poll-card-head > .poll-card-head-row:not(.poll-card-head-row--with-actions) {
    flex-direction: column;
    align-items: stretch;
  }

  .poll-card-head > .poll-card-head-row:not(.poll-card-head-row--with-actions) .poll-question {
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  .poll-card-head > .poll-card-head-row:not(.poll-card-head-row--with-actions) .poll-roster-btn {
    width: 100%;
    align-self: stretch;
  }

  .activity-summary-card {
    padding: 12px;
    border-radius: 18px;
  }

  .activity-poll-card {
    gap: 10px;
  }

  .activity-poll-card .activity-summary-card {
    padding: 0;
  }

  .poll-card-titlebar {
    align-items: flex-start;
  }

  .poll-card-titlebar .poll-card-head-actions {
    width: auto;
    margin-left: 0;
  }

  .poll-card-badges {
    flex-shrink: 0;
    max-width: 42%;
  }

  .activity-info-grid {
    grid-template-columns: 1fr;
  }

  .activity-control-row {
    flex-wrap: nowrap;
  }

  .activity-compact-author {
    max-width: 46%;
  }

  .flexible-poll-schedule-chips {
    grid-template-columns: 1fr;
  }

  .flexible-poll-detail-header {
    padding: 12px;
  }

  .activity-link-row a {
    flex: 1 1 auto;
  }

  .voter-chip:not(.voter-chip--avatar-only),
  .muted-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .calendar-card,
  .day-card,
  .detail-card {
    border-radius: 22px;
    padding: 15px;
  }

  .month-bar {
    gap: 10px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .weekdays,
  .calendar-grid {
    gap: 6px;
  }

  .calendar-day {
    min-height: 52px;
    border-radius: 14px;
    padding: 8px 4px 16px;
  }

  .activity-day-title {
    right: 4px;
    bottom: 6px;
    left: 4px;
    font-size: 7px;
  }

  .activity-count {
    top: 3px;
    right: 3px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.app-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.app-version {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Режим отладки аватарок (вкл. через miniapp_debug=1 в URL / localStorage) */
.miniapp-debug {
  position: fixed;
  z-index: 10000;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
  max-height: 38vh;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  background: rgba(22, 18, 16, 0.94);
  color: #f0e8dc;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.miniapp-debug.miniapp-debug-collapsed {
  max-height: none;
}

.miniapp-debug.miniapp-debug-collapsed .miniapp-debug-body,
.miniapp-debug.miniapp-debug-collapsed .miniapp-debug-hint {
  display: none !important;
}

.miniapp-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 800;
  flex-shrink: 0;
}

.miniapp-debug-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.miniapp-debug-btn {
  margin: 0;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.miniapp-debug-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

.miniapp-debug-body {
  margin: 0;
  padding: 8px 10px 10px;
  overflow: auto;
  flex: 1;
  min-height: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.miniapp-debug-hint {
  margin: 0;
  padding: 0 10px 10px;
  opacity: 0.72;
  font-size: 10px;
  line-height: 1.35;
}

.miniapp-debug-hint code {
  font-size: 0.95em;
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

/* Вход с обычного браузера (без initData) */
.web-login-panel {
  max-width: 32rem;
  text-align: left;
  place-items: start;
}

.web-login-mode-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.web-login-mode-panel {
  width: 100%;
}

.web-login-vpn-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0.25rem 0 1.1rem;
  width: 100%;
}

.web-login-bot-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  box-sizing: border-box;
}

.web-login-bot-banner-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.web-login-bot-banner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.web-login-bot-handle {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0.35rem 0.55rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card-strong);
  border-radius: 6px;
  border: 1px solid var(--border);
  user-select: all;
  cursor: text;
}

.web-login-copy-bot-btn {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
}

.web-login-vpn-side {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s ease;
  user-select: none;
  cursor: pointer;
}

.web-login-vpn-on .web-login-vpn-side[data-active-when="yes"] {
  color: var(--text);
}

.web-login-vpn-toggle-row:not(.web-login-vpn-on) .web-login-vpn-side[data-active-when="no"] {
  color: var(--text);
}

.web-login-vpn-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.web-login-vpn-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.web-login-vpn-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 15px;
  transition: background 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(28, 22, 20, 0.12);
}

.web-login-vpn-slider::before {
  content: "";
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background: var(--card-strong);
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(28, 22, 20, 0.18);
}

.web-login-vpn-switch input:focus-visible + .web-login-vpn-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.web-login-vpn-switch input:checked + .web-login-vpn-slider {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(184, 50, 50, 0.35);
}

.web-login-vpn-switch input:checked + .web-login-vpn-slider::before {
  transform: translateX(22px);
  background: var(--accent);
}

.web-login-panel h4 {
  margin: 0 0 0.5rem;
  text-align: center;
  width: 100%;
}

.web-login-lead {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.web-login-vpn-hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
}

.web-login-lead code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-soft);
}

.telegram-widget-slot {
  min-height: 44px;
  display: flex;
  justify-content: center;
}

.web-login-checking {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.web-login-check-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 4px;
}

.web-login-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

a.web-login-btn {
  text-decoration: none;
  text-align: center;
  justify-content: center;
}

/* —— Статистика чата —— */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stats-layout {
  --stats-glow: 0 0 40px rgba(240, 122, 99, 0.12);
  --stats-glass: rgba(255, 249, 244, 0.88);
  --stats-hero-gradient: linear-gradient(135deg, #fffefb 0%, #ffe5de 38%, #fff6ed 100%);
  --stats-accent-community: var(--accent);
  --stats-accent-telegram: #6b8cff;
  --stats-accent-calendar: var(--success);
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 0 2.5rem;
}

.stats-layout-main {
  min-width: 0;
}

.stats-layout-rail {
  display: block;
}

@media (max-width: 959px) {
  .stats-layout {
    display: grid;
    grid-template-areas:
      "hero"
      "filters"
      "content";
    row-gap: 0;
  }

  .stats-layout-main {
    display: contents;
  }

  .stats-layout-main > .stats-hero {
    grid-area: hero;
    margin-bottom: 0.85rem;
  }

  .stats-layout-main > .stats-content {
    grid-area: content;
  }

  .stats-layout-rail {
    grid-area: filters;
    margin-bottom: 1rem;
  }

  .stats-layout-rail .stats-sticky-wrap {
    position: static;
    margin-bottom: 0;
  }
}

@media (min-width: 960px) {
  .stats-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 17rem);
    gap: 1.25rem;
    align-items: start;
  }

  .stats-layout-main {
    display: block;
  }

  .stats-layout-rail {
    position: sticky;
    top: 12px;
    align-self: start;
  }

  .stats-layout-rail .stats-sticky-wrap {
    position: static;
    margin-bottom: 0;
  }

  .stats-layout-rail .stats-filters {
    margin-bottom: 0;
  }
}

.stats-hero {
  margin-bottom: 1rem;
}

.stats-hero--premium {
  position: relative;
  margin-bottom: 1.1rem;
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: var(--radius-xl);
  background: var(--stats-hero-gradient);
  border: 1px solid rgba(240, 122, 99, 0.16);
  box-shadow: var(--shadow-soft), var(--stats-glow);
  overflow: hidden;
}

.stats-hero-deco {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(240, 122, 99, 0.28) 0, transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(107, 140, 255, 0.18) 0, transparent 38%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 11px,
      rgba(240, 122, 99, 0.04) 11px,
      rgba(240, 122, 99, 0.04) 12px
    );
  pointer-events: none;
}

.stats-hero-inner {
  position: relative;
  z-index: 1;
}

.stats-hero--premium .stats-page-title {
  font-size: clamp(1.65rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stats-hero--premium .stats-range-hint {
  color: var(--muted);
  font-weight: 500;
}

.stats-sticky-wrap {
  position: sticky;
  top: max(0px, env(safe-area-inset-top));
  z-index: 6;
  margin-bottom: 1.15rem;
}

.stats-filters--sticky {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--stats-glass);
}

.stats-page-title {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.45rem, 4vw, 1.75rem);
  letter-spacing: -0.02em;
}

.stats-range-hint {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.stats-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.stats-filters-label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.stats-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* .stats-chip — см. unified .chip выше */

.stats-select--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.stats-select,
.stats-date-input {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  max-width: 100%;
}

.stats-custom-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
}

.stats-custom-panel.hidden {
  display: none;
}

.stats-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 8.5rem;
}

.stats-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stats-apply-btn {
  margin-left: auto;
}

@media (max-width: 28rem) {
  .stats-apply-btn {
    margin-left: 0;
    width: 100%;
  }
}

.stats-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stats-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.stats-dashboard--loading {
  gap: 1rem;
}

.stats-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}

.stats-kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 6.5rem;
}

.stats-kpi--accent {
  background: linear-gradient(145deg, #fffefb 0%, #fde8e8 55%, #f8f0e6 100%);
  border-color: rgba(184, 50, 50, 0.22);
}

.stats-kpi-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

.stats-kpi-value {
  margin: 0.1rem 0 0;
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
  min-width: 2.5ch;
}

.stats-kpi-delta {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-strong);
}

.stats-kpi-hint {
  margin: auto 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.stats-kpi--skeleton {
  min-height: 6.5rem;
  background: linear-gradient(110deg, var(--bg-soft) 8%, var(--card-strong) 18%, var(--bg-soft) 33%);
  background-size: 200% 100%;
  animation: stats-shimmer 1.2s ease-in-out infinite;
  border-color: transparent;
}

.stats-metrics-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
}

.stats-metrics-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-soft);
}

.stats-metrics-group-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.stats-metrics-group-desc {
  margin: 0 0 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.stats-metrics-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--stats-group-accent, var(--accent));
  flex-shrink: 0;
}

.stats-metrics-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.stats-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.stats-metric-tile {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid rgba(28, 22, 20, 0.06);
}

.stats-metric-tile-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stats-metric-tile-label {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.stats-metric-tile-hint {
  font-size: 0.68rem;
}

.stats-section-heading {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.stats-boards-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stats-board {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.stats-board[open] {
  border-color: rgba(184, 50, 50, 0.18);
}

.stats-board-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  min-width: 0;
}

.stats-board-summary::-webkit-details-marker {
  display: none;
}

.stats-board-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.stats-board-chevron svg {
  display: block;
}

.stats-board[open] .stats-board-chevron {
  transform: rotate(180deg);
}

.stats-board-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--accent);
  flex-shrink: 0;
}

.stats-board-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.stats-board-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.stats-board-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.stats-board-meta {
  font-size: 0.78rem;
}

.stats-board-sort {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 11.5rem;
}

.stats-board-sort-select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
}

.stats-board-body {
  padding: 0 0.75rem 0.85rem;
  border-top: 1px solid var(--border);
}

.stats-board-empty {
  margin: 0.75rem 0.25rem;
  font-size: 0.9rem;
}

.stats-leader-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats-leader {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.55rem 0.65rem;
  padding: 0.55rem 0.15rem;
  border-bottom: 1px solid rgba(28, 22, 20, 0.08);
}

.stats-leader:last-child {
  border-bottom: none;
}

.stats-leader--link,
.stats-podium-slot--link {
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

.stats-leader--link:hover,
.stats-podium-slot--link:hover {
  background: rgba(184, 50, 50, 0.06);
}

.stats-leader--link:focus-visible,
.stats-podium-slot--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stats-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  flex-shrink: 0;
}

.stats-rank--gold {
  background: linear-gradient(145deg, #fff4c4, #f0c84a);
  color: #5c4208;
}

.stats-rank--silver {
  background: linear-gradient(145deg, #f2f2f2, #c8c8c8);
  color: #3d3d3d;
}

.stats-rank--bronze {
  background: linear-gradient(145deg, #f5dcc8, #c98a5a);
  color: #4a2f1a;
}

.stats-leader-avatar {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.75rem;
}

.stats-leader-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stats-leader-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
}

.stats-leader-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.stats-leader-username {
  font-size: 0.8rem;
}

.stats-leader-count {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stats-leader-bar {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}

.stats-leader-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent));
  transition: width 0.35s ease;
}

.stats-notes {
  padding: 0.9rem 1rem;
  background: var(--card-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stats-notes-title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.stats-notes-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.stats-empty {
  text-align: center;
  padding: 2rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.stats-empty-title {
  margin: 0 0 0.5rem;
}

.stats-empty-inline {
  text-align: center;
  padding: 1.5rem 0;
}

.stats-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
}

.stats-skeleton-card {
  min-height: 7rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, var(--bg-soft) 8%, var(--card-strong) 18%, var(--bg-soft) 33%);
  background-size: 200% 100%;
  animation: stats-shimmer 1.2s ease-in-out infinite;
}

.stats-loading-caption {
  text-align: center;
  margin: 0;
}

@keyframes stats-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes stats-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-dashboard--live .stats-bento-item,
.stats-dashboard--live .stats-chart-card,
.stats-dashboard--live .stats-metrics-group,
.stats-dashboard--live .stats-composition,
.stats-dashboard--live .stats-board,
.stats-dashboard--live .stats-weekday,
.stats-dashboard--live .stats-mini-chart-card {
  animation: stats-fade-up 0.45s ease backwards;
}

.stats-dashboard--live .stats-bento-item:nth-child(1) { animation-delay: 0.02s; }
.stats-dashboard--live .stats-bento-item:nth-child(2) { animation-delay: 0.06s; }
.stats-dashboard--live .stats-bento-item:nth-child(3) { animation-delay: 0.1s; }
.stats-dashboard--live .stats-bento-item:nth-child(4) { animation-delay: 0.14s; }
.stats-dashboard--live .stats-chart-card { animation-delay: 0.08s; }

.stats-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.stats-bento--kpis {
  margin-bottom: 0.15rem;
}

.stats-bento-main {
  display: grid;
  gap: 0.85rem;
}

.stats-bento-secondary {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 40rem) {
  .stats-bento--kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .stats-bento-main {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
    align-items: start;
  }

  .stats-bento-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (min-width: 40rem) {
  .stats-bento-item--wide {
    grid-column: span 2;
  }

  .stats-bento-chart {
    grid-column: 1 / -1;
  }
}

.stats-bento-main .stats-bento-chart {
  grid-column: auto;
  min-height: 280px;
}

.stats-kpi--tone-coral {
  background: linear-gradient(155deg, #fff 0%, #ffe5de 70%, #fff6ed 100%);
  border-color: rgba(240, 122, 99, 0.2);
}

.stats-kpi--tone-coral::before {
  background: linear-gradient(90deg, #f07a63, #ffab91);
}

.stats-kpi--tone-mint {
  background: linear-gradient(155deg, #fff 0%, #e8f7ef 70%, #f6fffa 100%);
  border-color: rgba(79, 175, 122, 0.22);
}

.stats-kpi--tone-mint::before {
  background: linear-gradient(90deg, #4faf7a, #8fd4a8);
}

.stats-kpi--tone-grape {
  background: linear-gradient(155deg, #fff 0%, #ece8ff 70%, #f8f6ff 100%);
  border-color: rgba(107, 140, 255, 0.22);
}

.stats-kpi--tone-grape::before {
  background: linear-gradient(90deg, #6b8cff, #9eb4ff);
}

.stats-kpi--tone-amber {
  background: linear-gradient(155deg, #fff 0%, #fff0d6 70%, #fffaf2 100%);
  border-color: rgba(245, 166, 35, 0.25);
}

.stats-kpi--tone-amber::before {
  background: linear-gradient(90deg, #f5a623, #ffc857);
}

.stats-spotlight {
  padding: 1rem 1rem 0.85rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stats-spotlight-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stats-spotlight-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.stats-spotlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.stats-spotlight-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.55rem;
  align-items: center;
}

.stats-spotlight-body {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.stats-spotlight-name {
  font-size: 0.88rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-spotlight-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stats-spotlight-empty {
  margin: auto 0;
  text-align: center;
  padding: 1.5rem 0.5rem;
}

.stats-empty--c3 {
  padding: 2.25rem 1.5rem;
  background: linear-gradient(155deg, #fff 0%, #fff9f4 55%, #ffe5de 100%);
  border-color: rgba(240, 122, 99, 0.14);
}

.stats-dashboard--c3 {
  gap: 1.1rem;
}

.stats-skeleton-main {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 960px) {
  .stats-skeleton-main {
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr);
  }
}

.stats-kpi--c3 {
  position: relative;
  min-height: 9.5rem;
  padding: 0.95rem 1rem 0.65rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  overflow: hidden;
}

.stats-kpi--c3::before {
  display: none;
}

.stats-kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.stats-kpi-icon-corner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  opacity: 0.9;
}

.stats-kpi-icon-corner svg {
  display: block;
  width: 100%;
  height: 100%;
}

.stats-kpi--tone-coral .stats-kpi-icon-corner {
  color: var(--accent);
}

.stats-kpi--tone-mint .stats-kpi-icon-corner {
  color: var(--success);
}

.stats-kpi--tone-grape .stats-kpi-icon-corner {
  color: var(--stats-accent-telegram);
}

.stats-kpi--tone-amber .stats-kpi-icon-corner {
  color: var(--warning);
}

.stats-kpi--c3 .stats-kpi-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.stats-kpi--c3 .stats-kpi-value {
  margin: 0.15rem 0 0;
  font-size: clamp(1.65rem, 4.5vw, 2.05rem);
}

.stats-kpi-trend {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.stats-kpi-trend--up {
  color: var(--success);
}

.stats-kpi-trend--down {
  color: var(--danger);
}

.stats-kpi-trend--flat {
  color: var(--muted);
}

.stats-kpi--c3 .stats-kpi-hint {
  margin: 0;
  font-size: 0.72rem;
}

.stats-kpi-sparkline {
  margin-top: auto;
  width: 100%;
  height: 3.25rem;
  padding-top: 0.35rem;
}

.stats-kpi-sparkline-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.stats-kpi--skeleton.stats-kpi--c3 {
  min-height: 9.5rem;
}

.stats-chart-empty-c3 {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1rem 1.25rem;
  min-height: 11rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  background: var(--card-muted);
  border: 1px dashed rgba(43, 33, 24, 0.12);
  overflow: hidden;
}

.stats-chart-empty-c3-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 82% 18%, rgba(240, 122, 99, 0.12) 0, transparent 38%),
    radial-gradient(circle at 18% 78%, rgba(107, 140, 255, 0.1) 0, transparent 32%);
}

.stats-chart-empty-mascot {
  position: relative;
  z-index: 1;
  display: block;
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.stats-chart-empty-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.stats-chart-empty-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}

@media (max-width: 32rem) {
  .stats-chart-empty-c3 {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}

.stats-weekday {
  padding: 1rem 1rem 0.9rem;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stats-weekday-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.stats-weekday-empty {
  margin: auto 0;
  text-align: center;
  font-size: 0.88rem;
}

.stats-weekday-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 0.45rem;
  flex: 1;
  min-height: 8.5rem;
  padding-top: 0.25rem;
}

.stats-weekday-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  height: 100%;
}

.stats-weekday-val {
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-strong);
  line-height: 1;
  min-height: 0.68rem;
}

.stats-weekday-val--ghost {
  visibility: hidden;
}

.stats-weekday-bar {
  width: 100%;
  max-width: 2.1rem;
  height: 5.5rem;
  border-radius: 999px;
  background: var(--bg-soft);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.stats-weekday-bar-fill {
  display: block;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #ffab91 0%, var(--accent) 100%);
  transition: height 0.35s ease;
}

.stats-weekday-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.stats-mini-chart-meta {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
}

.stats-mini-chart-kpi {
  margin: 0;
  font-size: 1.65rem;
}

.stats-mini-chart-card--members .stats-mini-chart-meta {
  font-size: 0.72rem;
}

.stats-kpi--v2 {
  position: relative;
  min-height: 7.25rem;
  padding: 0.95rem 1rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.stats-kpi--v2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent));
  opacity: 0.85;
}

.stats-kpi--v2.stats-kpi--accent {
  background: linear-gradient(155deg, #fff 0%, #ffe5de 55%, #fff6ed 100%);
  border-color: rgba(240, 122, 99, 0.22);
  box-shadow: var(--shadow-soft);
}

.stats-kpi--v2::before {
  background: linear-gradient(90deg, var(--accent), #ffab91);
}

.stats-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-bottom: 0.15rem;
  color: var(--accent);
  flex-shrink: 0;
}

.stats-kpi-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.stats-kpi--tone-coral .stats-kpi-icon {
  color: var(--accent);
}

.stats-kpi--tone-grape .stats-kpi-icon {
  color: var(--stats-accent-telegram);
}

.stats-kpi--tone-amber .stats-kpi-icon {
  color: var(--warning);
}

.stats-kpi--tone-mint .stats-kpi-icon {
  color: var(--success);
}

.stats-kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

.stats-trend {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stats-trend--up {
  background: rgba(42, 93, 66, 0.12);
  color: var(--success);
}

.stats-trend--down {
  background: rgba(107, 28, 40, 0.1);
  color: var(--danger);
}

.stats-trend--flat {
  background: var(--bg-soft);
  color: var(--muted);
}

.stats-chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 0.85rem;
  box-shadow: var(--shadow-soft);
}

.stats-chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.stats-chart-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.stats-chart-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.stats-chart-seg {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.stats-chart-seg.is-active {
  background: var(--accent-soft);
  border-color: rgba(240, 122, 99, 0.35);
  color: var(--accent-strong);
}

.stats-chart-svg-wrap {
  width: 100%;
  overflow: hidden;
}

.stats-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.stats-chart-svg--compact {
  min-height: 5.75rem;
}

.stats-chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.stats-chart-grid-line--v {
  stroke-dasharray: 3 4;
  opacity: 0.75;
}

.stats-chart-plot-border {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.stats-chart-axis-label {
  fill: var(--muted);
  font-size: 9px;
  font-family: inherit;
}

.stats-chart-axis-label--y {
  font-size: 8.5px;
}

.stats-chart-value-label {
  fill: var(--text);
  font-size: 8.5px;
  font-weight: 600;
  font-family: inherit;
  pointer-events: none;
}

.stats-chart-empty {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

.stats-mini-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 32rem) {
  .stats-mini-chart-row {
    grid-template-columns: 1fr;
  }
}

.stats-mini-chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-soft);
}

.stats-mini-chart-title {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.stats-metrics-group--glass {
  background: var(--stats-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 4px solid var(--stats-group-accent, var(--accent));
}

.stats-metrics-group--community {
  --stats-group-accent: var(--stats-accent-community);
}

.stats-metrics-group--telegram {
  --stats-group-accent: var(--stats-accent-telegram);
}

.stats-metrics-group--calendar {
  --stats-group-accent: var(--stats-accent-calendar);
}

.stats-composition {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.stats-composition-ring {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 6px var(--card-strong);
}

.stats-composition-legend {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
}

.stats-composition-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.stats-composition-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.stats-podium {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  align-items: end;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem 0.35rem;
  margin-bottom: 0.5rem;
}

.stats-podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.stats-podium-slot--first {
  order: 2;
}

.stats-podium-slot--second {
  order: 1;
}

.stats-podium-slot--third {
  order: 3;
}

.stats-podium-pedestal {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(180deg, var(--bg-soft), var(--bg));
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem 0.35rem 0.4rem;
  min-height: 3.5rem;
}

.stats-podium-slot--first .stats-podium-pedestal {
  min-height: 5rem;
  background: linear-gradient(180deg, #fff4c4, #f8f0e6);
  border-color: rgba(240, 200, 74, 0.5);
}

.stats-podium-slot--second .stats-podium-pedestal {
  min-height: 4rem;
  background: linear-gradient(180deg, #f2f2f2, #f8f0e6);
}

.stats-podium-slot--third .stats-podium-pedestal {
  min-height: 3.25rem;
  background: linear-gradient(180deg, #f5dcc8, #f8f0e6);
}

.stats-podium-avatar {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.85rem;
}

.stats-podium-slot--first .stats-podium-avatar {
  width: 3.25rem;
  height: 3.25rem;
  box-shadow: 0 0 0 3px #f0c84a;
}

.stats-podium-slot--second .stats-podium-avatar {
  box-shadow: 0 0 0 2px #c8c8c8;
}

.stats-podium-slot--third .stats-podium-avatar {
  box-shadow: 0 0 0 2px #c98a5a;
}

.stats-podium-name {
  font-size: 0.78rem;
  font-weight: 600;
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-podium-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.stats-leader-bar-fill--glow {
  background: linear-gradient(90deg, var(--accent-warm), var(--accent), #d86b3a);
  box-shadow: 0 0 12px rgba(184, 50, 50, 0.35);
}

.stats-skeleton-bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.stats-skeleton-chart {
  grid-column: 1 / -1;
  min-height: 10rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, var(--bg-soft) 8%, var(--card-strong) 18%, var(--bg-soft) 33%);
  background-size: 200% 100%;
  animation: stats-shimmer 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .stats-dashboard--live .stats-bento-item,
  .stats-dashboard--live .stats-chart-card,
  .stats-dashboard--live .stats-metrics-group,
  .stats-dashboard--live .stats-composition,
  .stats-dashboard--live .stats-board {
    animation: none;
  }

  .stats-leader-bar-fill,
  .stats-leader-bar-fill--glow {
    transition: none;
  }
}

@media (max-width: 36rem) {
  .stats-board-summary {
    flex-wrap: wrap;
  }

  .stats-board-sort {
    flex: 1 1 100%;
    max-width: none;
    margin: 0.25rem 0 0;
    padding-left: 2.4rem;
    box-sizing: border-box;
  }

  .stats-board-sort-select {
    width: 100%;
    max-width: 100%;
  }

  .stats-metrics-grid {
    grid-template-columns: 1fr;
  }

  .stats-leader-count {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 639px) {
  .poll-row-wrap--has-avatars {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main avatars";
    align-items: center;
    gap: 6px 8px;
  }

  .poll-row-wrap--has-avatars .poll-row {
    gap: 4px;
  }

  .poll-row-wrap--has-avatars .poll-row-top {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .poll-row-wrap--has-avatars .poll-row-avatars {
    justify-content: flex-end;
    align-self: center;
    padding-left: 0;
  }

  .poll-row-stat {
    white-space: nowrap;
  }
}

@media (min-width: 960px) {
  .flexible-poll-split--active .poll-rows,
  .layout--split .poll-rows {
    gap: 12px;
  }

  .polls-hub-detail,
  .flexible-poll-detail {
    min-width: 0;
    overflow: hidden;
  }
}

.poll-card--compact {
  gap: 7px;
  padding: 9px 10px;
}

.poll-card--lean {
  border-radius: 16px;
  background: rgba(255, 254, 251, 0.9);
  box-shadow: none;
}

.poll-card--lean .poll-card-head {
  gap: 4px;
}

.poll-card--compact .poll-question {
  font-size: 1rem;
  line-height: 1.18;
}

.poll-card-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 8px;
  align-items: start;
}

.poll-card-primary {
  min-width: 0;
}

.poll-empty-hint--compact {
  margin: 0;
  font-size: 11px;
  line-height: 1.28;
}

.poll-blind-hint {
  color: var(--muted);
  font-weight: 650;
  background: rgba(240, 122, 99, 0.08);
  border-radius: 999px;
  padding: 8px 11px;
}

.poll-roster-btn--compact {
  min-height: 30px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
}

.poll-card--compact .poll-rows {
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.poll-card--compact .poll-row-wrap {
  gap: 6px 8px;
  min-height: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-muted);
  box-shadow: none;
}

.poll-card--compact .poll-row-wrap--has-avatars .poll-row {
  gap: 3px;
}

.poll-card--compact .poll-row-wrap + .poll-row-wrap {
  margin-top: 0;
}

.poll-card--compact .poll-row-wrap.is-selected {
  border-color: rgba(240, 122, 99, 0.4);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.poll-card--compact .poll-row-wrap--going.is-selected {
  border-color: rgba(79, 175, 122, 0.45);
  background: rgba(79, 175, 122, 0.12);
  color: #1f4d35;
}

.poll-card--compact .poll-row-wrap--maybe.is-selected {
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.12);
  color: #6b4a12;
}

.poll-card--compact .poll-row-wrap--not-going.is-selected {
  border-color: var(--border);
  background: rgba(212, 207, 201, 0.35);
  color: var(--text);
}

.poll-card--compact .poll-row-wrap:hover {
  border-color: rgba(240, 122, 99, 0.28);
}

.poll-card--compact .poll-comment-block {
  margin-top: 4px;
  gap: 6px;
}

.poll-card--compact .poll-comment-hint {
  font-size: 11px;
  line-height: 1.35;
}

.poll-card--compact .poll-row-label {
  font-size: 14px;
  line-height: 1.2;
}

.poll-card--compact .poll-row-stat {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.poll-card--compact .poll-row-wrap.is-selected .poll-row-stat {
  color: inherit;
  opacity: 0.9;
}

.poll-card--compact .poll-row-bar {
  height: 6px;
  background: rgba(43, 33, 24, 0.06);
  border-radius: 999px;
}

.poll-card--compact .poll-row-wrap--going .vote-bar span {
  background: var(--poll-going);
}

.poll-card--compact .poll-row-wrap--maybe .vote-bar span {
  background: var(--poll-maybe);
}

.poll-card--compact .poll-row-wrap--not-going .vote-bar span {
  background: var(--poll-no);
}

.poll-card--compact .voter-chip--avatar-only,
.poll-card--compact .poll-avatar-more {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.poll-card--compact .poll-row-avatars > * + * {
  margin-inline-start: -7px;
}

.poll-card--compact .poll-save-comment-btn {
  min-height: 36px;
  margin-top: 0;
  border-radius: 12px;
  padding-inline: 12px;
}

.poll-comment-block--inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

.poll-comment-block--inline .poll-comment-label {
  gap: 4px;
}

.poll-comment-block--inline .poll-comment-input {
  min-height: 38px;
  resize: vertical;
}

.poll-attachment-field {
  margin-top: 0.35rem;
}

.poll-form-attachment-preview {
  margin-top: 0.35rem;
}

.poll-form-attachment-preview.hidden {
  display: none;
}

.poll-attachment-aside {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  max-width: min(100%, 150px);
}

.poll-attachment-aside--form {
  max-width: 100%;
  padding: 5px 7px;
}

.poll-attachment-aside--form .poll-attachment-thumb {
  width: 34px;
  height: 34px;
}

.poll-attachment-thumb-link {
  display: block;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card-strong);
}

.poll-attachment-thumb-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.poll-attachment-thumb {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: cover;
}

.poll-attachment-aside-caption {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
}

.poll-attachment-aside--pdf {
  min-width: 0;
}

.poll-attachment-pdf-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.poll-attachment-pdf-chip:hover {
  filter: brightness(1.06);
}

.poll-attachment-field--compact {
  display: grid;
  gap: 7px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(255, 251, 246, 0.58);
  padding: 8px;
}

.poll-attachment-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.poll-attachment-field-head label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.poll-attachment-field-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.poll-attachment-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.poll-attachment-control input[type="file"] {
  min-width: 0;
  flex: 1 1 180px;
}

.poll-attachment-control .secondary-button {
  min-height: 34px;
  border-radius: 12px;
  padding-inline: 12px;
}

.vote-only-panel {
  max-width: 22rem;
  margin: 0 auto;
  text-align: center;
  padding: 1.25rem 1rem 1rem;
  border-radius: var(--radius-xl, 18px);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
}

.vote-only-panel-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
}

.vote-only-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0.5rem 0 1.25rem;
}

.vote-only-spinner {
  border-top-color: var(--success);
}

.vote-only-loading-text {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.vote-only-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 1.25rem;
  padding: 1.1rem 1rem;
  border-radius: 14px;
  background: rgba(42, 93, 66, 0.1);
  border: 1px solid rgba(42, 93, 66, 0.28);
}

.vote-only-result-icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(42, 93, 66, 0.35);
}

.vote-only-result-headline {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: -0.02em;
}

.vote-only-result-poll {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.vote-only-result-answer {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.vote-only-result-emoji {
  margin-right: 0.15em;
}

.vote-only-result-sub {
  margin: 0;
  max-width: 18rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--muted);
}

.vote-only-error {
  margin: 0 0 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(184, 50, 50, 0.25);
}

.vote-only-error-title {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--accent-strong);
}

.vote-only-error-detail {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
}

.vote-only-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.vote-only-actions .secondary-button,
.vote-only-actions .primary-button {
  width: 100%;
  justify-content: center;
  text-decoration: none;
}

.web-login-vote-hint {
  font-weight: 600;
}

@media (max-width: 420px) {
  .poll-card-top-grid {
    grid-template-columns: 1fr;
  }

  .poll-attachment-aside {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: none;
    width: fit-content;
  }

  .poll-attachment-aside-caption {
    align-self: center;
  }
}
/* Мобильный экран месяца — ровно в viewport */
body.cal-fit-month {
  overflow: hidden;
}

body.cal-fit-month .app-shell {
  --cal-chrome: calc(
    max(18px, env(safe-area-inset-top)) + 8px + 56px + 72px + env(safe-area-inset-bottom, 0px)
  );
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-height: 100dvh;
  min-height: 100svh;
  max-height: 100svh;
  overflow: hidden;
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

body.cal-fit-month .topbar {
  margin-bottom: 8px;
  flex-shrink: 0;
}

body.cal-fit-month .main-app,
body.cal-fit-month #tabPanelCalendar,
body.cal-fit-month .layout--calendar-polls,
body.cal-fit-month #calendarCard,
body.cal-fit-month .cal-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.cal-fit-month .main-app {
  gap: 0;
}

body.cal-fit-month .layout--calendar-polls {
  gap: 0;
}

body.cal-fit-month #calendarCard {
  margin: 0;
  padding: 0;
  border-top-width: 2px;
}

body.cal-fit-month .cal-view {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  height: 100%;
}

body.cal-fit-month .cal-hint {
  padding: 4px 10px 0;
  font-size: 10px;
  line-height: 1.3;
}

body.cal-fit-month .cal-view.cal-offmonth-selection {
  grid-template-rows: auto auto 1fr auto;
}

body.cal-fit-month .cal-offmonth-selection .cal-hint {
  display: block;
  padding: 4px 10px 2px;
  font-size: 10px;
}

body.cal-fit-month .cal-toolbar {
  padding: 8px 10px;
  gap: 6px;
}

body.cal-fit-month .cal-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 20px;
}

body.cal-fit-month .cal-btn--today {
  padding: 0 8px;
  font-size: 10px;
}

body.cal-fit-month .cal-title {
  font-size: 1rem;
}

body.cal-fit-month .cal-stats {
  margin-top: 3px;
  gap: 2px 6px;
}

body.cal-fit-month .cal-stats-item {
  font-size: 10px;
}

body.cal-fit-month .cal-board {
  padding: 6px 8px 4px;
  gap: 4px;
}

body.cal-fit-month .cal-dow {
  font-size: 9px;
}

body.cal-fit-month .cal-foot {
  padding: 6px 8px 8px;
  font-size: 9px;
  gap: 4px 8px;
}

body.cal-fit-month .app-footer {
  display: none;
}

body.cal-fit-month .cal-view .calendar-day {
  min-height: 0 !important;
  height: 100%;
}

body.cal-fit-month .cal-view .calendar-day.is-selected {
  transform: none;
  box-shadow:
    0 0 0 2px var(--accent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

@media (min-width: 960px) {
  .day-hero {
    padding: 14px 16px;
  }

  .activity-card {
    padding: 14px 14px 14px 16px;
    gap: 10px;
  }

  .activity-card-head h4 {
    font-size: 1.05rem;
  }

  .activity-poll-preview-bar {
    height: 7px;
  }

  .activity-poll-preview-text {
    font-size: 11px;
  }

  .day-poll-chip {
    font-size: 12px;
  }
}

@media (max-width: 959px) {
  .cal-view .calendar-day:not(.is-muted):not(:disabled):active {
    background: var(--accent-soft);
    filter: none;
  }

  .cal-view .calendar-day.is-selected:active {
    filter: brightness(0.97);
  }

  .day-card {
    padding: 14px;
  }

  .layout--calendar-polls .day-card {
    border-radius: var(--radius-xl);
  }
}

.profile-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-stats {
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.profile-stats-hero {
  position: relative;
  padding: 1rem 1.15rem 0.95rem;
  background: linear-gradient(135deg, #fffefb 0%, #f3f0ff 38%, #fff6ed 100%);
  border-bottom: 1px solid rgba(107, 140, 255, 0.1);
  overflow: hidden;
}

.profile-stats-hero-deco {
  position: absolute;
  inset: 0;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 88% 12%, rgba(107, 140, 255, 0.18) 0, transparent 42%),
    radial-gradient(circle at 12% 82%, rgba(240, 122, 99, 0.14) 0, transparent 40%);
  pointer-events: none;
}

.profile-stats-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.profile-stats-hero-inner .eyebrow {
  margin: 0;
}

.profile-stats-title {
  margin: 0;
  font-size: clamp(1.15rem, 3.4vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.profile-stats-range-hint {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

.profile-stats-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.profile-stats-body {
  padding: 0.85rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-stats-advanced {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-muted);
  overflow: hidden;
}

.profile-stats-advanced-summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.profile-stats-advanced-summary::-webkit-details-marker {
  display: none;
}

.profile-stats-advanced-summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--accent-strong);
  transition: transform 0.16s ease;
}

.profile-stats-advanced[open] .profile-stats-advanced-summary::after {
  transform: rotate(180deg);
}

.profile-stats-advanced-panel {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

.profile-stats-advanced-panel .stats-filters-label {
  margin: 10px 0 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-stats-advanced-panel .stats-custom-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.profile-stats-advanced-panel .stats-custom-panel.hidden {
  display: none;
}

.profile-stats-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.profile-stats-kpi {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.profile-stat-kpi {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--card-muted);
  border: 1px solid var(--border);
  min-width: 0;
}

.profile-stat-kpi-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.profile-stat-kpi-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.profile-stat-kpi-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-stat-kpi-label {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-stat-kpi-value {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.profile-stat-kpi .stats-trend {
  margin: 2px 0 0;
  font-size: var(--text-xs);
}

.profile-stats-chart.stats-chart-card {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--card-muted);
  border: 1px solid var(--border);
}

.profile-stats-chart .stats-chart-head {
  margin-bottom: 10px;
}

.profile-stats-chart .stats-chart-title {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 700;
}

.profile-stats-chart .stats-chart-svg-wrap {
  margin-top: 4px;
}

.profile-peer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.profile-profanity {
  margin-top: 1rem;
}

.profanity-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
}

.profanity-add-form label {
  flex: 1 1 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profanity-word-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.profanity-word-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.35rem 0.35rem 0.75rem;
  border: 1px solid rgba(107, 140, 255, 0.18);
  border-radius: 999px;
  background: linear-gradient(155deg, #fff 0%, #f3f0ff 100%);
  font-size: 0.92rem;
  font-weight: 600;
}

.profanity-delete-btn {
  flex-shrink: 0;
}

/* —— Куда я иду (my-activities) —— */
.my-upcoming-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

.my-upcoming-page-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.my-upcoming-lede {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.my-upcoming-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.my-upcoming-split {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.my-upcoming-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.my-upcoming-rail {
  display: none;
}

@media (min-width: 960px) {
  .my-upcoming-split {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 17rem);
    align-items: start;
  }

  .my-upcoming-rail {
    display: block;
    position: sticky;
    top: 12px;
    align-self: start;
  }

  .my-upcoming-toolbar--mobile {
    display: none;
  }

  .my-upcoming-filters-card {
    display: grid;
    gap: 10px;
    padding: 14px;
  }
}

@media (max-width: 959px) {
  .my-upcoming-rail {
    display: none !important;
  }
}

@media (min-width: 960px) {
  .profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
    gap: 1rem;
    align-items: start;
    max-width: 72rem;
    margin: 0 auto;
    padding-bottom: 2rem;
  }

  #tabPanelProfile.tab-panel:not(.hidden) {
    padding-bottom: 0;
  }

  #tabPanelProfile .profile-card {
    grid-column: 1;
    border-radius: var(--radius-xl);
  }

  #tabPanelProfile .profile-stats {
    grid-column: 2;
    position: sticky;
    top: 12px;
    align-self: start;
    border-radius: var(--radius-xl);
  }

  #tabPanelProfile .profile-boost-banner {
    grid-column: 1 / -1;
  }
}

.my-upcoming-maybe-chip.is-active {
  background: rgba(184, 50, 50, 0.12);
  border-color: rgba(184, 50, 50, 0.35);
  color: var(--accent);
}

.my-upcoming-pending-chip.is-active {
  background: rgba(120, 82, 28, 0.14);
  border-color: rgba(120, 82, 28, 0.38);
  color: #7a5218;
}

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

.my-upcoming-pending-hint {
  color: #7a5218;
}

.my-upcoming-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.my-upcoming-day-group {
  position: relative;
  padding-left: 14px;
  border-left: 2px solid rgba(184, 50, 50, 0.22);
}

.my-upcoming-date-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 0 10px -14px;
  padding: 6px 10px 6px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(243, 235, 224, 0.92);
  backdrop-filter: blur(6px);
}

.my-upcoming-day-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-upcoming-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(28, 22, 20, 0.08);
  background: var(--card);
  box-shadow: var(--shadow);
}

.my-upcoming-card--maybe {
  border-color: rgba(160, 120, 40, 0.35);
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.98), var(--card));
}

.my-upcoming-card-main {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.my-upcoming-rel {
  font-weight: 600;
  color: var(--accent);
}

.my-upcoming-maybe-hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: rgba(120, 90, 30, 0.95);
}

.my-upcoming-empty {
  margin-top: 8px;
}

.my-upcoming-pending {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.my-upcoming-pending p {
  margin: 0;
  font-size: 0.9rem;
}

.my-upcoming-loading {
  padding: 12px 4px;
}

.my-upcoming-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: var(--accent);
  color: #fff;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.app-tabbar-icon-wrap .my-upcoming-nav-badge,
.app-sidebar-icon-wrap .my-upcoming-nav-badge {
  position: absolute;
  top: -4px;
  right: -7px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 4px rgba(43, 33, 24, 0.18);
}

.main-tabs-menu-item .my-upcoming-nav-badge {
  margin-left: 8px;
  vertical-align: middle;
}

.main-tabs-menu-item {
  position: relative;
}

@media (max-width: 959px) {
  .my-upcoming-date-head {
    top: 0;
  }
}

.moderation-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding-bottom: 2rem;
}

.moderation-hero--serious {
  --moderation-hero-gradient: linear-gradient(135deg, #fffefb 0%, #ece8ff 42%, #f8f6ff 100%);
  --moderation-glow: 0 0 40px rgba(107, 140, 255, 0.12);
  position: relative;
  margin-bottom: 0.25rem;
  padding: 1.35rem 1.25rem 1.2rem;
  border-radius: var(--radius-xl);
  background: var(--moderation-hero-gradient);
  border: 1px solid rgba(107, 140, 255, 0.18);
  box-shadow: var(--shadow-soft), var(--moderation-glow);
  overflow: hidden;
}

.moderation-hero-deco {
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(circle at 14% 24%, rgba(107, 140, 255, 0.24) 0, transparent 44%),
    radial-gradient(circle at 86% 10%, rgba(158, 180, 255, 0.2) 0, transparent 40%),
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 11px,
      rgba(107, 140, 255, 0.04) 11px,
      rgba(107, 140, 255, 0.04) 12px
    );
  pointer-events: none;
}

.moderation-layout-grid {
  display: grid;
  gap: 1rem;
}

.moderation-layout-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.moderation-layout-aside {
  min-width: 0;
}

@media (min-width: 960px) {
  .moderation-layout-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
    align-items: start;
  }

  .moderation-layout-aside {
    position: sticky;
    top: 12px;
    align-self: start;
  }
}

.moderation-page-title {
  margin: 0;
  font-size: clamp(1.55rem, 4.5vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.moderation-page-lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-weight: 500;
  max-width: 42rem;
}

.moderation-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.15rem 1.1rem;
  border-color: rgba(107, 140, 255, 0.14);
  box-shadow: var(--shadow-soft);
}

.moderation-card .profile-section-title,
.moderation-card .section-head h3 {
  line-height: 1.25;
}

.moderation-card .section-head {
  align-items: center;
  gap: 0.75rem;
}

.moderation-hero--serious .eyebrow {
  color: #4a6fd9;
}

.moderation-primary-btn {
  background: linear-gradient(135deg, #6b8cff, #4a6fd9);
  border-color: transparent;
}

.moderation-primary-btn:active {
  background: linear-gradient(135deg, #5a7ef0, #3f63cc);
}

.profanity-card,
.content-levels-card,
.content-topics-card {
  margin-top: 0;
}

.moderation-page--combined .profanity-card {
  margin-top: 0;
}

.content-levels-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.content-levels-list {
  display: grid;
  gap: 0.75rem;
}

.content-level-card {
  border: 1px solid rgba(107, 140, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1.05rem;
  background: linear-gradient(155deg, #fff 0%, #f8f6ff 88%);
  box-shadow: var(--shadow-soft);
}

.content-level-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.content-level-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(107, 140, 255, 0.14);
  color: #4a6fd9;
}

.content-level-card-summary,
.content-level-card-meta {
  margin: 0.35rem 0 0;
}

.content-level-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.content-level-form {
  margin-top: 0;
  display: grid;
  gap: 0.75rem;
}

.content-level-flags {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.content-level-form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.content-topics-list {
  display: grid;
  gap: 0.65rem;
}

.content-topic-title {
  display: block;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.content-topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
  gap: 0.75rem;
  align-items: center;
  min-height: 44px;
  padding: 0.2rem 0;
}

.moderation-card .content-topic-select {
  width: 100%;
  padding: 10px 12px;
  font-size: var(--text-sm);
  line-height: 1.25;
  border-color: rgba(107, 140, 255, 0.2);
}

.moderation-card .content-topic-select:focus {
  border-color: #6b8cff;
  box-shadow: 0 0 0 4px rgba(107, 140, 255, 0.14);
}

.moderation-layout-aside .profanity-word-list {
  align-content: flex-start;
}

.moderation-layout-aside .profanity-word-item {
  max-width: 100%;
}

@media (max-width: 640px) {
  .content-levels-head .moderation-primary-btn {
    width: 100%;
  }

  .content-topic-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    min-height: 0;
    padding: 0.1rem 0;
  }
}

/* Круг добра — заглушка */
.kindness-layout {
  display: grid;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 8px;
}

.kindness-hero .kindness-page-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.15;
}

.kindness-hero .kindness-page-lede {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1.45;
}

.kindness-dev {
  position: relative;
  padding: 16px 18px;
  text-align: center;
}

.kindness-dev-badge {
  display: inline-flex;
  margin-bottom: 6px;
  pointer-events: none;
  cursor: default;
}

.kindness-dev-hint {
  margin: 0;
  max-width: 28rem;
  margin-inline: auto;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.kindness-preview-title {
  margin: 0 0 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kindness-feed {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kindness-card {
  padding: 14px 14px 12px;
  text-align: left;
}

.kindness-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.kindness-card-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.kindness-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.kindness-card-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}

.kindness-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.kindness-chip--ask {
  color: #9a4d12;
  background: #fff0d6;
}

.kindness-chip--offer {
  color: #1f6b45;
  background: #e3f5ec;
}

.kindness-card-text {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text);
}

.kindness-card-foot {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

/* Telegram spoiler + fallback вне WebView */
.tg-spoiler {
  background: currentColor;
  color: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.tg-spoiler.revealed,
.tg-spoiler:active {
  background: transparent;
  color: inherit;
}

@media (hover: hover) {
  .tg-spoiler:hover {
    background: transparent;
    color: inherit;
  }
}
