: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: Кнопки, которым нужна сеть — приглушаем при офлайн */

/* start: Полноэкранный спиннер — пока грузятся пользователь, привычки, ракета и прочее */
html.is-app-bootstrapping body > *:not(#appBootstrapOverlay) {
  visibility: hidden !important;
}

.app-bootstrap-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(160deg, #eef2ff 0%, var(--bg) 40%, #f8fafc 100%);
  color: var(--text);
}

.app-bootstrap-overlay.hidden {
  display: none;
}

html.is-app-bootstrapping .app-bootstrap-overlay {
  display: flex !important;
}

.app-bootstrap-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(53, 142, 241, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-bootstrap-spin 0.85s linear infinite;
}

.app-bootstrap-label {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

@keyframes app-bootstrap-spin {
  to {
    transform: rotate(360deg);
  }
}
/* end: Полноэкранный спиннер — пока грузятся пользователь, привычки, ракета и прочее */

/* start: Pull-to-refresh — индикатор свайпа сверху вниз */
.pull-to-refresh-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(29, 41, 57, 0.08);
  transform: translateY(-100%);
  transition: transform 0.18s ease;
  pointer-events: none;
}

.pull-to-refresh-indicator.is-visible {
  transform: translateY(0);
}

.pull-to-refresh-indicator.is-refreshing .pull-to-refresh-spinner {
  animation: app-bootstrap-spin 0.85s linear infinite;
}

.pull-to-refresh-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(53, 142, 241, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
}

.pull-to-refresh-label {
  white-space: nowrap;
}
/* end: Pull-to-refresh — индикатор свайпа сверху вниз */

* {
  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;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
}

/* start: слайдер приветствия — окно под картинки 3:4, только свайп */
.slider-section {
  display: block;
}

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

.slider-track {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: min(72vh, 640px);
  touch-action: none;
}

/* start: Лента слайдов — горизонтальный ряд, сдвиг translate при свайпе */
.slider-strip {
  display: flex;
  height: 100%;
  width: 100%;
  will-change: transform;
  transition: transform 0.35s ease;
}

.slider-strip.is-dragging {
  transition: none;
}
/* end: Лента слайдов — горизонтальный ряд, сдвиг translate при свайпе */

.slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
/* end: слайдер приветствия — окно под картинки 3:4, только свайп */

/* start: Заглушка слайда — если картинка не загрузилась, показываем мягкий фон */
.slide.slide--placeholder {
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 55%, #f3e8ff 100%);
}

.slide.slide--placeholder.is-active {
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 55%, #f3e8ff 100%);
}
/* end: Заглушка слайда */

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

/* start: Главная — кнопки «Зарегистрироваться» и «Войти» для гостей в браузере */
.guest-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.guest-auth-actions .wide-btn {
  margin-top: 0;
}
/* end: Главная — кнопки «Зарегистрироваться» и «Войти» для гостей в браузере */

/* start: Предложения и обратная связь — полноэкранная страница в настройках */
.settings-view-fullpage {
  min-height: calc(100vh - 160px);
}

.feedback-suggestions-page {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: calc(100vh - 160px);
}

.feedback-suggestions-text {
  min-height: 180px;
  resize: vertical;
}

.feedback-suggestions-file-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.feedback-suggestions-file-label input[type="file"] {
  font-size: 0.88rem;
}

.feedback-suggestions-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}
/* end: Предложения и обратная связь — полноэкранная страница в настройках */

/* start: Диалоги — плоские кнопки в один ряд без заливки и анимации */
.fm-dialog-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dialog-flat-btn {
  margin-top: 0;
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #ffffff;
  color: #1e293b;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: none;
  animation: none;
}

.dialog-flat-btn:hover,
.dialog-flat-btn:focus,
.dialog-flat-btn:active {
  background: #f8fafc;
  transform: none;
  box-shadow: none;
}
/* end: Диалоги — плоские кнопки в один ряд без заливки и анимации */

/* start: Уведомление о согласии с документами — один раз при входе */
.legal-continue-notice {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

.legal-continue-notice.hidden {
  display: none;
}

.legal-continue-notice-bar {
  pointer-events: auto;
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.legal-continue-notice-text {
  margin: 0;
  color: #111827;
  font-size: 0.92rem;
  line-height: 1.45;
}

.legal-continue-notice-btn {
  justify-self: end;
  width: auto;
  min-width: 120px;
}
/* end: Уведомление о согласии с документами — один раз при входе */

.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;
}

/* start: Вход по email — блоки пароля и регистрации */
.auth-password-group {
  display: grid;
  gap: 8px;
}

.auth-password-group.hidden {
  display: none;
}
/* end: Вход по email — блоки пароля и регистрации */

/* start: Повторная отправка кода — кнопка «Вам не пришел код?» */
.auth-resend-code-btn {
  justify-self: start;
  margin-top: 2px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.auth-resend-code-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}
/* end: Повторная отправка кода — кнопка «Вам не пришел код?» */

/* start: Предложение разрешить уведомления — блок прямо в форме входа */
.login-code-permission-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.login-code-permission-box.hidden {
  display: none;
}

.login-code-permission-text {
  margin: 0;
  font-size: 0.94rem;
  color: #9a3412;
  line-height: 1.4;
}

.login-code-permission-box .wide-btn {
  margin-top: 0;
}
/* end: Предложение разрешить уведомления — блок прямо в форме входа */

.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;
}

/* start: Подсказка про спам и блок ввода кода подтверждения email */
.auth-spam-hint {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.auth-email-confirm-group {
  margin-top: 12px;
}

.auth-email-confirm-group:not(.hidden) {
  display: grid;
  gap: 8px;
}

.auth-email-confirm-group.hidden {
  display: none;
}
/* end: Подсказка про спам и блок ввода кода подтверждения email */

.auth-message-action {
  display: inline;
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* start: L3 — чекбокс согласия с политикой при регистрации */
.auth-privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #3a3f48;
  cursor: pointer;
}
.auth-privacy-consent input {
  margin-top: 3px;
  flex-shrink: 0;
}
.auth-privacy-consent a {
  color: #358ef1;
}
.auth-privacy-link {
  margin-top: 12px;
  text-align: center;
  font-size: 0.82rem;
}
.auth-privacy-link a {
  color: #5c6770;
  text-decoration: underline;
}
/* end: L3 — чекбокс согласия с политикой при регистрации */

/* start: вход админа — dev-код под кнопкой «Подтвердить вход» */
.admin-dev-login-code {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed #c7d2fe;
  background: #eef2ff;
  color: #312e81;
  font-size: 0.92rem;
  text-align: center;
}

.admin-dev-login-code-value {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
}
/* end: вход админа — dev-код под кнопкой «Подтвердить вход» */

.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: 4px 0 6px;
  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%;
}

/* start: Цитата дня — 3D Flip (оборот: текст цитаты + автор, без обрезки) */
.quote-card-inner {
  display: grid;
  min-height: 86px;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

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

.quote-card-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 8px 12px;
  cursor: pointer;
  text-align: center;
  transform: rotateY(0deg);
}

.quote-card-back {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  padding: 10px 36px 10px 12px;
  cursor: pointer;
  transform: rotateY(180deg);
}

.quote-card-back .quote-text {
  margin: 0;
  width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.quote-card-back .quote-meta {
  margin: 0;
}
/* end: Цитата дня — 3D Flip (оборот: текст цитаты + автор, без обрезки) */

/* start: Цитата дня — кнопка «Поделиться» на плашке */
.quote-share-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(53, 142, 241, 0.12);
  color: #358ef1;
  cursor: pointer;
  z-index: 2;
}

.quote-share-btn:hover,
.quote-share-btn:focus-visible {
  background: rgba(53, 142, 241, 0.22);
}

.quote-share-icon {
  display: block;
}
/* end: Цитата дня — кнопка «Поделиться» на плашке */

/* start: Цитата дня — модальное окно «Поделиться» */
.quote-share-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.quote-share-overlay.hidden {
  display: none;
}

.quote-share-dialog {
  position: relative;
  width: min(100%, 420px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px 18px 24px;
  border-radius: 20px 20px 16px 16px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.quote-share-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.quote-share-title {
  margin: 0 36px 16px 0;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
}

.quote-share-preview-host {
  width: 100%;
  margin: 0 0 14px;
}

.quote-share-preview-host .quote-share-capture {
  position: relative;
  inset: auto;
  transform: none;
  width: 100%;
  min-height: 86px;
  padding: 8px 12px 36px 12px;
  cursor: default;
  box-sizing: border-box;
}

.quote-share-preview-host .quote-meta.hidden {
  display: none;
}

/* start: Цитата дня — подпись from DayGoal на плашке для шаринга */
.quote-share-brand {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 16px);
  pointer-events: none;
}

.quote-share-brand-from {
  font-family: var(--quote-font-main, Georgia, "Times New Roman", serif);
  font-size: calc(0.95rem - 2px);
  line-height: 1.2;
  color: #000000;
}

.quote-share-brand-name {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: #358ef1;
  font-family: "Adigiana 2", sans-serif;
  font-size: calc(0.95rem - 2px);
  line-height: 1.2;
  color: #ffffff;
  white-space: nowrap;
}
/* end: Цитата дня — подпись from DayGoal на плашке для шаринга */

.quote-share-attribution {
  margin: 0 0 14px;
  text-align: left;
  font-size: 0.92rem;
  color: #64748b;
}

.quote-share-landing-link {
  color: #358ef1;
  font-weight: 600;
  text-decoration: none;
}

.quote-share-landing-link:hover,
.quote-share-landing-link:focus-visible {
  text-decoration: underline;
}

.quote-share-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.quote-share-action-btn:hover,
.quote-share-action-btn:focus-visible {
  border-color: #358ef1;
  background: rgba(53, 142, 241, 0.08);
}

.quote-share-action-icon {
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
}

@media (min-width: 520px) {
  .quote-share-overlay {
    align-items: center;
  }

  .quote-share-dialog {
    border-radius: 20px;
  }
}
/* end: Цитата дня — модальное окно «Поделиться» */

.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: 10px;
  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: 34px;
  padding: 4px 2px 6px;
  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: 10px;
  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;
}

.entries-list .entry-item {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.entry-item {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 6px 8px;
  display: grid;
  gap: 4px;
  background: #fff;
  touch-action: pan-y;
}

.entry-item.is-entry-press-pending {
  background: #f8fafc;
  border-color: #c7d2fe;
  touch-action: pan-y;
}

.entry-item.is-entry-dragging {
  opacity: 0.92;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  touch-action: none;
  cursor: grabbing;
  transition: box-shadow 0.075s ease;
}

/* start: перетаскивание записей — блокируем прокрутку страницы во время long-press/drag */
body.is-entry-reorder-active {
  touch-action: none;
  overscroll-behavior: none;
}
/* end: перетаскивание записей — блокируем прокрутку страницы во время long-press/drag */

.entry-item.entry-drag-placeholder {
  opacity: 0.45;
  background: #eef2ff;
  border: 1px dashed #c7d2fe;
  box-shadow: none;
  pointer-events: none;
}

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

.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;
}

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

.habit-start-day-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.habit-start-day-btn {
  min-width: 36px;
  padding: 4px 6px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
}

.habit-start-day-btn.is-active {
  border-color: var(--accent, #358ef1);
  background: color-mix(in srgb, var(--accent, #358ef1) 12%, #fff);
}

/* 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-line {
  display: grid;
  grid-template-columns: 1fr var(--habit-week-grid-width);
  align-items: center;
  column-gap: 8px;
  width: 100%;
}

.entry-item.habit-entry .habit-time-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 0;
  line-height: 1.35;
}

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

.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 {
  position: relative;
  overflow: hidden;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  align-self: center;
  justify-self: center;
}

.habit-day-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #22c55e;
  transform: scale(0);
  opacity: 0;
}

.habit-day-dot.is-filling::before {
  opacity: 1;
  animation: habitDotGreenFill 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

.habit-day-dot.is-on::before {
  transform: scale(1);
  opacity: 1;
}

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

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

/* start: Привычки — плашка-предупреждение рядом с недоступным днём (позиция задаётся в script.js) */
.habit-dot-hint-popover,
.habit-locked-toast {
  position: fixed;
  z-index: 100;
  transform: translateX(-50%);
  max-width: min(320px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  pointer-events: none;
}

.habit-dot-hint-popover.hidden,
.habit-locked-toast.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-window {
    padding: 7px;
    border-radius: 14px;
    width: min(100%, 420px);
    margin-inline: auto;
  }

  .slider-track {
    max-height: min(68vh, 560px);
  }

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

  /* start: Главная — компактные кнопки «Зарегистрироваться» и «Войти» на телефоне */
  .guest-auth-actions {
    gap: 6px;
  }

  .guest-auth-actions .wide-btn {
    padding: 3px 10px;
    font-size: 0.72rem;
    line-height: 1.15;
    font-weight: 600;
    min-height: 0;
  }

  .guest-auth-actions .wide-btn:hover {
    transform: none;
  }
  /* end: Главная — компактные кнопки «Зарегистрироваться» и «Войти» на телефоне */

  .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: 0.7cm;
}

.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: 6px 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: -1.7cm 0 0;
  color: #1f2937;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

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

/* start: Эффективный режим — ракета-смайлик (взлёт вверх) */
.rocket-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, 6.25rem);
  line-height: 1;
  z-index: 1;
  pointer-events: none;
}
/* end: Эффективный режим — ракета-смайлик (взлёт вверх) */

.rocket-streak-roll {
  position: absolute;
  left: var(--rocket-hero-porthole-left, 50%);
  top: var(--rocket-hero-porthole-top, 46%);
  transform: translate(-50%, -50%);
  font-size: clamp(4.032rem, 17.28vw, 5.184rem);
  font-variant-numeric: tabular-nums;
  line-height: 1em;
  width: max-content;
  min-width: calc(var(--rocket-streak-ch, 1) * 1ch + 0.2em);
  height: 1em;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}

.rocket-streak-roll > .rocket-streak-porthole {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  font-weight: 800;
  line-height: 1em;
  color: #358ef1;
  text-align: center;
  white-space: nowrap;
}

/* start: Эффективный режим — смена цифры streak (лента: старая тянет новую вниз, без наезда) */
.rocket-streak-roll-track {
  display: block;
  width: 100%;
  transform: translate3d(0, -1em, 0);
  will-change: transform;
}

.rocket-streak-roll-track.is-rolling {
  animation: rocketStreakTrackRoll var(--rocket-streak-roll-duration, 3s) cubic-bezier(0.45, 0.05, 0.2, 1) forwards;
}

.rocket-streak-roll-track .rocket-streak-porthole {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 1em;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-size: inherit;
  font-weight: 800;
  line-height: 1em;
  color: #358ef1;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

@keyframes rocketStreakTrackRoll {
  from {
    transform: translate3d(0, -1em, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
/* end: Эффективный режим — смена цифры streak (лента: старая тянет новую вниз, без наезда) */

/* start: Эффективный режим — ежедневная анимация ракеты */
.rocket-pad-glow {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 72%;
  height: 18%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(ellipse at center, rgba(53, 142, 241, 0.22) 0%, transparent 72%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.rocket-hero-stage.is-anim-launch .rocket-emoji {
  animation: rocketEmojiLaunch 3s ease-in-out forwards;
}

.rocket-hero-stage.is-anim-launch .rocket-pad-glow {
  animation: rocketPadGlowLaunch 3s ease-out forwards;
}

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

@keyframes rocketEmojiLaunch {
  0% {
    transform: translate(-50%, -50%) translateY(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translateY(-400px);
    opacity: 0;
  }
}

@keyframes rocketPadGlowLaunch {
  0%,
  14% { opacity: 0; transform: translateX(-50%) scale(0.8); }
  28%,
  52% { opacity: 1; transform: translateX(-50%) scale(1.05); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.2); }
}

@keyframes rocketEmojiStall {
  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);
  }
}

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

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

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

.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;
  background: #358ef1;
  color: #fff;
}

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

#rocketBuyCanisterBtn {
  background: #fff;
  color: #358ef1;
  border: 2px solid #358ef1;
}

#rocketBuyCanisterBtn:hover,
#rocketBuyCanisterBtn:focus-visible {
  background: rgba(53, 142, 241, 0.08);
  color: #358ef1;
  border-color: #358ef1;
}

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

.rocket-marathon-title.is-default-title {
  text-align: center;
}

.rocket-marathon-title:not(.is-default-title) {
  text-align: center;
}

.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-overlay {
  z-index: 50;
  background: #ffffff;
}

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

.rocket-goal-dialog h3 {
  margin: 0 0 1cm;
  text-align: center;
  font-size: 1.05rem;
}

.rocket-goal-name-input {
  width: 100%;
  box-sizing: border-box;
}

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

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

.rocket-goal-option {
  width: 100%;
  text-align: center;
  padding: 10px 4px;
  border-radius: 10px;
  border: 1px solid #d0d5dd;
  background: #fff;
  cursor: pointer;
  font-size: clamp(0.68rem, 2.6vw, 0.8rem);
  line-height: 1.2;
  min-height: 2.6rem;
  white-space: nowrap;
}

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

.rocket-goal-option.is-selected {
  border-color: var(--accent, #358ef1);
  background: rgba(53, 142, 241, 0.1);
}

.rocket-goal-modal-actions {
  display: grid;
  gap: 8px;
  margin-top: 0.3cm;
}

/*
// 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: flex-start;
  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 #fmMarathonDurations.fm-duration-radios {
  margin-top: 8px;
  margin-bottom: 12px;
}

/* start: Создать марафон — выбор друга с аватаром */
.fm-marathon-friend-picker {
  position: relative;
}

.fm-marathon-friend-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: #fff;
  color: var(--text, #1a1a1a);
}

.fm-marathon-friend-trigger.is-empty {
  color: var(--muted, #888);
}

.fm-marathon-friend-trigger-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fm-marathon-friend-trigger-avatar,
.fm-marathon-friend-option-avatar {
  width: 32px;
  height: 32px;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.fm-marathon-friend-trigger-name,
.fm-marathon-friend-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-marathon-friend-trigger-chevron {
  flex-shrink: 0;
  color: var(--muted, #888);
  font-size: 0.85rem;
}

.fm-marathon-friend-list {
  position: absolute;
  z-index: 4;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: #fff;
  border: 2px solid var(--fm-create-accent);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(53, 142, 241, 0.16);
  max-height: min(40vh, 260px);
  overflow-y: auto;
}

.fm-marathon-friend-list.hidden {
  display: none;
}

.fm-marathon-friend-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.fm-marathon-friend-option:hover,
.fm-marathon-friend-option:focus-visible {
  background: rgba(53, 142, 241, 0.08);
}
/* end: Создать марафон — выбор друга с аватаром */

#createMarathonModal .fm-shared-habit-picker {
  text-align: left;
  cursor: pointer;
  background: #fff;
  color: var(--text, #1a1a1a);
}

#createMarathonModal .fm-shared-habit-picker.is-empty {
  color: var(--muted, #888);
}

#createMarathonModal .fm-shared-habit-hint {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted, #888);
}

/* start: Создать марафон — модалка выбора привычки */
.fm-marathon-habit-overlay {
  position: fixed;
  inset: 0;
  z-index: 62;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  padding: 16px;
}

.fm-marathon-habit-overlay.hidden {
  display: none;
}

.fm-marathon-habit-modal {
  width: min(400px, 100%);
  background: #fff;
  border: 2px solid var(--fm-create-accent, #358ef1);
  border-radius: 16px;
  padding: 20px 18px;
  display: grid;
  gap: 14px;
  box-shadow: 0 12px 36px rgba(53, 142, 241, 0.18);
}

.fm-marathon-habit-modal h4 {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  color: #1e293b;
}

.fm-marathon-habit-picker-actions {
  display: grid;
  gap: 10px;
}

.fm-marathon-habit-list-wrap {
  display: grid;
  gap: 10px;
}

.fm-marathon-habit-list-back {
  justify-self: start;
}

.fm-marathon-habit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: min(50vh, 320px);
  overflow: auto;
}

.fm-marathon-habit-list-item {
  width: 100%;
  text-align: left;
  border: 2px solid var(--fm-create-accent, #358ef1);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  font-size: 0.95rem;
  cursor: pointer;
}

.fm-marathon-habit-list-item:hover,
.fm-marathon-habit-list-item:focus-visible {
  background: rgba(53, 142, 241, 0.08);
}

.fm-marathon-habit-list-empty {
  margin: 0;
  text-align: center;
  color: var(--muted, #888);
  font-size: 0.9rem;
}

.fm-marathon-new-habit-modal {
  max-height: min(90vh, 640px);
  overflow: auto;
}

.fm-marathon-new-habit-back {
  justify-self: start;
}

.fm-marathon-new-habit-editor-host .editor-panel {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.fm-marathon-new-habit-editor-host .editor-panel.hidden {
  display: grid;
}
/* end: Создать марафон — модалка выбора привычки */

.entry-title.entry-title-with-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.habit-friend-avatar {
  flex-shrink: 0;
  display: inline-flex;
}

#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-share-interesting-menu {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}

#friendProfilePanel .fm-share-interesting-menu.hidden {
  display: none;
}

#friendShareInterestingBtn {
  margin-top: 8px;
}

#friendSendMessageBtn {
  margin-top: 12px;
}

#friendProfileLeaveMarathonBtn {
  margin-top: 0;
}

#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 и отправкой ссылки */

/* start: Режим «посетить как пользователь» — баннер и красная кнопка выхода */
.impersonate-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10050;
  padding: 8px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: rgba(180, 30, 30, 0.92);
  pointer-events: none;
}

.impersonate-exit-btn {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 10051;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #c62828;
  box-shadow: 0 4px 14px rgba(198, 40, 40, 0.45);
  cursor: pointer;
}

.impersonate-exit-btn:hover {
  background: #b71c1c;
}
/* end: Режим «посетить как пользователь» — баннер и красная кнопка выхода */

/* start: Android — общий масштаб и высота экрана (только html.is-android, iPhone не затрагиваем) */
.is-android .welcome-page {
  min-height: 100svh;
}

/* start: Android — полноэкранные панели: размер visualViewport (inset:0 + scale 0.9 обрезает края) */
.is-android .settings-panel,
.is-android .fm-full-page,
.is-android .fm-sub-page,
.is-android .rocket-panel,
.is-android .quote-onboarding {
  inset: auto;
  left: var(--android-vv-left, 0px);
  top: var(--android-vv-top, 0px);
  width: var(--android-vvw, 100vw);
  max-width: var(--android-vvw, 100vw);
  height: var(--android-vvh, 100svh);
  max-height: var(--android-vvh, 100svh);
  box-sizing: border-box;
}

/* start: Android — прокрутка контента внутри полноэкранных страниц (flex min-height: 0) */
.is-android .settings-dialog,
.is-android .rocket-dialog {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.is-android .rocket-header,
.is-android .fm-page-header {
  flex-shrink: 0;
}

.is-android .settings-header {
  flex-shrink: 0;
}

.is-android .settings-views {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* start: Android — настройки: как rocket-panel-body — absolute + прокрутка внутри visualViewport */
.is-android .settings-view.is-active {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  width: auto;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.is-android .settings-view.is-active > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
/* end: Android — настройки: как rocket-panel-body */

.is-android .settings-dialog {
  padding: max(12px, calc(env(safe-area-inset-top, 0px) + 10px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
}

.is-android .settings-view-fullpage,
.is-android .feedback-suggestions-page {
  min-height: 0;
  height: auto;
}

.is-android .settings-view.settings-view-fullpage.is-active {
  display: flex;
  flex-direction: column;
}

.is-android .feedback-suggestions-page {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.is-android .fm-full-page-body,
.is-android .rocket-panel-body {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.is-android .rocket-panel-body > *,
.is-android .fm-full-page-body > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
/* end: Android — прокрутка контента внутри полноэкранных страниц */

.is-android .fm-page-header {
  padding: max(50px, calc(env(safe-area-inset-top, 0px) + 12px)) 16px 0;
  margin-bottom: 1cm;
}

.is-android .quote-share-dialog {
  max-height: calc(100svh - 32px);
}

.is-android .quote-onboarding-dialog {
  max-height: 92svh;
}
/* end: Android — общий масштаб и высота экрана */

/* start: Android — точечные правки вёрстки (класс is-android на html, iPhone не затрагиваем) */
.is-android .rocket-dialog {
  padding: max(50px, calc(env(safe-area-inset-top, 0px) + 12px)) 16px max(18px, env(safe-area-inset-bottom, 0px));
  gap: 14px;
  min-height: 0;
}

.is-android .rocket-panel > .rocket-dialog > .rocket-header {
  margin-bottom: 0.15rem;
}

.is-android .rocket-streak-roll {
  font-size: clamp(1.85rem, 9vw, 2.5rem);
}

.is-android .rocket-hero-stage {
  width: min(9.5rem, 42vw);
  height: min(9.5rem, 42vw);
}

.is-android .rocket-stats-row {
  margin-top: 0.3rem;
  gap: 4px;
  width: 100%;
  max-width: 100%;
}

.is-android .rocket-stat-tile {
  aspect-ratio: auto;
  min-height: 4.1rem;
  padding: 5px 3px 4px;
  gap: 4px;
}

.is-android .rocket-stat-tile-label {
  font-size: 0.56rem;
  line-height: 1.15;
  word-break: break-word;
  hyphens: auto;
}

.is-android .rocket-stat-tile-value {
  font-size: clamp(1rem, 4.2vw, 1.35rem);
}

.is-android .rocket-streak-caption {
  margin: -0.4rem 0 0;
  font-size: 0.88rem;
  padding: 0 4px;
  max-width: 100%;
  text-align: center;
}

.is-android .rocket-calendar-legend {
  gap: 6px 8px;
  font-size: 0.72rem;
}

.is-android .rocket-cal-cell {
  font-size: 0.7rem;
}

.is-android .rocket-wallet,
.is-android .rocket-marathon,
.is-android .rocket-calendar-section,
.is-android .rocket-share-wrap {
  width: 100%;
  max-width: 100%;
}

.is-android .fm-own-week-chart {
  margin-top: 0.15rem;
}

.is-android .fm-week-chart {
  min-height: 140px;
}

.is-android .fm-marathon-slots {
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 4px;
}

.is-android .fm-slot.is-empty {
  width: 52px;
  height: 52px;
  flex: 0 1 52px;
}

.is-android .fm-slot-circle {
  width: 52px;
  height: 52px;
}

.is-android .fm-slot-together {
  width: 52px;
  max-width: 52px;
  font-size: 0.52rem;
}

.is-android .emoji-avatar-bg-picker {
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0 2px;
}

.is-android .emoji-avatar-bg-btn {
  width: 34px;
  height: 34px;
}

.app-time-picker {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(15, 23, 42, 0.35);
  display: grid;
  align-items: end;
}

.app-time-picker.hidden {
  display: none !important;
}

.app-time-picker-sheet {
  position: relative;
  background: #f2f2f7;
  border-radius: 14px 14px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}

.app-time-picker-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.app-time-picker-btn {
  border: none;
  background: transparent;
  color: #358ef1;
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
}

.app-time-picker-btn.is-primary {
  font-weight: 700;
}

.app-time-picker-wheels {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 4px;
  height: 180px;
}

.app-time-wheel {
  height: 180px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-time-wheel::-webkit-scrollbar {
  display: none;
}

.app-time-wheel-pad {
  height: 72px;
  flex-shrink: 0;
}

.app-time-wheel-item {
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  color: #6b7280;
  scroll-snap-align: center;
}

.app-time-wheel-sep {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
  padding-bottom: 4px;
}

.app-time-wheel-highlight {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(50% + 12px);
  transform: translateY(-50%);
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e5e7eb;
  pointer-events: none;
  z-index: 0;
}

.app-time-display {
  cursor: pointer;
}
/* end: Android — точечные правки вёрстки (класс is-android на html, iPhone не затрагиваем) */

/* start: UI-анимации — прогресс, кнопки, чекбокс, конфетти */
.card-day-meter-fill.is-pulse-active {
  animation: dayMeterPulse 0.45s ease-in-out infinite alternate;
}

@keyframes dayMeterPulse {
  from {
    opacity: 0.86;
    box-shadow: 0 0 8px color-mix(in srgb, #22c55e 25%, transparent);
  }
  to {
    opacity: 1;
    box-shadow: 0 0 14px color-mix(in srgb, #22c55e 50%, transparent);
  }
}

button.ui-btn-bounce,
button:not(.quote-share-btn):not(:disabled) {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

button.ui-btn-bounce:active,
button:not(.quote-share-btn):not(:disabled):active {
  transform: scale(0.92);
}

.check-draw {
  position: relative;
  width: 1.15rem;
  height: 1.15rem;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.check-draw input {
  appearance: none;
  width: 100%;
  height: 100%;
  border-radius: 0.35rem;
  border: 1.4px solid #9ca3af;
  background: #fff;
  margin: 0;
}

.check-draw-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.check-draw-path {
  fill: none;
  stroke: #16a34a;
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.38s ease;
}

.check-draw input:checked + .check-draw-icon .check-draw-path {
  stroke-dashoffset: 0;
}

.check-draw input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.entry-left input[type="checkbox"]:not(.check-draw input),
.calendar-day-item input[type="checkbox"]:not(.check-draw input) {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #16a34a;
  cursor: pointer;
}

@keyframes habitDotGreenFill {
  from { transform: scale(0); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}

/* start: UI-анимации — конфетти при отметке привычки */
.habit-confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

.habit-confetti-piece {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 1px;
  opacity: 0.95;
  animation: habitConfettiBurst 1.04s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes habitConfettiBurst {
  0% {
    opacity: 1;
    transform: rotate(var(--confetti-angle)) translateY(-2px) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--confetti-angle)) translateY(calc(-1 * var(--confetti-dist))) rotate(var(--confetti-spin)) scale(0.35);
  }
}
/* end: UI-анимации — конфетти при отметке привычки */

@media (prefers-reduced-motion: reduce) {
  .card-day-meter-fill.is-pulse-active,
  .habit-day-dot.is-filling::before,
  .habit-confetti-piece {
    animation: none !important;
  }

  button.ui-btn-bounce:active,
  button:not(.quote-share-btn):not(:disabled):active {
    transform: none;
  }

  .check-draw-path {
    transition: none;
    stroke-dashoffset: 0;
  }
}
/* end: UI-анимации — прогресс, кнопки, чекбокс, конфетти */

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