/* ============================================
   МИЦЕЛ – Основен стилов файл v43
   ============================================ */

:root {
  --paper: #f4efe4;
  --paper-dark: #ebe4d4;
  --card: #faf7ef;
  --ink: #2b2823;
  --ink-soft: #57534a;
  --forest: #4a6b4a;
  --forest-deep: #2f4a2f;
  --terracotta: #b35a3f;
  --sand: #d4c9b0;
  --line: #c9bfa8;
  --max: 1200px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

/* ============================================
   ANTI-OVERFLOW – глобални правила
   Предотвратява хоризонтален скрол на мобилно
   ============================================ */

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* Flex/grid деца не могат да принуждават родителя да расте */
*,
*::before,
*::after {
  min-width: 0;
}

/* Дълги думи (Gemeinschaftsmitglied) – пренасят се */
h1,
h2,
h3,
h4,
p,
li,
td,
th,
a,
span,
div,
.term,
.lead {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Хифенация само за дълги заглавия */
h1,
h2,
h3 {
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

/* Изображения и SVG не надхвърлят родителя */
img,
svg,
canvas,
video {
  max-width: 100%;
  height: auto;
}

/* Дълги URL-и, имейли, hex низове */
code,
pre,
.url,
a[href^='mailto:'],
a[href^='http'] {
  word-break: break-all;
}

/* По-малък padding на main за много тесни екрани */
@media (max-width: 380px) {
  main {
    width: 88%;
    padding: 2rem 0 2.5rem;
  }
}

body {
  margin: 0;
  background: #f4efe4;
  color: #2b2823;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Скриване на back-to-top при prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================
   ГЛОБАЛНИ FOCUS STATES (достъпност)
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================
   HEADER
   ============================================ */
header.site {
  border-bottom: 1px solid #c9bfa8;
  background: #ebe4d4;
  padding: 1.4rem 0;
  position: relative;
  z-index: 20;
}

header.site nav {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
}

header.site .brand {
  font-family: Georgia, 'Iowan Old Style', Palatino, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2f4a2f;
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-right: auto;
}

/* ============================================
   NAV LINKS
   ============================================ */
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
}

.nav-links a {
  color: #57534a;
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition:
    color 0.15s,
    border-color 0.15s;
}

.nav-links a:hover,
.nav-links a.current {
  color: #2f4a2f;
  border-bottom-color: #4a6b4a;
}

.nav-links a.lang-switch {
  font-weight: 600;
  color: var(--forest-deep);
}

/* ============================================
   BURGER TOGGLE
   ============================================ */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid #c9bfa8;
  border-radius: 2px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition:
    border-color 0.15s,
    background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:hover {
  border-color: #4a6b4a;
  background: #faf7ef;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: #2f4a2f;
  border-radius: 1px;
  transition:
    transform 0.25s ease,
    opacity 0.2s ease;
}

.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded='true'] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ============================================
   3D ЛОГО
   ============================================ */
.brand-with-logo {
  display: inline-flex !important;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.logo-canvas {
  width: 34px;
  height: 34px;
  display: block;
  flex-shrink: 0;
  cursor: pointer;
}

/* ============================================
   MAIN
   ============================================ */
main {
  width: 80%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

/* ============================================
   ТИПОГРАФИЯ
   ============================================ */
h1,
h2,
h3 {
  font-family: Georgia, 'Iowan Old Style', Palatino, serif;
  font-weight: 600;
  color: #2f4a2f;
  line-height: 1.25;
}

h1 {
  font-size: 2.5rem;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.65rem;
  margin: 3rem 0 1rem;
}

h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
}

p {
  margin: 0 0 1.1rem;
}
a {
  color: #2f4a2f;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  color: #b35a3f;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.eyebrow.pazaren {
  color: #8b5a3f;
}
.eyebrow.micel {
  color: #4a6b4a;
}

.lead {
  font-size: 1.15rem;
  color: #57534a;
  border-left: 3px solid #d4c9b0;
  padding-left: 1.25rem;
  margin: 0 0 2.5rem;
}

/* ============================================
   СПИСЪЦИ
   ============================================ */
ul.clean {
  padding-left: 1.1rem;
  margin: 0 0 1.5rem;
}

ul.clean li {
  margin-bottom: 0.5rem;
}
ul.clean li::marker {
  color: #b35a3f;
}

/* ============================================
   ТАБЛИЦИ
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.93rem;
}

th,
td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #c9bfa8;
  vertical-align: top;
}

th {
  font-family: Georgia, serif;
  font-weight: 600;
  color: #2f4a2f;
  background: #ebe4d4;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.45);
}

.compare-table th:first-child,
.compare-table td:first-child {
  width: 28%;
}
.compare-table th:nth-child(2),
.compare-table td:nth-child(2) {
  width: 36%;
}
.compare-table th:nth-child(3),
.compare-table td:nth-child(3) {
  width: 36%;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.75rem 0;
}

.table-scroll table {
  margin: 0;
  min-width: 540px; /* принуждава скрола на тясно */
}

/* Плавен индикатор за скрол */
.table-scroll::after {
  content: '→ scroll';
  display: block;
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-align: right;
  padding-top: 0.4rem;
  opacity: 0.6;
}

@media (min-width: 640px) {
  .table-scroll::after {
    display: none;
  }
  .table-scroll table {
    min-width: 0;
  }
}

/* ============================================
   NOTE
   ============================================ */
.note {
  font-size: 0.9rem;
  color: #57534a;
  background: #ebe4d4;
  padding: 1rem 1.25rem;
  border-left: 3px solid #4a6b4a;
  margin: 1.5rem 0;
}

.note strong {
  color: #2f4a2f;
}

/* ============================================
   КАРТИ
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

@media (min-width: 640px) {
  .card-grid.two {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  border: 1px solid #c9bfa8;
  background: #faf7ef;
  padding: 1.5rem 1.6rem;
  border-radius: 2px;
  transition:
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}

.card:hover,
.card:active {
  border-color: var(--forest);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(47, 74, 47, 0.08);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}
.card p {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: #57534a;
}

/* ============================================
   CTA
   ============================================ */
.cta {
  margin: 3.5rem 0 0;
  padding: 2.25rem 2rem;
  background: #2f4a2f;
  color: #f4efe4;
  border-radius: 2px;
}

.cta h2 {
  color: #f4efe4;
  margin-top: 0;
  margin-bottom: 0.75rem;
}
.cta p {
  color: #e2ddcd;
  margin-bottom: 1rem;
}
.cta a {
  color: #f4efe4;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 239, 228, 0.5);
}

.cta a.button {
  display: inline-block;
  background: #f4efe4;
  color: #2f4a2f;
  padding: 0.7rem 1.4rem;
  text-decoration: none;
  border-radius: 2px;
  font-weight: 600;
  border: none;
  margin-top: 0.5rem;
}

.cta a.button:hover {
  background: #ffffff;
}

/* ============================================
   ДВЕ КОЛОНИ
   ============================================ */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

@media (min-width: 700px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   ТАГОВЕ И ОПРЕДЕЛЕНИЯ
   ============================================ */
.model-tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.7rem;
  border-radius: 2px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.model-tag.pazaren {
  background: #e8dcc8;
  color: #6b3f2a;
}
.model-tag.micel {
  background: #d4e0d4;
  color: #2f4a2f;
}

.tm {
  font-size: 0.75rem;
  color: #57534a;
  font-style: italic;
}

.definition-block {
  background: #faf7ef;
  border: 1px solid #c9bfa8;
  border-radius: 2px;
  padding: 1.75rem 1.9rem;
  margin: 2rem 0;
}

.definition-block p:last-child {
  margin-bottom: 0;
}

/* ============================================
   GLOSSAR – TOOLTIPS ЗА ТЕРМИНИ
   ============================================ */
.term {
  text-decoration: none;
  border-bottom: 1px dashed var(--forest);
  cursor: help;
  position: relative;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.term:hover,
.term:focus-visible,
.term.active {
  color: var(--forest-deep);
  border-bottom-style: solid;
}

.term::after {
  content: attr(data-term-label);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--forest-deep);
  color: #f4efe4;
  padding: 0.65rem 0.9rem;
  border-radius: 2px;
  font-size: 0.82rem;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s,
    visibility 0.15s;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  letter-spacing: 0;
  text-transform: none;
}

.term::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--forest-deep);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.15s,
    visibility 0.15s;
  z-index: 101;
}

.term:hover::after,
.term:focus-visible::after,
.term.active::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.term:hover::before,
.term:focus-visible::before,
.term.active::before {
  opacity: 1;
  visibility: visible;
}

/* На мобилно – tooltip-ът излиза под текста, за да не се скрие */
@media (max-width: 640px) {
  .term::after {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(6px);
    max-width: calc(100vw - 2rem);
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
  }
  .term::before {
    bottom: auto;
    top: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--forest-deep);
    transform: translateX(-50%);
  }
  .term:hover::after,
  .term:focus-visible::after,
  .term.active::after {
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================
   FOOTER
   ============================================ */
footer.site {
  border-top: 1px solid #c9bfa8;
  padding: 2rem 0;
  font-size: 0.85rem;
  color: #57534a;
  text-align: center;
}

footer.site p {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================
   BACK TO TOP
   ============================================ */
.to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--forest-deep);
  color: #f4efe4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(47, 74, 47, 0.25);
  border: none;
  font-size: 1.15rem;
  font-family: inherit;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.25s,
    visibility 0.25s,
    transform 0.25s,
    background 0.15s;
  z-index: 40;
  -webkit-tap-highlight-color: transparent;
}

.to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover,
.to-top:active {
  background: var(--forest);
}

@media (max-width: 520px) {
  .to-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* ============================================
   STICKY PROGRESS (защитени страници)
   ============================================ */
.progress {
  margin: 0 0 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress.sticky {
  position: sticky;
  top: 0;
  background: var(--paper);
  padding: 1rem 0;
  margin-bottom: 1rem;
  z-index: 15;
  transition: box-shadow 0.2s;
}

.progress.sticky.scrolled {
  box-shadow: 0 4px 12px rgba(47, 74, 47, 0.08);
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--sand);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  background: var(--forest);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--forest-deep);
  white-space: nowrap;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-top: 0.6rem;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.progress-steps span.done {
  color: var(--forest);
  font-weight: 600;
}
.progress-steps span.current {
  color: var(--forest-deep);
  font-weight: 600;
}

/* ============================================
   HERO-КАРТА
   ============================================ */
.hero-map {
  margin: -2.5rem auto 2.5rem;
  padding-top: 0.5rem;
  text-align: center;
}

.hero-map .eyebrow {
  text-align: center;
  margin-bottom: 0.5rem;
}

.hero-map h1 {
  text-align: center;
  margin: 0 auto 1rem;
  max-width: 820px;
  font-size: 2.1rem;
  line-height: 1.2;
}

.map-wrapper {
  position: relative;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  aspect-ratio: 394.4 / 245;
  background: linear-gradient(180deg, #f4efe4 0%, #ebe4d4 100%);
  border-radius: 4px;
  box-shadow: 0 2px 20px rgba(47, 74, 47, 0.06);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s;
}

.map-wrapper.ready {
  opacity: 1;
}

.map-wrapper.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--sand);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.map-wrapper > svg.inline-map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#network-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-wrapper .sm_state {
  fill: #e8e0cf !important;
  stroke: #ffffff !important;
  stroke-width: 1 !important;
}

.map-dot {
  fill: #b35a3f;
  opacity: 0;
  animation: dotAppear 0.5s ease-out forwards;
}

.map-dot.hub {
  fill: #2f4a2f;
}

@keyframes dotAppear {
  0% {
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0.9;
  }
}

.map-connection {
  stroke: #4a6b4a;
  stroke-width: 0.6;
  stroke-linecap: round;
  fill: none;
  opacity: 0;
  vector-effect: non-scaling-stroke;
  animation: lineAppear 1s ease-out forwards;
}

.map-connection.highlight {
  stroke: #2f4a2f;
  stroke-width: 0.9;
}

@keyframes lineAppear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 0.4;
  }
}

.hero-text {
  width: 100%;
  font-size: 1rem;
  color: #57534a;
  margin: 1.75rem auto 0;
  text-align: center;
  line-height: 1.65;
  border-top: 1px solid #d4c9b0;
  padding-top: 1.5rem;
}

.hero-text strong {
  color: #2f4a2f;
}

/* ============================================
   АДАПТИВНОСТ
   ============================================ */
@media (max-width: 900px) {
  main {
    padding: 3rem 0 4rem;
  }
  h1 {
    font-size: 2.1rem;
  }
  h2 {
    font-size: 1.5rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #c9bfa8;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 0.95rem;
    padding: 0.75rem 0.5rem;
    width: 100%;
    border-bottom: none;
    border-radius: 2px;
  }

  .nav-links a:hover,
  .nav-links a.current {
    border-bottom-color: transparent;
    background: rgba(74, 107, 74, 0.08);
  }
}

@media (max-width: 640px) {
  .hero-map h1 {
    font-size: 1.65rem;
  }
  .hero-text {
    font-size: 0.94rem;
  }
  .logo-canvas {
    width: 28px;
    height: 28px;
  }

  .progress-steps {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.4rem;
    gap: 1rem;
    scrollbar-width: thin;
  }
  .progress-steps span {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  main {
    padding: 2.5rem 0 3rem;
  }
  header.site {
    padding: 1rem 0;
  }
  h1 {
    font-size: 1.75rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  table {
    font-size: 0.84rem;
  }
  th,
  td {
    padding: 0.55rem 0.6rem;
  }
  .compare-table {
    font-size: 0.8rem;
  }
  .progress {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .progress-track {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-dot,
  .map-connection {
    animation: none;
    opacity: 0.7;
  }
  .to-top {
    transition: none;
  }
  .term::after,
  .term::before {
    transition: none;
  }
}

/* ============================================
   ЕЗИКОВ СЕЛЕКТОР
   ============================================ */
.lang-selector-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.lang-header {
  margin-bottom: 3rem;
}

.lang-logo {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.lang-logo canvas {
  width: 80px;
  height: 80px;
  display: block;
  margin: 0 auto;
}

.lang-selector-page h1 {
  font-family: Georgia, 'Iowan Old Style', Palatino, serif;
  font-size: 3rem;
  color: var(--forest-deep);
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.lang-tagline {
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: var(--ink-soft);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0;
}

.lang-question {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
  max-width: 520px;
}

.lang-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 560px;
  margin-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .lang-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

.lang-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 2px;
  text-decoration: none;
  color: var(--forest-deep);
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.1s;
}

.lang-option:hover,
.lang-option:active {
  border-color: var(--forest-deep);
  box-shadow: 0 4px 20px rgba(47, 74, 47, 0.08);
  transform: translateY(-2px);
}

.lang-option .lang-code {
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--forest-deep);
  line-height: 1;
}

.lang-option .lang-name {
  font-size: 0.9rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.lang-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
  line-height: 1.6;
  max-width: 420px;
}

.lang-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
}

.lang-footer p {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 520px) {
  .lang-selector-page h1 {
    font-size: 2.25rem;
  }
  .lang-option {
    padding: 1.25rem 0.75rem;
  }
  .lang-option .lang-code {
    font-size: 1.6rem;
  }
}

@media (max-width: 520px) {
  .progress-steps {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.3rem;
  }
  .progress-steps span {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@keyframes holdShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.hold-button.failed {
  animation: holdShake 0.35s ease;
  border-color: var(--terracotta);
}
/* ============================================
   DEMO MODUS – временно за презентации
   Изтрий този блок заедно с demo.js
   ============================================ */
.demo-panel {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.85rem;
}

.demo-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    transform 0.15s,
    background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.demo-toggle:hover,
.demo-toggle:active {
  transform: scale(1.05);
  background: #9a4730;
}
.demo-panel.open .demo-toggle {
  background: var(--forest-deep);
}

.demo-body {
  position: absolute;
  top: 56px;
  right: 0;
  width: 280px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  padding: 1rem;
  border: 1px solid var(--line);
}

.demo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}
.demo-head strong {
  color: var(--forest-deep);
  font-size: 0.95rem;
}
.demo-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0 0.25rem;
}
.demo-close:hover {
  color: var(--terracotta);
}

.demo-sub {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.demo-jump-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terracotta);
  font-weight: 600;
  margin: 0.75rem 0 0.4rem;
}

.demo-jumps {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.demo-jump {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.82rem;
  border: 1px solid transparent;
  transition:
    background 0.1s,
    border-color 0.1s;
}
.demo-jump:hover {
  background: var(--paper-dark);
  border-color: var(--line);
}
.demo-jump.active {
  background: var(--forest-deep);
  color: #fff;
  font-weight: 600;
}

.demo-exit {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--terracotta);
  color: var(--terracotta);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition:
    background 0.15s,
    color 0.15s;
}
.demo-exit:hover {
  background: var(--terracotta);
  color: #fff;
}

/* Skip banner */
.demo-skip-banner {
  background: linear-gradient(135deg, #fff5e8 0%, #ffe9d6 100%);
  border: 2px dashed var(--terracotta);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin: 0 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.demo-skip-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.demo-skip-btn {
  background: var(--terracotta);
  color: #fff;
  border: none;
  border-radius: 2px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  flex: 1;
  min-width: 200px;
  -webkit-tap-highlight-color: transparent;
}
.demo-skip-btn:hover,
.demo-skip-btn:active {
  background: #9a4730;
}

/* Mobile */
@media (max-width: 520px) {
  .demo-panel {
    top: 0.6rem;
    right: 0.6rem;
  }
  .demo-toggle {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
  .demo-body {
    width: calc(100vw - 1.2rem);
    max-width: 320px;
    top: 50px;
    right: 0;
  }
  .demo-skip-banner {
    padding: 0.7rem;
  }
  .demo-skip-btn {
    min-width: 0;
    width: 100%;
  }
}

/* Print – скрий демо UI */
@media print {
  .demo-panel,
  .demo-skip-banner {
    display: none !important;
  }
}
