@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800&family=Nunito:wght@400;500;600;700&display=swap');

/* ── CSS-переменные (перекрываются из villa_info через theme.js) ── */
:root {
  --primary:      #c9a96e;
  --accent:       #38bdf8;
  --bg:           rgba(255, 255, 255, 0.12);
  --surface:      rgba(255, 255, 255, 0.13);
  --surface-2:    rgba(255, 255, 255, 0.07);
  --text-1:       #ffffff;
  --text-2:       rgba(255, 255, 255, 0.72);
  --text-3:       rgba(255, 255, 255, 0.45);
  --glass-border: 1px solid rgba(255, 255, 255, 0.18);
  --glass-blur:   blur(18px);
  --nav-bg:       rgba(7, 40, 65, 0.80);
  --r:            20px;
  --r-sm:         12px;
  --shadow:       0 2px 20px rgba(0, 0, 0, 0.18);
  --shadow-md:    0 8px 32px rgba(0, 0, 0, 0.28);
  --nav-h:        72px;
  --safe-b:       env(safe-area-inset-bottom, 0px);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  /* Лазурный градиент — фон всей страницы, волны поверх через waves.js */
  background: linear-gradient(155deg, #0c4a6e 0%, #0e7490 35%, #0891b2 65%, #06b6d4 100%);
  background-attachment: fixed;
  min-height: 100%;
}
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: transparent;
  color: var(--text-1);
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Типографика ── */
h1, h2, h3, .heading { font-family: 'Montserrat', sans-serif; }
h1 { font-size: 26px; font-weight: 800; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.caption { font-size: 12px; color: var(--text-3); }

/* ── Скролл контент над bottom nav ── */
.page { padding-bottom: calc(64px + var(--safe-b) + 40px); }

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: var(--glass-border);
}
.app-header .greeting { flex: 1; min-width: 0; }
.app-header .greeting-name { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-header .greeting-sub  { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; margin-left: 12px; }

/* ── Icon Button ── */
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-1);
  transition: background .15s;
  text-decoration: none;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.24); }

/* ── Аватар ── */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700; font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

/* ── Секция (заголовок + контент) ── */
.section { padding: 20px 20px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h2 { font-size: 17px; font-weight: 700; }
.section-link { font-size: 13px; color: var(--primary); font-weight: 600; }

/* ── Баннер пребывания ── */
.stay-banner {
  margin: 16px 20px 0;
  border-radius: var(--r);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stay-banner-cover {
  width: 100%; height: 130px;
  object-fit: cover;
  background: linear-gradient(135deg, #c9a96e22, #c9a96e44);
}
.stay-banner-cover-placeholder {
  width: 100%; height: 130px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(201,169,110,0.25));
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
}
.stay-banner-body { padding: 14px 16px 16px; }
.stay-banner-villa { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.stay-banner-welcome { font-size: 13px; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; }
.stay-dates { display: flex; gap: 12px; }
.stay-date-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(0, 0, 0, 0.22); border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 5px 10px; font-size: 12px; font-weight: 600;
  color: #fff;
}
.stay-date-pill span { color: rgba(255,255,255,0.65); font-weight: 400; }

/* ── WiFi-пилюля ── */
.wifi-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, 0.22); border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 12px; font-size: 13px; font-weight: 600;
  margin-top: 8px; cursor: pointer; color: #fff;
}
.wifi-pill .wifi-pass { color: var(--text-3); letter-spacing: 2px; }
.wifi-pill.revealed .wifi-pass { color: var(--text-1); letter-spacing: normal; }

/* ── Календарь-стрип ── */
.cal-strip { padding: 0 20px; margin-top: 20px; }
.cal-strip-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.cal-strip-scroll::-webkit-scrollbar { display: none; }
.cal-day {
  flex-shrink: 0; width: 46px;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 0;
  border-radius: 14px;
  cursor: pointer;
}
.cal-day.today { background: var(--primary); }
.cal-day.today .cal-day-num, .cal-day.today .cal-day-name { color: #fff; }
.cal-day-name { font-size: 10px; text-transform: uppercase; color: var(--text-3); letter-spacing: .5px; margin-bottom: 4px; }
.cal-day-num  { font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; color: var(--text-1); }
.cal-day-dots { display: flex; gap: 3px; margin-top: 4px; height: 6px; align-items: center; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot-villa    { background: var(--primary); }
.cal-dot-personal { background: #34d399; }

/* ── Сетка категорий ── */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-card {
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 2 / 1;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.cat-card:active { transform: scale(.97); }
.cat-card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
}
.cat-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.62) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
}
.cat-card-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.cat-card-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 14px;
}
.cat-card-icon { font-size: 26px; margin-bottom: 4px; }
.cat-card-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.3);
  line-height: 1.2;
}

/* Стеклянные фоны для категорий без фото */
.cat-color-0 { background: rgba(254, 243, 199, 0.18); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); }
.cat-color-1 { background: rgba(253, 232, 216, 0.18); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); }
.cat-color-2 { background: rgba(209, 245, 234, 0.18); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); }
.cat-color-3 { background: rgba(219, 234, 254, 0.20); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); }
.cat-color-4 { background: rgba(237, 233, 254, 0.18); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); }
.cat-color-5 { background: rgba(252, 231, 243, 0.18); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); }
/* При стеклянном фоне — белый текст */
.cat-card.no-image .cat-card-name  { color: var(--text-1); text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.cat-card.no-image .cat-card-overlay { display: none; }

/* ── Карточки событий ── */
.events-row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.events-row::-webkit-scrollbar { display: none; }
.event-card {
  flex-shrink: 0; width: 220px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s;
}
.event-card:active { transform: scale(.97); }
.event-card-img { width: 100%; height: 110px; object-fit: cover; background: rgba(255,255,255,0.1); }
.event-card-body { padding: 10px 12px 12px; }
.event-card-date { font-size: 11px; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 3px; }
.event-card-title { font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; line-height: 1.3; }
.event-card-loc { font-size: 11px; color: var(--text-2); margin-top: 3px; }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: calc(16px + var(--safe-b));
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 40px); max-width: 420px;
  height: 64px;
  background: rgba(7, 40, 65, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--glass-border);
  border-radius: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,.28), 0 2px 8px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none;
  cursor: pointer; border: none; background: none;
  padding: 6px 4px;
  border-radius: 24px;
  transition: background .15s;
}
.nav-item-center { flex: 1.2; }
.nav-icon-wrap {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .15s, transform .15s;
}
.nav-icon-img {
  width: 22px; height: 22px;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.45);
  transition: filter .15s;
}
.nav-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: rgba(255,255,255,.38); transition: color .15s; }
.nav-item.active .nav-icon-wrap { background: var(--primary); }
.nav-item.active .nav-icon-img { filter: brightness(0) invert(1) opacity(1); }
.nav-item.active .nav-label { color: var(--primary); }
.nav-item.active .nav-icon-wrap { transform: scale(1.08); }

/* ── Кнопка избранного в карточке ── */
.fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: background .15s, transform .15s;
  z-index: 2;
}
.fav-btn:active { transform: scale(.9); }
.fav-btn img { width: 16px; height: 16px; object-fit: contain; filter: brightness(0) invert(1) opacity(.55); transition: filter .15s; }
.fav-btn.fav-btn-active { background: var(--primary); }
.fav-btn.fav-btn-active img { filter: brightness(0) invert(1) opacity(1); }


/* ── Кнопки действий ── */
.action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer; border: none;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.action-btn:active { transform: scale(.97); opacity: .9; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-call     { background: #16a34a; color: #fff; }
.btn-maps     { background: #2563eb; color: #fff; }
.btn-visit    { background: var(--text-1); color: #fff; }
.btn-outline  { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-full     { width: 100%; }

/* ── Artifact detail ── */
.artifact-detail-img { width: 100%; max-height: 280px; object-fit: cover; }
.artifact-detail-body { padding: 20px; }
.artifact-detail-body h1 { font-size: 22px; margin-bottom: 10px; }
.artifact-body-text { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.artifact-body-text p { margin-bottom: 10px; }
.artifact-body-text a { color: var(--primary); }
.maps-iframe { width: 100%; height: 280px; border: none; border-radius: var(--r); }

/* ── Поиск ── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 50px;
  padding: 12px 18px;
  box-shadow: var(--shadow);
}
.search-bar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: 'Nunito', sans-serif; font-size: 15px; color: var(--text-1);
}
.search-bar input::placeholder { color: var(--text-3); }
.search-results { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.search-result-item {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: transform .15s;
}
.search-result-item:active { transform: scale(.98); }
.search-result-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.search-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 2px 8px; border-radius: 20px; letter-spacing: .5px;
}
.badge-artifact { background: rgba(254, 243, 199, 0.25); color: #fcd34d; }
.badge-event    { background: rgba(219, 234, 254, 0.25); color: #93c5fd; }
.badge-category { background: rgba(237, 233, 254, 0.25); color: #c4b5fd; }
.search-result-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.search-result-title em { font-style: normal; background: rgba(201,169,110,0.35); border-radius: 3px; padding: 0 2px; }
.search-result-snippet { font-size: 12px; color: var(--text-2); line-height: 1.4; }
.search-result-snippet em { font-style: normal; background: rgba(201,169,110,0.35); }
.search-cat { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.search-empty { text-align: center; color: var(--text-2); padding: 40px 20px; font-size: 15px; }

/* ── Календарь-грид ── */
.cal-month-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-month-title  { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; }
.cal-nav-btn { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-2); padding: 4px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid-header { text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-3); padding: 6px 0; }
.cal-cell {
  aspect-ratio: 1; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; position: relative; padding: 2px;
  transition: background .15s;
}
.cal-cell:hover { background: rgba(255,255,255,0.18); }
.cal-cell.today { background: var(--primary); }
.cal-cell.today .cal-cell-num { color: #fff; }
.cal-cell.other-month .cal-cell-num { color: var(--text-3); }
.cal-cell-num { font-size: 13px; font-weight: 600; line-height: 1; }
.cal-cell-dots { display: flex; gap: 2px; margin-top: 2px; }
.cal-cell-dot { width: 4px; height: 4px; border-radius: 50%; }
.cal-events-panel { background: var(--surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin-top: 16px; }
.cal-event-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.cal-event-item:last-child { border-bottom: none; padding-bottom: 0; }
.cal-event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.cal-event-title { font-weight: 600; font-size: 14px; }
.cal-event-meta  { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cal-add-form-inline { background: var(--surface); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); margin-top: 12px; }
.cal-add-form h3 { font-size: 15px; margin-bottom: 12px; }
.form-field { margin-bottom: 12px; }
.form-field label { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; display: block; text-transform: uppercase; letter-spacing: .4px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid rgba(255,255,255,0.2);
  border-radius: var(--r-sm); font-family: 'Nunito', sans-serif;
  font-size: 14px; background: rgba(255,255,255,0.08); color: var(--text-1);
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--primary); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── Модал (идентификация гостя) ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-sheet {
  background: rgba(12, 74, 110, 0.75);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: var(--glass-border);
  border-left: var(--glass-border);
  border-right: var(--glass-border);
  border-radius: 24px 24px 0 0;
  padding: 28px 24px calc(28px + var(--safe-b));
  width: 100%; max-width: 480px;
  animation: slideUp .25s ease;
  max-height: 90dvh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-drag { width: 40px; height: 4px; background: rgba(255,255,255,0.28); border-radius: 4px; margin: 0 auto 24px; }
.modal-title { font-family: 'Montserrat', sans-serif; font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.modal-sub { font-size: 14px; color: var(--text-2); margin-bottom: 24px; line-height: 1.5; }
.pin-input {
  width: 100%; text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 32px; font-weight: 700;
  letter-spacing: 12px;
  padding: 14px 16px;
  border: 2px solid rgba(255,255,255,0.22);
  border-radius: var(--r-sm);
  background: rgba(255,255,255,0.08); color: var(--text-1);
  outline: none;
}
.pin-input:focus { border-color: var(--primary); }
.modal-gap { margin-top: 12px; }
.modal-skip { text-align: center; margin-top: 14px; }
.modal-skip button { background: none; border: none; font-size: 14px; color: var(--text-3); cursor: pointer; font-family: 'Nunito', sans-serif; }
.pick-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.pick-item {
  background: rgba(255,255,255,0.08); border-radius: var(--r-sm);
  padding: 12px 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  border: 2px solid rgba(255,255,255,0.12);
  transition: border-color .15s;
}
.pick-item:hover { border-color: var(--primary); }
.pick-item-name { font-weight: 700; font-size: 15px; }
.pick-item-dates { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.modal-msg { text-align: center; padding: 8px 0 4px; font-size: 14px; color: var(--text-2); }
.modal-msg.error { color: #dc2626; }

/* ── A2HS banner ── */
.a2hs-banner {
  margin: 12px 20px 0;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; align-items: flex-start; gap: 12px;
}
.a2hs-icon { font-size: 28px; flex-shrink: 0; }
.a2hs-text { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.a2hs-close { background: none; border: none; font-size: 18px; color: var(--text-3); cursor: pointer; flex-shrink: 0; }

/* ── Back-header (artifact/category/search) ── */
.back-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: sticky; top: 0; z-index: 10;
  border-bottom: var(--glass-border);
}
.back-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.14); border: var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; flex-shrink: 0;
  color: var(--text-1);
}
.back-header-title { font-family: 'Montserrat', sans-serif; font-size: 17px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Скелетоны загрузки ── */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.07) 25%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.07) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

/* ── header-title (category/artifact/search) ── */
.header-title {
  flex: 1;
  font-family: 'Montserrat', sans-serif;
  font-size: 17px; font-weight: 700;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 0 8px;
}

/* ── Category hero ── */
.cat-hero { position: relative; width: 100%; }
.cat-hero img { width: 100%; height: 200px; object-fit: cover; }
.cat-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 60%);
  display: flex; flex-direction: column; align-items: flex-start;
  justify-content: flex-end; padding: 20px;
}
.cat-hero-icon { font-size: 32px; line-height: 1; }
.cat-hero-name { font-family: 'Montserrat', sans-serif; font-size: 22px; font-weight: 800; color: #fff; margin-top: 4px; }

/* ── Artifact list (карточки) ── */
.artifact-list { display: flex; flex-direction: column; gap: 12px; padding: 0 20px 8px; }
.artifact-card {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--r);
  padding: 14px; box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.artifact-card:active { box-shadow: var(--shadow-md); }
.artifact-card-img {
  width: 64px; height: 64px; border-radius: var(--r-sm);
  object-fit: cover; flex-shrink: 0;
}
.artifact-card-img-placeholder {
  width: 64px; height: 64px; border-radius: var(--r-sm);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}
.artifact-card-body { flex: 1; min-width: 0; }
.artifact-card-type-badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 8px; border-radius: 20px; margin-bottom: 4px;
}
.type-info    { background: rgba(224,242,254,0.22); color: #7dd3fc; }
.type-contact { background: rgba(220,252,231,0.22); color: #6ee7b7; }
.type-place   { background: rgba(254,249,195,0.22); color: #fcd34d; }
.type-link    { background: rgba(243,232,255,0.22); color: #d8b4fe; }
.artifact-card-title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.artifact-card-preview { font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }
.artifact-card-addr { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.artifact-card-action { margin-top: 8px; }
.artifact-action-btn {
  display: inline-block; font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 20px;
  background: var(--primary); color: #fff;
}

/* ── Artifact detail page ── */
.artifact-hero img { width: 100%; max-height: 280px; object-fit: cover; }
.artifact-detail { padding: 20px 20px 40px; }
.artifact-detail-title { font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.artifact-body-html { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.artifact-body-html h2,h3 { color: var(--text-1); margin: 16px 0 6px; }
.artifact-body-html p  { margin-bottom: 10px; }
.artifact-body-html ul,ol { padding-left: 18px; margin-bottom: 10px; }
.artifact-body-text { font-size: 15px; line-height: 1.6; color: var(--text-2); margin-bottom: 16px; }
.artifact-address { font-size: 14px; color: var(--text-2); margin-bottom: 16px; }
.artifact-big-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px;
  background: var(--primary); color: #fff;
  border-radius: var(--r); font-size: 16px; font-weight: 700;
  margin-bottom: 12px; text-align: center;
  font-family: 'Montserrat', sans-serif;
}
.artifact-big-btn-outline {
  background: rgba(255,255,255,0.1);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-1);
  border: 2px solid var(--primary);
}
.artifact-map-wrap {
  width: 100%; border-radius: var(--r); overflow: hidden;
  margin-bottom: 16px; height: 240px;
}
.artifact-map-wrap iframe { width: 100%; height: 100%; border: 0; }

/* ── Calendar ── */
.cal-grid-wrap { padding: 0 20px; }
.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cal-nav-label { font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 700; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-3); margin-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.cal-cell:hover   { background: rgba(255,255,255,0.18); }
.cal-cell.today   { background: var(--primary); color: #fff; }
.cal-cell.selected { background: rgba(255,255,255,0.35); color: #fff; }
.cal-cell-empty   { cursor: default; }
.cal-dots { display: flex; gap: 3px; margin-top: 2px; height: 5px; }
.cal-dot  { width: 5px; height: 5px; border-radius: 50%; }
.cal-dot-villa    { background: var(--primary); }
.cal-dot-personal { background: var(--accent); }

/* ── Calendar day detail ── */
.cal-day-detail { padding: 0; }
.event-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.event-row:last-child { border-bottom: none; }
.event-row-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.event-row-dot-villa    { background: var(--primary); }
.event-row-dot-personal { background: var(--accent); }
.event-row-body { flex: 1; min-width: 0; }
.event-row-title { font-weight: 700; font-size: 14px; }
.event-row-meta  { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.event-row-notes { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* ── Add event form ── */
.cal-add-form {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
}
.cal-add-inner {
  background: rgba(12, 74, 110, 0.80);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: var(--glass-border);
  border-left: var(--glass-border);
  border-right: var(--glass-border);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(24px + var(--safe-b));
  width: 100%; max-width: 480px; margin: 0 auto;
}
.cal-add-inner h3 { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* ── Search ── */
.search-header { gap: 8px; }
.search-input-wrap { flex: 1; }
.search-input {
  width: 100%; padding: 10px 16px; border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  font-size: 15px; font-family: 'Nunito', sans-serif;
  color: var(--text-1); outline: none;
}
.search-input:focus { border-color: var(--primary); }
.search-results { display: flex; flex-direction: column; gap: 8px; padding: 0 20px 20px; }
.search-result-skeleton { height: 72px; border-radius: 14px; }
.search-hit {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 12px; box-shadow: var(--shadow);
}
.search-hit-img {
  width: 52px; height: 52px; border-radius: var(--r-sm);
  object-fit: cover; flex-shrink: 0;
}
.search-hit-img-placeholder {
  width: 52px; height: 52px; border-radius: var(--r-sm);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.search-hit-body { flex: 1; min-width: 0; }
.search-hit-title { font-weight: 700; font-size: 14px; }
.search-hit-preview { font-size: 12px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-hit-cat { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.empty-msg { font-size: 14px; color: var(--text-3); text-align: center; padding: 32px 20px; }

/* ── Error page ── */
.error-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 80dvh; text-align: center; padding: 40px 20px;
}
.error-code { font-family: 'Montserrat', sans-serif; font-size: 72px; font-weight: 800; color: var(--primary); line-height: 1; }
.error-msg  { font-size: 20px; font-weight: 700; margin-top: 12px; }
.error-sub  { font-size: 14px; color: var(--text-2); margin-top: 8px; }

/* ── Утилиты ── */
.px-20 { padding-left: 20px; padding-right: 20px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mt-8  { margin-top: 8px; }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.emoji-bg { font-size: 48px; text-align: center; padding: 24px 0 8px; }
