:root {
  --accent: #2f6fed;
  --accent-dark: #1f4fc4;
  --bg: #f7f9fc;
  --bg-elevated: #ffffff;
  --text: #16202e;
  --text-muted: #57647a;
  --border: #e2e8f2;
  --shadow: 0 4px 20px rgba(22, 32, 46, 0.06);
  --radius: 14px;
  --danger: #d64545;
  --success: #1f9d5a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #5b8dff;
    --accent-dark: #7ba1ff;
    --bg: #0f1420;
    --bg-elevated: #161d2b;
    --text: #eef1f7;
    --text-muted: #9aa6bb;
    --border: #262f42;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

img { max-width: 100%; }

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand img { display: block; border-radius: 6px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch-label { font-size: 1rem; }
.lang-switch, select {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

/* Hero */
.hero { padding: 48px 20px 32px; }
.hero-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero-subtitle { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; margin: 0 auto 32px; }

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}
.trust-badge-stars { color: var(--accent); letter-spacing: 1px; }

.tool-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: left;
}
.tool-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tool-top select { flex: 1 1 220px; min-width: 0; }

.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tool-status {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.tool-status[data-state="error"] { color: var(--danger); font-weight: 600; }
.tool-status[data-state="active"] { color: var(--success); font-weight: 600; }

.meter-wrap { margin-top: 18px; }
#level-canvas {
  width: 100%;
  height: 100px;
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.level-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.device-info {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.device-info h3 { font-size: 1rem; margin: 0 0 8px; }
.device-info ul { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; color: var(--text-muted); display: grid; gap: 4px; }

.record-wrap { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
#playback-wrap { display: flex; flex-direction: column; gap: 8px; }
audio { width: 100%; }

/* Sections */
.section-inner { max-width: 1100px; margin: 0 auto; padding: 56px 20px; }
.section-inner.narrow { max-width: 760px; }
.features, .how-it-works { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 28px; text-align: center; letter-spacing: -0.01em; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.testimonial-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin: 0;
}
.testimonial-card blockquote { margin: 0 0 12px; }
.testimonial-card p { margin: 0; font-size: 0.95rem; }
.testimonial-card figcaption { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }

.steps-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  counter-reset: step;
}
.step-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  background: var(--bg-elevated);
}
.step-card::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.step-card h3 { margin: 0 0 8px; font-size: 1.02rem; }
.step-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.seo-content p { color: var(--text-muted); margin: 0 0 16px; }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-list details {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  background: var(--bg-elevated);
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 700;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { color: var(--text-muted); margin: 10px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 28px 20px; }
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.sister-site { margin: 0; flex-basis: 100%; text-align: center; }
.sister-site a { color: var(--accent); text-decoration: none; font-weight: 600; }
.sister-site a:hover { text-decoration: underline; }

/* RTL mirroring */
[dir="rtl"] .tool-status,
[dir="rtl"] .hero,
[dir="rtl"] .seo-content { text-align: right; }
[dir="rtl"] .faq-list summary::after { float: left; }
[dir="rtl"] .level-numbers { flex-direction: row-reverse; }
[dir="rtl"] .footer-inner { direction: rtl; }

@media (prefers-reduced-motion: reduce) {
  .btn, * { transition: none !important; animation: none !important; }
}

@media (max-width: 480px) {
  .tool-top { flex-direction: column; align-items: stretch; }
  .header-inner { padding: 12px 16px; }
  .section-inner { padding: 40px 16px; }
}
