/* =============================================================
   guide.css — Guide Page Styles (Design System v2.2)
   NashDomBG · Ukrainian parents 55+ · Large type, clear hierarchy
   Neo-Glassmorphism · Light theme · Integrates neo-tokens.css
   ============================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Page-specific layout constants (not in tokens) */
:root {
  --guide-max-w:   1140px;
  --guide-tab-h:   62px;
  --guide-pad-h:   clamp(16px, 4vw, 48px);
  --guide-green-border: rgba(34, 197, 94, 0.30);
  --guide-green-bg: linear-gradient(135deg, rgba(34, 197, 94, 0.10), rgba(34, 197, 94, 0.05)), var(--glass-light);
  --text-muted: rgba(26, 26, 46, 0.45);
}

html { scroll-behavior: smooth; font-size: clamp(18px, 2.5vw, 22px); }

body {
  font-family: var(--font-body);
  background: var(--scene-bg-gradient);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
strong { font-weight: 700; }


/* =============================================================
   HEADER
   ============================================================= */

.guide-header {
  padding: 28px var(--guide-pad-h) 20px;
  max-width: var(--guide-max-w);
  margin: 0 auto;
}

.guide-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--accent);
  opacity: 0.8;
  transition: opacity var(--dur-fade) ease;
  min-height: 44px;
  padding: 6px 0;
  margin-bottom: 12px;
}
.guide-back:hover { opacity: 1; }

.guide-header h1 {
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: var(--ls-headline);
  line-height: 1.2;
}

.guide-header-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.guide-disclaimer-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  margin-top: 14px;
}

.guide-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--text-secondary);
  background: var(--glass-light);
  border: var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  margin-top: 10px;
  margin-left: 12px;
  cursor: pointer;
  transition: border-color var(--dur-fade) ease;
  min-height: 44px;
}
.guide-print-btn:hover {
  border-color: rgba(59, 122, 140, 0.4);
  color: var(--text-primary);
}




/* =============================================================
   STICKY TAB BAR
   ============================================================= */

.guide-tabs-wrap {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--glass-heavy);
  backdrop-filter: var(--blur-medium);
  border-bottom: 1px solid var(--divider-soft);
}

.guide-tabs {
  display: flex;
  max-width: var(--guide-max-w);
  margin: 0 auto;
  padding: 0 var(--guide-pad-h);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 2px;
}
.guide-tabs::-webkit-scrollbar { display: none; }

/* Fade indicator — shows there are more tabs to the right */
.guide-tabs-wrap { position: relative; }
.guide-tabs-wrap::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 48px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85));
  pointer-events: none;
  z-index: 1;
}

.guide-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  height: var(--guide-tab-h);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  transition: color var(--dur-fade) ease, border-color var(--dur-fade) ease;
  min-height: 44px;
  font-family: var(--font-body);
  flex-shrink: 0;
}
.guide-tab .tab-icon { font-size: 17px; }

.guide-tab:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(59, 122, 140, 0.3);
}
.guide-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.guide-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}


/* =============================================================
   TAB PANELS
   ============================================================= */

.guide-panels {
  max-width: var(--guide-max-w);
  margin: 0 auto;
  padding: 36px var(--guide-pad-h) 80px;
  scroll-margin-top: 70px;
  position: relative;
}

.guide-panel {
  height: 0;
  overflow: hidden;
  visibility: hidden;
  animation: gFadeIn var(--dur-quick) ease forwards;
}
.guide-panel.is-active {
  height: auto;
  overflow: visible;
  visibility: visible;
}

@keyframes gFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Staggered card entrance */
@keyframes gSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.guide-panel.is-active .city-card,
.guide-panel.is-active .buy-step,
.guide-panel.is-active .risk-card,
.guide-panel.is-active .vnzh-path,
.guide-panel.is-active .market-stat,
.guide-panel.is-active .catalyst-card {
  animation: gSlideUp var(--dur-enter) var(--ease-glass) both;
}
.guide-panel.is-active :nth-child(1) { animation-delay: 0ms; }
.guide-panel.is-active :nth-child(2) { animation-delay: 60ms; }
.guide-panel.is-active :nth-child(3) { animation-delay: 120ms; }
.guide-panel.is-active :nth-child(4) { animation-delay: 180ms; }
.guide-panel.is-active :nth-child(5) { animation-delay: 240ms; }
.guide-panel.is-active :nth-child(6) { animation-delay: 300ms; }
.guide-panel.is-active :nth-child(7) { animation-delay: 360ms; }


/* =============================================================
   SHARED COMPONENTS
   ============================================================= */

.g-section-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  letter-spacing: var(--ls-headline);
}


/* =============================================================
   TAB 1 — ГОРОДА
   ============================================================= */

.cities-intro {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 680px;
  line-height: 1.65;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.city-card {
  background: var(--glass-medium);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-card);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-standard) var(--ease-glass),
              border-color var(--dur-standard) var(--ease-glass),
              transform var(--dur-standard) var(--ease-glass);
}
.city-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(255, 255, 255, 0.45);
}

.city-card--best {
  border-color: rgba(59, 122, 140, 0.35);
  background: linear-gradient(135deg, rgba(59, 122, 140, 0.06), rgba(59, 122, 140, 0.02)), var(--glass-medium);
}
.city-card--best:hover {
  border-color: rgba(59, 122, 140, 0.50);
  background: linear-gradient(135deg, rgba(59, 122, 140, 0.10), rgba(59, 122, 140, 0.04)), var(--glass-medium);
}

.city-best-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(59, 122, 140, 0.12);
  border: 1px solid rgba(59, 122, 140, 0.30);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  margin-bottom: 10px;
}

.city-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.city-tagline {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.45;
}

/* Price bar */
.city-price-row { margin-bottom: 14px; }
.city-price-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}
.city-price-label-text {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-overline);
  font-weight: 500;
}
.city-price-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.city-price-track {
  height: 7px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  overflow: hidden;
}
.city-price-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 500ms ease;
}
.city-price-fill--low    { background: linear-gradient(90deg, var(--green), #16a34a); }
.city-price-fill--medium { background: linear-gradient(90deg, var(--yellow), #d97706); }
.city-price-fill--high   { background: linear-gradient(90deg, var(--red), #dc2626); }

/* What you get */
.city-get {
  font-size: 15px;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.city-get strong { color: var(--accent); font-weight: 600; }

/* Indicators */
.city-indicators {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 13px;
}
.city-indicator { display: flex; flex-direction: column; gap: 5px; }
.city-indicator-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-overline);
  font-weight: 600;
}
.city-dots { display: flex; gap: 4px; align-items: center; }
.city-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  border: 1.5px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.city-dot.on          { background: var(--accent); border-color: var(--accent); }
.city-dot.on.green    { background: var(--green);  border-color: var(--green);  }

.city-indicator-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.city-indicator-text--high { color: var(--green-text); }
.city-indicator-text--mid  { color: var(--text-secondary); }
.city-indicator-text--low  { color: var(--amber-text); }

.city-legend {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 8px 14px;
  background: var(--glass-light);
  border: var(--border-glass);
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Score */
.city-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
}
.city-score-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.city-score-stars { display: flex; gap: 4px; }
.city-star { font-size: 15px; color: rgba(0, 0, 0, 0.15); line-height: 1; }
.city-star.on { color: var(--star-color); }

/* Tags */
.city-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.city-tag {
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}
.city-tag--pro {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-text);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.city-tag--con {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-text);
  border: 1px solid rgba(245, 158, 11, 0.25);
}


/* =============================================================
   TAB 2 — КАК КУПИТЬ
   ============================================================= */

.buy-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.buy-step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: var(--glass-medium);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-standard) var(--ease-glass),
              border-color var(--dur-standard) var(--ease-glass),
              transform var(--dur-standard) var(--ease-glass);
}
.buy-step:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(255, 255, 255, 0.45);
}

.buy-step-num {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(59, 122, 140, 0.12);
  border: 1.5px solid rgba(59, 122, 140, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: var(--ls-headline);
}

.buy-step-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
}
.buy-step-body p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.buy-step-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Costs table */
.buy-costs-title,
.buy-checklist-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.guide-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: var(--border-glass);
  background: var(--glass-light);
  backdrop-filter: var(--blur-light);
  box-shadow: var(--shadow-card);
  margin-bottom: 28px;
}
.guide-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.guide-table th {
  text-align: left;
  padding: 13px 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-overline);
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--divider-soft);
  white-space: nowrap;
}
.guide-table td {
  padding: 12px 18px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--divider-soft);
  line-height: 1.5;
}
.guide-table tr:last-child td { border-bottom: none; }
.guide-table tr.total-row td {
  font-weight: 700;
  background: rgba(59, 122, 140, 0.06);
  border-top: 1px solid rgba(59, 122, 140, 0.18);
}
.guide-table tr.total-row td:last-child {
  color: var(--accent);
  font-size: 17px;
}

/* Callout cards */
.buy-callouts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.buy-callout {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  backdrop-filter: var(--blur-light);
}
.buy-callout-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.buy-callout p { color: var(--text-primary); }
.buy-callout--ok {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04)), var(--glass-light);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.buy-callout--warn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.04)), var(--glass-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.buy-callout--danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.04)), var(--glass-light);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.buy-callout--tip {
  background: linear-gradient(135deg, rgba(59, 122, 140, 0.08), rgba(59, 122, 140, 0.04)), var(--glass-light);
  border: 1px solid rgba(59, 122, 140, 0.25);
}

/* Checklist */
.buy-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  list-style: none;
}
.buy-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--glass-light);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 44px;
  box-shadow: var(--shadow-card);
}
.check-box {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--green);
  background: rgba(34, 197, 94, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.check-box::after {
  content: '✓';
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}


/* =============================================================
   TAB 3 — ВНЖ
   ============================================================= */

.vnzh-warning {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.10), rgba(239, 68, 68, 0.05)), var(--glass-light);
  border: 2px solid rgba(239, 68, 68, 0.30);
  backdrop-filter: var(--blur-light);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-card);
}
.vnzh-warning-icon { font-size: 26px; flex-shrink: 0; }
.vnzh-warning-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.55;
}
.vnzh-warning-text span { color: var(--red); font-weight: 700; }

.vnzh-paths {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.vnzh-path {
  border-radius: var(--radius-card);
  padding: 20px 22px;
  border: var(--border-glass);
  background: var(--glass-medium);
  backdrop-filter: var(--blur-light);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-standard) var(--ease-glass),
              border-color var(--dur-standard) var(--ease-glass),
              transform var(--dur-standard) var(--ease-glass);
}
.vnzh-path:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(255, 255, 255, 0.45);
}
.vnzh-path--green {
  border-color: rgba(34, 197, 94, 0.25);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04)), var(--glass-light);
}
.vnzh-path--blue {
  border-color: rgba(59, 122, 140, 0.25);
  background: linear-gradient(135deg, rgba(59, 122, 140, 0.08), rgba(59, 122, 140, 0.04)), var(--glass-light);
}
.vnzh-path--disabled {
  border-color: rgba(0, 0, 0, 0.06);
  opacity: 0.5;
}

.vnzh-path-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.vnzh-path--green .vnzh-path-badge {
  background: rgba(34, 197, 94, 0.14);
  color: var(--green-text);
  border: 1px solid rgba(34, 197, 94, 0.28);
}
.vnzh-path--blue .vnzh-path-badge {
  background: rgba(59, 122, 140, 0.12);
  color: var(--accent);
  border: 1px solid rgba(59, 122, 140, 0.28);
}
.vnzh-path--disabled .vnzh-path-badge {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.vnzh-path h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}
.vnzh-path-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.vnzh-path-cost {
  font-size: 14px;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid var(--divider-soft);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.vnzh-path-cost span { display: flex; align-items: flex-start; gap: 6px; line-height: 1.5; }
.vnzh-pro { color: var(--green-text); font-weight: 600; }
.vnzh-con { color: var(--amber-text); }
.vnzh-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Timeline */
.vnzh-timeline { margin-bottom: 28px; }
.vnzh-timeline-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
}
.vnzh-timeline-track {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.vnzh-timeline-track::-webkit-scrollbar { display: none; }
.vnzh-timeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  gap: 10px;
  flex-shrink: 0;
}
.vnzh-timeline-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  flex-shrink: 0;
}
.vnzh-timeline-circle--start {
  background: rgba(59, 122, 140, 0.14);
  border: 2px solid var(--accent);
  color: var(--accent);
}
.vnzh-timeline-circle--mid {
  background: rgba(34, 197, 94, 0.12);
  border: 2px solid var(--green);
  color: var(--green-text);
}
.vnzh-timeline-circle--end {
  background: rgba(234, 179, 8, 0.12);
  border: 2px solid var(--yellow);
  color: var(--amber-text);
}
.vnzh-timeline-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.4;
}
.vnzh-timeline-arrow {
  flex: 1;
  min-width: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--green));
  margin-bottom: 28px;
  position: relative;
}
.vnzh-timeline-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--green);
}

.vnzh-costs-note {
  background: var(--glass-light);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  box-shadow: var(--shadow-card);
}
.vnzh-costs-note strong { color: var(--text-primary); font-weight: 600; }


/* =============================================================
   TAB 4 — РИСКИ
   ============================================================= */

.risks-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.risk-card {
  border-radius: var(--radius-card);
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  backdrop-filter: var(--blur-light);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-standard) var(--ease-glass),
              transform var(--dur-standard) var(--ease-glass);
}
.risk-card:hover {
  box-shadow: var(--shadow-card-hover);
}
.risk-card--red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.04)), var(--glass-light);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.risk-card--amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.04)), var(--glass-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.risk-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; line-height: 1; }
.risk-body h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.risk-body p { font-size: 15px; color: var(--text-secondary); line-height: 1.65; }
.risk-body strong { color: var(--text-primary); font-weight: 700; }

.risk-severity {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 5px;
  margin-bottom: 7px;
}
.risk-severity--critical {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red-text);
  border: 1px solid rgba(239, 68, 68, 0.28);
}
.risk-severity--important {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber-text);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.risks-rule {
  background: linear-gradient(135deg, rgba(59, 122, 140, 0.07), rgba(59, 122, 140, 0.03)), var(--glass-light);
  backdrop-filter: var(--blur-light);
  border: 2px solid rgba(59, 122, 140, 0.25);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.55;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-card);
}
.risks-rule .rule-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--ls-overline);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.risks-rule strong { color: var(--accent); }


/* =============================================================
   TAB 5 — РЫНОК
   ============================================================= */

.market-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.market-stat {
  background: var(--glass-medium);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-standard) var(--ease-glass),
              border-color var(--dur-standard) var(--ease-glass),
              transform var(--dur-standard) var(--ease-glass);
}
.market-stat:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(255, 255, 255, 0.45);
}
.market-stat-num {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent);
}
.market-stat-num.green { color: var(--green); }
.market-stat-num.amber { color: var(--yellow); }
.market-stat-label {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 4px;
}
.market-stat-sub { font-size: 13px; color: var(--text-muted); line-height: 1.4; }

.market-section-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 26px 0 12px;
}

.market-nobubble {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04)), var(--glass-light);
  backdrop-filter: var(--blur-light);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-card);
  padding: 18px 22px;
  margin-bottom: 22px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  box-shadow: var(--shadow-card);
}
.market-nobubble-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--green-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.market-nobubble strong { color: var(--green-text); font-weight: 700; }

.market-catalysts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.catalyst-card {
  background: var(--glass-medium);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur-standard) var(--ease-glass),
              border-color var(--dur-standard) var(--ease-glass),
              transform var(--dur-standard) var(--ease-glass);
}
.catalyst-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(255, 255, 255, 0.45);
}
.catalyst-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.catalyst-body h4 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.catalyst-body p { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

/* New vs secondary */
.market-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.market-compare-card {
  background: var(--glass-medium);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}
.market-compare-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.market-compare-card ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.market-compare-card li {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.market-compare-card li::before {
  content: '•';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.market-compare-card--recommended {
  border-color: rgba(34, 197, 94, 0.25);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04)), var(--glass-light);
}
.market-compare-card--recommended h4 { color: var(--green-text); }

.market-mortgage {
  background: var(--glass-medium);
  backdrop-filter: var(--blur-light);
  border: var(--border-glass);
  border-radius: var(--radius-card);
  padding: 18px 22px;
  margin-bottom: 22px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  box-shadow: var(--shadow-card);
}
.market-mortgage strong { color: var(--text-primary); font-weight: 700; }

/* Timing */
.market-timing {
  background: linear-gradient(135deg, rgba(59, 122, 140, 0.08), rgba(59, 122, 140, 0.03)), var(--glass-light);
  backdrop-filter: var(--blur-light);
  border: 1.5px solid rgba(59, 122, 140, 0.25);
  border-radius: var(--radius-card);
  padding: 22px 26px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-card);
}
.market-timing-icon { font-size: 28px; flex-shrink: 0; }
.market-timing-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.market-timing-body p { font-size: 15px; color: var(--text-secondary); line-height: 1.65; }
.market-timing-body strong { color: var(--text-primary); font-weight: 700; }


/* =============================================================
   PANEL SUMMARY ("Что запомнить")
   ============================================================= */

.panel-summary {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 36px;
  padding: 20px 22px;
  background: linear-gradient(135deg, rgba(59, 122, 140, 0.07), rgba(59, 122, 140, 0.03)), var(--glass-light);
  backdrop-filter: var(--blur-light);
  border: 1.5px solid rgba(59, 122, 140, 0.22);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.panel-summary-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.panel-summary strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.panel-summary ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-summary li {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
}

.panel-summary li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 700px) {
  .panel-summary { flex-direction: column; gap: 8px; padding: 16px 16px; }
}


/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 700px) {
  .guide-header { padding: 20px 16px 14px; }
  .guide-tabs { padding: 0 8px; }
  .guide-tab { padding: 0 10px; font-size: 14px; gap: 4px; }
  .guide-tab .tab-label { font-size: 11px; }
  .guide-tab .tab-icon { font-size: 16px; }
  .guide-panels { padding: 22px 14px 60px; }

  .city-grid { grid-template-columns: 1fr; }
  .buy-callouts { grid-template-columns: 1fr; }
  .buy-checklist { grid-template-columns: 1fr; }
  .vnzh-paths { grid-template-columns: 1fr; }
  .market-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .market-compare { grid-template-columns: 1fr; }
  .market-catalysts { grid-template-columns: 1fr; }

  .buy-step { flex-direction: column; gap: 10px; }
  .buy-step-num { width: 40px; height: 40px; font-size: 17px; }

  .vnzh-timeline-node { min-width: 86px; }
  .vnzh-timeline-circle { width: 44px; height: 44px; font-size: 10px; }

  .market-timing { flex-direction: column; gap: 10px; }
  .risks-rule { font-size: 15px; padding: 18px 16px; }
}

@media (max-width: 480px) {
  html { font-size: 19px; }
  .market-stat-num { font-size: 30px; }
  .vnzh-warning-text { font-size: 15px; }
}

/* --- Hover lift only on pointer devices --- */
@media (hover: hover) and (pointer: fine) {
  .city-card:hover,
  .buy-step:hover,
  .risk-card:hover,
  .vnzh-path:hover,
  .market-stat:hover,
  .catalyst-card:hover,
  .market-compare-card:hover {
    transform: translateY(-2px);
  }
}
/* Disable hover lift on touch */
@media (hover: none) {
  .city-card:hover,
  .buy-step:hover,
  .risk-card:hover,
  .vnzh-path:hover,
  .market-stat:hover,
  .catalyst-card:hover,
  .market-compare-card:hover {
    transform: none;
  }
}

/* --- Responsive tables → card view on mobile --- */
@media (max-width: 600px) {
  .guide-table thead { display: none; }
  .guide-table,
  .guide-table tbody,
  .guide-table tr,
  .guide-table td { display: block; width: 100%; }
  .guide-table tr {
    padding: 14px 16px;
    border-bottom: 1px solid var(--divider-soft);
  }
  .guide-table tr:last-child { border-bottom: none; }
  .guide-table td {
    padding: 3px 0;
    border-bottom: none;
    font-size: 15px;
    line-height: 1.5;
  }
  .guide-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--ls-overline);
    color: var(--text-muted);
    margin-bottom: 2px;
  }
  .guide-table tr.total-row {
    margin-top: 4px;
    padding-top: 12px;
  }
  .guide-table tr.total-row td {
    background: none;
    border-top: none;
  }
  .guide-table tr.total-row td:first-child {
    background: rgba(59, 122, 140, 0.06);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
  }

  /* Timeline vertical on mobile */
  .vnzh-timeline-track {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .vnzh-timeline-node {
    flex-direction: row;
    min-width: unset;
    gap: 14px;
    padding: 8px 0;
  }
  .vnzh-timeline-circle {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
  .vnzh-timeline-label {
    text-align: left;
    font-size: 14px;
  }
  .vnzh-timeline-arrow {
    width: 2px;
    min-width: 2px;
    height: 20px;
    min-height: 20px;
    margin-bottom: 0;
    margin-left: 23px;
    background: linear-gradient(180deg, var(--accent), var(--green));
  }
  .vnzh-timeline-arrow::after {
    right: auto;
    top: auto;
    bottom: -1px;
    left: -4px;
    border-top: 8px solid var(--green);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guide-panel,
  .guide-panel.is-active .city-card,
  .guide-panel.is-active .buy-step,
  .guide-panel.is-active .risk-card,
  .guide-panel.is-active .vnzh-path,
  .guide-panel.is-active .market-stat,
  .guide-panel.is-active .catalyst-card { animation: none; }

  .city-card, .buy-step,
  .catalyst-card, .market-stat,
  .risk-card, .vnzh-path,
  .market-compare-card, .market-mortgage,
  .market-timing { transition: none; }

  .city-card:hover,
  .buy-step:hover,
  .risk-card:hover,
  .vnzh-path:hover,
  .market-stat:hover,
  .catalyst-card:hover { transform: none; }
}

/* =============================================================
   PRINT STYLES
   ============================================================= */

@media print {
  /* Show all panels */
  .guide-panel {
    height: auto !important;
    overflow: visible !important;
    visibility: visible !important;
    position: relative !important;
    width: auto !important;
    left: auto !important;
    page-break-inside: avoid;
    margin-bottom: 24px;
    border-top: 2px solid #ccc;
    padding-top: 16px;
  }

  /* Hide interactive elements */
  .guide-tabs-wrap,
  .guide-back,
  .guide-print-btn { display: none !important; }

  /* Remove glass effects for print */
  body {
    background: white !important;
    color: #1a1a2e !important;
  }

  .city-card, .buy-step, .buy-callout,
  .vnzh-path, .risk-card, .market-stat,
  .catalyst-card, .market-compare-card,
  .market-mortgage, .market-timing, .market-nobubble,
  .vnzh-warning, .vnzh-costs-note, .risks-rule,
  .panel-summary, .guide-table-wrap {
    background: white !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    color: #1a1a2e !important;
  }

  /* Ensure text is black */
  .city-name, .buy-step-body h3, .risk-body h3,
  .vnzh-path h3, .catalyst-body h4,
  .market-compare-card h4, .market-stat-label,
  .g-section-title, .market-section-title,
  .panel-summary strong, .guide-header h1 {
    color: #1a1a2e !important;
  }

  .market-stat-num,
  .market-stat-num.green,
  .market-stat-num.amber {
    color: #333 !important;
  }

  /* Tables print cleanly */
  .guide-table-wrap {
    overflow: visible !important;
  }

  /* Disable animations */
  * {
    animation: none !important;
    transition: none !important;
  }

  /* Page breaks */
  .guide-panel { page-break-before: always; }
  .guide-panel:first-child { page-break-before: avoid; }

  /* Add panel titles for print context */
  .guide-panel::before {
    content: attr(aria-labelledby);
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #999;
    margin-bottom: 8px;
  }
}
