/* ══════════════════════════════════════════
   TouchScreenTest.org — styles.css
   ══════════════════════════════════════════ */

/* ── CSS VARIABLES ── */
:root {
  --blue:        #2b35f0;
  --blue-dark:   #1f28d6;
  --blue-light:  #eef0ff;
  --nav-bg:      #2b35f0;
  --bg:          #f5f6fa;
  --surface:     #ffffff;
  --text:        #1a1a2e;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --card-bg:     #ffffff;
  --faq-bg:      #ffffff;
  --shadow:      0 1px 3px rgba(0,0,0,0.08);
  --font:        'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --radius:      10px;
  --navbar-h:    56px;
}

[data-theme="dark"] {
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --text:       #e8eaf0;
  --text-muted: #9399a8;
  --border:     #2a2d3a;
  --card-bg:    #1e2130;
  --faq-bg:     #1e2130;
  --blue-light: #1e2250;
  --shadow:     0 1px 4px rgba(0,0,0,0.35);
}

/* Dropdowns always stay white regardless of theme */
[data-theme="dark"] .nav-dropdown {
  background: #ffffff !important;
  border-color: #d1d5db !important;
}
[data-theme="dark"] .dropdown-item {
  color: #111827 !important;
  background: transparent !important;
}
[data-theme="dark"] .dropdown-item:hover {
  background: #eff0ff !important;
  color: #2b35f0 !important;
}
[data-theme="dark"] .dropdown-item.active { color: #2b35f0 !important; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: background 0.25s, color 0.25s;
}

/* ══════════════════════════════
   NAVBAR
   ══════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  height: var(--navbar-h);
  overflow: visible;  /* CRITICAL: never clip dropdowns */
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--navbar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;  /* never clip dropdowns */
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 4px;
}
.nav-icon { width: 22px; height: 22px; flex-shrink: 0; }
.logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* Desktop links */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  padding: 5px 11px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-link:hover  { color: #fff; background: rgba(255,255,255,0.12); }
.nav-link.active { color: #fff; font-weight: 700; }

/* Right group */
.nav-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Feedback button */
.nav-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.nav-feedback:hover { background: rgba(255,255,255,0.22); }

/* ── Icon buttons (theme + lang) — WHITE background ── */
.nav-btn-wrap { position: relative; }

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: #ffffff;          /* solid white */
  border: none;
  border-radius: 9px;
  cursor: pointer;
  color: var(--blue);           /* icon color = blue */
  transition: background 0.15s, transform 0.1s;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.nav-icon-btn:hover  { background: rgba(255,255,255,0.88); }
.nav-icon-btn:active { transform: scale(0.93); }

.nav-flag-btn { font-size: 20px; }

/* Dropdowns */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 11px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.18);
  min-width: 150px;
  padding: 5px;
  z-index: 99999;
  display: none;
  flex-direction: column;
  gap: 1px;
}
.nav-dropdown.open { display: flex; }
.lang-dropdown-wide { min-width: 190px; max-height: 340px; overflow-y: auto; }

.dropdown-item {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #111827 !important;
  background: transparent !important;
  border: none;
  border-radius: 7px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
  white-space: nowrap;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  opacity: 1 !important;
  visibility: visible !important;
}
.dropdown-item:hover,
.dropdown-item:active {
  background: #eff0ff !important;
  color: #2b35f0 !important;
}
.dropdown-item.active {
  color: #2b35f0 !important;
  font-weight: 700 !important;
}
.dropdown-item .check {
  margin-left: auto;
  color: #2b35f0 !important;
  flex-shrink: 0;
  opacity: 1 !important;
}

/* ══════════════════════════════
   HAMBURGER (mobile)
   ══════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}
/* Animate to X */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════
   MOBILE MENU DRAWER
   ══════════════════════════════ */
.mobile-menu {
  display: none; /* shown by JS */
  position: absolute;
  top: var(--navbar-h);
  left: 0; right: 0;
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 12px 20px 20px;
  z-index: 99;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.mobile-menu.open { display: flex; }

.mobile-nav-links { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav-link {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.mobile-nav-link:hover,
.mobile-nav-link.active { background: rgba(255,255,255,0.12); color: #fff; }

.mobile-menu-divider { height: 1px; background: rgba(255,255,255,0.12); margin: 10px 0; }

.mobile-feedback-btn {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px; padding: 10px 14px;
  cursor: pointer; width: fit-content;
}
.mobile-feedback-btn:hover { background: rgba(255,255,255,0.18); }

/* Backdrop */
.mobile-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(0,0,0,0.25);
}
.mobile-backdrop.open { display: block; }

/* ══════════════════════════════
   HERO
   ══════════════════════════════ */
.hero {
  min-height: calc(100vh - var(--navbar-h));
  min-height: calc(100dvh - var(--navbar-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.hero-title {
  font-size: clamp(32px, 5.5vw, 58px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 440px;
  margin: 0 auto 32px;
}

.btn-start {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  border: none;
  border-radius: 9px;
  padding: 15px 56px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(43,53,240,0.35);
}
.btn-start:hover  { background: var(--blue-dark); }
.btn-start:active { transform: scale(0.97); }

.autostart-toggle {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 16px;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; user-select: none;
}
.autostart-toggle input { display: none; }
.toggle-track {
  width: 36px; height: 20px;
  background: #d1d5db; border-radius: 10px;
  position: relative; transition: background 0.2s; flex-shrink: 0;
}
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.2s;
}
.autostart-toggle input:checked ~ .toggle-track { background: var(--blue); }
.autostart-toggle input:checked ~ .toggle-track .toggle-thumb { left: 18px; }

/* ══════════════════════════════
   TEST OVERLAY
   ══════════════════════════════ */
.test-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%; height: 100dvh;
  z-index: 1000;
  background: #2b35f0;
  touch-action: none; overscroll-behavior: none;
  user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.test-overlay.hidden { display: none; pointer-events: none; }

#canvas {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%; height: 100dvh;
  overflow: hidden; background: #fff;
}
#grid { display: grid; width: 100%; height: 100%; }
.cell { background: #2b35f0; contain: strict; will-change: background-color; }
.cell.hit  { background: #1ec95a; }
.cell.dead { background: #e02020 !important; }

#prog-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.15); z-index: 100; pointer-events: none; }
#prog-fill { height: 100%; width: 0%; background: #fff; opacity: 0.7; transition: width 0.08s linear; will-change: width; }

#status { position: fixed; top: max(10px, env(safe-area-inset-top,10px)); right: max(10px, env(safe-area-inset-right,10px)); z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; pointer-events: none; }
#coverage-num { font-size: 22px; font-weight: 700; color: #fff; line-height: 1; text-shadow: 0 1px 4px rgba(0,0,0,0.25); }
#coverage-label { font-size: 10px; font-weight: 500; color: rgba(255,255,255,0.5); letter-spacing: 0.08em; text-transform: uppercase; }

#instruction { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 50; text-align: center; pointer-events: none; transition: opacity 0.3s ease; }
#instruction.hidden { opacity: 0; }
#instruction h2 { font-size: 17px; font-weight: 600; color: rgba(255,255,255,0.92); margin-bottom: 6px; }
#instruction p  { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.5; }

#menu-trigger { position: fixed; bottom: max(14px,env(safe-area-inset-bottom,14px)); left: max(14px,env(safe-area-inset-left,14px)); z-index: 200; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.35); cursor: pointer; touch-action: manipulation; display: flex; align-items: center; justify-content: center; transition: background 0.15s; -webkit-tap-highlight-color: transparent; }
#menu-trigger:active { background: rgba(255,255,255,0.35); }
#menu-trigger span { display: block; width: 3px; height: 3px; border-radius: 50%; background: #fff; box-shadow: 0 -5px 0 #fff, 0 5px 0 #fff; }

#camera-btn { position: fixed; top: max(10px,env(safe-area-inset-top,10px)); left: 50%; transform: translateX(-50%); z-index: 200; width: 44px; height: 44px; border-radius: 50%; background: rgba(10,14,40,0.75); border: 1.5px solid rgba(255,255,255,0.25); cursor: pointer; touch-action: manipulation; display: flex; align-items: center; justify-content: center; transition: background 0.15s; -webkit-tap-highlight-color: transparent; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: auto; }
#camera-btn:active { background: rgba(255,255,255,0.28); }
#camera-btn svg { width: 20px; height: 20px; color: #fff; opacity: 0.9; }

#flash { position: fixed; inset: 0; z-index: 500; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.08s ease-out; }
#flash.on { opacity: 0.85; }

#panel { position: fixed; bottom: max(52px,calc(env(safe-area-inset-bottom,0px)+52px)); left: max(14px,env(safe-area-inset-left,14px)); z-index: 200; background: rgba(10,14,40,0.92); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 160px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transform: translateY(8px); opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; }
#panel.open { opacity: 1; pointer-events: all; transform: translateY(0); }

.panel-btn { font-family: var(--font); font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.88); background: transparent; border: none; border-radius: 8px; padding: 9px 12px; text-align: left; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; display: flex; align-items: center; gap: 10px; transition: background 0.1s; white-space: nowrap; pointer-events: auto; }
.panel-btn:active, .panel-btn:hover { background: rgba(255,255,255,0.08); }
.panel-btn .icon { width: 16px; text-align: center; font-size: 14px; opacity: 0.7; }
.panel-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 2px 0; }
body.dz-active .dz-btn { color: #ff8080; }

#result { position: fixed; inset: 0; z-index: 350; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(20,28,200,0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transition: opacity 0.5s ease; touch-action: manipulation; }
#result.show { opacity: 1; pointer-events: auto; }
.result-status { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-bottom: 4px; }
.result-value  { font-size: clamp(56px,16vw,96px); font-weight: 800; color: #fff; line-height: 1; letter-spacing: -0.02em; }
.result-sub    { font-size: 14px; color: rgba(255,255,255,0.55); margin-top: 4px; }
.result-meta   { font-size: 12px; color: rgba(255,255,255,0.3); letter-spacing: 0.04em; margin-top: 2px; }
.result-actions { display: flex; gap: 10px; margin-top: 24px; align-items: center; touch-action: manipulation; pointer-events: auto; position: relative; z-index: 400; }
.result-action { font-family: var(--font); font-size: 14px; font-weight: 600; color: #fff; background: rgba(255,255,255,0.12); border: 1.5px solid rgba(255,255,255,0.22); border-radius: 10px; padding: 11px 28px; cursor: pointer; touch-action: manipulation; pointer-events: auto; -webkit-tap-highlight-color: transparent; position: relative; z-index: 400; }
.result-action:active { background: rgba(255,255,255,0.32); }
.result-camera { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.12); border: 1.5px solid rgba(255,255,255,0.22); cursor: pointer; touch-action: manipulation; pointer-events: auto; -webkit-tap-highlight-color: transparent; display: flex; align-items: center; justify-content: center; transition: background 0.15s; position: relative; z-index: 400; }
.result-camera:active { background: rgba(255,255,255,0.38); }
.result-camera svg { width: 20px; height: 20px; color: #fff; opacity: 0.9; }

#toast { position: fixed; bottom: max(80px,calc(env(safe-area-inset-bottom,0px)+80px)); left: 50%; transform: translateX(-50%); z-index: 600; font-size: 13px; font-weight: 500; color: #fff; background: rgba(0,0,0,0.7); border-radius: 20px; padding: 8px 16px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
#toast.show { opacity: 1; }

/* ══════════════════════════════
   CONTENT SECTIONS
   ══════════════════════════════ */
.below-hero { background: var(--bg); }
.section-title { font-size: clamp(20px,2.8vw,28px); font-weight: 800; color: var(--text); letter-spacing: -0.01em; margin-bottom: 32px; }

.features-section { max-width: 1000px; margin: 0 auto; padding: 72px 24px 64px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 28px 48px; }
.feature-item h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.feature-item p  { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

.guide-cards, .trouble-cards { max-width: 1000px; margin: 0 auto; padding: 0 24px 56px; display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 14px; }
.guide-card, .trouble-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); }
.guide-card-icon, .trouble-icon { width: 36px; height: 36px; flex-shrink: 0; background: var(--blue-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.guide-card-icon svg, .trouble-icon svg { width: 18px; height: 18px; color: var(--blue); }
.guide-card h3, .trouble-card h3 { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.guide-card p,  .trouble-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
.card-link { font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.how-section { max-width: 1000px; margin: 0 auto; padding: 0 24px 64px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 28px 48px; }
.how-item { display: flex; gap: 14px; }
.how-num  { font-size: 14px; font-weight: 700; color: var(--blue); flex-shrink: 0; margin-top: 1px; }
.how-item h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.how-item p  { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

.why-section { max-width: 1000px; margin: 0 auto; padding: 0 24px 64px; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 28px 48px; }
.why-item h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.why-item p  { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

/* FAQ */
.faq-section { max-width: 760px; margin: 0 auto; padding: 0 24px 72px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--faq-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; font-family: var(--font); font-size: 15px; font-weight: 600; color: var(--text); background: transparent; border: none; cursor: pointer; text-align: left; -webkit-tap-highlight-color: transparent; transition: background 0.12s; }
.faq-q:hover { background: var(--bg); }
.faq-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.25s ease; }
.faq-q[aria-expanded="true"] .faq-arrow { transform: rotate(180deg); }
.faq-a { font-size: 14px; color: var(--text-muted); line-height: 1.7; padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.open .faq-a { max-height: 300px; padding: 0 18px 16px; }

/* ══════════════════════════════
   FOOTER — matches header style
   ══════════════════════════════ */
.footer {
  background: var(--nav-bg);   /* same blue as navbar */
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--navbar-h);     /* same height as navbar */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  margin-right: 8px;
  flex-shrink: 0;
}
.footer-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.footer-links a {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  padding: 4px 9px;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.footer-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }

.footer-right {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}
.footer-right a {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.footer-right a:hover { color: #fff; }

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */

/* ── Tablet / large mobile ── */
@media (max-width: 768px) {
  /* Hide desktop nav links */
  .nav-links { display: none; }

  /* Hide feedback button on all mobile/tablet sizes */
  .nav-feedback,
  .nav-right > a[href*="mailto"],
  .nav-right > a[style] { display: none !important; }

  /* Show hamburger */
  .hamburger { display: flex; }

  /* Footer stacks */
  .footer-inner {
    height: auto;
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .footer-left { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-links { gap: 2px; }
}

/* ── Small mobile — primary fix ── */
@media (max-width: 540px) {
  /* Navbar: never clip dropdowns */
  .navbar { height: auto; min-height: var(--navbar-h); overflow: visible !important; }

  .nav-inner {
    padding: 0 12px;
    gap: 5px;
    flex-wrap: nowrap;
    height: var(--navbar-h);
    overflow: visible !important;  /* MUST be visible so dropdown isn't clipped */
  }

  /* Logo: show full name clearly */
  .nav-logo { gap: 6px; margin-right: 0; min-width: 0; flex-shrink: 1; }
  .logo-text {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
  }
  .logo-img { width: 34px !important; height: 34px !important; }

  /* Hide Feedback button */
  .nav-feedback,
  .nav-right > a[href*="mailto"],
  .nav-right > a.nav-feedback,
  .nav-right > a[style] { display: none !important; }

  /* Icon buttons */
  .nav-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 17px;
    flex-shrink: 0;
  }

  /* Hamburger */
  .hamburger { width: 34px; height: 34px; flex-shrink: 0; }
  .hamburger span { width: 17px; }

  /* Nav right */
  .nav-right { gap: 5px; flex-shrink: 0; }

  /* ── DROPDOWN: fixed position on mobile to escape navbar clipping ── */
  .nav-dropdown {
    position: fixed !important;
    top: var(--navbar-h) !important;
    right: 12px !important;
    left: auto !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
    z-index: 99999 !important;
    border-radius: 12px !important;
  }
  .dropdown-item {
    color: #111827 !important;
    background: transparent !important;
    font-size: 14px;
    opacity: 1 !important;
    visibility: visible !important;
  }
  .dropdown-item:hover,
  .dropdown-item:active {
    background: #eff0ff !important;
    color: #2b35f0 !important;
  }
  .dropdown-item.active { color: #2b35f0 !important; }
  .dropdown-item .check { color: #2b35f0 !important; }

  /* Lang dropdown width on mobile */
  .lang-dropdown-wide {
    min-width: 200px !important;
    max-width: calc(100vw - 24px) !important;
  }

  /* Hero */
  .hero { padding: 40px 20px 48px; text-align: center; width: 100%; }
  .hero-title { font-size: clamp(26px, 8vw, 40px); word-break: break-word; }
  .hero-subtitle { font-size: 15px; max-width: 100%; padding: 0; }
  .btn-start { padding: 14px 40px; font-size: 16px; width: 100%; max-width: 320px; }

  /* Sections */
  .features-section, .guide-cards, .how-section,
  .trouble-cards, .why-section, .faq-section { padding-left: 16px; padding-right: 16px; }
}

/* ── Very small (≤360px) ── */
@media (max-width: 360px) {
  .logo-text { font-size: 13px; }
  .nav-icon-btn { width: 30px; height: 30px; font-size: 15px; }
  .hamburger { width: 30px; height: 30px; }
  .hamburger span { width: 15px; }
  .nav-inner { padding: 0 10px; gap: 4px; }
}