/* CSM Medina — единый визуальный стиль (как экран записи) */
:root {
  --csm-green: #00843E;
  --csm-green-deep: #006b32;
  --csm-green-soft: #e8f5ee;
  --csm-ink: #0f1f17;
  --csm-muted: #5b6b63;
  --csm-line: #e4ebe6;
  --csm-bg: #f3f7f4;
  --csm-card: #ffffff;
  --csm-radius: 18px;
  --csm-radius-pill: 999px;
  --csm-shadow: 0 10px 28px rgba(15, 31, 23, 0.05);
  --csm-font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--csm-font);
  background: var(--csm-bg);
  color: var(--csm-ink);
  -webkit-font-smoothing: antialiased;
  font-weight: 500;
  overscroll-behavior-y: contain;
}

.app {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px 96px;
  background: linear-gradient(180deg, #f7fbf8 0%, var(--csm-bg) 42%, #eef4f0 100%);
}

/* Typography scale */
.page-hero,
.booking-hero {
  margin: 4px 0 20px;
  padding: 20px 18px 18px;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(0, 132, 62, 0.16), transparent 55%),
    linear-gradient(160deg, #ffffff 0%, #f3faf6 100%);
  box-shadow: var(--csm-shadow);
  border: 1px solid rgba(0, 132, 62, 0.08);
}

.page-kicker,
.booking-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--csm-green);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  min-height: 28px;
}

.hero-top-row .page-kicker,
.hero-top-row .booking-kicker {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.page-title,
.booking-title,
.title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--csm-ink);
  text-align: left;
  line-height: 1.2;
}

.title {
  text-align: center;
  margin: 12px 0 18px;
}

.page-lead,
.booking-lead {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--csm-muted);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 15px 16px;
  margin-bottom: 10px;
  border-radius: var(--csm-radius-pill);
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.12s ease, background 0.12s ease;
}

.btn:active { transform: scale(0.99); }

.btn-green {
  background: var(--csm-green) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 12px 28px rgba(0, 132, 62, 0.24);
}

.btn-green:active {
  background: var(--csm-green-deep) !important;
}

.btn-green:disabled {
  background: #a5d8b7 !important;
  color: #fff !important;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-outline {
  background: #fff;
  border: 1px solid rgba(0, 132, 62, 0.35);
  color: var(--csm-green);
  box-shadow: none;
  font-weight: 600;
}

.btn-link {
  background: none;
  border: none;
  color: var(--csm-green);
  font-size: 14px;
  font-weight: 600;
  padding: 10px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: none;
}

button#nextBtn.booking-next,
.booking-next {
  background: var(--csm-green) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--csm-radius-pill) !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 28px rgba(0, 132, 62, 0.28);
}

/* Lists / cards */
.dropdown { margin-bottom: 12px; }

.dropdown-box {
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid var(--csm-line);
  box-shadow: var(--csm-shadow);
}

.search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--csm-line);
  margin-bottom: 8px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  background: #f7faf8;
}

.list { max-height: 260px; overflow-y: auto; }

.item {
  padding: 12px 10px;
  border-bottom: 1px solid var(--csm-line);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--csm-ink);
  border-radius: 10px;
}

.item:last-child { border-bottom: none; }
.item:hover,
.item:active { background: var(--csm-green-soft); }

.hidden { display: none !important; }
.screen.hidden { display: none !important; }

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--csm-line);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav.hidden {
  display: none !important;
}

.nav-item {
  appearance: none;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: #8a9a91;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 56px;
  padding: 6px 4px;
}

.nav-item span {
  display: block;
  font-size: 20px;
}

.nav-item.active {
  color: var(--csm-green);
}

.nav-item.active small {
  font-weight: 700;
}

/* Welcome */
.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 95vh;
  background: url('img/auth-hero.jpg') center/cover no-repeat;
}

.welcome-card {
  background: #fff;
  width: 100%;
  padding: 24px;
  border-radius: 24px 24px 0 0;
  text-align: center;
  box-shadow: 0 -12px 40px rgba(15, 31, 23, 0.12);
}

.welcome-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--csm-muted);
  margin-bottom: 20px;
  line-height: 1.45;
}

/* Calendar + time slots (compact) */
.cal-panel {
  margin: 0 0 14px;
  padding: 14px 12px 12px;
  border-radius: var(--csm-radius);
  background: var(--csm-card);
  border: 1px solid var(--csm-line);
  box-shadow: var(--csm-shadow);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cal-nav {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--csm-green-soft);
  color: var(--csm-green);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cal-nav:active {
  background: #d8eee2;
}

.cal-month {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--csm-ink);
  text-align: center;
  text-transform: capitalize;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-weekdays {
  margin-bottom: 4px;
}

.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--csm-muted);
  padding: 2px 0 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  background: #eef1ef;
  color: #9aa59e;
  cursor: default;
}

.cal-day.is-available {
  background: var(--csm-green-soft);
  color: var(--csm-green);
  cursor: pointer;
}

.cal-day.is-available:active {
  transform: scale(0.96);
}

.cal-day.is-selected {
  background: var(--csm-green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 132, 62, 0.28);
}

.times-block {
  margin: 0 0 8px;
}

.times-heading {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--csm-muted);
}

.times-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.time-chip {
  margin: 0;
  padding: 11px 6px;
  border: 0;
  border-radius: 12px;
  background: var(--csm-green);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 132, 62, 0.18);
}

.time-chip:active {
  background: var(--csm-green-deep);
  transform: scale(0.97);
}

.time-chip .time-chip-end {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.82;
}

@media (max-width: 360px) {
  .times-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#screen-slots .page-hero {
  margin-bottom: 14px;
  padding: 16px 16px 14px;
}

#screen-slots .page-title {
  font-size: 22px;
}

#screen-slots .page-lead {
  font-size: 13px;
}

.csm_hr {
  border: 0;
  border-top: 1px solid var(--csm-line);
  margin: 14px 0;
}

/* Feedback / review */
.feedback-visit-card {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  margin: 0 0 22px;
  border-radius: var(--csm-radius);
  background: var(--csm-green-soft);
  border: 1px solid rgba(0, 132, 62, 0.12);
}

.feedback-visit-date {
  flex: 0 0 auto;
  text-align: center;
  min-width: 52px;
}

.feedback-visit-date .day {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--csm-green);
  letter-spacing: -0.03em;
}

.feedback-visit-date .month {
  font-size: 12px;
  font-weight: 600;
  color: var(--csm-green);
  text-transform: lowercase;
  margin: 2px 0 8px;
}

.feedback-visit-date .time {
  font-size: 13px;
  font-weight: 600;
  color: var(--csm-ink);
}

.feedback-visit-info {
  flex: 1;
  min-width: 0;
}

.feedback-visit-info .name {
  font-size: 15px;
  font-weight: 700;
  color: var(--csm-ink);
  line-height: 1.3;
  margin-bottom: 4px;
}

.feedback-visit-info .meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--csm-muted);
  line-height: 1.35;
}

.feedback-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 6px;
}

.feedback-star {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 4px;
  font-size: 36px;
  line-height: 1;
  color: #d5e0d9;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.12s ease;
}

.feedback-star.is-on {
  color: var(--csm-green);
}

.feedback-star:active {
  transform: scale(0.92);
}

.feedback-rating-hint {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--csm-muted);
  margin: 0 0 18px;
}

.feedback-comment-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--csm-ink);
  margin: 0 0 8px;
}

.feedback-comment {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--csm-line);
  border-radius: 14px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--csm-ink);
  background: #fff;
  resize: vertical;
  min-height: 96px;
  margin-bottom: 16px;
}

.feedback-comment:focus {
  outline: none;
  border-color: rgba(0, 132, 62, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 132, 62, 0.12);
}

.feedback-thanks-card {
  margin-top: 28px;
  padding: 28px 22px 24px;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(0, 132, 62, 0.14), transparent 55%),
    linear-gradient(160deg, #ffffff 0%, #f3faf6 100%);
  border: 1px solid rgba(0, 132, 62, 0.1);
  box-shadow: var(--csm-shadow);
  text-align: center;
}

.feedback-thanks-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--csm-green);
  text-transform: uppercase;
}

.feedback-thanks-text {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--csm-green);
}

.feedback-thanks-extra {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--csm-muted);
}

.feedback-yandex-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--csm-green);
  word-break: break-all;
  margin-bottom: 18px;
}

.feedback-brand-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--csm-green);
  margin-top: 8px;
}

.feedback-brand-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--csm-ink);
  margin-top: 4px;
}

/* Analyses list */
#screen-analyses .page-hero {
  margin-bottom: 14px;
  padding: 16px 16px 14px;
}

#screen-analyses .page-title {
  font-size: 22px;
}

.analyses-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}

.analysis-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px 12px 14px;
  border-radius: 16px;
  background: var(--csm-card);
  border: 1px solid var(--csm-line);
  box-shadow: var(--csm-shadow);
  cursor: pointer;
  transition: background 0.15s ease;
}

.analysis-card:active {
  background: var(--csm-green-soft);
}

.analysis-card-body {
  flex: 1;
  min-width: 0;
}

.analysis-card-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--csm-muted);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.analysis-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--csm-ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.analysis-card-meta {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--csm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.analysis-ico-btn {
  appearance: none;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--csm-green-soft);
  color: var(--csm-green);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.analysis-ico-btn:active {
  background: #d8eee2;
  transform: scale(0.96);
}

.analysis-ico-btn .icon-svg {
  width: 18px;
  height: 18px;
}

.analyses-empty {
  text-align: center;
  padding: 36px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--csm-muted);
}

/* Loading skeletons */
.csm-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.csm-skeleton {
  border-radius: 16px;
  background: linear-gradient(90deg, #e8eee9 0%, #f4f7f5 45%, #e8eee9 90%);
  background-size: 200% 100%;
  animation: csmShimmer 1.1s ease-in-out infinite;
}

@keyframes csmShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.csm-skeleton-card {
  height: 88px;
}

.csm-skeleton-card--tall {
  height: 120px;
}

.csm-skeleton-line {
  height: 14px;
  margin: 0 0 8px;
  border-radius: 8px;
}

.csm-skeleton-line--sm {
  width: 40%;
  height: 12px;
}

.csm-skeleton-line--md {
  width: 70%;
}

/* Soft empty / offline */
.csm-soft-msg {
  text-align: center;
  padding: 28px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--csm-muted);
  line-height: 1.45;
}

.csm-soft-msg strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: var(--csm-ink);
}

.visit-review-done {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--csm-green);
}

/* Nearest visit widget */
.nearest-visit {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(0, 132, 62, 0.14), transparent 55%),
    #fff;
  border: 1px solid rgba(0, 132, 62, 0.12);
  box-shadow: var(--csm-shadow);
  cursor: pointer;
}

.nearest-visit.hidden {
  display: none !important;
}

.nearest-visit-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--csm-green);
}

.nearest-visit-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--csm-ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.nearest-visit-meta {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--csm-muted);
  line-height: 1.35;
}

.nearest-visit-cta {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--csm-green);
}
