:root {
  --bg: #0a0f1d;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-strong: #141b2f;
  --card: rgba(19, 26, 48, 0.82);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent: #5eead4;
  --accent-2: #fb7185;
  --text: #eef2ff;
  --muted: #a8b3cc;
  --glow: rgba(94, 234, 212, 0.25);
  --font-sans: "Trebuchet MS", "Gill Sans", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-display: "Trebuchet MS", "Georgia", "Times New Roman", serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, rgba(94, 234, 212, 0.08), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(251, 113, 133, 0.12), transparent 40%),
    linear-gradient(135deg, #0a0f1d 0%, #182235 50%, #0d1427 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 18px 10px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 30%, rgba(94, 234, 212, 0.12), transparent 45%),
    radial-gradient(circle at 85% 15%, rgba(251, 113, 133, 0.16), transparent 40%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 45%);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.7;
  z-index: 0;
}

html[dir="rtl"] body {
  direction: rtl;
  unicode-bidi: plaintext;
}

.container {
  width: min(1080px, 100%);
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 26px;
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 36px);
  box-shadow: 0 30px 80px rgba(4, 8, 20, 0.45);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 1;
}

h1 { margin: 0; }
.header { margin-bottom: 4px; }
.title-block { width: 100%; }
.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.title-center { justify-content: center; }
.header-center { text-align: center; }
.app-title {
  font-family: var(--font-display);
  font-size: 34px;
  letter-spacing: 0.8px;
  color: #fca5a5;
  text-shadow: 0 0 16px rgba(252, 165, 165, 0.35);
}
.tagline { margin-bottom: 2px; }
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 4px;
}
.lang-switcher .select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang-switcher .lang-globe {
  position: absolute;
  left: 10px;
  width: 18px;
  height: 18px;
  background: url("icons/globe-color.svg") no-repeat center / contain;
  filter: drop-shadow(0 0 6px rgba(94,234,212,0.35));
  animation: spin 10s linear infinite;
  pointer-events: none;
}
.lang-switcher select {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 32px 6px 36px;
  min-width: 140px;
  font-weight: 600;
}
html[dir="rtl"] .lang-switcher .lang-globe {
  left: auto;
  right: 10px;
}
html[dir="rtl"] .lang-switcher select {
  padding: 6px 36px 6px 32px;
}
.lang-switcher select:focus-visible {
  outline: 2px solid rgba(94,234,212,0.6);
  outline-offset: 2px;
}
.lang-icon { width: 22px; height: 22px; animation: spin 8s linear infinite; filter: drop-shadow(0 0 6px rgba(94,234,212,0.4)); }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

p.desc { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; }
label { color: var(--muted); font-size: 14px; text-align: center; }

input[type="text"] {
  width: min(560px, 100%);
  padding: 12px 42px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  text-align: center;
  font-size: 15px;
}
.input-placeholder {
  color: var(--muted);
  font-style: italic;
}
.text-input-wrap {
  width: min(560px, 100%);
  position: relative;
  display: flex;
  justify-content: center;
}
.text-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(10, 15, 29, 0.6);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}
.text-clear:hover {
  transform: translateY(-50%);
}
.text-clear:active {
  transform: translateY(calc(-50% + 2px));
}
.text-input-wrap.empty .text-clear {
  opacity: 0;
  pointer-events: none;
}

.card {
  width: min(920px, 100%);
  margin: 6px auto;
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 50px rgba(6, 10, 24, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: cardReveal 520ms ease both;
  }
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.control {
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  flex: 1;
  min-width: 240px;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.slider-card {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
  justify-items: center;
}
.controls-row {
  width: 100%;
  justify-content: stretch;
}
.controls-row .slider-card {
  width: 100%;
  max-width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  justify-items: stretch;
}
.controls-row .control {
  max-width: none;
}
.slider-card .slider-row {
  margin-top: 0 !important;
  width: 100%;
}
.text-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.text-card.card {
  margin-top: 6px;
}
.text-card input[type="text"] {
  margin: 0;
  padding: 0 42px 0 14px;
  height: 42px;
  line-height: 1.1;
  display: block;
}
.option-row .control { flex: 1 1 240px; }
.control.control-wide { flex: 2 1 520px; }

.slider-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.slider-value { display: none; }
input[type="range"] {
  flex: 1;
  width: min(320px, 100%);
  max-width: 100%;
  margin: 0 auto;
  accent-color: #94b4c5;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a365b 0%, #455d82 45%, #6f86a6 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.08), 0 0 10px rgba(136, 176, 208, 0.25);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d4e8f0 0%, #8fb1c6 55%, #6a859c 100%);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}
input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a365b 0%, #455d82 45%, #6f86a6 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.08), 0 0 10px rgba(136, 176, 208, 0.25);
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #d4e8f0 0%, #8fb1c6 55%, #6a859c 100%);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
}
select {
  width: max-content;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
}
select[multiple] {
  width: 100%;
  min-height: 120px;
}
select option {
  background: #0f172a;
  color: #e5e7eb;
}
.options-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.options-toggle.options-inside { margin-top: 8px; }
.options-panel {
  margin-top: 6px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  align-items: center;
}
.options-panel .row { gap: 10px; justify-content: center; }
.options-panel .control {
  padding: 8px 10px;
  min-width: 200px;
}
.options-panel label { font-size: 12px; text-align: center; }
.options-panel .hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.options-panel select {
  padding: 6px 8px;
  border-radius: 10px;
  min-width: 200px;
  text-align: center;
}
.options-panel input[type="text"],
.options-panel input[type="number"] {
  width: 100%;
  min-width: 200px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  text-align: center;
}
.options-panel select[multiple] { min-height: 80px; }
.options-panel .slider-row { gap: 8px; }
.options-subcard {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  width: min(780px, 100%);
  margin: 0 auto;
}
.options-subcard + .options-subcard { margin-top: 8px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  text-align: center;
  width: 100%;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  opacity: 0.9;
  text-align: center;
}
.accent-title {
  color: #fca5a5 !important;
  text-shadow: 0 0 10px rgba(252, 165, 165, 0.35);
}
.card-header {
  justify-content: center;
}
.card-header .perc-toggle {
  margin-left: 0;
}
.flat-control {
  background: transparent;
  border: 0;
  padding: 0;
}
.flat-control select {
  background: rgba(255,255,255,0.03);
}
.section-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
}
.compact-row { margin-top: 4px; }
.instrument-row { align-items: center; justify-content: center; }
.instrument-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.025);
  align-items: center;
  text-align: center;
}
.instrument-label { font-size: 11px; color: var(--muted); }
.instrument-vol label { font-size: 11px; color: var(--muted); }
.instrument-vol input[type="range"] { width: 160px; max-width: 160px; }
.perc-card .control {
  min-width: 200px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.button-card {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.bars {
  width: 100%;
  height: 220px;
  display: block;
  align-self: stretch;
}
.main-controls {
  justify-content: center;
  width: 100%;
}

.export-card {
  justify-content: center;
  margin-top: auto;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
  width: min(920px, 100%);
}
.export-card button {
  flex: 0 0 auto;
}
@media (max-width: 680px) {
  .container { padding: 10px; }
  .title-row { gap: 6px; }
  .app-title { font-size: 24px; }
  p.desc { margin-bottom: 6px; font-size: 12px; }
  .lang-switcher select { min-width: 120px; padding: 5px 28px 5px 32px; }
  .card { padding: 14px; }
  .button-card { gap: 6px; padding: 6px; }
  .button-card button {
    flex: 0 0 auto;
    padding: 7px 9px;
    font-size: 11px;
  }
  .row { gap: 6px; }
  .control { min-width: 160px; padding: 8px; }
  .text-card input[type="text"] { padding: 0 10px; height: 38px; }
  .options-panel { padding: 10px; }
  .options-panel .control { min-width: 160px; padding: 6px; }
  .options-panel select { padding: 4px 6px; }
  .options-panel select[multiple] { min-height: 70px; }
  .options-subcard { padding: 8px; }
  .instrument-card { min-width: 150px; }
  .instrument-vol input[type="range"] { width: 140px; max-width: 140px; }
  .bars { height: 160px; }
}

button {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  color: #0b1021;
  background: var(--accent);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25), 0 10px 24px rgba(0,0,0,0.35);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}
button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6) brightness(0.85);
  box-shadow: 0 4px 0 rgba(0,0,0,0.2), 0 8px 18px rgba(0,0,0,0.3);
  opacity: 0.65;
  transform: none;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.25), 0 8px 18px rgba(0,0,0,0.35); }
.btn-primary {
  background: linear-gradient(180deg, #5aff6a 0%, #20d845 55%, #0fb736 100%);
  color: #041407;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.5);
  box-shadow:
    0 10px 0 rgba(8, 68, 23, 0.8),
    0 16px 26px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-danger {
  background: linear-gradient(180deg, #ff7a7a 0%, #f13b3b 55%, #cc2a2a 100%);
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.2);
  box-shadow:
    0 10px 0 rgba(92, 18, 18, 0.8),
    0 16px 26px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-aux {
  background: linear-gradient(180deg, #2f6f9b 0%, #1f4a78 100%);
  color: #e6f0ff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
  box-shadow: 0 8px 0 rgba(12, 26, 46, 0.75), 0 14px 22px rgba(0,0,0,0.4);
}
.hidden { display: none !important; }
.perc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.perc-toggle-text {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.perc-toggle-text.active {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(94,234,212,0.35);
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 1px;
  background: radial-gradient(circle at 30% 30%, #d4e8f0 0%, #8fb1c6 55%, #6a859c 100%);
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  transition: transform 0.2s ease;
}
.switch input:checked + .switch-slider {
  background: rgba(94,234,212,0.35);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.25), 0 0 8px rgba(94,234,212,0.35);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #5eead4; border-radius: 50%; animation: spin 0.9s linear infinite; visibility: hidden; }

#helpButton,
#installButton {
  flex: 0 0 2.1rem;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #d5dbe9;
  background: #063e35;
  color: #ecfdf5;
  font-size: 0.95rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#helpButton:hover,
#installButton:hover {
  background: #065f46;
  border-color: #d5dbe9;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}

.help-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  z-index: 50;
  transition: transform 0.25s ease, opacity 0.25s ease;
  padding-top: env(safe-area-inset-top, 0);
  overflow: hidden;
  overscroll-behavior: contain;
}

.help-modal.hidden {
  display: none;
}

.help-modal-card {
  background: #020617;
  border-radius: 1rem 1rem 0 0;
  border: 1px solid #1d3559;
  width: min(760px, 100%);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.8);
  padding: 0.9rem 1.1rem 1.3rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
}

.help-modal-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
  padding: 0.45rem 0.35rem 0.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.6rem 0.6rem 0 0;
}

.help-logo {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.help-modal-title {
  margin: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fca5a5;
  text-align: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  text-shadow: 0 0 6px rgba(252, 165, 165, 0.4);
}

.help-close-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 14px;
  border: 1px solid rgba(252, 165, 165, 0.65);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), rgba(248, 113, 113, 0.12));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
html[dir="rtl"] .help-close-icon {
  right: auto;
  left: 0.75rem;
}

.help-close-icon:hover,
.help-close-icon:focus {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(248, 113, 113, 0.22));
  border-color: rgba(252, 165, 165, 0.9);
  transform: translateY(-1px) scale(1.02);
}

.help-close-line {
  position: absolute;
  width: 14px;
  height: 2px;
  background: #fecaca;
  border-radius: 999px;
}
.help-close-line:first-child {
  transform: rotate(45deg);
}
.help-close-line:last-child {
  transform: rotate(-45deg);
}

.help-modal-body {
  margin-top: 0;
  font-size: 0.95rem;
  color: var(--muted);
  flex: 1;
  overflow-y: auto;
  line-height: 1.35;
  text-align: justify;
  hyphens: auto;
  padding-left: 0;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.help-modal-body::-webkit-scrollbar {
  width: 8px;
}
.help-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.help-modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(252, 165, 165, 0.6), rgba(248, 113, 113, 0.7));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.12);
}
.help-modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(252, 165, 165, 0.75), rgba(248, 113, 113, 0.85));
}
.help-modal-body p {
  margin: 0 0 0.75rem;
}
.help-modal-body p:first-of-type::before {
  content: "";
  display: block;
  height: 0.5rem;
}
.help-modal-body strong {
  color: #fca5a5;
  text-shadow: 0 0 6px rgba(252, 165, 165, 0.4);
}
.help-modal-body p strong {
  display: inline-block;
  line-height: 1.45;
}

.help-accent {
  color: #fca5a5 !important;
  text-shadow: 0 0 6px rgba(252, 165, 165, 0.4);
}

.help-footer {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin: 0.6rem 0 0.2rem;
}

.help-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 0 0 0.02rem;
  line-height: 1.2;
}
.help-intro p {
  margin: 0;
  line-height: 1.2;
}
.help-intro-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.05;
  text-align: center;
  color: #fca5a5;
  text-shadow: 0 0 6px rgba(252, 165, 165, 0.4);
}
.help-intro-tagline {
  margin: -0.08rem 0 0;
  line-height: 1.05;
  text-align: center;
}
.help-intro-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
}
.help-intro-line-italic {
  font-style: italic;
}
.help-intro .help-footer {
  margin: 0.08rem 0 0.06rem;
  line-height: 1.2;
  text-align: center;
}

.help-modal-body ul {
  padding-left: 1.25rem;
}

@media (max-width: 640px) {
  .help-modal {
    align-items: stretch;
    justify-content: flex-end;
    padding: 0 0.6rem calc(env(safe-area-inset-bottom, 0) + 0.75rem);
  }
  .help-modal-card {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(env(safe-area-inset-bottom, 0) + 12px);
    width: 100%;
    padding: 0.95rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0));
    border-radius: 1rem 1rem 0 0;
    max-height: 75vh;
    min-height: 45vh;
    height: 60vh;
    margin: 0 auto;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  }
  .help-logo {
    width: 44px;
    height: 44px;
  }
  .help-close-icon {
    width: 1.9rem;
    height: 1.9rem;
  }
}

@media (min-width: 641px) {
  .help-modal {
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-end;
  }
  .help-modal-card {
    height: 100vh;
    max-height: none;
    width: min(540px, 46vw);
    border-radius: 1rem 0 0 1rem;
    border-right: 0;
    padding: 0.85rem 1.15rem 1.1rem 0.2rem;
    overflow: hidden;
  }
  .help-modal-body {
    max-height: calc(100vh - 130px);
    padding-right: 0.85rem;
    scrollbar-gutter: stable both-edges;
  }
}
.spinner.on { visibility: visible; }

.status-line {
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(248,113,113,0.3);
  background: rgba(248,113,113,0.08);
  color: #fecaca;
  font-size: 13px;
  display: none;
  text-align: center;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.status-line.on { display: block; }
.tooltip-button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  background: rgba(8, 12, 24, 0.95);
  color: #e5e7eb;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
  z-index: 5;
}
.tooltip-button {
  position: relative;
}
.tooltip-button:hover::after,
.tooltip-button:focus-visible::after,
.tooltip-button.show-tooltip::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
