:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1d2939;
  --accent: #358ef1;
  --accent-hover: #426636;
  --muted: #1a2e56;
  --shadow: 0 16px 40px rgb(243 223 14 / 12%);
}

/* start: Индикатор сети — стили верхней полоски «Офлайн / Онлайн» */
.network-status-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 6px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #c0392b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(0);
  transition: transform 0.25s ease, background 0.25s ease;
  pointer-events: none;
}

.network-status-bar.is-hidden {
  transform: translateY(-100%);
}

.network-status-bar.is-online {
  background: #2e7d32;
}

.network-status-bar.is-syncing {
  background: #1565c0;
}

.network-status-text {
  display: inline-block;
  max-width: 95vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* end: Индикатор сети — стили верхней полоски «Офлайн / Онлайн» */

/* start: Маркер офлайн-элементов — задачи/привычки, ожидающие отправки на сервер */
.entry-item.is-pending-sync,
.fm-friends-list li.is-pending-sync {
  position: relative;
}

.entry-item.is-pending-sync::after,
.fm-friends-list li.is-pending-sync::after {
  content: "⏳";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.75;
  pointer-events: none;
}
/* end: Маркер офлайн-элементов — задачи/привычки, ожидающие отправки на сервер */

/* start: Кнопки, которым нужна сеть — приглушаем при офлайн */
body.is-offline .needs-network,
body.is-offline [data-needs-network="true"] {
  opacity: 0.45;
  filter: grayscale(0.4);
  pointer-events: none;
  cursor: not-allowed;
}
/* end: Кнопки, которым нужна сеть — приглушаем при офлайн */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(
160deg, #eef2ff 0%, var(--bg) 40%, #f8fafc 100%);
  color: var(--text);
}

.welcome-page {
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0px 0px 0px;
  display: grid;
  gap: 22px;
}

.welcome-page.has-rocket-fab {
  padding-bottom: 88px;
}

.hero {
  text-align: center;
  padding: 14px 10px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}

.hero p {
  margin: 0 auto;
  max-width: 680px;
  line-height: 1.55;
  color: var(--muted);
  font-size: clamp(0.96rem, 2.5vw, 1.12rem);
}

.slider-section {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.slider-window {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px;
  width: min(100%, 420px);
}

.slider-track {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  max-height: 72vh;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e4e7ec;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.nav-btn {
  height: 44px;
  width: 44px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.nav-btn:active {
  transform: translateY(0);
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dot {
  border: none;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #d0d5dd;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.dot.is-active {
  background: var(--accent);
  transform: scale(1.2);
}

.auth-section {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.auth-form {
  display: none;
  gap: 8px;
}

.auth-form.is-active {
  display: grid;
}

.login-only-form {
  gap: 10px;
}

.phone-pill {
  border-radius: 999px;
  padding: 14px 18px;
}

.verify-form {
  margin-top: 10px;
}

.name-group {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 0.92rem;
  color: var(--muted);
}

.field-input {
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 1rem;
  outline: none;
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.wide-btn {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.wide-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.auth-message {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 0.94rem;
  color: var(--muted);
}

.auth-message.is-error {
  color: #b42318;
}

.auth-message.is-success {
  color: #027a48;
}

.hidden {
  display: none !important;
}

/* start: Нижняя панель — настройки слева от ракеты */
.bottom-fab-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-btn {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #4b5563;
  font-size: 3.84rem;
  line-height: 1;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}
/* end: Нижняя панель — настройки слева от ракеты */

.quote-onboarding {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 12px;
}

.quote-onboarding-dialog {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
}

/* start: Настройки — полноэкранная страница как профиль */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-dialog {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
  padding: 50px 16px 16px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.settings-views {
  flex: 1;
  overflow: hidden;
}
/* end: Настройки — полноэкранная страница как профиль */

.settings-header,
.settings-footer,
.quote-head {
  align-items: center;
  gap: 10px;
}

.settings-header,
.quote-head {
  display: flex;
  justify-content: space-between;
}

.settings-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  margin-bottom: 1cm;
}

.settings-header .settings-back-btn + h3 {
  margin-left: 0;
}

.settings-views {
  position: relative;
  min-height: 200px;
  margin-top: 0;
}

.settings-view {
  display: grid;
  gap: 12px;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: auto;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.settings-view.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
}

.settings-view.is-leaving {
  opacity: 0;
  transform: translateX(-12px);
}

.settings-nav {
  display: grid;
  gap: 8px;
}

.settings-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.settings-nav-icon {
  flex-shrink: 0;
  width: 1.4rem;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
}

.settings-nav-label {
  flex: 1 1 auto;
  min-width: 0;
}

.settings-nav-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.settings-nav-item:active {
  transform: scale(0.99);
}

.settings-admin-archive-btn {
  margin-top: 12px;
}

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

.settings-info-card {
  width: 100%;
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
}

.settings-back-btn {
  flex-shrink: 0;
}

.settings-header-spacer {
  width: 44px;
}

.settings-header h3 {
  margin: 0;
  text-align: center;
  color: var(--text);
}

.settings-dialog,
.settings-view {
  color: var(--text);
}

.settings-plain-text {
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
}

/* start: Уведомления — заголовок чуть жирнее */
.settings-notifications-title {
  font-weight: 650;
}
/* end: Уведомления — заголовок чуть жирнее */

/* Страница «Тема оформления»: превью главного экрана */
.theme-preview {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  user-select: none;
}

.theme-preview-main {
  padding: 10px;
  border-radius: 14px;
  background: var(--preview-main-bg, #358ef1);
  color: var(--preview-main-fg, #fff);
}

.theme-preview-calendar {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #e8eaec;
  overflow: hidden;
  margin-bottom: 8px;
}

.theme-preview-week,
.theme-preview-week-nums {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.theme-preview-week {
  font-size: 0.55rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  padding: 4px 2px 2px;
}

.theme-preview-week-nums {
  font-size: 0.62rem;
  font-weight: 600;
  color: #334155;
  padding: 0 2px 6px;
}

.theme-preview-week-nums .is-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--preview-accent, #358ef1);
  color: #fff;
}

.theme-preview-cards {
  display: grid;
  gap: 6px;
}

.theme-preview-card {
  background: #fff;
  border: 1px solid #e8eaec;
  border-radius: 10px;
  padding: 6px 8px;
  color: #1e293b;
}

.theme-preview-card h4 {
  margin: 0 0 4px;
  font-size: 0.68rem;
}

.theme-preview-card p {
  margin: 0 0 2px;
  font-size: 0.58rem;
  color: #64748b;
}

.theme-colors-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.theme-colors-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px;
  scrollbar-width: none;
}

.theme-colors-track::-webkit-scrollbar {
  display: none;
}

.theme-color-swatch {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  scroll-snap-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.theme-color-swatch:hover {
  transform: scale(1.06);
}

.theme-color-swatch.is-selected {
  border-color: #1e293b;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1e293b;
}

.theme-color-swatch[data-color-id="white"] {
  border-color: #d1d5db;
}

.theme-colors-nav {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #475569;
  flex-shrink: 0;
}

.theme-colors-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.theme-save-btn {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .theme-colors-nav {
    display: none;
  }
}

.settings-muted {
  color: var(--text);
  font-size: 0.92rem;
}

/* Цитата дня */
.quote-section {
  --quote-font-main: Georgia, "Times New Roman", serif;
  --quote-font-meta: "Segoe UI", system-ui, sans-serif;
  margin: 6px 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  align-self: center;
}

.quote-section[data-block-card="quote"] {
  grid-column: 1 / -1;
}

.quote-card {
  perspective: 900px;
  width: 100%;
}

/* Размер блока цитатат дня */
.quote-card-inner {
  position: relative;
  min-height: 86px;
  transform-style: preserve-3d;
  transition: transform 0.55s ease;
}

.quote-card.is-revealed .quote-card-inner {
  transform: rotateY(180deg);
}

.quote-card-face {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fffef8;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.quote-card-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: center;
}

.quote-card-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  cursor: pointer;
  transform: rotateY(180deg);
}

.quote-title {
  margin: 0;
  font-family: var(--quote-font-main);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.quote-text {
  margin: 4px 0 2px;
  font-family: var(--quote-font-main);
  font-size: 0.95rem;
  line-height: 1.35;
}

.quote-meta {
  margin: 0;
  font-family: var(--quote-font-meta);
  font-size: 0.82rem;
  line-height: 1.25;
  opacity: 0.55;
}

/* анимация */
.quote-reveal-hint {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.quote-card:not(.is-revealed) .quote-reveal-hint::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 214, 120, 0.95) 50%, transparent 65%);
  background-size: 220% 220%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: quoteRevealSweep 2.8s ease-in-out infinite;
}

@keyframes quoteRevealSweep {
  0% {
    background-position: 120% 50%;
    opacity: 0.35;
  }
  50% {
    background-position: 0% 50%;
    opacity: 0.95;
  }
  100% {
    background-position: -120% 50%;
    opacity: 0.35;
  }
}
/* end: анимация */

.quote-categories {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.stats-box {
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.theme-default {
  --theme-bg: #f8fafc;
}

.theme-paper {
  background-image: repeating-linear-gradient(0deg, #faf3dd, #faf3dd 24px, #f3e8c8 24px, #f3e8c8 25px);
}

.theme-cartoon {
  background: linear-gradient(135deg, #dbeafe, #fef3c7);
}

.theme-minimal {
  background: #f4f4f5;
}

.main-block {
  background: var(--main-block-bg, #358ef1);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  transition: background-color 0.35s ease;
}

/* Заголовки и текст внутри карточек — фиксированный цвет, не зависит от темы фона */
.main-block .calendar-section,
.main-block .blocks-grid,
.main-block .quote-section,
.main-block .planner-card,
.main-block .planner-card h3,
.main-block .card-head h3 {
  color: var(--text);
}

.main-block h2 {
  margin: 0;
}

.main-block-subtitle {
  margin: 8px 0 14px;
  color: var(--muted);
}

/* КАЛЕНДАРЬ — одна карточка: неделя со свайпом, панель месяца */
.calendar-section {
  margin-bottom: 12px;
  padding: 0;
}

.calendar-card {
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8eaec;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.calendar-week-swipe {
  touch-action: pan-y;
  background: transparent;
}

.calendar-week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  box-shadow: inset 0 -1px 0 #f1f5f9;
}

.calendar-week-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px 2px 8px;
  border: none;
  border-right: 1px solid #f1f5f9;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: #334155;
}

.calendar-week-cell:last-child {
  border-right: none;
}

.calendar-week-cell:active {
  background: #f8fafc;
}

.calendar-week-cell.is-today .calendar-week-cell-num {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.calendar-week-cell.is-selected:not(.is-today) .calendar-week-cell-num {
  box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: 999px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.calendar-week-cell.is-weekend {
  background: #fafbfc;
  color: #64748b;
}

.calendar-week-cell.is-holiday {
  background: #f0f7ff;
  color: #1d4ed8;
}

.calendar-week-cell-label {
  font-size: clamp(0.62rem, 2.3vw, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.calendar-week-cell-num {
  font-size: clamp(0.92rem, 3vw, 1.02rem);
  font-weight: 600;
  line-height: 1.2;
}

.calendar-month-panel {
  overflow: hidden;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.2s ease;
}

.calendar-month-panel:not(.is-open) {
  border-top-width: 0;
}

.calendar-month-panel.is-open {
  max-height: 2200px;
  opacity: 1;
}

.calendar-month-panel-inner {
  padding: 12px 12px 14px;
  display: grid;
  gap: 10px;
}

.calendar-month-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eceff3;
}

.calendar-month-title {
  flex: 1 1 120px;
  text-align: center;
  font-weight: 650;
  font-size: 0.95rem;
  color: #0f172a;
  order: 0;
}

.calendar-month-nav {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid #e8eaec;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-month-nav:active {
  background: #f1f5f9;
}

.calendar-month-close {
  min-height: 40px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.calendar-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  text-align: center;
  font-size: clamp(0.62rem, 2.3vw, 0.72rem);
  font-weight: 600;
  color: #94a3b8;
  padding: 2px 0 0;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #e8eaec;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.calendar-month-day {
  min-height: 44px;
  border: none;
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  padding: 4px;
  margin: 0;
}

.calendar-month-day:nth-child(7n) {
  border-right: none;
}

.calendar-month-day.is-outside {
  color: #cbd5e1;
  background: #fafbfc;
}

.calendar-month-day.is-today {
  background: color-mix(in srgb, var(--accent) 16%, #ffffff);
  color: var(--accent);
  font-weight: 700;
}

.calendar-month-day.is-selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.calendar-month-day.is-weekend {
  background: #fafbfc;
  color: #64748b;
}

.calendar-month-day.is-holiday {
  background: #f0f7ff;
  color: #1d4ed8;
}

.calendar-day-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.calendar-day-panel-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  min-width: 0;
  flex: 1;
}

.calendar-add-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.calendar-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.calendar-readonly-hint {
  font-size: 0.82rem;
  color: #64748b;
  padding: 2px 0;
}

.calendar-day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.calendar-day-item {
  border: 1px solid #e8eaec;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.calendar-day-item-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.calendar-day-item-title {
  margin: 0;
  font-size: 0.9rem;
  flex: 1;
  word-break: break-word;
}

.calendar-day-item.is-done .calendar-day-item-title {
  color: #64748b;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.calendar-day-item-meta {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.calendar-day-item-type {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-empty-day-hit {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  border-radius: 10px;
  border: 1px dashed #d1d5db;
  background: #fff;
  color: #64748b;
  font-size: 0.84rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .calendar-week-row {
    grid-template-columns: repeat(7, minmax(28px, 1fr));
  }

  .calendar-week-cell-label {
    font-size: 0.56rem;
    letter-spacing: 0.02em;
  }
}

.blocks-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.planner-card {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  padding: 12px;
  background: #fcfcfd;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

/* start: полоска прогресса дня между заголовком и кнопкой */
.card-head-with-day-meter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 8px;
  row-gap: 0;
}

.card-head-with-day-meter h3 {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  white-space: nowrap;
}

.card-head-with-day-meter > .icon-btn {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  flex-shrink: 0;
}

.card-head .icon-btn {
  cursor: pointer;
}

.card-day-meter {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: end;
  width: auto;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 4px 0 0;
}

.card-day-meter-track {
  width: 7.5rem;
  max-width: 100%;
  height: 10.5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted, #64748b) 18%, transparent);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.06);
}

.card-day-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #facc15 0%,
    #a3e635 55%,
    #22c55e 100%
  );
  box-shadow: 0 0 10px color-mix(in srgb, #22c55e 35%, transparent);
  transition: width 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.card-day-meter-caption {
  margin: 0;
  width: 7.5rem;
  max-width: 100%;
  font-size: 0.58rem;
  line-height: 1.15;
  color: var(--muted);
  opacity: 0.55;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* end: полоска прогресса дня между заголовком и кнопкой */

.card-head h3 {
  margin: 0;
  font-size: 1rem;
  user-select: none;
  flex: 1;
  min-width: 0;
}

.planner-card.is-collapsed .entries-list > li {
  display: none;
}

.icon-btn {
  border: 1px solid #c7d7fe;
  background: #eef2ff;
  color: var(--accent);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.entries-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.entry-item {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
}

.entry-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* изменения по чекбоксу */
.entry-left input[type="checkbox"],
.calendar-day-item input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #16a34a;
  cursor: pointer;
}

.entry-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.entry-left .entry-title {
  margin: 0;
}

.entry-title {
  margin: 0;
  font-size: 0.95rem;
  word-break: break-word;
}

.entry-item.is-done .entry-title {
  color: #64748b;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.entry-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.entry-actions {
  display: flex;
  gap: 6px;
}

.mini-btn {
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  padding: 1px 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

.editor-panel {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

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

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin: 4px 0;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin: 6px 0;
}

.calendar-field {
  display: none;
}

.calendar-field.visible {
  display: block;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-actions .wide-btn {
  width: auto;
  min-width: 98px;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 0.84rem;
}

.habit-frequency-row {
  display: grid;
  gap: 6px;
}

/* start: привычки — строка названия горизонтально, подписи дней над кружками справа */
:root {
  --habit-day-column-size: 22px;
  --habit-week-grid-width: calc(var(--habit-day-column-size) * 7);
}

.entry-item.habit-entry {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.entry-item.habit-entry .habit-entry-main {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.entry-item.habit-entry .habit-entry-main .entry-title {
  flex: 1 1 auto;
  min-width: 0;
  word-break: normal;
  overflow-wrap: anywhere;
}

.entry-item.habit-entry .habit-week-row {
  align-self: flex-end;
  display: grid;
  grid-template-columns: repeat(7, var(--habit-day-column-size));
  width: var(--habit-week-grid-width);
  align-items: center;
  justify-items: center;
}

.entry-item.habit-entry .habit-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  width: 100%;
}

.habit-days-header-row {
  display: grid;
  grid-template-columns: 1fr var(--habit-week-grid-width);
  align-items: end;
  margin-bottom: 2px;
  list-style: none;
  border: none;
  padding: 0 8px;
  background: transparent;
  box-sizing: border-box;
}

.habit-days-header-row .habit-days-spacer {
  min-width: 0;
}

.habit-days-labels-grid {
  display: grid;
  grid-template-columns: repeat(7, var(--habit-day-column-size));
  width: var(--habit-week-grid-width);
  align-items: end;
  justify-items: center;
}

.habit-days-header-row .habit-day-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  width: var(--habit-day-column-size);
}

.habit-day-placeholder {
  width: var(--habit-day-column-size);
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--muted, #94a3b8) 32%, transparent);
  font-size: 0.68rem;
  font-weight: 300;
  line-height: 1;
  user-select: none;
}

.habit-day-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  align-self: center;
  justify-self: center;
}

.habit-day-dot.is-on {
  background: #22c55e;
  border-color: #16a34a;
}

.habit-day-dot.is-locked {
  cursor: not-allowed;
}

.habit-day-dot.is-locked:not(.is-on) {
  background: #f8fafc;
  border-color: #dbe3ef;
}

/* start: Привычки — маленькая подсказка для недоступных кружков */
.habit-dot-hint-popover {
  position: fixed;
  z-index: 100;
  max-width: min(260px, calc(100vw - 24px));
  padding: 7px 10px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.2);
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.habit-dot-hint-popover.hidden {
  display: none;
}
/* end: Привычки — маленькая подсказка для недоступных кружков */
/* end: привычки — строка названия горизонтально, подписи дней над кружками справа */

.compact-btn {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.settings-footer {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  padding-bottom: 1cm;
}

.footer-btn {
  width: min(280px, 100%);
  flex: 0 1 auto;
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* start: Настройки — кнопка выхода как белая плашка с отступом снизу */
#logoutBtn.footer-btn {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

#logoutBtn.footer-btn:hover {
  background: #f8fafc;
  color: #111827;
}
/* end: Настройки — кнопка выхода как белая плашка с отступом снизу */

.main-block-config {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.block-config-icon {
  flex-shrink: 0;
  width: 1.35rem;
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
}

.block-config-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px 8px;
  background: #fff;
  position: relative;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.block-config-item.is-block-dragging {
  opacity: 0.98;
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
  border-color: #c7d2fe;
  box-shadow:
    0 0 0 1px rgb(99 102 241 / 0.12),
    0 4px 14px rgb(15 23 42 / 0.07);
  transform: scale(1.01);
  z-index: 1;
}

.drag-handle {
  border: none;
  background: transparent;
  cursor: grab;
  color: #64748b;
  font-size: 1rem;
  touch-action: none;
  padding: 8px 4px;
  margin: -4px 0;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: 0.2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .switch-slider {
  background: #22c55e;
}

.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}

.secondary-btn {
  background: #f16fa4;
}

.secondary-btn:hover {
  background: #667085;
}

@media (max-width: 640px) {
  .welcome-page {
    padding: 16px 10px 24px;
    gap: 14px;
  }

  .slider-section {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .nav-btn {
    display: none;
  }

  .slider-window {
    padding: 7px;
    border-radius: 14px;
    width: min(100%, 380px);
  }

  .auth-section {
    padding: 14px;
    border-radius: 14px;
  }

  .main-block,
  .editor-panel {
    padding: 14px;
    border-radius: 14px;
  }
}

/* start: Эффективный режим — плавающая кнопка и страница */
.rocket-fab {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #4b5563;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.rocket-fab-ship {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.rocket-fab-emoji {
  font-size: 4.646rem;
  line-height: 1;
  transform: translateY(-2px);
}

.rocket-fab-porthole {
  position: absolute;
  left: var(--rocket-fab-porthole-left, 50%);
  top: var(--rocket-fab-porthole-top, 46%);
  transform: translate(-50%, -50%);
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #358ef1;
  font-size: 0.78rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1.5px solid #2a6fc4;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  touch-action: none;
}

.rocket-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rocket-dialog {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
  padding: 50px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.rocket-header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.rocket-panel > .rocket-dialog > .rocket-header {
  margin-bottom: 1cm;
}

.rocket-header h3 {
  margin: 0;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text);
}

.rocket-header-spacer {
  width: 44px;
}

.rocket-panel-body {
  display: grid;
  gap: 14px;
  flex: 1;
  overflow: auto;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}

/*
// start: Бургеры админа — стили строки с кнопкой ☰
.rocket-panel-section-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 6px;
}

.rocket-panel-section-row > [data-rocket-section] {
  min-width: 0;
}
// end: Бургеры админа — стили строки с кнопкой ☰
*/

.rocket-hero {
  padding: 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  margin-bottom: -2px;
}

.rocket-hero-stage {
  position: relative;
  width: min(12rem, 52vw);
  height: min(12rem, 52vw);
  margin: 0 auto;
}

.rocket-streak-caption {
  margin: -1cm 0 0;
  color: #1f2937;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.rocket-streak-days-word {
  font-weight: inherit;
}

.rocket-hero-flame {
  position: absolute;
  left: var(--rocket-hero-emoji-left, 50%);
  top: calc(var(--rocket-hero-emoji-top, 50%) + 14%);
  width: clamp(2rem, 9vw, 2.6rem);
  height: clamp(2.4rem, 11vw, 3.1rem);
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 70% at 50% 20%, #fff6a8 0%, transparent 68%),
    radial-gradient(ellipse 80% 100% at 50% 80%, #ffb347 0%, #ff6a00 52%, #e62e00 78%, transparent 100%);
  border-radius: 50% 50% 42% 42%;
  filter: blur(0.4px);
  z-index: 0;
}

.rocket-hero-emoji {
  position: absolute;
  left: var(--rocket-hero-emoji-left, 50%);
  top: var(--rocket-hero-emoji-top, 50%);
  transform: translate(-50%, -50%);
  font-size: clamp(4.3rem, 19vw, 5.5rem);
  line-height: 1;
  z-index: 1;
}

.rocket-streak-porthole {
  position: absolute;
  left: var(--rocket-hero-porthole-left, 50%);
  top: var(--rocket-hero-porthole-top, 46%);
  transform: translate(-50%, -50%);
  min-width: 36px;
  padding: 0 6px;
  font-size: clamp(4.032rem, 17.28vw, 5.184rem);
  font-weight: 800;
  line-height: 1;
  color: #358ef1;
  text-align: center;
  z-index: 2;
}

/* start: Эффективный режим — ежедневная анимация ракеты */
.rocket-hero-stage.is-anim-launch .rocket-hero-emoji {
  animation: rocketHeroLaunch 1.15s cubic-bezier(0.22, 0.85, 0.28, 1) forwards;
}

.rocket-hero-stage.is-anim-launch .rocket-hero-flame {
  animation: rocketHeroFlame 1.15s ease-out forwards;
}

.rocket-hero-stage.is-anim-launch .rocket-streak-porthole {
  animation: rocketStreakPop 1.15s cubic-bezier(0.22, 0.85, 0.28, 1) forwards;
}

.rocket-hero-stage.is-anim-stall .rocket-hero-emoji {
  animation: rocketHeroStall 1.35s ease-in-out forwards;
}

.rocket-hero-stage.is-anim-stall .rocket-hero-flame {
  animation: rocketHeroStallSmoke 1.35s ease-in-out forwards;
}

.rocket-hero-stage.is-anim-stall .rocket-streak-porthole {
  animation: rocketStreakShake 1.35s ease-in-out forwards;
}

@keyframes rocketHeroLaunch {
  0% {
    transform: translate(-50%, -50%) translateY(10px);
  }
  38% {
    transform: translate(-50%, -50%) translateY(-32px);
  }
  68% {
    transform: translate(-50%, -50%) translateY(-22px);
  }
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
}

@keyframes rocketHeroFlame {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }
  18%,
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
  }
}

@keyframes rocketStreakPop {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
  }
  42% {
    transform: translate(-50%, -50%) scale(1.24);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes rocketHeroStall {
  0%,
  100% {
    transform: translate(-50%, -50%) translate(0, 0) rotate(0deg);
  }
  14% {
    transform: translate(-50%, -50%) translate(-9px, 2px) rotate(-7deg);
  }
  28% {
    transform: translate(-50%, -50%) translate(10px, 0) rotate(6deg);
  }
  42% {
    transform: translate(-50%, -50%) translate(-8px, 3px) rotate(-5deg);
  }
  56% {
    transform: translate(-50%, -50%) translate(7px, 1px) rotate(4deg);
  }
  70% {
    transform: translate(-50%, -50%) translate(-5px, 2px) rotate(-3deg);
  }
}

@keyframes rocketHeroStallSmoke {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  20%,
  80% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(0.95);
    filter: blur(2px) grayscale(0.35);
  }
}

@keyframes rocketStreakShake {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  25% {
    transform: translate(calc(-50% - 4px), -50%) scale(0.94);
  }
  50% {
    transform: translate(calc(-50% + 5px), -50%) scale(0.96);
  }
  75% {
    transform: translate(calc(-50% - 3px), -50%) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rocket-hero-stage.is-anim-launch .rocket-hero-emoji,
  .rocket-hero-stage.is-anim-launch .rocket-hero-flame,
  .rocket-hero-stage.is-anim-launch .rocket-streak-porthole,
  .rocket-hero-stage.is-anim-stall .rocket-hero-emoji,
  .rocket-hero-stage.is-anim-stall .rocket-hero-flame,
  .rocket-hero-stage.is-anim-stall .rocket-streak-porthole {
    animation: none;
  }
}
/* end: Эффективный режим — ежедневная анимация ракеты */

.rocket-stats-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.rocket-stat-tile {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid #d0d5dd;
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.rocket-stat-tile-label {
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--muted);
}

.rocket-stat-tile-value {
  font-size: clamp(1.2rem, 5vw, 1.55rem);
  font-weight: 800;
  color: #358ef1;
  line-height: 1;
}

.rocket-change-goal-btn {
  margin-top: 10px;
}

.rocket-change-goal-btn,
#rocketBuyCanisterBtn {
  background: #358ef1;
  color: #fff;
}

.rocket-change-goal-btn:hover,
#rocketBuyCanisterBtn:hover {
  background: #2a7ad4;
  color: #fff;
}

.rocket-marathon h4,
.rocket-goals-list h4,
.rocket-calendar-section h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.rocket-marathon-caption {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.rocket-marathon-track {
  height: 12px;
  border-radius: 999px;
  background: #e4e7ec;
  overflow: hidden;
}

.rocket-marathon-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5, #22c55e);
  transition: width 0.25s ease;
}

.rocket-wallet {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
}

.rocket-wallet-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 2.5em;
}

.rocket-wallet-line {
  margin: 0;
}

.rocket-goal-path {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 8px 14px;
  padding: 0 4px;
}

.rocket-goal-path::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 4px;
  background: #e4e7ec;
  border-radius: 999px;
  transform: translateY(-50%);
  z-index: 0;
}

.rocket-goal-path-segment {
  position: absolute;
  left: 8px;
  top: 50%;
  height: 4px;
  background: linear-gradient(90deg, #4f46e5, #22c55e);
  border-radius: 999px;
  transform: translateY(-50%);
  z-index: 0;
}

.rocket-goal-node {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  justify-items: center;
  background: none;
  border: none;
  cursor: default;
  padding: 0;
  font: inherit;
  color: #667085;
}

.rocket-goal-node-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid #d0d5dd;
}

.rocket-goal-node-label {
  font-size: 0.72rem;
  font-weight: 600;
}

.rocket-goal-node.is-current .rocket-goal-node-dot {
  border-color: var(--accent, #4f46e5);
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.rocket-goal-node.is-current .rocket-goal-node-label {
  color: var(--accent, #4f46e5);
  font-weight: 800;
}

.rocket-goal-node.is-completed .rocket-goal-node-dot {
  border-color: #12b76a;
  background: #12b76a;
}

.rocket-goal-node.is-skipped {
  opacity: 0.55;
  text-decoration: line-through;
}

.rocket-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.rocket-calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 4px;
}

.rocket-cal-cell {
  position: relative;
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  color: #667085;
  background: #f2f4f7;
  cursor: default;
  padding: 0;
  isolation: isolate;
}

.rocket-cal-cell.is-outside {
  opacity: 0.35;
}

.rocket-cal-cell.is-done {
  background: #12b76a;
  color: #fff;
}

.rocket-cal-cell.is-perfect {
  overflow: hidden;
  background: linear-gradient(145deg, #f5c451, #e8a317);
  color: #3b2f04;
  font-weight: 700;
  z-index: 0;
}

.rocket-cal-cell.is-perfect::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, 0.95) 0 0.9px, transparent 1.4px),
    radial-gradient(circle at 70% 22%, rgba(255, 255, 255, 0.8) 0 0.65px, transparent 1px),
    radial-gradient(circle at 48% 68%, rgba(255, 255, 255, 0.9) 0 0.75px, transparent 1.2px),
    radial-gradient(circle at 82% 62%, rgba(255, 255, 255, 0.7) 0 0.55px, transparent 0.95px),
    radial-gradient(circle at 35% 52%, rgba(255, 255, 255, 0.55) 0 0.5px, transparent 0.85px),
    radial-gradient(circle at 58% 38%, rgba(255, 255, 255, 0.65) 0 0.45px, transparent 0.8px);
  animation: rocket-perfect-stars 2.6s ease-in-out infinite;
}

.rocket-cal-cell.is-perfect::after {
  content: "✦";
  position: absolute;
  right: 14%;
  bottom: 16%;
  left: auto;
  top: auto;
  z-index: 0;
  font-size: 0.38em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.85);
  pointer-events: none;
  animation: rocket-perfect-star-spark 1.9s ease-in-out infinite 0.45s;
}

@keyframes rocket-perfect-stars {
  0%, 100% { opacity: 0.2; }
  35% { opacity: 0.95; }
  55% { opacity: 0.35; }
  78% { opacity: 1; }
}

@keyframes rocket-perfect-star-spark {
  0%, 100% { opacity: 0.15; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(18deg); }
}

.rocket-cal-cell.is-missed {
  background: #98a2b3;
  color: #fff;
}

.rocket-cal-cell.is-canister {
  background: #2e90fa;
  color: #fff;
}

.rocket-cal-cell.is-today {
  outline: 2px solid var(--accent, #4f46e5);
  outline-offset: 1px;
}

.rocket-calendar-legend {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  font-size: 0.78rem;
  color: var(--muted);
}

.rocket-calendar-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rocket-cal-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  display: inline-block;
}

.rocket-cal-dot.is-done {
  background: #12b76a;
}

.rocket-cal-dot.is-perfect {
  background: linear-gradient(145deg, #f5c451, #e8a317);
}

.rocket-cal-dot.is-missed {
  background: #98a2b3;
}

.rocket-cal-dot.is-canister {
  background: #2e90fa;
}

.rocket-goal-dialog {
  width: min(400px, 100%);
}

.rocket-goal-hint {
  margin: 8px 0 0;
  color: var(--muted, #667085);
  font-size: 0.92rem;
  line-height: 1.45;
}

.rocket-goal-options {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
}

.rocket-goal-option {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  background: #fff;
  cursor: pointer;
  font-size: 0.95rem;
}

.rocket-goal-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rocket-goal-option.is-selected {
  border-color: var(--accent, #4f46e5);
  background: #eef2ff;
}

/*
// start: Бургеры админа — стили перетаскивания строки
.rocket-panel-section-row.is-section-dragging {
  opacity: 0.98;
  z-index: 1;
}

.rocket-panel-section-row.is-section-dragging [data-rocket-section] {
  box-shadow: 0 4px 14px rgb(15 23 42 / 0.08);
}
// end: Бургеры админа — стили перетаскивания строки
*/

@media (max-width: 519px) {
  .settings-btn,
  .friendly-marathon-fab-icon {
    font-size: 3.2rem;
  }

  .rocket-stat-tile-label {
    font-size: 0.62rem;
  }

  .rocket-fab-emoji {
    font-size: 3.872rem;
  }
}
/* end: Эффективный режим — плавающая кнопка и страница */

/* start: Дружеский марафон — нижняя кнопка и страница */
.friendly-marathon-fab {
  position: relative;
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #4b5563;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.friendly-marathon-fab-icon {
  display: inline-block;
  font-size: 3.84rem;
  line-height: 1;
  transform: scaleX(-1);
}

.welcome-page.has-rocket-fab .main-block {
  padding-bottom: 110px;
}

.fm-full-page,
.fm-sub-page {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fm-sub-page {
  z-index: 41;
}

.fm-page-header {
  flex-shrink: 0;
  padding: 50px 16px 0;
  margin-bottom: 1cm;
}

.fm-page-header + .fm-full-page-body {
  padding-top: 0;
}

.fm-full-page-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  box-sizing: border-box;
}

.fm-form-body {
  align-items: stretch;
  max-width: 420px;
}

/* start: Страница «Добавить друга» — плашки (поле и кнопки) на 30 % шире */
#addFriendModal .fm-form-body {
  max-width: 546px;
  width: min(100%, 546px);
  margin-left: auto;
  margin-right: auto;
  align-items: center;
}

/* end: Страница «Добавить друга» — плашки (поле и кнопки) на 30 % шире */

.fm-stretch {
  width: 100%;
  box-sizing: border-box;
}

.fm-stretch-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fm-stretch-actions .wide-btn {
  width: 100%;
}

.fm-avatar-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
}

.fm-avatar-canvas {
  width: 80px;
  height: 80px;
  border-radius: 999px;
  display: block;
}

/* start: Дружеский марафон — эмодзи-аватар и портрет */
.fm-profile-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

/* start: Дружеский марафон — имя между аватаром и кружками портрета */
.fm-profile-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}
/* end: Дружеский марафон — имя между аватаром и кружками портрета */

.fm-emoji-avatar-circle {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 3.3rem;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.fm-emoji-avatar-circle.is-fallback {
  font-size: 2.03rem;
  font-weight: 700;
  color: #6b7280;
}

.fm-portrait-rings {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 360px;
}

.fm-portrait-ring {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fm-portrait-ring.is-placeholder {
  opacity: 0.55;
  cursor: pointer;
}

.fm-portrait-ring.is-filled {
  background: #fff;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.fm-portrait-ring.is-filled:hover,
.fm-portrait-ring.is-filled:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

/* start: Портрет — всплывающая подсказка у заполненного кружка */
.fm-portrait-hint-popover {
  position: fixed;
  z-index: 55;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.fm-portrait-hint-popover.hidden {
  display: none;
}

.fm-portrait-hint-title {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fm-portrait-hint-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
}
/* end: Портрет — всплывающая подсказка */

.fm-slot .fm-emoji-avatar-circle {
  width: 100%;
  height: 100%;
  font-size: 2.625rem;
  border: none;
  box-shadow: none;
}

.emoji-avatar-page-body {
  align-items: stretch;
  max-width: 720px;
}

/* start: Аватар — акцент на приглашении к тесту (серые кружки характера) */
.emoji-avatar-page-body.is-focus-test .emoji-avatar-pick-title,
.emoji-avatar-page-body.is-focus-test .emoji-avatar-picker-shell {
  opacity: 0.35;
  pointer-events: none;
}

.emoji-avatar-page-body.is-focus-test .emoji-portrait-test-block {
  margin-top: 4px;
  padding: 16px 14px 18px;
  border-radius: 14px;
  background: rgba(53, 142, 241, 0.08);
  box-shadow: 0 0 0 2px rgba(53, 142, 241, 0.35);
  animation: emojiPortraitTestPulse 1.6s ease-in-out 2;
}

@keyframes emojiPortraitTestPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(53, 142, 241, 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(53, 142, 241, 0.2);
  }
}
/* end: Аватар — акцент на приглашении к тесту */

/* start: Аватар — кружок превью по центру */
.emoji-avatar-preview-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 8px 0 6px;
}

.emoji-avatar-page-preview {
  width: 90px;
  height: 90px;
  min-width: 80px;
  min-height: 80px;
  max-width: 100px;
  max-height: 100px;
}
/* end: Аватар — кружок превью по центру */

/* start: Аватар — заголовок и сетка смайлов 7×4 */
.emoji-avatar-pick-title {
  text-align: center;
  font-weight: 600;
  margin: 0 0 8px;
  color: #374151;
}

.emoji-avatar-picker-shell {
  position: relative;
  margin-bottom: 16px;
}

.emoji-avatar-picker-toggle {
  display: block;
  margin: 0 auto 6px;
  width: 36px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-size: 0.75rem;
  cursor: pointer;
  line-height: 1;
}

.emoji-avatar-picker-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
}

.emoji-avatar-picker-backdrop.is-visible {
  display: block;
}

.emoji-avatar-picker-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  padding: 4px 0 10px;
  position: relative;
  z-index: 41;
}

.emoji-avatar-picker-shell.is-collapsed .emoji-avatar-picker-scroll {
  display: none;
}

.emoji-avatar-picker-page {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(40px, 1fr));
  gap: 6px;
  min-width: 100%;
  box-sizing: border-box;
}

.emoji-avatar-pick-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #f9fafb;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0;
}

.emoji-avatar-pick-spacer {
  display: block;
  aspect-ratio: 1;
}

.emoji-avatar-pick-btn.is-active {
  border-color: #358ef1;
  box-shadow: 0 0 0 2px rgba(53, 142, 241, 0.25);
}
/* end: Аватар — заголовок и сетка смайлов */

/* start: Аватар — выбор фона */
.emoji-avatar-bg-label {
  text-align: center;
  margin: 0 0 8px;
  color: #6b7280;
  font-size: 0.92rem;
}

.emoji-avatar-bg-picker {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.emoji-avatar-bg-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d1d5db;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.emoji-avatar-bg-btn.is-active {
  box-shadow: 0 0 0 3px #358ef1;
}

.emoji-avatar-bg-btn.is-default-bg {
  border: 1px dashed #9ca3af;
}
/* end: Аватар — выбор фона */

.emoji-portrait-test-block {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.emoji-portrait-intro {
  text-align: center;
  margin: 0 0 12px;
}

.emoji-portrait-intro-title {
  margin: 0;
  font-weight: 700;
  font-size: clamp(24px, 5vw, 28px);
  line-height: 1.3;
  color: #111827;
}

.emoji-portrait-intro.is-completed .emoji-portrait-intro-title {
  font-size: clamp(18px, 4.4vw, 21px);
  font-weight: 800;
  line-height: 1.18;
  white-space: nowrap;
}

.emoji-portrait-intro-samples {
  margin: 10px 0 0;
  font-size: clamp(32px, 6vw, 36px);
  letter-spacing: 4px;
  line-height: 1.35;
}

.emoji-portrait-start-btn {
  display: block;
  margin: 0 auto 18px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: #358ef1;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(53, 142, 241, 0.35);
}

.emoji-portrait-start-btn:hover,
.emoji-portrait-start-btn:focus-visible {
  background: #2b7cd6;
}

.emoji-portrait-question-wrap {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.emoji-portrait-question-wrap.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.emoji-portrait-question-wrap.is-fade-in.is-visible {
  animation: emojiPortraitFadeIn 0.3s ease forwards;
}

@keyframes emojiPortraitFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.emoji-portrait-question-wrap.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.emoji-portrait-question-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.emoji-portrait-answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.emoji-portrait-answer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.emoji-portrait-answer-card:hover,
.emoji-portrait-answer-card:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(53, 142, 241, 0.15);
}

.emoji-portrait-answer-emo {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.emoji-portrait-answer-text {
  font-size: 0.95rem;
  color: #374151;
}

.emoji-portrait-done-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.emoji-portrait-done-overlay.is-show {
  opacity: 1;
  pointer-events: auto;
}

.emoji-portrait-done-text {
  margin: 0;
  padding: 20px 28px;
  border-radius: 14px;
  background: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.2);
}

@media (min-width: 600px) {
  .emoji-portrait-answers {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .emoji-portrait-answers {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* end: Дружеский марафон — эмодзи-аватар и портрет */

.fm-subs-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.fm-subs-link {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: #111827;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.fm-subs-link:hover,
.fm-subs-link:focus-visible {
  color: #111827;
  opacity: 0.78;
}

.fm-subs-link:active {
  opacity: 0.55;
  transform: scale(0.96);
}

.fm-dot {
  color: #9ca3af;
}

/* start: Дружеский марафон — страница «Друзья» */
.fm-friends-tabs {
  display: flex;
  gap: 0;
  margin: 0 16px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #f9fafb;
}

.fm-friends-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
}

.fm-friends-tab:active {
  opacity: 0.65;
  transform: scale(0.98);
}

.fm-friends-tab.is-active {
  background: #fff;
  color: #111827;
  box-shadow: inset 0 -2px 0 #358ef1;
}

.fm-friends-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 16px 20px;
}

.fm-friends-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  flex: 1;
  overflow-y: auto;
}

.fm-friends-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 4px;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.fm-friends-row:hover,
.fm-friends-row:focus-visible {
  background: #f9fafb;
}

.fm-friends-row-avatar {
  width: 48px;
  height: 48px;
  font-size: 2.03rem;
  flex-shrink: 0;
}

.fm-friends-row-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.fm-friends-row-arrow {
  color: #9ca3af;
  font-size: 1.1rem;
}

.fm-friends-empty {
  padding: 24px 12px;
  text-align: center;
  color: #6b7280;
}

.fm-friends-add-btn {
  margin-top: auto;
  flex-shrink: 0;
}

#fmFriendsPanel.fm-full-page {
  display: flex;
  flex-direction: column;
}

#fmFriendsPanel .fm-friends-body {
  flex: 1;
}
/* end: Дружеский марафон — страница «Друзья» */

.fm-marathon-slots {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.fm-slot {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  position: relative;
  padding: 0;
  cursor: pointer;
  background: #fff;
}

.fm-slot.is-empty {
  border: 2px dashed #cbd5e1;
  color: #9ca3af;
  display: grid;
  place-items: center;
}

.fm-slot-plus {
  font-size: 1.5rem;
  line-height: 1;
}

/* start: Слот марафона с другом — кружок и плашка «N/M вместе» под ним */
.fm-slot.is-filled {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fm-slot-circle {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: 2px solid #93c5fd;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  box-sizing: border-box;
}

.fm-slot-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
}

.fm-slot .fm-emoji-avatar-circle.fm-slot-avatar {
  border: none;
  box-shadow: none;
}

.fm-slot-together {
  width: 60px;
  max-width: 60px;
  padding: 3px 4px;
  border-radius: 999px;
  background: #45baed;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
/* end: Слот марафона с другом — кружок и плашка «N/M вместе» под ним */

.fm-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.fm-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}

.fm-swatch.is-active {
  border-color: #358ef1;
  box-shadow: 0 0 0 2px rgba(53, 142, 241, 0.35);
}

.fm-duration-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.fm-duration-opt {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

/* start: Страница «Создать марафон» — поля и выбор длительности */
#createMarathonModal {
  --fm-create-accent: #358ef1;
}

#createMarathonModal .field-input,
#createMarathonModal select.field-input {
  border: 2px solid var(--fm-create-accent);
  outline: none;
}

#createMarathonModal .field-input:focus {
  border-color: var(--fm-create-accent);
  box-shadow: none;
}

#createMarathonModal .fm-duration-opt input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  border: 2px solid var(--fm-create-accent);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

#createMarathonModal .fm-duration-opt input[type="radio"]:checked {
  background: var(--fm-create-accent);
  box-shadow: inset 0 0 0 2px #fff;
}

#createMarathonModal input[type="checkbox"] {
  accent-color: var(--fm-create-accent);
}

#createMarathonModal .fm-duration-label {
  margin-bottom: 0;
}

#createMarathonModal .fm-duration-radios {
  margin-top: 0;
}

#createMarathonModal .fm-marathon-show-habits-row {
  margin-top: 3.6px;
}

#fmMarathonCreate.wide-btn {
  background: var(--fm-create-accent);
  border-color: var(--fm-create-accent);
  color: #fff;
}

#fmMarathonCreate.wide-btn:hover,
#fmMarathonCreate.wide-btn:focus-visible {
  background: #358ef1;
  border-color: #358ef1;
}
/* end: Страница «Создать марафон» — поля и выбор длительности */

/* start: Профиль друга — кнопка подписки без зелёного фона после нажатия */
#friendProfileFollowBtn.wide-btn,
#friendProfileFollowBtn.wide-btn:hover,
#friendProfileFollowBtn.wide-btn:active,
#friendProfileFollowBtn.wide-btn:focus,
#friendProfileFollowBtn.wide-btn:focus-visible {
  background: #45baed;
  transform: none;
}
/* end: Профиль друга — кнопка подписки без зелёного фона после нажатия */

/* start: Профиль друга — кнопки «поделиться привычками/задачами» и «послание» */
#friendReqHabitsBtn,
#friendReqTasksBtn {
  background: #fff;
  border: 2px solid #45baed;
  color: #1f2937;
}

#friendReqHabitsBtn:hover,
#friendReqTasksBtn:hover,
#friendReqHabitsBtn:focus-visible,
#friendReqTasksBtn:focus-visible {
  background: rgba(69, 186, 237, 0.1);
  transform: none;
}

#friendReqHabitsBtn:disabled,
#friendReqTasksBtn:disabled {
  background: #f8fafc;
  border-color: #93c5fd;
  color: #6b7280;
  opacity: 1;
}

#friendSendMessageBtn {
  background: #45baed;
  border: 2px solid #45baed;
  color: #fff;
  animation: friendMessageBtnGlow 2.4s ease-in-out infinite;
}

#friendSendMessageBtn:hover,
#friendSendMessageBtn:focus-visible {
  background: #3aa8d8;
  border-color: #3aa8d8;
  color: #fff;
  transform: translateY(-1px);
}

@keyframes friendMessageBtnGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(69, 186, 237, 0.35),
      0 4px 12px rgba(69, 186, 237, 0.2);
  }

  50% {
    box-shadow:
      0 0 18px 5px rgba(69, 186, 237, 0.55),
      0 0 32px 10px rgba(69, 186, 237, 0.22),
      0 4px 14px rgba(69, 186, 237, 0.35);
  }
}
/* end: Профиль друга — кнопки «поделиться привычками/задачами» и «послание» */

.fm-week-chart {
  width: 100%;
  min-height: 160px;
  padding: 8px 4px 4px;
  background: #f8fafc;
  border-radius: 12px;
  box-sizing: border-box;
}

.fm-own-week-chart {
  margin-top: 0.3cm;
}

/* start: WeekChart — столбчатый график привычек и задач */
.week-chart {
  position: relative;
  width: 100%;
  --week-chart-plot-height: 128px;
  --week-chart-label-height: 22px;
}

.week-chart-inner {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  align-items: start;
}

.week-chart-y {
  position: relative;
  height: var(--week-chart-plot-height);
  margin-bottom: var(--week-chart-label-height);
}

.week-chart-y-tick {
  position: absolute;
  right: 0;
  font-size: 0.65rem;
  color: #9ca3af;
  line-height: 1;
}

.week-chart-main {
  position: relative;
  height: calc(var(--week-chart-plot-height) + var(--week-chart-label-height));
}

.week-chart-grid {
  position: absolute;
  inset: 0 0 var(--week-chart-label-height);
  pointer-events: none;
}

.week-chart-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #e5e7eb;
}

.week-chart-days {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100%;
}

.week-chart-day {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.week-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: var(--week-chart-plot-height);
  flex: 0 0 var(--week-chart-plot-height);
  min-height: 0;
}

.week-chart-day.is-today .week-chart-bars {
  padding: 2px;
  border: 1px solid rgba(107, 114, 128, 0.28);
  border-radius: 8px;
  background: rgba(107, 114, 128, 0.08);
  box-sizing: border-box;
}

.week-chart-bar {
  --week-chart-bar-color: transparent;
  flex: 1;
  max-width: 18px;
  min-width: 10px;
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column-reverse;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  transition: filter 0.15s ease, transform 0.15s ease;
}

/* start: WeekChart — пустые плашки на месте незапланированных столбцов */
.week-chart-bar.is-empty.is-outline {
  flex: 1;
  max-width: 18px;
  min-width: 10px;
  min-height: 6px;
  height: 6px;
  box-sizing: border-box;
  overflow: hidden;
  opacity: 0.45;
  background: var(--week-chart-bar-color);
}

.week-chart-bar.is-empty.is-outline:hover,
.week-chart-bar.is-empty.is-outline:focus-visible {
  opacity: 0.9;
  filter: brightness(1.05);
  transform: translateY(-2px);
  outline: none;
}
/* end: WeekChart — пустые плашки на месте незапланированных столбцов */

.week-chart-bar:not(.is-empty):hover,
.week-chart-bar:not(.is-empty):focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px);
  outline: none;
}

.week-chart-seg {
  display: block;
  width: 100%;
  min-height: 0;
  border-radius: 0;
}

.week-chart-bar.is-habits {
  --week-chart-bar-color: #22c55e;
}

.week-chart-bar.is-tasks {
  --week-chart-bar-color: #3b82f6;
}

.week-chart-bar .week-chart-seg.is-done {
  background: var(--week-chart-bar-color);
}

.week-chart-seg.is-rest {
  background: rgba(212, 212, 216, 0.4);
}

.week-chart-day-label {
  flex: 0 0 var(--week-chart-label-height);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: 0;
  padding-top: 6px;
  box-sizing: border-box;
  font-size: 0.7rem;
  color: #6b7280;
  text-align: center;
  line-height: 1.1;
}

.week-chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 160px;
  max-width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #374151;
  pointer-events: none;
}

.week-chart-tooltip.hidden {
  display: none;
}

.week-chart-day.is-tip-open .week-chart-bar {
  filter: brightness(1.06);
}
/* end: WeekChart — столбчатый график привычек и задач */

.fm-chart-empty {
  width: 100%;
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin: 0;
  padding: 24px 8px;
}

.fm-today-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  width: 100%;
  margin: 0;
  text-align: left;
  color: #4b5563;
  font-size: 0.9rem;
}

.fm-today-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fm-today-stat-sep {
  color: #9ca3af;
}

.fm-stat-marker {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.fm-stat-marker.is-habits {
  background: rgba(34, 197, 94, 0.75);
}

.fm-stat-marker.is-tasks {
  background: rgba(53, 142, 241, 0.75);
}

.fm-profile-social-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
  margin-bottom: 0.3cm;
}

.fm-marathon-slots-msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: left;
}

#friendProfilePanel .fm-friend-permissions {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

#friendProfilePanel .fm-friend-permissions .switch-row {
  align-self: stretch;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.fm-permission-denied {
  text-align: center;
  color: #b45309;
  font-size: 0.9rem;
  margin: 8px 0;
}

.fm-subs-row .fm-subs-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.fm-subs-row .fm-subs-link:hover,
.fm-subs-row .fm-subs-link:focus-visible {
  color: var(--accent, #358ef1);
}

.fm-today-page {
  width: 100%;
  border: 2px solid #45baed;
  border-radius: 12px;
  padding: 14px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fm-today-section-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.fm-today-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: left;
}

.fm-message-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

.fm-today-checklist li {
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.fm-today-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm-today-item-head input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  accent-color: #16a34a;
  cursor: default;
}

.fm-today-item-text {
  font-size: 0.95rem;
  word-break: break-word;
}

.fm-today-item.is-done .fm-today-item-text {
  color: #9ca3af;
  text-decoration: line-through;
}

.fm-today-item-kind {
  display: block;
  margin: 2px 0 0 1.65rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.fm-today-empty {
  color: #9ca3af;
  text-align: center;
  padding: 12px 0;
  border-bottom: none;
}

.fm-message-text {
  min-height: 120px;
  resize: vertical;
}

.fm-locked-row:has(input:disabled) {
  opacity: 0.65;
}

/* start: Дружеский марафон — диалог «пользователь не найден» */
.fm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
}

.fm-dialog-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px;
  display: grid;
  gap: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.fm-dialog-text {
  margin: 0;
  text-align: center;
  font-size: 1rem;
  line-height: 1.45;
  color: #1e293b;
}

.fm-dialog-actions {
  display: grid;
  gap: 10px;
}
/* end: Дружеский марафон — диалог «пользователь не найден» */

/* start: Дружеский марафон — bottom sheet с QR и отправкой ссылки */
.fm-bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.fm-bottom-sheet-overlay.hidden {
  display: none;
}

.fm-bottom-sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 16px;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
  animation: fm-sheet-slide-up 0.28s ease-out;
}

@keyframes fm-sheet-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.fm-bottom-sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.fm-bottom-sheet-handle {
  width: 40px;
  height: 4px;
  margin: 4px auto 0;
  border-radius: 999px;
  background: #cbd5e1;
}

.fm-share-qr-host {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 212px;
  padding: 8px 0;
}

.fm-share-qr-host img,
.fm-share-qr-host canvas {
  display: block;
  border-radius: 8px;
}

.fm-share-qr-fallback {
  margin: 0;
  font-size: 0.85rem;
  word-break: break-all;
  text-align: center;
  color: #64748b;
}

.fm-share-link-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fm-share-square-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 96px;
  padding: 12px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fm-share-square-btn:active {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.fm-share-square-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.fm-share-square-label {
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  color: #334155;
  max-width: 100%;
}

.fm-share-apps-sheet {
  z-index: 1;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

#fmShareAppsSheet.fm-bottom-sheet-overlay {
  z-index: 63;
}

.fm-share-apps-title {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.fm-share-apps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.fm-share-app-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  color: #1e293b;
}

.fm-share-app-row:hover,
.fm-share-app-row:focus-visible {
  background: #f1f5f9;
}

.fm-share-app-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: #f8fafc;
  border-radius: 10px;
  flex-shrink: 0;
}

.fm-share-app-label {
  font-weight: 500;
}

body.fm-sheet-open {
  overflow: hidden;
}
/* end: Дружеский марафон — bottom sheet с QR и отправкой ссылки */

/* end: Дружеский марафон — нижняя кнопка и страница */
