/* Chat modal message styles */
.chat-message {
  margin: 8px 0;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.chat-message-bot {
  background: #eaf3ff;
  color: #2563eb;
  font-weight: 500;
}

.chat-message-user {
  background: #f6f8fa;
  color: #111827;
  text-align: right;
}

.chat-modal-send {
  margin-left: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-modal-send:hover {
  background: #1741b6;
}

/* Chat modal styles */
.chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
}

.chat-modal.open {
  display: block;
}

.chat-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
}

.chat-modal-window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.18);
  width: 100%;
  max-width: 400px;
  padding: 0;
}

.chat-modal-header {
  font-size: 20px;
  font-weight: 700;
  padding: 18px 24px 8px 24px;
  color: #2563eb;
}

.chat-modal-content {
  padding: 0 24px 18px 24px;
}

.chat-modal-messages {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 12px;
  background: #f6f8fa;
  border-radius: 8px;
  padding: 8px;
}

.chat-modal-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 16px;
}

.chat-modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  background: none;
  border: none;
  font-size: 28px;
  color: #2563eb;
  cursor: pointer;
}

.chat-floating-btn {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 9998;
  background: none;
  border: none;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.18);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}

.chatbot-image-wrapper {
  position: relative;
  display: inline-block;
}

.chatbot-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%;
  top: -48px;
  transform: translateX(-50%);
  background: #fff;
  color: #2563EB;
  padding: 12px 20px;
  border-radius: 18px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  transition: opacity 0.2s;
  z-index: 10;
}

.chatbot-tooltip::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 12px 12px 0 12px;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.chatbot-image-wrapper:hover .chatbot-tooltip {
  visibility: visible;
  opacity: 1;
}

.bot-card .chatbot-image {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.bot-card .chatbot-image:hover {
  transform: scale(1.08);
}

/* Bot card styles */
.bot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 32px 24px;
  margin-right: 40px;
  min-width: 320px;
  flex: 1;
  max-width: 450px;
}

.hero-banner-text {
  flex: 1;
  max-width: 600px;
}

.bot-greeting {
  color: #ffffff !important;
  text-align: center;
  margin-top: 18px;
}

.bot-greeting h3 {
  color: #ffffff !important;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 18px;
  text-shadow: none;
}

.bot-greeting p {
  color: #eaf0fa;
  font-size: 18px;
  font-weight: 400;
  margin-top: 0;
  text-shadow: none;
}

@media (max-width: 768px) {
  .hero-banner-content {
    flex-direction: column;
    align-items: center;
  }

  .bot-card {
    margin-right: 0;
    margin-bottom: 24px;
  }
}

.hero-banner-image {
  justify-content: flex-start;
}

/* Chatbot greeting block */
.chatbot-greeting-block {
  color: #fff;
  margin-left: 24px;
  min-width: 220px;
}

@media (max-width: 768px) {
  .hero-banner-image {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .chatbot-greeting-block {
    margin-left: 0;
    margin-top: 12px;
    text-align: center;
  }
}

/* Base styles */
:root {
  --bg-primary: #F9FAFB;
  --text-primary: #111827;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --button-primary: #2563EB;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

html {
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  background: #eaf3ff;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-weight: 600;
  font-size: 18px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo:hover {
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(17, 24, 39, 0.04);
}

.nav-links a.active {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.nav-links a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.burger {
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .burger {
    display: inline-flex;
  }
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
  /* Глубокий градиент из квиза */
  color: #fff !important;
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}

.hero-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-banner-text h2 {
  color: #ffffff !important;
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-banner-text p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  max-width: 500px;
  line-height: 1.6;
}

.hero-steps {
  margin: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-step {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.step-num {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  z-index: 2;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.hero-step p {
  margin: 0 !important;
  font-size: 18px !important;
  color: #ffffff !important;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
}

/* Connecting dashed line */
.hero-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 18px;
  /* center of 36px circle */
  top: 36px;
  height: 24px;
  /* same as gap */
  width: 0;
  border-left: 1px dashed rgba(255, 255, 255, 0.3);
  z-index: 1;
}

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.btn.btn-hero {
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%) !important;
  /* Зеленый градиент как в квизе */
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
  transition: all 0.25s ease;
}

.btn.btn-hero:hover {
  background: linear-gradient(135deg, #00e4ba 0%, #00c8a4 100%) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(0, 212, 170, 0.4);
  transform: translateY(-2px);
}

.btn.btn-hero:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.hero-banner-image {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  padding: 20px;
}

.chatbot-image {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  max-height: 220px;
  /* border: 2px solid #fff; удалено для устранения белого контура */
  border-radius: 8px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
  color: #fff !important;
  padding: 64px 0;
  border-bottom: none;
}

.hero h1 {
  color: #fff !important;
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.2;
}

.hero p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.btn:hover {
  background: linear-gradient(135deg, #00e4ba 0%, #00c8a4 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 212, 170, 0.3);
}

.btn.secondary {
  background: #fff;
  color: #111827;
  border: 1px solid var(--border);
  font-weight: 500;
  box-shadow: none;
}

.btn.secondary:hover {
  background: #f9fafb;
  border-color: #1a1a2e;
  color: #1a1a2e;
  transform: translateY(-1px);
}

.btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Grid */
.grid {
  display: grid;
  gap: 20px;
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {

  .grid.cols-3,
  .grid.cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card h3 {
  margin: 12px 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
}

.card h3:hover {
  color: #0f3460;
}

.muted {
  color: var(--text-secondary);
  font-size: 14px;
  margin: 0;
}

.icon {
  width: 48px;
  height: 48px;
  color: var(--text-primary);
}

/* Footer */
.footer {
  margin-top: 64px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: rgba(255, 255, 255, 0.8);
  padding: 48px 0;
  border-top: none;
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #fff;
}

.footer h4 {
  color: #fff !important;
  font-weight: 600;
}

.footer p {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Modal */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: none;
  backdrop-filter: blur(4px);
  z-index: 1000;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  z-index: 1001;
}

.modal-inner {
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 80px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.close {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.close:hover {
  background: #f9fafb;
}

/* Legal Modal Specifics */
.legal-modal-body {
  max-height: 70vh !important;
  color: #111827;
}

.legal-content h4 {
  color: #111827 !important;
  margin-top: 20px;
}

.legal-content p {
  color: #374151 !important;
  margin-bottom: 12px;
}

.legal-content strong {
  color: #111827;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 14px;
}

.field input {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 16px;
  transition: all 0.2s ease;
}

.field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.checkbox input[type="checkbox"] {
  margin: 0;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Focus styles */
a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Typography improvements */
h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-primary);
}

h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-primary);
}

/* About page specific styles */
.hero h1 {
  color: var(--text-primary);
}

.card h2 {
  color: #1a1a2e;
}

.card strong {
  color: var(--accent);
}

/* Filter Panel */
.filter-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 32px;
  scroll-margin-top: 80px;
}

.filter-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex: 1;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-chip:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}

/* Article tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .hero-banner {
    padding: 60px 0;
    margin-bottom: 32px;
    min-height: 250px;
  }

  .hero-banner-content {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }

  .hero-banner-text h2 {
    font-size: 28px;
  }

  .hero-banner-text p {
    font-size: 16px;
  }

  .hero-banner-image {
    min-height: 120px;
    order: -1;
    padding: 15px;
  }

  .chatbot-image {
    max-height: 100px;
  }

  .filter-panel {
    margin-top: 16px;
    padding: 16px 0;
  }

  .filter-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .filter-chips {
    order: 1;
  }

  .sort-controls {
    order: 2;
    justify-content: flex-end;
    margin-top: 12px;
  }
}

/* --- Calculator Styles --- */
.calculator-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
}

.calc-progress {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.calc-progress-bar {
  height: 100%;
  background: var(--primary-color, #2563eb);
  transition: width 0.3s ease;
}

.calc-step h4 {
  margin-bottom: 20px;
  color: var(--text-dark, #1e293b);
  font-size: 1.25rem;
}

.profession-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.profession-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profession-card:hover {
  border-color: var(--primary-color);
}

.profession-card.active {
  border-color: var(--primary-color);
  background: #eff6ff;
}

.profession-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.profession-name {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Navigation buttons at the bottom */
.calc-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  /* Push to bottom of flex container */
  padding-top: 24px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.field input,
.field select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
}

.results-summary {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.summary-item.main {
  margin-bottom: 16px;
}

.summary-label {
  color: #64748b;
  font-size: 0.875rem;
}

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
}

.advanced-details-toggle {
  width: 100%;
  padding: 16px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  color: #2563eb;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 24px;
  transition: all 0.3s ease;
  animation: pulse-attention 3s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
}

.advanced-details-toggle:hover {
  background: #eff6ff;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  animation-play-state: paused;
}

@keyframes pulse-attention {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.2);
    background: #f1f5f9;
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    background: #e0f2fe;
    border-color: #bae6fd;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    background: #f1f5f9;
  }
}

.advanced-content {
  display: none;
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
}

.advanced-content.show {
  display: block;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.results-table td {
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

.results-table .text-right {
  text-align: right;
}

.results-table .bold {
  font-weight: 700;
}

.results-table .highlight {
  color: var(--primary-color);
}

/* Redesigned Results Chart */
.result-section h5 {
  margin: 24px 0 16px;
  font-size: 1.1rem;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.chart-bar {
  display: flex;
  height: 32px;
  width: 100%;
  background: #f1f5f9;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chart-segment {
  height: 100%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Progress-bar labels are now hidden (moved to legend) */
.chart-segment .chart-label {
  display: none;
}

.chart-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.legend-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-dot-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.legend-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  padding-left: 20px;
}

/* Premium Color Palette */
.bg-tax-federal {
  background-color: #f87171;
}

/* Soft Red */
.bg-tax-se {
  background-color: #fb923c;
}

/* Soft Orange */
.bg-tax-expenses {
  background-color: #60a5fa;
}

/* Soft Blue */
.bg-tax-takehome {
  background-color: #34d399;
}

/* Soft Green */

.results-summary {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.summary-item.main .summary-value {
  font-size: 2rem;
  color: #2563eb;
  letter-spacing: -0.02em;
}

/* Bilingual Terms Styling */
.term-en {
  color: #94a3b8;
  /* text-gray-400 equivalent */
  font-size: 0.8em;
  font-weight: 300;
  margin-left: 4px;
}

.btn-cpa-cta {
  display: flex;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  justify-content: center;
  background: #2563eb;
  color: #ffffff;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-cpa-cta:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
}

@media (max-width: 480px) {
  .profession-grid {
    grid-template-columns: 1fr;
  }
}
/* Dropdown Menu Styles */
.nav-item-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #ffffff;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border-radius: 12px;
  padding: 8px;
  z-index: 1000;
  border: 1px solid #e5e7eb;
  margin-top: 4px;
}

.nav-item-dropdown:hover .dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-menu a {
  color: #374151 !important;
  padding: 10px 12px;
  text-decoration: none;
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: transparent !important;
}

.dropdown-menu a:hover {
  background-color: #f3f4f6 !important;
  color: #2563eb !important;
  transform: translateX(4px);
}

/* =============================================
   MOBILE RESPONSIVE IMPROVEMENTS (July 2026)
   ============================================= */

/* 1. MOBILE NAVIGATION
   Dropdown opens as full-width overlay below the sticky header */
@media (max-width: 900px) {

  /* Nav menu overlay */
  .nav-links[data-open="true"] {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #eaf3ff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    padding: 8px 20px 20px;
    z-index: 45;
    gap: 4px;
  }

  /* Full-width tap-friendly links */
  .nav-links[data-open="true"] > a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
  }

  /* Dropdown section inside mobile menu */
  .nav-links[data-open="true"] .nav-item-dropdown {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .nav-links[data-open="true"] .nav-item-dropdown > a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
  }

  /* Always show sub-items on mobile (hover doesn\'t work on touch) */
  .nav-links[data-open="true"] .dropdown-menu {
    position: static !important;
    display: block;  /* no !important — allows inline style="display:none" to hide specific menus */
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    padding: 0 0 4px 20px;
    margin-top: 0 !important;
    min-width: 0;
    width: 100%;
    border-radius: 0;
    animation: none !important;
  }

  .nav-links[data-open="true"] .dropdown-menu a {
    font-size: 15px;
    padding: 8px 12px;
    transform: none !important;
  }
}

/* 1b. FIX h1 IN HERO BANNER (tax-guide.html uses h1 instead of h2) */
@media (max-width: 768px) {
  .hero-banner-text h1 {
    font-size: 28px !important;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  .hero-banner-text h1 {
    font-size: 22px !important;
  }
}

/* 1c. CLEAN UP nav-item-dropdown link in mobile menu */
@media (max-width: 900px) {
  /* Override inline display:flex on the Налоговое руководство link */
  .nav-links[data-open="true"] .nav-item-dropdown > a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    box-sizing: border-box;
  }

  /* Hide the ▼ arrow in mobile menu (no dropdown to show) */
  .nav-links[data-open="true"] .nav-item-dropdown > a span {
    display: none;
  }
}

/* 2. BOT CARD ON MOBILE — fix min-width overflow */
@media (max-width: 768px) {
  .bot-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: 24px 16px;
    box-sizing: border-box;
  }

  .bot-greeting h3 {
    font-size: 20px;
  }

  .bot-greeting p {
    font-size: 16px;
  }
}

/* 3. EXTRA SMALL SCREENS (< 480px) */
@media (max-width: 480px) {
  .hero-banner {
    padding: 32px 0;
  }

  .hero-banner-text h2 {
    font-size: 22px !important;
  }

  .hero-banner-text p {
    font-size: 15px !important;
    max-width: 100%;
  }

  .hero h1 {
    font-size: 26px !important;
  }

  /* Stack CTA buttons vertically on tiny screens */
  .hero-btns {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-btns .btn {
    justify-content: center;
    text-align: center;
  }

  .chatbot-greeting-block {
    min-width: 0;
  }
}

/* 4. ARTICLE PAGES ON MOBILE */
@media (max-width: 600px) {
  .article-content {
    padding: 20px 16px !important;
  }

  .article-content h1 {
    font-size: 1.8rem !important;
  }

  .article-content h2 {
    font-size: 1.3rem !important;
    margin-top: 1.8rem !important;
  }

  .article-content h3 {
    font-size: 1.1rem !important;
  }
}

/* 5. GLOBAL: prevent text from causing horizontal overflow */
p, li, h1, h2, h3, h4 {
  overflow-wrap: break-word;
}
