/* 1. VARIABLES & ROOT STYLES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
  /* Цветовая палитра */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-secondary: #64748b;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  /* Оттенки серого */
  --color-light: rgba(255, 255, 255, 1);
  --color-gray-100: rgba(235, 235, 235, 1);
  --color-gray-200: rgba(215, 215, 215, 1);
  --color-gray-300: rgba(200, 200, 200, 1);
  --color-gray-400: rgba(160, 160, 160, 1);
  --color-gray-500: rgba(130, 130, 130, 1);
  --color-gray-600: rgba(100, 100, 100, 1);
  --color-gray-700: rgba(80, 80, 80, 1);
  --color-gray-800: rgba(40, 40, 40, 1);
  --color-gray-900: rgba(118, 138, 131, 1);
  --color-dark: #020617;

  /* Типография */
  --font-family-base: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-family-mono: 'Fira Code', 'Roboto Mono', monospace;
  --line-height: 1.6;

  /* Размеры шрифта */
  --text-xxs: 0.65rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Прочее */
  --border-radius: 0.375rem;
  --border-radius-lg: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition: all 0.2s ease-in-out;

  /* Тонкая полоса прокрутки (как у .add-container в form.css) */
  --app-scrollbar-color: rgba(148, 163, 184, 0.45);
  --app-scrollbar-thumb: rgba(148, 163, 184, 0.4);
  --app-scrollbar-thumb-hover: rgba(148, 163, 184, 0.55);
}

/* 2. RESET & BASE STYLES */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  /* Прокрутка только у body: иначе на пустой главной появляется полоса (100vh vs вьюпорт, margin шапки и т.д.) */
  overflow: hidden;
}

body {
  display: flow-root;
  background-image: url('../images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  margin: 0;
  padding: 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  font-family: var(--font-family-base);
  line-height: var(--line-height);
  overflow-x: clip;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--app-scrollbar-color) transparent;
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-thumb {
  background: var(--app-scrollbar-thumb);
  border-radius: 8px;
}

body::-webkit-scrollbar-thumb:hover {
  background: var(--app-scrollbar-thumb-hover);
}

/* Внутренние области с прокруткой — тот же вид, что у формы добавления гонки */
.user-planned-cal-modal__body,
.user-reminder-inbox-modal__list,
.user-menu__planned-cal-grid,
.route-description-readonly-plain,
.route-media-lightbox__comments,
.user-cal-reminder-dialog__textarea,
.race-events-panel__body,
.race-year-cal-year-grid,
.race-year-cal-exp-cell__previews,
.race-detail-preview-overlay__body,
.catalog-route-side-panel__desc {
  scrollbar-width: thin;
  scrollbar-color: var(--app-scrollbar-color) transparent;
}

.user-planned-cal-modal__body::-webkit-scrollbar,
.user-reminder-inbox-modal__list::-webkit-scrollbar,
.user-menu__planned-cal-grid::-webkit-scrollbar,
.route-description-readonly-plain::-webkit-scrollbar,
.route-media-lightbox__comments::-webkit-scrollbar,
.user-cal-reminder-dialog__textarea::-webkit-scrollbar,
.race-events-panel__body::-webkit-scrollbar,
.race-year-cal-year-grid::-webkit-scrollbar,
.race-year-cal-exp-cell__previews::-webkit-scrollbar,
.race-detail-preview-overlay__body::-webkit-scrollbar,
.catalog-route-side-panel__desc::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.user-planned-cal-modal__body::-webkit-scrollbar-thumb,
.user-reminder-inbox-modal__list::-webkit-scrollbar-thumb,
.user-menu__planned-cal-grid::-webkit-scrollbar-thumb,
.route-description-readonly-plain::-webkit-scrollbar-thumb,
.route-media-lightbox__comments::-webkit-scrollbar-thumb,
.user-cal-reminder-dialog__textarea::-webkit-scrollbar-thumb,
.race-events-panel__body::-webkit-scrollbar-thumb,
.race-year-cal-year-grid::-webkit-scrollbar-thumb,
.race-year-cal-exp-cell__previews::-webkit-scrollbar-thumb,
.race-detail-preview-overlay__body::-webkit-scrollbar-thumb,
.catalog-route-side-panel__desc::-webkit-scrollbar-thumb {
  background: var(--app-scrollbar-thumb);
  border-radius: 8px;
}

.user-planned-cal-modal__body::-webkit-scrollbar-thumb:hover,
.user-reminder-inbox-modal__list::-webkit-scrollbar-thumb:hover,
.user-menu__planned-cal-grid::-webkit-scrollbar-thumb:hover,
.route-description-readonly-plain::-webkit-scrollbar-thumb:hover,
.route-media-lightbox__comments::-webkit-scrollbar-thumb:hover,
.user-cal-reminder-dialog__textarea::-webkit-scrollbar-thumb:hover,
.race-events-panel__body::-webkit-scrollbar-thumb:hover,
.race-year-cal-year-grid::-webkit-scrollbar-thumb:hover,
.race-year-cal-exp-cell__previews::-webkit-scrollbar-thumb:hover,
.race-detail-preview-overlay__body::-webkit-scrollbar-thumb:hover,
.catalog-route-side-panel__desc::-webkit-scrollbar-thumb:hover {
  background: var(--app-scrollbar-thumb-hover);
}

@media (max-width: 720px) {
  .route-media-lightbox {
    scrollbar-width: thin;
    scrollbar-color: var(--app-scrollbar-color) transparent;
  }

  .route-media-lightbox::-webkit-scrollbar {
    width: 8px;
  }

  .route-media-lightbox::-webkit-scrollbar-thumb {
    background: var(--app-scrollbar-thumb);
    border-radius: 8px;
  }

  .route-media-lightbox::-webkit-scrollbar-thumb:hover {
    background: var(--app-scrollbar-thumb-hover);
  }
}

/* 3. UTILITY CLASSES */
/* Цвета текста */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-light { color: var(--color-light); }
.text-dark { color: var(--color-dark); }
.text-muted { color: var(--color-gray-500); }

/* Цвета фона */
.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-success { background-color: var(--color-success); }
.bg-danger { background-color: var(--color-danger); }
.bg-warning { background-color: var(--color-warning); }
.bg-light { background-color: var(--color-light); }
.bg-dark { background-color: var(--color-dark); }
.bg-Y { background: #fbca1f; }

/* Отступы */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.ml-1 { margin-left: 0.25rem; }
.mr-1 { margin-right: 0.25rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* Размеры текста */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

/* Выравнивание текста */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-ff { font-family: inherit; }
.bolt { font-family: inherit; }



/* Flexbox утилиты */
.flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* Другие утилиты */
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }


/* 4. COMPONENT CLASSES */

/* Карточки */
.card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Навигация */
.nav {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  color: var(--color-gray-600);
  text-decoration: none;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--color-primary);
}

/* 5. LAYOUT CLASSES */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem;
}

.col {
  flex: 1;
  padding: 0 0.5rem;
}

/* Адаптивные колонки */
.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* 6. SPECIFIC COMPONENTS */
.content_top{
  /*background-color: var(--color-gray-100);*/
  /* Выше .content_subtop (12000), карты и fixed-модалок гонок (~20–21k); ниже полноэкранного лайтбокса медиа (28k). */
  position: relative;
  z-index: 22000;
  padding: 5px 10px; /* паддинги как в DOM: top/bottom 5px */
  border-radius: var(--border-radius-lg);
  margin: 5px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 1));

   backdrop-filter:
    blur(5px)          /* Размытие */
    grayscale(100%)     /* Черно-белый */
    brightness(0.8);    /* Затемнение */

    /* Прозрачность самого окна */
    background: rgba(0, 0, 0, 0.2);

}

.content_subtop {
  /* Поверх .content_mid с картой (иначе выпадающий список уходит под OL-слои); ниже модалок формы ~20k */
  position: relative;
  z-index: 12000;
  overflow: visible;
  padding: 0 10px;
  border-radius: var(--border-radius-lg);
  margin: 5px;
  height: 39px; /* как было */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 1));

  backdrop-filter:
    blur(5px)
    grayscale(100%)
    brightness(0.8);

  background: rgba(0, 0, 0, 0.2);
}

/* Страница «Гонки»: та же высота и выравнивание, что у «Треки» (.content_subtop height: 39px) */
.content_subtop.content_subtop--races-filters {
  height: 39px;
  align-items: center;
  flex-wrap: nowrap;
}

.content_subtop.content_subtop--races-filters .content-subtop-filters {
  flex-wrap: nowrap;
  align-items: center;
}

.content-subtop-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.content-subtop-favorite-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.content-subtop-favorite-filter__label {
  white-space: nowrap;
}

.catalog-favorites-only-toggle {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  box-sizing: border-box;
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.55);
  white-space: nowrap;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-favorites-only-toggle:hover {
  border-color: rgba(251, 202, 31, 0.55);
}

.catalog-favorites-only-toggle:focus {
  outline: none;
}

.catalog-favorites-only-toggle:focus-visible {
  outline: 2px solid rgba(251, 202, 31, 0.75);
  outline-offset: 2px;
}

.catalog-favorites-only-toggle.catalog-favorites-only-toggle--active {
  background: #facc15;
  color: #0f172a;
  border-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0.08em 0.08em rgba(0, 0, 0, 0.25);
}

.content-subtop-complexity-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.content-subtop-complexity-filter__label {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Кастомный выпадающий список сложности (без системной синей подсветки нативного select) */
.catalog-complexity-dropdown {
  position: relative;
  /* было 7.5rem / 11rem; −30% ширины */
  min-width: 5.25rem;
  max-width: 7.7rem;
}

.catalog-complexity-dropdown__toggle {
  width: 100%;
  height: 26px;
  padding: 0 22px 0 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  text-align: left;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px 6px;
  /* треугольник вместо синего system UI */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%230f172a' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
}

.catalog-complexity-dropdown__toggle.catalog-complexity-select--all {
  background-color: #ffffff;
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.55);
}

.catalog-complexity-dropdown__toggle.catalog-complexity-select--easy {
  background-color: #22c55e;
  color: #0f172a;
  border-color: #15803d;
}

.catalog-complexity-dropdown__toggle.catalog-complexity-select--medium {
  background-color: #eab308;
  color: #0f172a;
  border-color: #a16207;
}

.catalog-complexity-dropdown__toggle.catalog-complexity-select--hard {
  background-color: #ef4444;
  color: #0f172a;
  border-color: #b91c1c;
}

.catalog-complexity-dropdown__toggle:focus {
  outline: none;
}

.catalog-complexity-dropdown__toggle:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.45);
  outline-offset: 2px;
}

.catalog-complexity-dropdown__toggle[aria-expanded='true'] {
  border-radius: 6px 6px 0 0;
}

.catalog-complexity-dropdown__list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  z-index: 8000;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
  border-radius: 0 0 6px 6px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-top: none;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  min-width: 100%;
}

/* Строка списка = те же габариты, что у кнопки «текущий выбор» (без сдвига границ при hover) */
.catalog-complexity-dropdown__opt {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  margin: 0;
  padding: 0 22px 0 8px;
  border: none;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: font-size 0.18s ease;
}

.catalog-complexity-dropdown__opt + .catalog-complexity-dropdown__opt {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.catalog-complexity-dropdown__opt:hover {
  font-size: 13px;
}

.catalog-complexity-dropdown__opt:focus {
  outline: none;
}

.catalog-complexity-dropdown__opt:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.28);
}

.catalog-complexity-dropdown__opt.catalog-complexity-opt--all {
  background-color: #ffffff;
  color: #0f172a;
}

.catalog-complexity-dropdown__opt.catalog-complexity-opt--easy {
  background-color: #22c55e;
  color: #0f172a;
}

.catalog-complexity-dropdown__opt.catalog-complexity-opt--medium {
  background-color: #eab308;
  color: #0f172a;
}

.catalog-complexity-dropdown__opt.catalog-complexity-opt--hard {
  background-color: #ef4444;
  color: #0f172a;
}

.content_mid {
  padding: 0;
  border-radius: var(--border-radius-lg);
  margin: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.18));
  position: absolute;
  z-index: 0;
  top: 68px; /* -~10% от 75px */
  left: 0;
  right: 0;
  bottom: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  background: rgba(248, 250, 252, 0.35);
}

/* Если между шапкой и картой вставлен дополнительный контейнер — сдвигаем карту ниже */
.content_subtop + .content_mid {
  /* 75px (как было) + 38px (высота subtop) + 5px (зазор как между блоками) */
  top: calc(68px + 38px + 5px);
}

.left-items, .right-items {
  display: flex;
  gap: 10px;
  align-items: center;
}

.left-items {
  flex-shrink: 0;
}

.right-items {
  min-width: 0;
  flex-shrink: 1;
}

.center-items {
    position: fixed; /* или absolute в зависимости от needs */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 16px;
    align-items: center;
    z-index: 1000; /* Чтобы было поверх других элементов */
    max-width: calc(100vw - 24px);
    max-width: calc(100dvw - 24px);
    min-width: 0;
    box-sizing: border-box;
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, var(--color-gray-800) 0%, var(--color-primary) 100%);
  color: var(--color-light);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}

h1 {
  font-size: var(--text-4xl);
  margin-bottom: 10px;
}

.description {
  font-size: var(--text-lg);
  max-width: 800px;
  margin: 0 auto;
}

.map-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
  height: 100%;
  flex-direction: column;
}

.map-wrapper {
  flex: 1;
  min-width: 100%;
  min-height: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-width: unset;
  cursor: pointer;
}

#map {
  width: 100%;
  height: 100%;
  position: relative;
  /* Слой UI (панель гонок, кнопки) — соседи .ol-viewport; изоляция помогает порядку z-index */
  isolation: isolate;
}

.controls {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.controls h2 {
  margin-bottom: 15px;
  color: var(--color-gray-800);
}

.layer-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.layer-btn {
  padding: 10px 15px;
  background-color: var(--color-primary);
  color: var(--color-light);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.layer-btn:hover {
  background-color: var(--color-primary-hover);
}

.layer-btn.active {
  background-color: var(--color-gray-800);
}

.info-panel {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.info-panel h2 {
  margin-bottom: 15px;
  color: var(--color-gray-800);
}

.coordinates {
  margin-top: 15px;
  padding: 10px;
  background-color: var(--color-gray-100);
  border-radius: 5px;
  font-family: var(--font-family-mono);
}

/* 7. RESPONSIVE DESIGN */
@media (max-width: 768px) {
  :root {
    --text-3xl: 1.5rem;
    --text-4xl: 1.875rem;
  }

  .container {
    padding: 20px 0.5rem;
  }

  .nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Шапка и карта: адаптив в mobile-layout.css (≤899px), здесь не трогаем — иначе ломается вёрстка */
}

/* 8. HELPER CLASSES */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Меню пользователя (никнейм → панель: календарь, выход); слой шапки задаёт .content_top */
.user-menu {
  position: relative;
  z-index: 1;
}

.user-menu__toggle {
  border: 0;
  font: inherit;
}

.user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  min-width: 252px;
  max-width: min(320px, calc(100dvw - 20px));
  padding: 10px 10px 8px;
  background: linear-gradient(165deg, #f8fafc 0%, #eef2f7 100%);
  border: 2px solid #0f172a;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 1px 0 rgba(255, 255, 255, 0.65) inset;
  box-sizing: border-box;
}

.user-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 780;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  line-height: 1.35;
  cursor: pointer;
  transition:
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease;
}

.user-menu__item:hover {
  background: #fff;
  border-color: rgba(251, 202, 31, 0.55);
  box-shadow: 0 0 0 1px rgba(251, 202, 31, 0.2);
}

.user-menu__item:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

button.user-menu__item {
  appearance: none;
  -webkit-appearance: none;
}

/* Модальное окно «Мой календарь» (поверх шапки z-index 22000) */
.user-planned-cal-modal {
  position: fixed;
  inset: 0;
  z-index: 28500;
  display: flex;
  align-items: center;
  justify-content: center;
  /* safe-area: модалка не вылезает под вырез / панель; не внутри .content_top (filter ломал fixed) */
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(0.65rem, env(safe-area-inset-right, 0px))
    max(0.5rem, env(safe-area-inset-bottom, 0px)) max(0.65rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.user-planned-cal-modal[hidden] {
  display: none !important;
}

.user-planned-cal-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.65);
  cursor: pointer;
}

.user-planned-cal-modal__sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(96vw, 900px);
  height: min(
    calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.25rem),
    calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.25rem)
  );
  max-height: min(
    calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.25rem),
    calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 1.25rem)
  );
  min-height: 0;
  border-radius: 14px;
  border: 2px solid rgba(15, 23, 42, 0.55);
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  box-sizing: border-box;
}

.user-planned-cal-modal__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 6, 23, 0.4);
}

.user-planned-cal-modal__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #f8fafc;
}

.user-planned-cal-modal__close {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.user-planned-cal-modal__close:hover {
  color: #fff;
  border-color: rgba(251, 202, 31, 0.45);
}

.user-planned-cal-modal__status {
  flex-shrink: 0;
  margin: 0;
  padding: 0.35rem 0.65rem 0;
  font-size: var(--text-xs);
  color: #cbd5e1;
  line-height: 1.45;
  min-height: 0;
}

.user-planned-cal-modal__body {
  flex: 1;
  min-height: 0;
  padding: 0.4rem 0.55rem 0.55rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.user-menu__planned-cal {
  border-radius: 8px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.25);
  min-width: 0;
  max-width: 100%;
}

.user-menu__planned-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 8px;
}

.user-menu__planned-cal-year {
  font-weight: 800;
  font-size: 1rem;
  color: #f8fafc;
  min-width: 3.5rem;
  text-align: center;
}

.user-menu__planned-cal-nav {
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid rgba(251, 202, 31, 0.45);
  border-radius: 6px;
  background: rgba(251, 202, 31, 0.18);
  color: #fefce8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.user-menu__planned-cal-nav:hover {
  background: rgba(251, 202, 31, 0.32);
}

.user-menu__planned-cal-back {
  margin-left: auto;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.user-menu__planned-cal-back:hover {
  border-color: rgba(251, 202, 31, 0.5);
  color: #fefce8;
}

.user-menu__planned-cal-grid {
  max-width: 100%;
  min-width: 0;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: 6px;
  padding: 4px;
  background: rgba(2, 6, 23, 0.45);
}

/* Компактнее мини-календари внутри меню */
.user-menu__planned-cal-grid .race-year-cal-year-grid {
  gap: 0.2rem 0.24rem;
}

.user-menu__planned-cal-grid .race-year-cal-month {
  padding: 0.16rem 0.2rem 0.22rem;
}

.user-menu__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

/* «Выйти»: серый, примерно на 20 % меньше прежней жёлтой кнопки */
.user-menu__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 2px solid #64748b;
  border-radius: 9px;
  background: linear-gradient(180deg, #94a3b8 0%, #7c8aa0 100%);
  color: #f8fafc;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(30, 41, 59, 0.35);
  transition:
    background 0.12s ease,
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.user-menu__logout:hover {
  background: linear-gradient(180deg, #7c8aa0 0%, #64748b 100%);
  color: #fff;
}

.user-menu__logout:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(30, 41, 59, 0.35);
}

.user-menu__logout:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.user-menu__logout svg {
  flex-shrink: 0;
}

/* Общий вид «карточки» для страниц профиля и сообщений (согласован с меню: скругление, кайма) */
.user-app-card.mein-container {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0.65rem auto 1.5rem !important;
  width: calc(100% - 20px);
  max-width: min(700px, calc(100dvw - 20px)) !important;
  padding: 1.1rem 1.2rem 1.35rem !important;
  border-radius: 14px !important;
  border: 2px solid rgba(15, 23, 42, 0.92) !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px) grayscale(32%) brightness(0.88);
  -webkit-backdrop-filter: blur(8px) grayscale(32%) brightness(0.88);
  background: rgba(15, 23, 42, 0.72) !important;
  box-sizing: border-box;
}

/* --- Страница профиля: нейтральная серая карточка (без slate / без «стекла»), мелкие кнопки --- */
.user-app-card.mein-container.profile-page {
    margin: 0.5rem auto 1rem !important;
    padding: 0.75rem 0.9rem 0.95rem !important;
    max-width: min(28rem, calc(100dvw - 16px)) !important;
    width: calc(100% - 12px);
    background: rgba(56, 56, 56, 0.97) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.profile-page__section {
    margin-bottom: 0.75rem;
}

.profile-page__section:last-child {
    margin-bottom: 0;
}

.profile-page__section-title {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(210, 210, 210, 0.95);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.profile-page__section-title i {
    opacity: 0.85;
    font-size: 0.85rem;
}

.profile-page__section--data .profile-page__section-title {
    margin-bottom: 0.28rem;
    /* Между «на всю ширину карточки» и сильным сужением (~24.25rem): ~26.25rem */
    max-width: min(26.25rem, calc(100% - 0.7rem));
    margin-left: auto;
    margin-right: auto;
}

/* Вкладка «Данные»: узкая колонка только для полей и смены пароля (плашка организатора — на всю ширину секции) */
.user-app-card.mein-container.profile-page .profile-page__data-sheet {
    width: 100%;
    max-width: min(26.25rem, calc(100% - 0.7rem));
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Плашка статуса организатора — на всю ширину секции «Данные», не уже колонки полей */
.user-app-card.mein-container.profile-page .profile-page__section--data > .profile-org-status--data-bleed {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

.profile-org-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.42rem;
    padding: 0.42rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.22);
}

.profile-org-status__body {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 9rem;
}

.profile-org-status__icon {
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1;
    margin-top: 0.14rem;
    opacity: 0.88;
}

.profile-org-status--organizer {
    border-color: rgba(74, 222, 128, 0.35);
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.35) 0%, rgba(0, 0, 0, 0.2) 100%);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.08);
}

.profile-org-status--organizer .profile-org-status__icon {
    color: #bbf7d0;
}

.profile-org-status--pending {
    border-color: rgba(251, 191, 36, 0.38);
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.22) 0%, rgba(0, 0, 0, 0.18) 100%);
}

.profile-org-status--pending .profile-org-status__icon {
    color: #fde68a;
}

.profile-org-status--guest {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(30, 41, 59, 0.2);
}

.profile-org-status--guest .profile-org-status__icon {
    color: rgba(203, 213, 225, 0.92);
}

.profile-org-status--rejected {
    border-color: rgba(248, 113, 113, 0.38);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.28) 0%, rgba(0, 0, 0, 0.18) 100%);
}

.profile-org-status--rejected .profile-org-status__icon {
    color: #fecaca;
}

.profile-org-status__content {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.profile-org-status__title {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.22;
    color: rgba(248, 250, 252, 0.98);
}

.profile-org-status__desc {
    display: block;
    font-size: 0.66rem;
    line-height: 1.32;
    color: rgba(210, 214, 220, 0.9);
}

.user-app-card.mein-container.profile-page .profile-org-status__cta {
    padding: 0.28rem 0.55rem;
    font-size: 0.68rem;
    flex-shrink: 0;
    align-self: center;
}

@media (max-width: 575.98px) {
    .user-app-card.mein-container.profile-page .profile-org-status__cta {
        width: 100%;
        justify-content: center;
    }
}

.profile-page__email-extras {
    margin-top: 0.12rem;
    line-height: 1.25;
}

.profile-page__section--data .profile-page__actions {
    margin-top: 0.28rem;
    padding-top: 0.15rem;
}

.profile-page__form--password .profile-page__actions {
    margin-top: 0.28rem;
    padding-top: 0.12rem;
}

.profile-page__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(220, 220, 220, 0.95);
    margin: 0;
}

.profile-page__label--muted {
    opacity: 0.55;
}

.profile-page__field-hint {
    font-size: 0.68rem;
    line-height: 1.35;
    color: rgba(200, 200, 200, 0.5);
}

.profile-page__handle-line {
    font-size: 0.9rem;
    color: rgba(235, 235, 235, 0.95);
}

.profile-page__handle-at {
    opacity: 0.55;
    margin-right: 0.06rem;
}

.profile-page__handle-code {
    font-size: 0.88rem;
    padding: 0.12rem 0.35rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.25);
    color: #fbfbf0;
}

.profile-page__hint {
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(200, 200, 200, 0.92);
}

.profile-page__hint--pending {
    color: rgba(210, 210, 200, 0.96);
}

.profile-page__form .form-control {
    background: #2f2f2f;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f2f2f2;
}

.profile-page__form .form-control:focus {
    border-color: rgba(251, 202, 31, 0.55);
    box-shadow: 0 0 0 2px rgba(251, 202, 31, 0.12);
    background: #353535;
    color: #fff;
}

.profile-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding-top: 0.35rem;
}

.user-app-card.mein-container.profile-page .but.profile-page__btn {
    padding: 0.32rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-width: 2px;
    border-radius: 0.38em;
    box-shadow: 0.06em 0.06em;
    line-height: 1.2;
}

.user-app-card.mein-container.profile-page .but.profile-page__btn:hover {
    transform: translate(-0.03em, -0.03em);
    box-shadow: 0.1em 0.1em;
}

.user-app-card.mein-container.profile-page .but.profile-page__btn:active {
    transform: translate(0.03em, 0.03em);
    box-shadow: 0.04em 0.04em;
}

.user-app-card.mein-container.profile-page .but.profile-page__btn i {
    margin-right: 0.25em;
    font-size: 0.92em;
    vertical-align: -0.06em;
}

.user-app-card.mein-container.profile-page .but.profile-page__btn--ghost {
    background: rgba(0, 0, 0, 0.2);
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none;
}

.user-app-card.mein-container.profile-page .but.profile-page__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: none;
    box-shadow: none;
}

.user-app-card.mein-container.profile-page .but.profile-page__btn--ghost:active {
    transform: translate(0, 1px);
    box-shadow: none;
}

.user-app-card.mein-container.profile-page .profile-page__pwd-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    color: rgba(129, 196, 255, 0.95);
    font-size: 0.72rem;
    font-weight: 400;
    text-decoration: underline;
    text-underline-offset: 0.12em;
    cursor: pointer;
    text-align: left;
}

.user-app-card.mein-container.profile-page .profile-page__pwd-link:hover {
    color: rgba(186, 220, 255, 1);
}

.user-app-card.mein-container.profile-page .profile-page__pwd-link:focus-visible {
    outline: 2px solid rgba(251, 202, 31, 0.55);
    outline-offset: 2px;
    border-radius: 2px;
}

.profile-page__pwd-panel {
    margin-top: 0.32rem;
    margin-bottom: 0.25rem;
    padding: 0.55rem 0.5rem 0.2rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-page__form--password {
    margin: 0;
}

.profile-page__pwd-help {
    margin-top: 0.35rem;
    color: rgba(175, 175, 175, 0.98) !important;
    font-size: 0.68rem !important;
    line-height: 1.35;
}

.profile-page__pwd-help ul {
    margin: 0.25rem 0 0;
    padding-left: 1rem;
}

.user-app-card.messages-page-shell {
  border-radius: 14px;
  border: 2px solid rgba(15, 23, 42, 0.92);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
}

.user-header-acts {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  --user-header-act-h: calc(35px * 1.05); /* +5 % к текущему размеру кнопок */
}

/* Компактнее и одинаковой высоты: почта и кнопка с ником */
.user-header-acts .user-reminder-mail-btn {
  width: var(--user-header-act-h);
  height: var(--user-header-act-h);
  border-radius: 0.55em;
}

.user-header-acts .user-reminder-mail-btn__icon svg {
  width: calc(16px * 1.05);
  height: calc(16px * 1.05);
}

/* Чтобы кнопка с ником совпадала по вертикали с почтой */
.user-header-acts .user-menu {
  display: flex;
  align-items: center;
}

.user-header-acts .user-menu__toggle.but {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--user-header-act-h);
  min-height: var(--user-header-act-h);
  max-height: var(--user-header-act-h);
  padding: 0 0.75em;
  margin: 0;
  /* .user-menu__toggle задаёт font: inherit — из‑за этого текст «плывёт» по вертикали */
  font-family: inherit;
  font-size: calc(10.5px * 1.1); /* +10 % только текст никнейма */
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
  border-radius: 0.55em;
  appearance: none;
  -webkit-appearance: none;
}

.user-reminder-mail-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 3px solid #0f172a;
  border-radius: 0.4em;
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0.08em 0.08em 0 #0f172a;
  box-sizing: border-box;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
}

.user-reminder-mail-btn:hover {
  transform: translate(-0.04em, -0.04em);
  box-shadow: 0.12em 0.12em 0 #0f172a;
}

.user-reminder-mail-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-reminder-mail-btn__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 0.95rem;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid #0f172a;
}

.user-cal-day-menu-popover {
  position: fixed;
  z-index: 28650;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 0.35rem;
  border-radius: 8px;
  border: 2px solid #0f172a;
  background: rgba(248, 250, 252, 0.99);
  box-shadow: 0.12em 0.12em 0 #0f172a;
  box-sizing: border-box;
}

.user-cal-day-menu-popover[hidden] {
  display: none !important;
}

.user-cal-day-menu-popover__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  margin: 0;
  padding: 0.5rem 0.55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
}

.user-cal-day-menu-popover__item:hover {
  background: rgba(251, 202, 31, 0.22);
}

.user-cal-day-menu-popover__muted {
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}

.user-cal-day-menu-popover__main {
  font-size: 0.85rem;
  font-weight: 800;
}

.user-cal-reminder-dialog {
  position: fixed;
  inset: 0;
  z-index: 28700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(0.65rem, env(safe-area-inset-right, 0px))
    max(0.5rem, env(safe-area-inset-bottom, 0px)) max(0.65rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.user-cal-reminder-dialog[hidden] {
  display: none !important;
}

.user-cal-reminder-dialog__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.55);
  cursor: pointer;
}

.user-cal-reminder-dialog__sheet {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  padding: 1rem 1rem 0.85rem;
  border-radius: 10px;
  border: 2px solid #0f172a;
  background: rgba(248, 250, 252, 0.99);
  box-shadow: 0.14em 0.14em 0 #0f172a;
  box-sizing: border-box;
}

.user-cal-reminder-dialog__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.user-cal-reminder-dialog__hint {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}

.user-cal-reminder-dialog__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
}

.user-cal-reminder-dialog__textarea {
  width: 100%;
  min-height: 6.5rem;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.55rem;
  border: 2px solid #0f172a;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  resize: vertical;
  box-sizing: border-box;
  background: #fff;
  color: #0f172a;
}

.user-cal-reminder-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.user-cal-reminder-dialog__btn {
  margin: 0;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid #0f172a;
}

.user-cal-reminder-dialog__btn--ghost {
  background: #fff;
  color: #0f172a;
}

.user-cal-reminder-dialog__btn--primary {
  background: #fbca1f;
  color: #0f172a;
  box-shadow: 0.06em 0.06em 0 #0f172a;
}

.user-reminder-inbox-modal {
  position: fixed;
  inset: 0;
  z-index: 28680;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(0.65rem, env(safe-area-inset-right, 0px))
    max(0.5rem, env(safe-area-inset-bottom, 0px)) max(0.65rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.user-reminder-inbox-modal[hidden] {
  display: none !important;
}

.user-reminder-inbox-modal__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(2, 6, 23, 0.55);
  cursor: pointer;
}

.user-reminder-inbox-modal__sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(92vw, 440px);
  max-height: min(78dvh, 520px);
  border-radius: 10px;
  border: 2px solid #0f172a;
  background: rgba(248, 250, 252, 0.99);
  box-shadow: 0.14em 0.14em 0 #0f172a;
  overflow: hidden;
  box-sizing: border-box;
}

.user-reminder-inbox-modal__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 2px solid rgba(15, 23, 42, 0.1);
  background: rgba(251, 202, 31, 0.2);
}

.user-reminder-inbox-modal__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.user-reminder-inbox-modal__close {
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 2px solid #0f172a;
  border-radius: 6px;
  background: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  color: #0f172a;
}

.user-reminder-inbox-modal__list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem 0.65rem 0.65rem;
}

.user-reminder-inbox-modal__loading,
.user-reminder-inbox-modal__empty {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #475569;
}

.user-reminder-inbox-modal__item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.45rem;
  border-radius: 8px;
  border: 2px solid rgba(15, 23, 42, 0.12);
  background: #fff;
}

.user-reminder-inbox-modal__item:last-child {
  margin-bottom: 0;
}

.user-reminder-inbox-modal__item--read {
  opacity: 0.72;
}

.user-reminder-inbox-modal__item-date {
  flex: 0 0 5.75rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  line-height: 1.35;
}

.user-reminder-inbox-modal__item-body {
  flex: 1;
  min-width: 0;
}

.user-reminder-inbox-modal__item-thumb {
  float: left;
  margin: 0 0.5rem 0.35rem 0;
  max-width: 120px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.user-reminder-inbox-modal__item-thumb img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.user-reminder-inbox-modal__item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.user-reminder-inbox-modal__item-msg {
  font-size: 0.82rem;
  color: #0f172a;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-reminder-inbox-modal__item-body::after {
  content: '';
  display: table;
  clear: both;
}

.user-reminder-inbox-modal__item-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
}

.user-reminder-inbox-modal__item-link:hover {
  text-decoration: underline;
}


