/* ===== CSS VARIABLES ===== */
:root {
  --color-background: #0f1111;
  --color-surface: rgba(38, 40, 40, 0.85);
  --color-text: #f5f5f5;
  --color-text-secondary: rgba(167, 169, 169, 0.7);
  --color-primary: #32b8c6;
  --color-primary-hover: #2da6b2;
  --color-border: rgba(119, 124, 124, 0.3);
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 20px;
  --spacing-xl: 24px;
  --border-radius: 8px;
  --font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Единый источник параметров Liquid Glass для всех карточек приложения. */
  --liquid-glass-blur: 0px;
  --liquid-glass-saturate: 100%;
  --liquid-glass-displacement: 10;
  --liquid-glass-border: rgba(190, 220, 255, .24);
  --page-header-height: 72px;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  /* Базовый режим — PWA. Нативная оболочка переопределяет значение в mobile.css. */
  --app-viewport-height: 100vh;
}

/* ===== СНЕЖИНКИ ===== */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1; /* За звёздами, но перед фоном */
    display: none; /* По умолчанию скрыто, показываем через JS */
}

.snowflake {
    position: absolute;
    top: -20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    animation: snowfall linear infinite;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes snowfall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 20%; animation-duration: 10s; animation-delay: 1s; }
.snowflake:nth-child(3) { left: 30%; animation-duration: 12s; animation-delay: 2s; }
.snowflake:nth-child(4) { left: 40%; animation-duration: 9s; animation-delay: 3s; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 11s; animation-delay: 4s; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 13s; animation-delay: 5s; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 8s; animation-delay: 6s; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 10s; animation-delay: 7s; }
.snowflake:nth-child(9) { left: 90%; animation-duration: 12s; animation-delay: 8s; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 9s; animation-delay: 9s; }

/* ===== АДАПТИВНОСТЬ ДЛЯ СНЕЖИНОК ===== */
@media (max-width: 480px) {
    .snowflake {
        font-size: 14px;
    }
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 14px;
  height: var(--app-viewport-height);
  min-height: var(--app-viewport-height);
  overflow: hidden;
  isolation: isolate;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Текст интерфейса не должен выделяться долгим нажатием. Ввод и специально
   помеченные данные остаются нормальными нативными полями. */
input,
textarea,
select,
option,
[contenteditable="true"],
[data-selectable] {
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

img {
  -webkit-user-drag: none;
}

/* На заставке звёзды поднимаются над её прозрачным фоном, но остаются под
   логотипом. После перехода в приложение класс снимается, и слой возвращается
   в обычный фоновой режим. */
html.splash-active,
html.splash-active body {
  background: #000;
}

html.splash-active .stars-background {
  z-index: 1001;
}

.raketa-confetti-layer { position:fixed; inset:0; z-index:2000; pointer-events:none; overflow:hidden; }
.raketa-confetti { position:absolute; top:-24px; width:8px; height:12px; border-radius:2px; opacity:0; animation:raketaConfettiFall var(--duration) linear forwards; }
@keyframes raketaConfettiFall { 0% { transform:translate3d(0,0,0) rotate(0); opacity:0; } 10% { opacity:1; } 90% { opacity:.85; } 100% { transform:translate3d(var(--drift),105vh,0) rotate(540deg); opacity:0; } }

/* Desktop centering */
@media (min-width: 768px) {
  body {
    display: flex;
    justify-content: center;
    background: var(--color-background);
  }
  body > div[id$="-screen"] {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
  }

  #loading-screen {
    max-width: none;
    margin: 0;
  }
}

/* ===== UTILITY CLASSES ===== */
.hidden { display: none !important; }

.no-data, .loading, .error {
  text-align: center;
  padding: 40px 20px;
  font-family: var(--font-family);
}
.no-data, .loading { color: var(--color-text-secondary); }
.loading { display:flex; align-items:center; justify-content:center; gap:10px; min-height:88px; font:600 13px/1.2 var(--font-family); }
.loading-indicator { width:16px; height:16px; border:2px solid rgba(15,91,255,.22); border-top-color:#0f5bff; border-radius:50%; animation:spin .8s linear infinite; flex:0 0 auto; }
.error { color: #f44336; }

/* ===== SCREEN CONTAINERS ===== */
.screen-container {
  min-height: 100vh;
  padding: var(--spacing-md);
  display: flex;
  justify-content: center;
  align-items: center;
}

.content-container {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: var(--app-viewport-height);
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  z-index: 1002;
  overflow: hidden;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.loading-container {
  text-align: center;
  perspective: 900px;
}

/* На заставке логотип остаётся в центре, версия закреплена снизу по центру. */
#loading-screen .logo {
  width: min(58vw, 190px);
  max-width: none;
  margin: 0;
  transform-origin: center;
  will-change: transform, opacity;
  animation: raketa-splash-launch 620ms cubic-bezier(.22, .8, .3, 1) 1s both;
}

#loading-screen .splash-version {
  position: absolute;
  right: 0;
  bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  left: 0;
  width: max-content;
  margin: 0 auto;
  padding: 7px 12px;
  border: 1px solid rgba(185, 211, 255, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: rgba(220, 232, 250, .82);
  font: 600 11px/1 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .12em;
  text-shadow: 0 0 16px rgba(107, 163, 255, .34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#loading-screen .loading-spinner,
#loading-screen .loading-text,
#loading-screen .author-info {
  display: none;
}

@keyframes raketa-splash-launch {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  55% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(3.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  #loading-screen .logo {
    animation: raketa-splash-reduced 250ms ease-out 1s both;
  }
}

@keyframes raketa-splash-reduced {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.08); }
}

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(15,91,255,.22);
  border-top-color: #0f5bff;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
  margin: 30px auto;
}

.loading-text {
  margin: 0;
  color: #8e99a8;
  font-size: 12px;
  font-weight: 600;
}

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

/* ===== AUTH SCREEN ===== */
#auth-screen {
  min-height: var(--app-viewport-height);
  display: flex;
  justify-content: center;
  align-items: flex-start;   /* прижимаем к верху */
  padding-top: max(40px, calc(var(--safe-area-top) + 24px));
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
  padding-bottom: max(var(--spacing-md), var(--safe-area-bottom));
}

.auth-container h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 40px 0 32px 0;
  text-align: center;
  width: 100%;
}

.telegram-widget-container {
  margin: 32px 0;
  display: flex;
  justify-content: center;
}

/* ===== MAIN SCREEN LAYOUT ===== */
#main-screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: var(--app-viewport-height);
  min-height: 0;
  overflow: hidden;
  padding-top: var(--safe-area-top);
  padding-bottom: 0;
}

/* Full-screen iOS leaves system areas to the web view. Internal screens need
   their headers below the Dynamic Island, not beneath it. */
#birthdays-screen,
#newbies-screen,
#employees-screen,
#parking-screen,
#office-screen,
#polls-screen,
#poll-questions-screen {
  min-height: var(--app-viewport-height);
  padding-top: var(--safe-area-top);
  padding-bottom: var(--safe-area-bottom);
}

.main-header { padding: var(--spacing-md); text-align: center; }

/* Единственная верхняя панель для всех внутренних разделов. */
.page-header {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: min(100%, 430px);
  min-height: 72px;
  margin: 0 auto;
  padding: 16px;
  color: #f5f7fa;
}

.page-back-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #29313d;
  border-radius: 10px;
  background: #11151d;
  color: #8e99a8;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.page-back-button:hover,
.page-back-button:focus-visible {
  border-color: #0f5bff;
  color: #f5f7fa;
}

.page-back-button:focus-visible {
  outline: 2px solid #0f5bff;
  outline-offset: 2px;
}

.page-back-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-heading { min-width: 0; }
.page-heading h1 {
  margin: 0;
  color: #f5f7fa;
  font: 700 24px/1.1 var(--font-family);
  letter-spacing: -0.06em;
}
.page-heading p {
  margin: 5px 0 0;
  color: #8e99a8;
  font: 12px/1.4 var(--font-family);
}

/* Верхние панели остаются навигационным слоем над контентом: карточки могут
   прокручиваться под стеклом, а заголовок и кнопка «назад» не теряют контраст. */
#birthdays-screen > .page-header,
#newbies-screen > .page-header,
#employees-screen > .page-header,
#parking-screen > .page-header,
#office-screen > .page-header,
#polls-screen > .page-header,
#poll-questions-screen > .page-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  min-height: calc(var(--page-header-height) + var(--safe-area-top));
  padding: calc(16px + var(--safe-area-top)) 16px 16px;
  border-bottom: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(0) saturate(100%);
  -webkit-backdrop-filter: blur(0) saturate(100%);
  transition: background 180ms ease, box-shadow 180ms ease, backdrop-filter 180ms ease, -webkit-backdrop-filter 180ms ease;
}

#birthdays-screen > .birthdays-content,
#newbies-screen > .newbies-content,
#employees-screen > .employees-content,
#parking-screen > .parking-content,
#office-screen > .office-content,
#polls-screen > .polls-content,
#poll-questions-screen > .poll-questions-content {
  padding-top: calc(var(--page-header-height) + var(--safe-area-top) + 12px);
}

/* The glass reaches the system area; its inner padding owns the top inset. */
#birthdays-screen,
#newbies-screen,
#employees-screen,
#parking-screen,
#office-screen,
#polls-screen,
#poll-questions-screen {
  padding-top: 0;
  padding-bottom: 0;
}

#birthdays-screen > .birthdays-content,
#newbies-screen > .newbies-content,
#employees-screen > .employees-content,
#parking-screen > .parking-content,
#office-screen > .office-content,
#polls-screen > .polls-content,
#poll-questions-screen > .poll-questions-content {
  padding-bottom: calc(12px + var(--safe-area-bottom));
}

#employee-screen .employee-profile-v2 > .page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--page-header-height);
  border-bottom: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: blur(0) saturate(100%);
  -webkit-backdrop-filter: blur(0) saturate(100%);
  transition: background 180ms ease, box-shadow 180ms ease, backdrop-filter 180ms ease, -webkit-backdrop-filter 180ms ease;
}

#birthdays-screen > .page-header.page-header-is-elevated,
#newbies-screen > .page-header.page-header-is-elevated,
#employees-screen > .page-header.page-header-is-elevated,
#parking-screen > .page-header.page-header-is-elevated,
#office-screen > .page-header.page-header-is-elevated,
#polls-screen > .page-header.page-header-is-elevated,
#poll-questions-screen > .page-header.page-header-is-elevated,
#employee-screen .employee-profile-v2 > .page-header.page-header-is-elevated {
  background: linear-gradient(180deg, rgba(21, 26, 35, .78), rgba(21, 26, 35, .48));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 9px 26px rgba(0, 0, 0, .12);
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #birthdays-screen > .page-header.page-header-is-elevated,
  #newbies-screen > .page-header.page-header-is-elevated,
  #employees-screen > .page-header.page-header-is-elevated,
  #parking-screen > .page-header.page-header-is-elevated,
  #office-screen > .page-header.page-header-is-elevated,
  #polls-screen > .page-header.page-header-is-elevated,
  #poll-questions-screen > .page-header.page-header-is-elevated,
  #employee-screen .employee-profile-v2 > .page-header.page-header-is-elevated {
    background: rgba(21, 26, 35, .94);
  }
}
.main-content {
  flex: 1;
  min-height: 0;
  padding: 24px var(--spacing-md);
  text-align: center;
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
}
.main-footer {
  padding: 8px;
  text-align: center;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* ===== MAIN MENU ===== */
.main-menu {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 24px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.birthday-greeting { margin:0 0 24px; padding:16px 14px; border:1px solid #0f5bff; border-radius:12px; background:linear-gradient(110deg,rgba(15,91,255,.2),#11151d); color:#f5f7fa; font:700 16px/1.4 var(--font-family); letter-spacing:-.03em; cursor:pointer; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: #11151d;
  border: 1px solid #29313d;
  border-radius: 12px;
  color: #f5f7fa;
  cursor: pointer;
  transition: border-color 150ms ease, transform 120ms ease, opacity 120ms ease, background-color 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.menu-item:hover {
  border-color: #0f5bff;
}

.menu-item:active {
  border-color: #0f5bff;
  background: rgba(15, 91, 255, .22);
  transform: scale(.985);
}

.menu-item.is-loading {
  border-color: #0f5bff;
  background: rgba(15, 91, 255, .16);
  cursor: default;
  pointer-events: none;
  opacity: .9;
  transform: none;
  box-shadow: inset 0 0 0 1px rgba(15,91,255,.7), 0 0 18px rgba(15,91,255,.16);
}

/* Experimental native Liquid Glass material — limited to the main menu while
   we calibrate it against the live iPhone background. */
#main-screen .menu-item.liquid-glass-card {
  border-color: rgba(218, 235, 255, .24);
  background: linear-gradient(135deg,
    rgba(255, 255, 255, .13) 0%,
    rgba(214, 231, 255, .065) 44%,
    rgba(123, 163, 226, .075) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .44),
    inset 0 -1px 0 rgba(255, 255, 255, .07),
    0 12px 30px rgba(0, 0, 0, .18);
  backdrop-filter: blur(24px) saturate(165%) brightness(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(165%) brightness(1.12);
  transition: transform 260ms cubic-bezier(.2, .8, .2, 1), filter 180ms ease,
    border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

#main-screen .menu-item.liquid-glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(110% 80% at 8% 0%, rgba(255, 255, 255, .14), transparent 54%);
}

#main-screen .menu-item.liquid-glass-card > * {
  position: relative;
  z-index: 1;
}

#main-screen .menu-item.liquid-glass-card:hover {
  border-color: rgba(224, 240, 255, .38);
}

#main-screen .menu-item.liquid-glass-card:active {
  border-color: rgba(230, 244, 255, .48);
  background: linear-gradient(135deg, rgba(255, 255, 255, .25), rgba(131, 172, 241, .16));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .48), 0 7px 18px rgba(0, 0, 0, .16);
}

#main-screen .menu-item.liquid-glass-card .menu-emoji {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #1d6cff;
  filter: drop-shadow(0 1px 5px rgba(29, 108, 255, .28));
}

/* Liquid Glass: один общий стиль для карточек меню, сотрудников, дней рождения и опросов. */
.menu-item.liquid-glass-card,
.employee-item.liquid-glass-card,
.birthday-card.liquid-glass-card,
.newbie-card.liquid-glass-card,
.poll-item.liquid-glass-card,
.parking-list.liquid-glass-card,
#poll-questions-screen .question-item.liquid-glass-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(218, 235, 255, .20);
  background: linear-gradient(135deg, rgba(255, 255, 255, .105), rgba(177, 208, 255, .045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30),
    inset 0 -1px 0 rgba(255, 255, 255, .045),
    0 10px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
}

/* The office is a single shared sheet of glass, so its internal places remain
   part of one map rather than turning into thirty independent cards. */
#office-screen .office-cabinets {
  border-color: rgba(218, 235, 255, .20);
  background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(177, 208, 255, .035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28),
    inset 0 -1px 0 rgba(255, 255, 255, .04),
    0 12px 30px rgba(0, 0, 0, .18);
  backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
}

#employee-screen .employee-profile-hero,
#employee-screen .employee-details {
  border-color: rgba(218, 235, 255, .20);
  background: linear-gradient(135deg, rgba(255, 255, 255, .105), rgba(177, 208, 255, .045));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30),
    inset 0 -1px 0 rgba(255, 255, 255, .045),
    0 10px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(155%) brightness(1.06);
}

/* В парковке стекло одно на всю таблицу, строки остаются прозрачными. */
.parking-list.liquid-glass-card .parking-v2-spot {
  background: transparent;
}

.parking-list.liquid-glass-card .parking-v2-spot.is-current {
  background: rgba(15, 91, 255, .08);
}

.parking-list.liquid-glass-card .parking-v2-spot + .parking-v2-spot {
  border-top-color: rgba(210, 232, 255, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22),
    inset 0 -1px 0 rgba(0, 0, 0, .48);
}

/* Пользовательские аватары не имеют собственной рамки — рамка остаётся у стеклянной ячейки. */
#employees-screen .employee-item-photo,
#employees-screen .employee-item-photo-placeholder,
#birthdays-screen .birthday-list-avatar,
#newbies-screen .birthday-list-avatar,
#parking-screen .parking-v2-avatar,
#office-screen .office-place-avatar,
#employee-screen .employee-profile-avatar,
.author-photo {
  border: 0 !important;
}

#parking-screen .parking-v2-spot.is-current .parking-v2-avatar {
  border: 0 !important;
  box-shadow: 0 0 0 2px #0f5bff, 0 0 12px rgba(15, 91, 255, .3);
}

/* Parking must remain readable even if its optional module stylesheet arrives
   late in a standalone PWA. These are the structural rules, not decoration. */
#parking-screen .parking-v2-section { width:100%; }
#parking-screen .parking-v2-list { width:100%; margin:0; border-radius:11px; overflow:hidden; }
#parking-screen .parking-v2-scroll-list { overflow:hidden; }
#parking-screen .parking-v2-spot {
  display:grid;
  grid-template-columns:40px minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  min-height:48px;
  padding:4px 11px;
  background:transparent;
  font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
}
#parking-screen .parking-v2-spot + .parking-v2-spot {
  border-top:1px solid rgba(210,232,255,.62);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.48);
}
#parking-screen .parking-v2-spot.is-current {
  background:rgba(15,91,255,.14);
  box-shadow:inset 3px 0 #0f5bff, inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.48);
}
#parking-screen .parking-v2-number {
  display:flex;
  align-items:center;
  justify-content:center;
  color:#f5f7fa;
  font:700 18px/1 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
}
#parking-screen .parking-v2-copy { min-width:0; text-align:left; }
#parking-screen .parking-v2-copy strong,
#parking-screen .parking-v2-copy small {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
}
#parking-screen .parking-v2-copy strong { color:#f5f7fa; font-size:12px; }
#parking-screen .parking-v2-copy small { margin-top:3px; color:#8e99a8; font-size:10px; }
#parking-screen .parking-v2-trailing { display:flex; align-items:center; gap:8px; }
#parking-screen .parking-v2-trailing em { color:#0f5bff; font-size:10px; font-style:normal; }
#parking-screen .parking-v2-avatar {
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  overflow:hidden;
  border-radius:10px;
  background:#18243d;
  color:#b9ceff;
  font-size:11px;
  font-weight:700;
}
#parking-screen .parking-v2-avatar img { width:100%; height:100%; object-fit:cover; }
#parking-screen .parking-v2-spot-unknown .parking-v2-number,
#parking-screen .parking-v2-spot-unknown .parking-v2-copy strong,
#parking-screen .parking-v2-spot-unknown .parking-v2-copy small { color:#687385; }

.menu-emoji {
  flex-shrink: 0;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #0f5bff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f5bff;
}

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.menu-emoji svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.menu-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.menu-title {
  display: block;
  color: #f5f7fa;
  font-size: 14px;
  font-weight: 700;
}

.menu-meta {
  display: block;
  margin-top: 4px;
  color: #8e99a8;
  font-size: 12px;
}

.menu-meta.menu-meta-accent {
  color: #0f5bff;
}

.office-menu-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.office-menu-badge {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: bold;
  background: transparent;
  box-shadow: none;
}

.office-menu-badge-free { color: #fff; }
.office-menu-badge-orange { color: #fff; }
.office-menu-badge-orange { display: none; }

.office-menu-badge::after {
  display: block;
  font-size: 8px;
  line-height: 1;
  font-weight: 500;
  margin-top: 2px;
}

.office-menu-badge-free::after { content: 'своб.'; }
.office-menu-badge-orange::after { content: 'запр.'; }

.menu-badge.employees-count {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  box-shadow: none;
  font-size: 14px;
  font-weight: 600;
}

/* ===== NOTIFICATIONS ===== */
.custom-notification .notification-content {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
}

.custom-notification .notification-message {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.custom-notification .notification-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  color: #263238;
  font-size: 18px;
  line-height: 20px;
  cursor: pointer;
}

/* ===== BADGES ===== */
.menu-badge {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
  margin-left: auto;
  background: transparent;
  box-shadow: none;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.menu-badge.parking-booked {
  color: #fff;
  animation: parkingPulse 1s infinite ease-in-out;
  font-size: 16px;
  font-weight: 700;
}

.menu-badge.birthdays-today {
  width: auto;
  min-width: 36px;
  height: 38px;
  padding: 0 2px 0 0;
  gap: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: none;
}

.birthday-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  margin-left: -11px;
  overflow: hidden;
  border: 2px solid #0f5bff;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(15, 91, 255, 0.8), 0 0 12px rgba(15, 91, 255, 0.7);
  animation: birthdayAvatarPulse 1.6s infinite ease-in-out;
  color: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.birthday-avatar:first-child {
  margin-left: 0;
}

.birthday-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.birthday-avatar-fallback {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.menu-badge.parking-free,
.menu-badge.birthdays-next,
.menu-badge.newbies-week {
  color: #fff;
  animation: gentlePulse 3s infinite ease-in-out;
}

.menu-badge.parking-none {
  color: #fff;
  animation: gentlePulse 3s infinite ease-in-out;
}

.menu-badge.sync-questions {
  color: #fff;
  animation: gentlePulse 3s infinite ease-in-out;
}

/* Badge layouts */
.menu-badge.parking-free,
.menu-badge.parking-none,
.menu-badge.birthdays-next {
  flex-direction: column;
  padding: 2px;
  font-size: 10px;
  line-height: 1;
}

.menu-count-number.is-stale {
  color: #ffd166;
  text-shadow: 0 0 8px rgba(255, 190, 55, 0.55);
}

.menu-badge.birthdays-next {
  font-size: 14px;
  line-height: 1.1;
}

.parking-text {
  font-size: 14px;
  font-weight: 600;
  margin-top: 1px;
  line-height: 1;
}

@keyframes parkingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes birthdayAvatarPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 1px rgba(15, 91, 255, 0.8), 0 0 10px rgba(15, 91, 255, 0.6);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px rgba(15, 91, 255, 0.95), 0 0 18px rgba(15, 91, 255, 0.95);
  }
}

/* ===== VISUAL ELEMENTS ===== */
.stars-background {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
}

.star {
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.95), 0 0 16px rgba(180, 215, 255, 0.7);
  animation: starFly 12s infinite ease-in-out;
  will-change: transform, opacity;
}

@keyframes starFly {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -50%, 0) scale(0.2);
  }
  18% {
    opacity: 0.35;
  }
  70% {
    opacity: 1;
    transform: translate3d(calc(-50% + var(--target-x)), calc(-50% + var(--target-y)), 0) scale(var(--depth));
  }
  88% {
    opacity: 0.45;
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(-50% + var(--target-x)), calc(-50% + var(--target-y)), 0) scale(var(--depth));
  }
}

.logo {
  display: block;
  max-width: 150px;
  width: auto;
  margin: 0 auto 0 auto;
  height: auto;
}

.back-btn {
  background: none;
  border: none;
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 18px;
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-md);
  margin-right: 10px;
  border-radius: var(--border-radius);
  transition: background-color 150ms ease;
}

.back-btn:hover {
  background: rgba(119,124,124,0.15);
}

/* ===== AUTHOR INFO ===== */
.author-info {
  position: absolute;
  bottom: 20px; left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  color: #8e99a8;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  transform: translateX(-50%);
  transition: opacity 150ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.main-content > .author-info {
  position: absolute;
  /* Центр строки совпадает по высоте с центром кнопки выхода. */
  bottom: 20px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 88px);
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
}

.main-content {
  padding-bottom: 70px;
}

.author-info:hover {
  opacity: .9;
}

.author-photo {
  width: 26px; height: 26px;
  border: 1px solid #000;
  border-radius: 7px;
  object-fit: cover;
  background: #18243d;
  filter: brightness(1.08) contrast(1.08);
}

.author-text {
  color: #8e99a8;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.author-emoji {
  font-size: 10px;
  line-height: 1;
}

@keyframes authorTextShine {
  0%, 64% { background-position: 130% 0; }
  92%, 100% { background-position: -30% 0; }
}

/* ===== LOGOUT BUTTON ===== */
.logout-button {
  position: fixed;
  bottom: 15px; left: 15px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.logout-button:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

/* ===== SCROLL FIXES ===== */
[id$="-screen"] {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* iOS-style return gesture: only screens that have somewhere to go back from
   are moved, while scrollable content keeps its native vertical behaviour. */
#birthdays-screen.edge-back-dragging,
#newbies-screen.edge-back-dragging,
#employees-screen.edge-back-dragging,
#parking-screen.edge-back-dragging,
#office-screen.edge-back-dragging,
#polls-screen.edge-back-dragging,
#poll-questions-screen.edge-back-dragging,
#employee-screen.edge-back-dragging {
  translate: var(--edge-back-offset, 0px) 0;
  box-shadow: -16px 0 36px rgba(0, 0, 0, .28);
  will-change: translate;
}

#birthdays-screen.edge-back-settling,
#newbies-screen.edge-back-settling,
#employees-screen.edge-back-settling,
#parking-screen.edge-back-settling,
#office-screen.edge-back-settling,
#polls-screen.edge-back-settling,
#poll-questions-screen.edge-back-settling,
#employee-screen.edge-back-settling {
  translate: var(--edge-back-offset, 0px) 0;
  pointer-events: none;
  transition: translate 180ms cubic-bezier(.2, .8, .2, 1), box-shadow 180ms ease;
  will-change: translate;
}

@media (prefers-reduced-motion: reduce) {
  #birthdays-screen.edge-back-settling,
  #newbies-screen.edge-back-settling,
  #employees-screen.edge-back-settling,
  #parking-screen.edge-back-settling,
  #office-screen.edge-back-settling,
  #polls-screen.edge-back-settling,
  #poll-questions-screen.edge-back-settling,
  #employee-screen.edge-back-settling {
    transition: none;
  }
}

@keyframes nativeScreenEnter {
  from { opacity: .01; translate: 20px 0; }
  to { opacity: 1; translate: 0 0; }
}

#birthdays-screen.screen-entering,
#newbies-screen.screen-entering,
#employees-screen.screen-entering,
#parking-screen.screen-entering,
#office-screen.screen-entering,
#polls-screen.screen-entering,
#poll-questions-screen.screen-entering,
#employee-screen.screen-entering {
  animation: nativeScreenEnter 280ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes nativeCardEnter {
  from { opacity: .01; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.native-card-enter {
  animation: nativeCardEnter 360ms cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: var(--native-card-delay, 0ms);
}

/* Небольшое физическое «нажатие» делает кликабельность понятной ещё до
   действия. Эффект один и тот же для всех интерактивных поверхностей. */
@media (prefers-reduced-motion: no-preference) {
  .menu-item,
  .page-back-button,
  .employee-item,
  .birthday-card,
  .newbie-card,
  .poll-item,
  .office-place-clickable,
  .action-btn,
  .map-btn,
  .default-status-btn,
  .office-default-status-btn,
  .recall-btn,
  .sync-action-btn,
  .toggle-btn,
  .vote-btn,
  .delete-btn {
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    transition: transform 260ms cubic-bezier(.2, .8, .2, 1), filter 180ms ease, border-color 180ms ease, background-color 180ms ease;
  }

  .menu-item:active,
  .page-back-button:active,
  .employee-item:active,
  .birthday-card:active,
  .newbie-card:active,
  .poll-item:active,
  .office-place-clickable:active,
  .action-btn:not(:disabled):active,
  .map-btn:not(:disabled):active,
  .default-status-btn:not(:disabled):active,
  .office-default-status-btn:not(:disabled):active,
  .recall-btn:not(:disabled):active,
  .sync-action-btn:not(:disabled):active,
  .toggle-btn:not(:disabled):active,
  .vote-btn:not(:disabled):active,
  .delete-btn:not(:disabled):active {
    transform: scale(.975);
    filter: brightness(.94);
    transition-duration: 70ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  .native-card-enter,
  #birthdays-screen.screen-entering,
  #newbies-screen.screen-entering,
  #employees-screen.screen-entering,
  #parking-screen.screen-entering,
  #office-screen.screen-entering,
  #polls-screen.screen-entering,
  #poll-questions-screen.screen-entering,
  #employee-screen.screen-entering {
    animation: none;
  }
}

.employees-content,
.birthdays-content,
.newbies-content,
.parking-content,
.polls-content {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}

#main-screen,
#main-screen .main-content {
  overflow: hidden;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.invite-code-input-container { margin: 20px 0; display: flex; justify-content: center; }
#invite-code-input { width: 150px; padding: 12px; border: 2px solid #ddd; border-radius: 8px; font-weight: 600; font-size: 18px; text-align: center; }
.invite-actions { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; align-items: center; width: 100%; }
.invite-submit-btn { background: #4CAF50; color: white; padding: 12px; border: none; border-radius: 8px; cursor: pointer; font-size: 16px; width: 80%; }
.invite-cancel-btn { background: transparent; color: #666; padding: 10px; border: 1px solid #ddd; border-radius: 8px; cursor: pointer; font-size: 14px; width: 80%; }
.invite-hint { font-size: 12px; color: #888; margin-top: 20px; text-align: center; }
#invite-code-screen .auth-container { padding: var(--spacing-md); text-align: center; }
#invite-code-screen .logo { margin-bottom: 40px; }
#invite-code-screen h2 { text-align: center; width: 100%; }



.auth-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.auth-error {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
}
.hidden {
    display: none;
}

/* Поднимаем логотип вверх */
#auth-screen .auth-container {
    padding-top: 20px;   /* было больше? убираем лишнее */
}

.auth-hint {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin: -10px 0 20px 0;
}

/* Разделитель ИЛИ */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--color-text-secondary);
    font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}
.auth-divider span {
    margin: 0 10px;
}

/* Telegram виджет — центрируем и чуть отступаем */
.telegram-widget-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

/* Немного причешем кнопки в email-форме */
.auth-btn {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}
.auth-btn:hover {
    background: #0056b3;
}
.auth-secondary {
    background: #6c757d;
    margin-top: 10px;
}
.auth-secondary:hover {
    background: #5a6268;
}

/* AUTH GUIDELINE */
#auth-screen { position:relative; z-index:1; align-items:center; padding:16px; background:transparent; }
#auth-screen .auth-container { width:100%; max-width:430px; padding:20px 0 18px; color:#f5f7fa; font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; }
#auth-screen .auth-container .logo { width:150px; margin:0 auto 30px; }
#auth-screen .auth-container h2 { margin:0 0 13px; color:#f5f7fa; font:700 clamp(30px,8vw,42px)/1.08 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:-.08em; }
#auth-screen .auth-hint { margin:0 0 24px; color:#8e99a8; font:12px/1.5 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; }
#auth-screen .auth-step { display:grid; gap:10px; }
#auth-screen .auth-input { width:100%; height:52px; margin:0; padding:0 15px; border:1px solid #29313d; border-radius:10px; outline:0; background:#11151d; color:#f5f7fa; font:16px 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; }
#auth-screen .auth-input::placeholder { color:#596575; }
#auth-screen .auth-input:focus { border-color:#0f5bff; box-shadow:0 0 0 3px rgba(15,91,255,.16); }
#auth-screen .auth-btn { min-height:48px; padding:0 16px; border:1px solid #0f5bff; border-radius:10px; background:#0f5bff; color:#fff; font:700 14px 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; }
#auth-screen .auth-btn:hover { background:#0534fe; }
#auth-screen .auth-secondary { margin-top:0; border-color:#29313d; background:transparent; color:#8e99a8; }
#auth-screen .auth-secondary:hover { background:transparent; border-color:#536176; color:#f5f7fa; }
#auth-screen .auth-divider { margin:22px 0 16px; color:#596575; font:12px 'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,monospace; }
#auth-screen .auth-divider::before,#auth-screen .auth-divider::after { border-color:#29313d; }
#auth-screen .telegram-widget-container { min-height:44px; margin:0; }
#auth-screen .telegram-widget-container.is-unavailable { display:none; }

/* Переход из PWA в нативное приложение */
.native-app-prompt {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px;
}
.native-app-prompt.hidden { display: none; }
.native-app-prompt-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.native-app-prompt-card {
    position: relative;
    width: min(100%, 430px);
    padding: 28px 22px 20px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 26px;
    background: linear-gradient(145deg, rgba(26, 31, 42, .98), rgba(11, 14, 20, .98));
    box-shadow: 0 18px 60px rgba(0, 0, 0, .42);
    color: #f5f7fa;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
.native-app-prompt-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    place-items: center;
    border-radius: 14px;
    background: #0f5bff;
    color: #fff;
}
.native-app-prompt-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.native-app-prompt-card h2 { margin: 0 38px 10px 0; font-size: 21px; line-height: 1.2; letter-spacing: -.04em; }
.native-app-prompt-card p { margin: 0 0 20px; color: #aab4c2; font-size: 13px; line-height: 1.55; }
.native-app-prompt-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8e99a8;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.native-app-prompt-primary,
.native-app-prompt-secondary {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font: 700 14px 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    cursor: pointer;
}
.native-app-prompt-primary { border: 1px solid #0f5bff; background: #0f5bff; color: #fff; }
.native-app-prompt-secondary { margin-top: 8px; border: 1px solid #29313d; background: transparent; color: #aab4c2; }
.native-app-prompt-primary:active { background: #0534fe; }
.native-app-prompt-secondary:active { border-color: #536176; color: #f5f7fa; }
