/* ================================================================
   МедЭксперт PWA — teal redesign
================================================================ */
:root {
  --primary:        #009688;
  --primary-light:  #E0F2F1;
  --primary-dark:   #00695C;
  --gradient:       linear-gradient(170deg, #26C6DA 0%, #009688 55%, #00796B 100%);
  --gradient-hero:  linear-gradient(175deg, #22C8BB 0%, #00897B 50%, #006A60 100%);
  --gradient-card:  linear-gradient(135deg, #4DB6AC 0%, #00897B 100%);
  --bg:             #F4F8F7;
  --card:           #ffffff;
  --text:           #0D1F1C;
  --text-muted:     #5E7E7A;
  --border:         #DCE9E7;
  --success:        #4CAF50;
  --danger:         #ef4444;
  --radius:         18px;
  --radius-sm:      12px;
  --nav-h:          68px;
  --shadow-xs:      0 1px 2px rgba(0,60,54,.05);
  --shadow-sm:      0 1px 4px rgba(0,60,54,.07), 0 2px 8px rgba(0,60,54,.04);
  --shadow:         0 4px 12px rgba(0,60,54,.09), 0 1px 4px rgba(0,60,54,.04);
  --shadow-teal:    0 8px 24px rgba(0,150,136,.22), 0 2px 8px rgba(0,150,136,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}

/* ── Экраны ── */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity .22s ease, transform .22s ease;
}
.screen.active  { opacity: 1; pointer-events: auto; transform: translateX(0); }
.screen.slide-out { opacity: 0; transform: translateX(-24px); }

/* ── Сплэш ── */
#screen-splash {
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
}
.splash-inner { text-align: center; color: #fff; }
.splash-logo {
  width: 92px; height: 92px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 28px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  overflow: hidden;
}
.splash-logo img { width: 80px; height: 80px; object-fit: contain; }
.splash-name { font-size: 26px; font-weight: 700; margin-bottom: 6px; letter-spacing: -.3px; }
.splash-city { font-size: 15px; font-weight: 600; opacity: .92; margin-bottom: 6px; }
.splash-sub  { font-size: 14px; opacity: .75; }

/* ── Авторизация ── */
.auth-wrap {
  min-height: 100svh;
  padding: 56px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-wrap .field-wrap,
.auth-wrap .btn-primary,
.auth-wrap .btn-link,
.auth-wrap .form-error,
.auth-wrap .dev-hint,
.auth-wrap .otp-wrap,
.auth-wrap .back-btn { width: 100%; max-width: 400px; }
.auth-logo {
  width: 72px; height: 72px;
  background: var(--gradient-hero);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
  box-shadow: var(--shadow-teal);
  overflow: hidden;
}
.auth-logo img { width: 62px; height: 62px; object-fit: contain; }
.auth-brand { font-size: 13px; font-weight: 600; color: var(--text-muted); margin: -16px 0 20px; text-align: center; letter-spacing: .2px; }
.auth-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.4px; text-align: center; }
.auth-sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 36px; line-height: 1.6; text-align: center; max-width: 280px; }
/* Согласие на обработку ПД: пустой чекбокс перед кнопкой «Получить код» */
.auth-consent {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; max-width: 400px; margin: 2px 0 16px;
  font-size: 13px; line-height: 1.5; color: var(--text);
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.auth-consent input {
  width: 20px; height: 20px; flex: none;
  accent-color: var(--primary); cursor: pointer;
}
.auth-consent a { color: var(--primary-dark); }
/* Сопутствующие строки на экранах входа (ссылка на политику, ПЭП-подпись) */
.auth-legal {
  margin-top: 18px; font-size: 12px; line-height: 1.55; color: var(--text-muted);
  text-align: center; max-width: 300px;
}
.auth-legal a { color: var(--primary-dark); text-decoration: underline; }

/* ── Модалка установки приложения ── */
.im-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.im-overlay.hidden { display: none; }
.im-backdrop {
  position: absolute; inset: 0;
  background: rgba(13,31,28,.45);
  backdrop-filter: blur(2px);
}
.im-modal {
  position: relative; width: 100%; max-width: 340px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 22px 20px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: im-pop .25s ease;
}
@keyframes im-pop {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
.im-modal .hidden { display: none; }
.im-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--gradient-hero);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-teal);
  overflow: hidden;
}
.im-icon img { width: 54px; height: 54px; object-fit: contain; }
.im-title { font-size: 19px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.3px; }
.im-text  { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin-bottom: 20px; }
.im-spinner {
  width: 44px; height: 44px;
  margin: 6px auto 18px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: im-spin .9s linear infinite;
}
@keyframes im-spin { to { transform: rotate(360deg); } }
.im-modal .gate-steps { text-align: left; margin-bottom: 4px; }
.gate-note {
  font-size: 13px; color: var(--text-muted);
  text-align: center; line-height: 1.5;
  margin-top: 14px;
}
.btn-gate-later { margin-top: 14px; padding: 10px 0; }
.gate-steps {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 14px;
}
.gate-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; line-height: 1.45; text-align: left;
}
.gate-step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gate-ios-share { vertical-align: -3px; color: var(--primary); margin: 0 2px; }
.gate-check {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}

/* ── Поля ── */
.field-wrap  { margin-bottom: 14px; }
.field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .4px;
}
.field-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,150,136,.12);
}

/* ── Кнопки ── */
.btn-primary {
  display: block;
  padding: 15px 24px;
  background: var(--gradient);
  color: #fff; border: none;
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  box-shadow: var(--shadow-teal);
  letter-spacing: -.1px;
}
.btn-primary:hover    { opacity: .92; }
.btn-primary:active   { transform: scale(.98); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-primary.btn-full { width: 100%; text-align: center; }

.btn-outline {
  display: block;
  padding: 14px 24px;
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-outline.btn-full { width: 100%; text-align: center; }
.btn-outline:hover { background: var(--primary-light); }

.btn-link {
  background: none; border: none;
  color: var(--primary); font-size: 14px;
  cursor: pointer; padding: 4px 0;
}
.btn-link:disabled { color: var(--text-muted); cursor: default; }

/* ── OTP ── */
.otp-wrap { display: flex; gap: 10px; justify-content: center; margin: 28px 0; }
.otp-digit {
  width: 62px; height: 70px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 30px; font-weight: 700;
  text-align: center;
  background: var(--card);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.otp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,150,136,.12);
}

/* ── PIN-код ── */
.pin-dots {
  display: flex; gap: 20px; justify-content: center;
  margin: 10px 0 2px;
}
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  transition: background .15s, border-color .15s, transform .15s;
}
.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.12);
}
.pin-dots.shake { animation: pin-shake .4s ease; }
@keyframes pin-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(10px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 74px);
  gap: 14px 24px;
  justify-content: center;
  margin-top: 20px;
}
.pin-key {
  width: 74px; height: 74px;
  border: none; border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 26px; font-weight: 600;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background .12s, transform .12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.pin-key:active { background: var(--primary-light); transform: scale(.92); }
.pin-key-del {
  font-size: 22px; color: var(--text-muted);
  background: transparent; box-shadow: none;
}

/* ── Ошибки / dev ── */
.form-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }
.dev-hint   {
  font-size: 12px; color: #92400e; margin-top: 8px;
  background: #fef3c7; border: 1px solid #fcd34d;
  padding: 10px 14px; border-radius: 10px;
}

/* ── Header страниц ── */
.page-header {
  position: sticky; top: 0;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  z-index: 10; min-height: 58px;
}
.page-header.with-back { gap: 8px; }
.back-btn-header {
  background: none; border: none;
  font-size: 20px; color: var(--primary);
  cursor: pointer; padding: 4px 8px 4px 0; line-height: 1;
}
.back-btn {
  background: none; border: none;
  color: var(--primary); font-size: 14px;
  cursor: pointer; margin-bottom: 20px; display: inline-block;
}
.page-title, .page-subtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-title    { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
/* Заголовок с доп. кнопкой справа (сейчас — чат): без min-width:0 у этой
   обёртки flex-элемент не сжимается меньше своего контента, и длинный текст
   кнопки («Вернуть ИИ помощника») выталкивал разметку за экран */
.page-header.with-back > div { min-width: 0; flex: 1; }

/* ================================================================
   БАННЕР УСТАНОВКИ
================================================================ */
.install-banner {
  position: sticky; top: 0; z-index: 9;
  background: linear-gradient(135deg, #E0F2F1 0%, #B2DFDB 100%);
  border-bottom: 1px solid #80CBC4;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  transition: max-height .3s ease, opacity .3s ease, padding .3s ease;
}
.install-banner.hidden {
  max-height: 0; opacity: 0; padding: 0;
  pointer-events: none; border: none; overflow: hidden;
}
.install-banner-logo {
  width: 38px; height: 38px;
  border-radius: 9px; flex-shrink: 0;
  background: white;
  padding: 2px;
}
.install-banner-text { flex: 1; min-width: 0; }
.install-banner-title { font-size: 13px; font-weight: 700; color: #004D40; }
.install-banner-sub   { font-size: 11px; color: #00695C; margin-top: 1px; }
.install-banner-btn-sec {
  background: transparent; color: #00695C;
  border: 1.5px solid #009688;
  border-radius: 8px; padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.install-banner-btn {
  background: var(--gradient); color: #fff; border: none;
  border-radius: 8px; padding: 7px 14px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,150,136,.3);
}
.install-banner-close {
  background: none; border: none;
  color: #009688; font-size: 16px; line-height: 1;
  cursor: pointer; padding: 4px; flex-shrink: 0;
  opacity: .7;
}
.install-banner-close:hover { opacity: 1; }

/* ================================================================
   ГЛАВНАЯ
================================================================ */

/* ── Hero ── */
.home-hero {
  background: var(--gradient-hero);
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px 24px;
  color: #fff;
}
.home-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.home-clinic-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-clinic-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.home-clinic-logo img { width: 34px; height: 34px; object-fit: contain; }
.home-clinic-label {
  font-size: 9px; text-transform: uppercase;
  letter-spacing: 1px; opacity: .75; line-height: 1; margin-bottom: 3px;
}
.home-clinic-name-text { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.home-avatar-wrap { position: relative; }
.home-patient-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: 2.5px solid rgba(255,255,255,.45);
  font-size: 19px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
}
.home-avatar-online {
  position: absolute; bottom: 1px; right: 1px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #4CAF50;
  border: 2px solid rgba(0,106,96,.8);
}
.home-greeting-sub  { font-size: 14px; opacity: .8; margin-bottom: 4px; }
.home-greeting-name { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }

/* ── Page body ── */
.page-body { padding: 16px 16px calc(var(--nav-h) + 16px); }

/* ── Ближайший приём ── */
.next-appt-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.next-appt-card.empty {
  padding: 14px 16px;
  color: var(--text-muted); font-size: 14px;
}
.nac-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.nac-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
}
.nac-badge-today {
  background: var(--success); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.nac-badge-date {
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
}
.nac-body {
  display: flex; gap: 14px;
  margin-bottom: 16px; align-items: flex-start;
}
.nac-doctor-avatar {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--gradient-card);
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  position: relative;
}
.nac-doctor-avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.nac-info { flex: 1; min-width: 0; }
.nac-doctor-name {
  font-weight: 700; font-size: 16px; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nac-spec { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.nac-meta { display: flex; flex-direction: column; gap: 4px; }
.nac-meta-item { font-size: 12px; color: var(--text-muted); }
.nac-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nac-btn-primary {
  background: var(--gradient); color: #fff; border: none;
  border-radius: 10px; padding: 12px 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-align: center; transition: opacity .15s;
}
.nac-btn-primary:active { opacity: .85; }
.nac-btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 10px; padding: 12px 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-align: center; transition: background .15s;
}
.nac-btn-outline:hover { background: var(--primary-light); }
/* Компактное пустое состояние: одна строка вместо высокой карточки */
.nac-empty-compact { display: flex; align-items: center; gap: 12px; }
.nac-empty-ico { font-size: 26px; flex-shrink: 0; }
.nac-empty-msg { flex: 1; min-width: 0; font-size: 13px; color: var(--text-muted); line-height: 1.35; text-align: left; }
.nac-empty-btn {
  background: var(--gradient); color: #fff; border: none;
  border-radius: 10px; padding: 10px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  flex-shrink: 0; transition: opacity .15s;
}
.nac-empty-btn:active { opacity: .85; }

/* ── Незаконченная запись: «Продолжить» ── */
.draft-card {
  background: #FFF8E1;
  border: 1px solid #FFE0A3;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.draft-card.hidden { display: none; }
.draft-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.draft-ico {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(245, 158, 11, .18);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; flex-shrink: 0;
}
.draft-info { flex: 1; min-width: 0; }
.draft-title { font-size: 14px; font-weight: 700; color: #92400e; }
.draft-sub {
  font-size: 12px; color: #a16207; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.draft-close {
  background: none; border: none; cursor: pointer;
  color: #a16207; font-size: 15px; padding: 4px 2px; flex-shrink: 0;
}
.draft-btn {
  width: 100%; margin-top: 12px;
  background: var(--gradient); color: #fff; border: none;
  border-radius: 10px; padding: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.draft-btn:active { opacity: .85; }

/* ── Быстрые действия (3 колонки) ── */
.quick-actions-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.quick-btn-3 {
  background: var(--card); border: none;
  border-radius: 16px; padding: 18px 8px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow-sm);
  text-align: center; line-height: 1.4;
  transition: transform .15s, box-shadow .15s;
}
.quick-btn-3:hover  { transform: translateY(-1px); box-shadow: var(--shadow); }
.quick-btn-3:active { transform: scale(.97); }
.quick-icon-circle {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
/* Акцентная плашка «Лечись бесплатно» — мягкий светло-красный */
.quick-btn-free { background: #FDEDEA; color: #B03A30; }
.quick-btn-free .quick-icon-circle { background: #F9D8D2; }

/* ── Напоминание о здоровье ── */
.health-tip-card {
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 10px;
}
.health-tip-icon-wrap {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(76,175,80,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.health-tip-title { font-size: 13px; font-weight: 700; color: #2E7D32; margin-bottom: 4px; }
.health-tip-text  { font-size: 12px; color: #388E3C; line-height: 1.5; }
.health-tip-card.hidden { display: none; }

/* ── Карусель врачей клиники (главная) ── */
.home-doctors-section { margin-top: 18px; }
.home-doctors-section.hidden { display: none; }
.home-doctors-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.home-doctors-track::-webkit-scrollbar { display: none; }
.home-doc-card {
  flex: 0 0 86%;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
}
.home-doc-photo {
  width: 84px; height: 112px;
  border-radius: var(--radius-sm);
  background: var(--gradient-card);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.home-doc-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.home-doc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-doc-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.home-doc-spec { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-top: 2px; }
.home-doc-excerpt {
  font-size: 12px; line-height: 1.45; color: var(--text-muted); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.home-doc-btn {
  margin-top: 8px; align-self: flex-start;
  background: var(--gradient); color: #fff; border: none;
  border-radius: 10px; padding: 8px 14px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.home-doc-btn:active { opacity: .85; }
.home-doctors-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.home-doc-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--border);
  transition: background .2s, width .2s;
}
.home-doc-dot.active { background: var(--primary); width: 16px; }

/* ================================================================
   ОНЛАЙН-ЗАПИСЬ
================================================================ */
.section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .7px; margin: 22px 0 10px;
}
.section-title:first-child { margin-top: 4px; }

/* Подсказка над списком врачей, оказывающих услугу. Без неё экран выглядит
   просто «списком врачей», и непонятно, что от пациента ждут выбора. */
.svc-hint {
  margin: 0 0 12px; padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 12.5px; line-height: 1.45;
}
.section-title.mt { margin-top: 26px; }

/* Шаги */
.step-bar { display: flex; align-items: center; padding: 16px 0 8px; margin-bottom: 8px; }
.step {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .2s, color .2s;
}
.step.active { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(0,150,136,.15); }
.step.done   { background: var(--success); color: #fff; }
.step-line   { flex: 1; height: 2px; background: var(--border); }

.booking-step { display: none; }
.booking-step.active { display: block; }

/* Специальности */
.list-grid { display: flex; flex-direction: column; gap: 8px; }

/* Вкладки «К врачу» / «На услугу» */
.booking-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 14px;
}
.bk-tab {
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 11px 8px;
  font-size: 14px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.bk-tab.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Карточка врача на шаге выбора даты */
.bk-doctor-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.bk-doc-info { flex: 1; min-width: 0; }
.bk-doc-name { font-size: 15px; font-weight: 700; }
.bk-doc-sub  { font-size: 13px; color: var(--text-muted); margin-top: 1px; }

/* Сводка записи на шаге данных пациента */
.bk-summary {
  background: var(--primary-light);
  border: 1px solid rgba(0,150,136,.25);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 18px;
}
.bk-sum-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 3px 0;
}
.bk-sum-label { color: var(--text-muted); flex-shrink: 0; }
.bk-sum-value { font-weight: 600; text-align: right; }
.bk-summary-edit {
  width: 100%; margin-top: 10px;
  background: transparent;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  color: var(--primary-dark);
  font-size: 13px; font-weight: 600;
  padding: 9px; cursor: pointer;
  transition: background .15s;
}
.bk-summary-edit:active { background: rgba(0,150,136,.12); }

/* Карточка услуги */
.svc-card {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 13px 14px; cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: transform .12s, box-shadow .12s;
}
.svc-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.svc-name  { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; line-height: 1.35; }
.svc-price { font-size: 13px; font-weight: 700; color: var(--primary-dark); white-space: nowrap; flex-shrink: 0; }

.spec-card {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 14px 16px; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between;
  border-left: 3px solid transparent;
}
.spec-card:hover  { transform: translateY(-1px); box-shadow: var(--shadow); border-left-color: var(--primary); }
.spec-card.active { border-left-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 2px rgba(0,150,136,.15); }
.spec-card-left    { flex: 1; min-width: 0; }
.spec-card-chevron { color: var(--text-muted); font-size: 16px; margin-left: 8px; flex-shrink: 0; }
.spec-name  { font-weight: 600; font-size: 15px; }
.spec-count { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Врачи */
.doctor-card {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 14px 16px; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
}
.doctor-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.doctor-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gradient-card);
  color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative; overflow: hidden;
}
.doctor-avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}
.doctor-name { font-weight: 600; font-size: 15px; flex: 1; }

/* Даты и слоты */
.dates-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.date-btn {
  padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--card); font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: border-color .12s, background .12s;
}
.date-btn:hover  { border-color: var(--primary); }
.date-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0,150,136,.3); }
.date-day { font-size: 11px; font-weight: 400; display: block; margin-top: 2px; opacity: .8; }

.slots-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.slot-btn {
  padding: 9px 16px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--card); font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: border-color .12s, background .12s;
}
.slot-btn:hover  { border-color: var(--primary); }
.slot-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(0,150,136,.3); }

/* Успех */
.success-wrap { text-align: center; padding: 40px 0; }
.success-icon {
  width: 80px; height: 80px;
  background: var(--gradient); color: #fff;
  border-radius: 50%; font-size: 36px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; box-shadow: var(--shadow-teal);
}
.success-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.3px; }
.success-sub   { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ================================================================
   МОИ ЗАПИСИ
================================================================ */
.appt-item {
  background: var(--card); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.appt-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.appt-item-dt   { font-size: 14px; font-weight: 700; color: var(--primary); }
.appt-item-doc  { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.appt-item-spec { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.appt-item-cancel {
  background: none; border: 1px solid var(--danger);
  color: var(--danger); border-radius: 6px;
  font-size: 12px; padding: 4px 10px; cursor: pointer;
  transition: background .12s;
}
.appt-item-cancel:hover { background: #fef2f2; }
/* Подпись перед отменёнными и прошедшими записями */
.appt-group-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .7px;
  margin: 22px 0 10px;
}
.appt-group-title:first-child { margin-top: 4px; }
/* «Записаться снова» у прошедшей или отменённой записи */
.appt-again-btn {
  width: 100%; margin-top: 12px;
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 10px; padding: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.appt-again-btn:hover  { background: var(--primary-light); }
.appt-again-btn:active { opacity: .85; }

/* ── Разделы профиля ── */
.profile-menu { margin-top: 18px; }
.profile-menu-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; cursor: pointer;
}
.profile-menu-row:active { transform: scale(.995); }
.profile-menu-icon  { font-size: 20px; }
.profile-menu-text  { flex: 1; min-width: 0; }
.profile-menu-title { font-size: 15px; font-weight: 600; }
.profile-menu-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Настройки уведомлений ── */
.ns-list { display: flex; flex-direction: column; gap: 10px; }
.ns-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; cursor: pointer;
}
.ns-row-text  { flex: 1; min-width: 0; }
.ns-row-title { font-size: 15px; font-weight: 600; }
.ns-row-sub   { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.35; }

/* Тумблер: сам input скрыт, рисуем соседний span */
.ns-switch { position: absolute; opacity: 0; width: 0; height: 0; }
.ns-switch-ui {
  position: relative; flex-shrink: 0;
  width: 46px; height: 27px; border-radius: 999px;
  background: #cbd5e1; transition: background .18s;
}
.ns-switch-ui::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s;
}
.ns-switch:checked + .ns-switch-ui { background: var(--primary); }
.ns-switch:checked + .ns-switch-ui::after { transform: translateX(19px); }
.ns-switch:focus-visible + .ns-switch-ui { outline: 2px solid var(--primary); outline-offset: 2px; }

.ns-system {
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.ns-system-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.ns-system-text  { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.ns-note   { font-size: 12px; color: var(--text-muted); line-height: 1.45; margin-top: 14px; }
.ns-status { font-size: 13px; color: var(--success); text-align: center; margin-top: 10px; min-height: 18px; }

/* ── Поиск на шаге 1 онлайн-записи ── */
.bk-search-wrap { position: relative; margin-bottom: 14px; }
.bk-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .6; pointer-events: none;
}
.bk-search-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 38px 12px 38px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--text);
  font-size: 15px; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
.bk-search-input:focus { outline: none; border-color: var(--primary); }
.bk-search-input::-webkit-search-cancel-button { display: none; }
.bk-search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: rgba(148, 163, 184, .18); color: var(--text-muted);
  font-size: 13px; line-height: 1; cursor: pointer;
}
.bk-search-sub { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.bk-search-empty { text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: 14px; }
.bk-search-empty-icon { font-size: 30px; margin-bottom: 8px; }
.bk-search-empty-hint { font-size: 13px; margin-top: 4px; }

/* ── Карточка записи (screen-appointment) ── */
.ac-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.ac-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ac-doctor { font-size: 16px; font-weight: 700; }
.ac-spec   { font-size: 13px; color: var(--text-muted); }
.ac-status {
  display: block; text-align: center; font-size: 13px; font-weight: 600;
  border-radius: 10px; padding: 9px; margin-bottom: 12px;
}
.ac-status-ok   { color: var(--success); background: rgba(76, 175, 80, .10); }
.ac-status-wait { color: #b45309;        background: rgba(245, 158, 11, .12); }
.ac-status-off  { color: var(--text-muted); background: rgba(148, 163, 184, .12); }
.ac-rows { border-top: 1px solid var(--border); padding-top: 10px; }
.ac-doc-link { display: block; margin-top: 10px; font-size: 13px; }
.ac-actions { margin-top: 4px; }
.ac-cancel-link {
  display: block; width: 100%; margin-top: 14px;
  font-size: 13px; color: var(--danger); text-align: center;
}

/* Статусы в списке «Мои записи» */
.appt-badge { font-size: 11px; font-weight: 600; border-radius: 20px; padding: 3px 9px; }
.appt-badge-ok   { color: var(--success); background: rgba(76, 175, 80, .12); }
.appt-badge-wait { color: #b45309;        background: rgba(245, 158, 11, .14); }
.appt-badge-off  { color: var(--text-muted); background: rgba(148, 163, 184, .14); }
.appt-item-tap { cursor: pointer; transition: transform .12s; }
.appt-item-tap:active { transform: scale(.99); }
.appt-item-chevron { margin-left: auto; font-size: 22px; color: var(--text-muted); }

/* Ссылка «Отменить запись» под карточкой ближайшего приёма */
.nac-cancel-link {
  display: block; width: 100%; margin-top: 10px; padding: 4px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--text-muted); text-align: center;
}
.nac-cancel-link:hover { color: var(--danger); }
.nac-meta-ok { font-size: 12px; color: var(--success); font-weight: 600; }

/* Кнопка опасного действия в диалоге */
.btn-danger { background: var(--danger) !important; }

/* Подтверждение и перенос записи */
.appt-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.appt-btn-confirm {
  flex: 1; background: var(--gradient); color: #fff; border: none;
  border-radius: 8px; padding: 10px 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.appt-btn-confirm:active { opacity: .85; }
.appt-btn-confirm:disabled { opacity: .6; cursor: default; }
.appt-btn-move {
  flex: 1; background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary); border-radius: 8px; padding: 10px 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.appt-btn-move:hover { background: var(--primary-light); }
.appt-confirmed {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--success, #16a34a);
  background: rgba(22, 163, 74, .08); border-radius: 8px;
  padding: 10px 8px; text-align: center;
}

/* Врач с фото внутри карточки записи */
.appt-item-body { display: flex; align-items: center; gap: 12px; }
.appt-item-docwrap { flex: 1; min-width: 0; }

/* Раскрывающиеся детали записи (тап только по «Подробнее»/«Свернуть») */
.appt-item-details {
  display: none;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.appt-item.expanded .appt-item-details { display: block; }
.appt-detail-row {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 3px 0;
}
.appt-detail-label { color: var(--text-muted); flex-shrink: 0; }
.appt-detail-value { font-weight: 600; text-align: right; }
.appt-item-more {
  font-size: 12px; font-weight: 600; color: var(--primary);
  margin-top: 4px; padding: 8px 0 2px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.appt-more-close { display: none; }
.appt-item.expanded .appt-more-open  { display: none; }
.appt-item.expanded .appt-more-close { display: inline; }

/* ================================================================
   ПРОФИЛЬ
================================================================ */
.profile-hero {
  background: var(--gradient-hero);
  padding: 56px 20px 32px;
  text-align: center; color: #fff;
  position: relative;
}
.back-btn-hero {
  position: absolute; top: 14px; left: 14px;
  width: 34px; height: 34px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  color: #fff; font-size: 17px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 3px solid rgba(255,255,255,.4);
  font-size: 34px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
/* Фотография профиля: тем же кружком, что и инициалы */
.home-patient-avatar.has-photo,
.profile-avatar.has-photo {
  background-size: cover; background-position: center; background-repeat: no-repeat;
  color: transparent;
}
.profile-avatar.has-photo #profile-avatar-text { display: none; }

.profile-avatar-wrap { position: relative; width: 76px; margin: 0 auto 14px; }
.profile-avatar-wrap .profile-avatar { margin: 0; cursor: pointer; }
.profile-avatar-btn {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff; background: var(--card);
  font-size: 14px; line-height: 1; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xs);
}
.profile-avatar-remove {
  display: block; margin: 10px auto 0;
  border: none; background: rgba(255,255,255,.18); color: #fff;
  font-size: 12px; font-family: inherit; padding: 6px 14px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.profile-avatar-remove.hidden { display: none; }

/* Выбор источника фотографии: камера или галерея */
.photo-sheet { position: fixed; inset: 0; z-index: 300; }
.photo-sheet.hidden { display: none; }
.photo-sheet-backdrop { position: absolute; inset: 0; background: rgba(13,31,28,.5); }
.photo-sheet-inner {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(0,50,45,.25);
  animation: docSheetUp .25s ease;
}
.photo-sheet-title {
  font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 12px;
}
.photo-sheet-btn {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--bg); color: var(--text);
  font-family: inherit; text-align: left; cursor: pointer;
}
.photo-sheet-btn:active { background: var(--primary-light); }
.photo-sheet-icon  { font-size: 24px; line-height: 1; }
.photo-sheet-label { display: block; font-size: 15px; font-weight: 600; }
.photo-sheet-hint  { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.photo-sheet-cancel {
  width: 100%; padding: 13px; margin-top: 4px;
  border: none; border-radius: 16px;
  background: transparent; color: var(--text-muted);
  font-size: 15px; font-family: inherit; cursor: pointer;
}

.profile-name  { font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.profile-phone { font-size: 14px; opacity: .8; margin-top: 4px; }
/* Гость */
.profile-guest-card { background: #FFF8E1; border: 1px solid #FFE082; border-radius: 14px; padding: 16px; margin-top: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.profile-guest-icon { font-size: 32px; }
.profile-guest-title { font-size: 15px; font-weight: 700; color: #F57F17; }
.profile-guest-text { font-size: 13px; color: #795548; line-height: 1.5; }

/* Редактирование профиля */
.profile-section-title { font-size: 13px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .6px; margin: 16px 0 10px; }
.profile-readonly-row { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.profile-readonly-label { font-size: 13px; color: #999; min-width: 72px; flex-shrink: 0; }
.profile-readonly-value { font-size: 15px; font-weight: 500; color: #333; }
.profile-readonly-note { font-size: 12px; color: #999; margin: 8px 0 0; line-height: 1.4; }

/* Установка */
.profile-install-promo { background: var(--primary-light, #E0F2F1); border-radius: 12px; padding: 12px 16px; margin-top: 8px; margin-bottom: 10px; }
.profile-install-promo-title { font-size: 15px; font-weight: 700; color: var(--primary, #009688); margin-bottom: 3px; }
.profile-install-hint { font-size: 13px; color: #555; line-height: 1.4; }

/* ================================================================
   НИЖНЯЯ НАВИГАЦИЯ
================================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav.hidden { display: none; }
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: none; border: none;
  cursor: pointer; color: var(--text-muted);
  font-size: 10px; font-weight: 500;
  transition: color .15s; padding: 8px 4px;
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute; top: 0; left: 22%; right: 22%;
  height: 2.5px;
  background: var(--gradient);
  border-radius: 0 0 3px 3px;
}
.nav-icon  { font-size: 22px; line-height: 1; }
.nav-label { font-size: 10px; white-space: nowrap; }
.nav-badge {
  position: absolute; top: 5px; right: calc(50% - 20px);
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid white; line-height: 1;
}
.nav-badge.hidden { display: none; }

/* ================================================================
   ПРОЧЕЕ
================================================================ */
.loading-row { text-align: center; color: var(--text-muted); padding: 32px; font-size: 14px; }
.mt    { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%; transform: translateX(-50%);
  background: #1a2e2b; color: #fff;
  padding: 11px 22px; border-radius: 22px;
  font-size: 14px; z-index: 200;
  transition: opacity .3s; white-space: nowrap;
  max-width: 90%; box-shadow: 0 4px 16px rgba(0,50,45,.28);
}
.toast.hidden { opacity: 0; pointer-events: none; }

/* ================================================================
   УВЕДОМЛЕНИЯ — колокольчик и лента
================================================================ */
.home-hero-actions { display: flex; align-items: center; gap: 10px; }
.home-bell {
  position: relative;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 50%;
  font-size: 17px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.home-bell:active { background: rgba(255,255,255,.26); }
.bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 9px;
  padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #067a6e;
}
.bell-badge.hidden { display: none; }

.notif-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 8px;
}
.notif-item.unread { border-left: 3px solid var(--primary); }
.notif-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; font-weight: 600; line-height: 1.35; }
.notif-item.unread .notif-title { font-weight: 800; }
.notif-dot {
  display: none;
  width: 8px; height: 8px; border-radius: 50%;
  background: #EF4444;
  margin-left: 6px;
  vertical-align: middle;
}
.notif-item.unread .notif-dot { display: inline-block; }
.notif-body { font-size: 13px; color: var(--text); line-height: 1.5; margin-top: 3px; white-space: pre-line; }
.notif-date { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.notif-item { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Красная полоса «уведомления выключены» над шапкой */
.push-alert-bar {
  position: fixed; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  z-index: 260;
  background: #DC2626; color: #fff;
  height: calc(40px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 14px 0;
  display: none;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.push-alert-main { flex: 1; min-width: 0; text-align: left; }
.push-alert-title {
  font-size: 12px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.push-alert-sub {
  font-size: 10.5px; font-weight: 500; line-height: 1.3; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.push-alert-btn {
  flex-shrink: 0;
  font-size: 12px; font-weight: 700; line-height: 1;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  padding: 7px 14px;
}
body.pushbar-on .push-alert-bar { display: flex; }
body.pushbar-on #app {
  margin: calc(40px + env(safe-area-inset-top, 0px)) auto 0;
  height: calc(100svh - 40px - env(safe-area-inset-top, 0px));
}

/* Баннер «включите уведомления» */
.push-banner {
  background: var(--primary-light);
  border: 1px solid rgba(0,150,136,.25);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 12px;
}
.push-banner-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }

/* Модалка просмотра уведомления */
.notif-sheet-head {
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 12px;
}
.notif-sheet-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--primary-light);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-sheet-title { font-size: 16px; font-weight: 700; line-height: 1.35; margin-bottom: 3px; }
.notif-sheet-body-text {
  font-size: 14px; line-height: 1.6; color: var(--text);
  white-space: pre-line;
  margin-bottom: 16px;
}

.notif-empty {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
}
.notif-empty-icon  { font-size: 40px; margin-bottom: 10px; }
.notif-empty-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.notif-empty-text  { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* ================================================================
   МИНИКАРТОЧКА ВРАЧА (bottom sheet)
================================================================ */
.doctor-info-btn {
  flex-shrink: 0;
  background: var(--primary-light);
  border: none; border-radius: 50%;
  width: 28px; height: 28px;
  color: var(--primary-dark);
  font-size: 15px; line-height: 1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.doctor-info-btn:active { background: var(--primary); color: #fff; }

.doc-sheet { position: fixed; inset: 0; z-index: 300; }
.doc-sheet.hidden { display: none; }
.doc-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(13,31,28,.5);
  transition: opacity .22s ease;
}
.doc-sheet.closing .doc-sheet-backdrop { opacity: 0; }
.doc-sheet-inner {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  max-height: 82svh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 32px rgba(0,50,45,.25);
  animation: docSheetUp .25s ease;
}
@keyframes docSheetUp {
  from { transform: translateX(-50%) translateY(40px); opacity: .4; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
/* Черточка — зона свайпа вниз: увеличенная область хвата, сама полоска через ::after */
.doc-sheet-grip {
  width: 100%;
  padding: 12px 0 14px;
  margin: -10px 0 4px;
  display: flex; justify-content: center;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.doc-sheet-grip:active { cursor: grabbing; }
.doc-sheet-grip::after {
  content: '';
  width: 42px; height: 4px; border-radius: 2px;
  background: var(--border);
}
.doc-sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.doc-sheet-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--gradient-card);
  color: #fff; font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative; overflow: hidden;
}
.doc-sheet-avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.doc-sheet-title { flex: 1; min-width: 0; }
.doc-sheet-name  { font-size: 17px; font-weight: 700; line-height: 1.3; }
.doc-sheet-spec  { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.doc-sheet-facts { margin-bottom: 12px; }
.doc-sheet-fact {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px; line-height: 1.5; padding: 3px 0;
}
.doc-sheet-treats-title {
  font-size: 12px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.doc-sheet-treats {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.doc-sheet-chip {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 20px;
}

.doc-sheet-desc {
  font-size: 13.5px; line-height: 1.6; color: var(--text);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.doc-sheet-desc-empty { color: var(--text-muted); }
.doc-sheet-link {
  display: block; text-align: center;
  font-size: 13px; font-weight: 600;
  color: var(--primary-dark);
  text-decoration: none;
  padding: 12px 0 2px;
}

/* ================================================================
   ЛОЯЛЬНОСТЬ — баллы и скидка
================================================================ */
/* Приветствие + чип баллов в шапке */
.home-greeting-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.home-greeting-left { min-width: 0; }
.loy-hero-chip {
  flex-shrink: 0;
  text-align: right;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 8px 12px;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, background .15s ease;
}
.loy-hero-chip:active { transform: scale(.96); background: rgba(255,255,255,.24); }
.loy-hero-chip-num { font-size: 15px; font-weight: 800; letter-spacing: -.2px; white-space: nowrap; }
.loy-hero-chip-sub { font-size: 11px; opacity: .85; margin-top: 1px; white-space: nowrap; }

/* Экран «Мои баллы»: большой баланс */
.loy-balance-card {
  background: var(--gradient-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-teal);
  color: #fff;
  padding: 26px 20px;
  text-align: center;
  margin-bottom: 14px;
}
.loy-balance-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.loy-balance-num   { font-size: 44px; font-weight: 800; letter-spacing: -1px; line-height: 1.2; margin: 6px 0 4px; }
.loy-balance-sub   { font-size: 13px; opacity: .85; }

/* Баллы и депозит в одну строку (когда есть оба кошелька) */
.loy-balance-row { display: flex; gap: 10px; margin-bottom: 14px; }
.loy-balance-row .loy-balance-card { flex: 1; min-width: 0; margin-bottom: 0; padding: 18px 10px; }
.loy-balance-row .loy-balance-label { font-size: 11px; }
.loy-balance-row .loy-balance-num   { font-size: 28px; letter-spacing: -.5px; }
.loy-balance-row .loy-balance-sub   { font-size: 11.5px; }

/* Инфо-карточки: скидка, старые баллы МедЛок */
/* ================================================================
   ЧАТ С КЛИНИКОЙ
================================================================ */
/* Экран чата — колонка: шапка, лента, поле ввода. Высоты не подбираем
   пикселями (шапка с подзаголовком у разных шрифтов разная) — ленту тянет flex,
   прокрутка живёт внутри неё, поле ввода прибито к низу над навигацией */
#screen-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#screen-chat .page-header { flex-shrink: 0; }
.chat-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px;
}
.chat-row { display: flex; margin-bottom: 8px; align-items: flex-start; gap: 6px; }

/* Кто пишет из клиники — видно кружком: помощник или живой сотрудник */
.chat-ava {
  width: 28px; height: 28px; flex-shrink: 0; margin-top: 2px;
  border-radius: 50%;
  background-size: cover; background-position: center; background-repeat: no-repeat;
}
.chat-ava.ava-clinic { background-image: url('/assets/pwa/icon.svg'); }
.chat-ava.ava-bot    { background-image: url('/assets/pwa/bot.svg'); }
/* Продолжение группы: место под кружок остаётся, сам он не рисуется */
.chat-ava.ava-hidden { visibility: hidden; }
.chat-row-mine   { justify-content: flex-end; }
.chat-row-clinic { justify-content: flex-start; }
.chat-bubble {
  max-width: 78%;
  border-radius: 16px;
  padding: 9px 12px 6px;
  box-shadow: var(--shadow-xs);
  word-break: break-word;
}
.chat-bubble-mine {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.chat-bubble-clinic {
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
/* Пузыри одного собеседника подряд — плотнее, «уголок» только у первого */
.chat-row + .chat-row { margin-top: 2px; }
.chat-row.chat-first  { margin-top: 10px; }
.chat-row-mine:not(.chat-first)   .chat-bubble { border-bottom-right-radius: 16px; border-top-right-radius: 5px; }
.chat-row-clinic:not(.chat-first) .chat-bubble { border-bottom-left-radius: 16px;  border-top-left-radius: 5px; }

/* Кто из клиники пишет: пациент должен видеть, что отвечает живой человек */
.chat-author {
  font-size: 11.5px; font-weight: 700; color: var(--primary);
  margin-bottom: 2px;
}

.chat-text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.chat-text a { color: inherit; text-decoration: underline; }
.chat-bubble-clinic .chat-text a { color: var(--primary); }

.chat-time {
  font-size: 10px; margin-top: 3px;
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  color: var(--text-muted);
}
.chat-bubble-mine .chat-time { color: rgba(255,255,255,.75); }
.chat-status { font-size: 11px; line-height: 1; letter-spacing: -1px; }
/* Прочитано — галочки светлее фона пузыря, видно с одного взгляда */
.chat-row-mine[data-state="read"] .chat-status { color: #a7f3d0; letter-spacing: 0; }
.chat-row-mine[data-state="sending"] .chat-status { opacity: .7; }
.chat-row-mine[data-state="failed"]  .chat-status { color: #fee2e2; }

/* Не ушло: пузырь глушим и подписываем, тап повторяет отправку */
.chat-row.chat-failed .chat-bubble { opacity: .75; cursor: pointer; }
.chat-row.chat-failed .chat-bubble::after {
  content: 'Не отправлено — нажмите, чтобы повторить';
  display: block; margin-top: 4px;
  font-size: 10.5px; color: #fee2e2;
}

/* Разделитель дней */
.chat-daysep { display: flex; justify-content: center; margin: 14px 0 8px; }
.chat-daysep span {
  padding: 3px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted);
}

/* ── Карточка записи в сообщении помощника ──
   Помощник не бронирует сам: он показывает ближайшее свободное время,
   а тап открывает обычный мастер записи. */
.bkc {
  margin-top: 8px; padding: 10px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg);
}
.bkc-who   { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.bkc-spec  { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 1px; }
.bkc-price { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.bkc-slots { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 8px; }
.bkc-slot {
  flex: 1 1 auto; min-width: 92px;
  padding: 9px 10px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff;
  font-size: 13px; font-family: inherit; font-weight: 600;
}
.bkc-slot:active { opacity: .85; }
.bkc-other {
  width: 100%; padding: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  background: transparent; color: var(--text);
  font-size: 12.5px; font-family: inherit;
}
/* «Записаться» на карточке услуги — единственное действие в ней, поэтому
   основная, фирменная зелёная. На карточке врача зелёные сами времена,
   а «Другое время» рядом с ними остаётся вторичной и потому серой. */
.bkc-book {
  padding: 10px; border: none;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600;
}
.bkc-book:active { opacity: .85; }

/* ── Помощник клиники ── */
/* Кнопка выхода к человеку: не кричит, но видна всегда, пока отвечает ИИ */
.chat-human-btn {
  margin-left: auto; flex-shrink: 0;
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-muted); font-size: 12px; font-family: inherit; line-height: 1;
}
.chat-human-btn:active { background: var(--border); }

.chat-typing {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0 2px; padding: 6px 12px 6px 6px;
  border-radius: 14px; align-self: flex-start; width: fit-content;
  background: var(--card); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.chat-typing .chat-ava { margin-top: 0; }
.chat-typing-dots { display: inline-flex; gap: 3px; }
.chat-typing-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-muted); opacity: .4;
  animation: chatTypingBlink 1.2s infinite;
}
.chat-typing-dots i:nth-child(2) { animation-delay: .2s; }
.chat-typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes chatTypingBlink {
  0%, 60%, 100% { opacity: .25; }
  30%           { opacity: 1; }
}

/* Переписка не загрузилась */
.chat-error { text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 13px; }
.chat-retry {
  margin-top: 12px; padding: 9px 18px;
  border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 14px; font-family: inherit;
}

/* ── Эмодзи ── */
.chat-emoji-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  border: none; border-radius: 50%; background: transparent;
  font-size: 22px; line-height: 1; padding: 0; cursor: pointer; opacity: .8;
}
.chat-emoji-btn.active { background: var(--primary-light); opacity: 1; }

.chat-emoji {
  flex-shrink: 0;
  max-height: 40vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 6px;
  background: var(--card); border-top: 1px solid var(--border);
}
.chat-emoji.hidden { display: none; }
.chat-emoji-group + .chat-emoji-group { margin-top: 10px; }
.chat-emoji-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin-bottom: 5px;
}
.chat-emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; }
.chat-emoji-cell {
  height: 40px; border: none; border-radius: 10px; background: transparent;
  font-size: 24px; line-height: 1; padding: 0; cursor: pointer;
}
.chat-emoji-cell:active { background: var(--primary-light); }

.chat-input-bar {
  flex-shrink: 0;
  margin-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1; min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 15px; font-family: inherit;
  line-height: 1.35;
  resize: none; outline: none;
  max-height: 120px;
  background: var(--bg);
  color: var(--text);
}
.chat-input:focus { border-color: var(--primary); }
.chat-send {
  width: 42px; height: 42px; flex-shrink: 0;
  border: none; border-radius: 50%;
  background: var(--gradient); color: #fff;
  font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-send:active { opacity: .85; }

.chat-empty { text-align: center; padding: 40px 20px; }
.chat-empty-icon  { font-size: 40px; margin-bottom: 10px; }
.chat-empty-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.chat-empty-text  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* Статус пациента (категория лояльности) */
.loy-status-card {
  background: var(--primary-light);
  border: 1px solid #B2DFDB;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.loy-status-label {
  font-size: 10px; font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase; letter-spacing: .8px;
}
.loy-status-name {
  font-size: 17px; font-weight: 700;
  color: var(--primary-dark);
  margin: 3px 0 6px;
}
.loy-status-line {
  font-size: 13px; color: var(--text);
  line-height: 1.5;
}

.loy-info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.loy-info-icon  { font-size: 22px; flex-shrink: 0; }
.loy-info-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.loy-info-text  { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

/* Заглушка до запуска программы */
.loy-empty-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
}
.loy-empty-icon  { font-size: 40px; margin-bottom: 10px; }
.loy-empty-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.loy-empty-text  { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* Условия программы */
.loy-term-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; line-height: 1.5; color: var(--text);
  padding: 7px 2px;
}
.loy-term-icon { flex-shrink: 0; }

/* Плашка ближайшего сгорания */
.loy-expire-note {
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; line-height: 1.45; color: #6D5410;
  margin-bottom: 10px;
}
.loy-expire-note strong { font-weight: 700; }

/* История операций */
.loy-tx-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.loy-tx-icon   { font-size: 18px; flex-shrink: 0; }
.loy-tx-info   { flex: 1; min-width: 0; }
.loy-tx-label  { font-size: 13px; font-weight: 600; }
.loy-tx-date   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.loy-tx-amount { font-size: 15px; font-weight: 800; white-space: nowrap; }
.loy-tx-amount.plus  { color: var(--success); }
.loy-tx-amount.minus { color: var(--danger); }

/* ================================================================
   Оценка визита (задача 9)
================================================================ */
.rate-stars {
  display: flex; justify-content: center; gap: 6px;
  margin: 22px 0 6px;
}
.rate-star {
  border: none; background: none; cursor: pointer;
  font-size: 44px; line-height: 1;
  color: #D5E3E1;
  padding: 4px;
  transition: color .15s ease, transform .1s ease;
}
.rate-star.on { color: #FFB300; }
.rate-star:active { transform: scale(1.15); }

.rate-hint {
  text-align: center; font-size: 13px; color: var(--text-muted);
  margin: 8px 0 0; line-height: 1.45;
}
.rate-hint.rate-error { color: var(--danger); }

.rate-follow {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 16px;
  margin-top: 16px;
}
.rate-follow-title {
  font-size: 16px; font-weight: 700; text-align: center;
  margin-bottom: 10px;
}
.rate-ask { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.rate-comment {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit; font-size: 14px;
  resize: vertical; min-height: 84px;
  background: var(--bg);
  margin-bottom: 10px;
}
.rate-comment:focus { outline: none; border-color: var(--primary); background: var(--card); }

.rate-yandex {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.rate-yandex-text { font-size: 13px; line-height: 1.45; margin-bottom: 10px; }

.rate-thanks {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 26px 18px 18px;
  margin-top: 24px;
  text-align: center;
}
.rate-thanks-icon  { font-size: 44px; margin-bottom: 10px; }
.rate-thanks-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.rate-thanks-text  { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.rate-thanks .rate-yandex { margin-top: 14px; text-align: left; }

/* ================================================================
   ПРИГЛАСИТЬ БЛИЗКОГО — рефералка + акция-розыгрыш (задача 18)
================================================================ */

/* Строка «вас пригласили» на экране входа */
.ref-invited-hint {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

/* Баннер акции на главной (временный, на период розыгрыша) */
.raffle-card {
  background: var(--gradient-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-teal);
  margin-bottom: 14px;
  overflow: hidden;
}
.raffle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  color: #fff;
}
.raffle-ico { font-size: 28px; flex-shrink: 0; }
.raffle-info { flex: 1; min-width: 0; }
.raffle-title { font-size: 15px; font-weight: 700; }
.raffle-sub   { font-size: 12.5px; opacity: .92; line-height: 1.35; margin-top: 2px; }
.raffle-cta {
  flex-shrink: 0;
  background: rgba(255,255,255,.22);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

/* Карточка участия в розыгрыше */
.ref-raffle-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.ref-raffle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ref-raffle-title { font-size: 15px; font-weight: 700; }
.ref-head-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ref-status-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
/* Счётчик приглашений в углу карточки розыгрыша (решение 2026-08-07) */
.ref-invited-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.ref-nums { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ref-num-chip {
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
}
.ref-progress-bar {
  height: 8px;
  background: var(--primary-light);
  border-radius: 999px;
  overflow: hidden;
}
.ref-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .3s ease;
}
.ref-progress-text { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.ref-next-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--primary-dark);
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.ref-join-text { font-size: 14px; line-height: 1.45; margin-bottom: 12px; }
.ref-consent-note {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}
.ref-consent-note a { color: var(--primary-dark); }

/* Карточка «поделиться» */
.ref-share-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.ref-share-title { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.ref-how-title   { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
/* Ссылка и кнопки — под объяснением программы, отделены пунктиром */
.ref-share-part  { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ref-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  cursor: pointer;
}
.ref-link-text {
  flex: 1;
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ref-link-copy { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }
.ref-qr-box {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px;
}
.ref-qr-box svg { width: 200px; height: 200px; display: block; }
.ref-qr-hint {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

/* Счётчики */
.ref-counters { display: flex; gap: 10px; margin-bottom: 14px; }
.ref-counter {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  padding: 12px;
  text-align: center;
}
.ref-counter-num { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.ref-counter-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.3; }

/* Призовой блок */
.ref-prize-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.ref-prize-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.ref-prize-text  { font-size: 14px; line-height: 1.45; margin-bottom: 10px; }
.ref-prize-line  { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
/* Информация о розыгрыше внутри верхней карточки (статус/вступление) */
.ref-raffle-info {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.ref-raffle-info .ref-prize-text { margin-bottom: 0; margin-top: 6px; }
.ref-rules-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Прошедшие розыгрыши */
.ref-draw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.ref-draw-ico { font-size: 22px; flex-shrink: 0; }
.ref-draw-prize { font-size: 14px; font-weight: 600; }
.ref-draw-sub   { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* Приватность */
.ref-privacy-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* Карточка-вход с экрана баллов */
.loy-ref-card { cursor: pointer; align-items: center; }
.loy-ref-card .spec-card-chevron { margin-left: auto; }

/* Строка на экране успеха записи (пик довольства) */
.success-ref-row {
  margin-top: 14px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
}
.success-ref-link { color: var(--primary-dark); font-weight: 700; }

/* ── Собственный депозит (задача 19): золотая карточка поверх loy-balance-card ── */
.loy-balance-card.dep-gold {
  background: linear-gradient(135deg, #F2B33D 0%, #E08E0B 55%, #C9780A 100%);
  box-shadow: 0 8px 24px rgba(224,142,11,.28), 0 2px 8px rgba(224,142,11,.14);
}

/* ── Скрытие блоков рефералки и чата ──
   Общего правила .hidden в файле НЕТ (toast и install-banner прячутся
   с анимацией, display:none им нельзя) — каждому блоку нужно своё.
   У этих семи его не было: QR-код не скрывался кнопкой, а пустой баннер
   розыгрыша, строка «вас пригласили», «Позвать человека», строка на экране
   успеха и пункт в профиле были бы видны всегда */
.ref-qr-box.hidden,
.ref-qr-hint.hidden,
.ref-invited-hint.hidden,
.raffle-card.hidden,
.chat-human-btn.hidden,
.success-ref-row.hidden,
.profile-menu-row.hidden { display: none; }

/* ── Правовые документы в профиле ── */
.profile-legal {
  margin-top: 20px; padding-bottom: 8px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px;
  font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.5;
}
.profile-legal a { color: var(--text-muted); text-decoration: underline; }

/* ── Использовать на кассе: код списания (шаг 5 лояльности) ── */
.redeem-open-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--primary, #1B7A67);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.redeem-open-icon  { font-size: 24px; }
.redeem-open-text  { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.redeem-open-title { font-size: 15px; font-weight: 700; color: #1A1A1A; }
.redeem-open-sub   { font-size: 12px; color: #777; }

.redeem-card {
  background: #fff;
  border-radius: 20px;
  padding: 22px 16px 18px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  margin-bottom: 12px;
}
.redeem-card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.redeem-qr { display: flex; justify-content: center; }
.redeem-qr svg { width: 210px; height: 210px; }
.redeem-code {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.redeem-code-hint { font-size: 12px; color: #888; margin-top: 4px; }

.redeem-cap-note {
  background: #FFF7E6;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: #8A5A00;
  margin-bottom: 12px;
}
.redeem-terms { margin-bottom: 16px; }

.redeem-cancel-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #B03A30;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  font-family: inherit;
}

.redeem-success {
  background: #fff;
  border-radius: 20px;
  padding: 32px 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.redeem-success-icon  { font-size: 48px; margin-bottom: 12px; }
.redeem-success-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.redeem-success-text  { font-size: 13px; color: #666; line-height: 1.5; margin-bottom: 20px; }
.redeem-done-btn {
  background: var(--primary, #1B7A67);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
