:root {
  --help-panel: rgba(0, 0, 0, 0.55);
  --help-accent: #e4f91b;
  --help-accent-dim: rgba(228, 249, 27, 0.15);
  --help-text: #f1f5f9;
  --help-muted: #94a3b8;
  --help-border: rgba(255, 255, 255, 0.12);
  --help-sidebar-w: clamp(240px, 20vw, 340px);
  --help-blue: #3b82f6;
  --help-orange: #f97316;
}

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

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(145deg, #2c5f2d 0%, #1a3a1b 50%, #0c1f0d 100%);
  color: var(--help-text);
  min-height: 100vh;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.6;
}

.help-layout { display: flex; min-height: 100vh; }

.help-sidebar {
  width: var(--help-sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.45) 100%);
  border-right: 1px solid var(--help-border);
  padding: clamp(16px, 2vw, 24px);
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow: auto;
}

.help-brand { font-size: 0.95rem; color: var(--help-muted); margin-bottom: 10px; }
.help-brand strong { color: var(--help-accent); font-weight: 700; }

.help-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--help-accent);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 20px;
  font-size: 1rem;
}
.help-back:hover { opacity: 0.9; }

.help-search-wrap { margin-bottom: 20px; }
.help-search-wrap label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--help-muted);
  margin-bottom: 8px;
}

#helpSearch {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--help-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--help-text);
  font-size: 1rem;
}
#helpSearch::placeholder { color: var(--help-muted); }
#helpSearch:focus { outline: 2px solid var(--help-accent); outline-offset: 2px; }

.help-nav { list-style: none; margin: 0; padding: 0; }
.help-nav li { margin-bottom: 4px; }
.help-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 1rem;
  padding: 9px 12px;
}
.help-nav a:hover, .help-nav a:focus-visible {
  background: var(--help-accent-dim);
  color: var(--help-accent);
}

.help-main {
  flex: 1;
  min-width: 0;
  padding: clamp(16px, 2.5vw, 36px);
  padding-bottom: 48px;
}

.help-hero {
  position: relative;
  padding: clamp(20px, 3vw, 32px) clamp(20px, 2.5vw, 36px);
  margin-bottom: 28px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--help-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.help-hero.is-hidden { display: none; }

.help-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, var(--help-accent), transparent 45%, var(--help-blue));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.help-main h1 {
  color: var(--help-accent);
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.help-lead { color: var(--help-muted); margin: 0 0 16px; }
.help-lead:last-of-type { margin-bottom: 0; }

.help-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.help-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(228, 249, 27, 0.12);
  color: #d9f99d;
  border: 1px solid rgba(228, 249, 27, 0.35);
}
.help-badge--photo {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

.help-article {
  background: var(--help-panel);
  border: 1px solid var(--help-border);
  border-radius: 16px;
  padding: clamp(16px, 2vw, 28px);
  margin-bottom: 28px;
  scroll-margin-top: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.help-article h2 {
  color: var(--help-accent);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  margin: 0 0 14px;
  font-weight: 700;
}

.help-article p, .help-article li { color: #e2e8f0; }
.help-article ul { margin: 12px 0; padding-left: 1.25rem; }
.help-article li { margin-bottom: 8px; }
.help-article.is-hidden { display: none; }

/* Real screenshot + text side-by-side */
.help-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
  align-items: start;
  margin-top: 18px;
}
@media (max-width: 960px) {
  .help-split { grid-template-columns: 1fr; }
}

.help-shot {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  background: #0f172a;
  max-width: min(100%, 860px);
}
.help-shot--narrow { max-width: min(100%, 480px); margin-left: auto; margin-right: auto; }
.help-shot img,
.help-shot video,
video.help-shot {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 12px;
}
.help-shot-label {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--help-accent);
  border: 1px solid rgba(228, 249, 27, 0.4);
  pointer-events: none;
}

.help-figure {
  margin: 16px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--help-border);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.help-figure img { display: block; width: 100%; height: auto; }

.help-caption {
  font-size: 0.9rem;
  color: var(--help-muted);
  margin: 10px 0 0;
  line-height: 1.5;
}

.help-tip {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  border-left: 4px solid var(--help-blue);
  font-size: 1rem;
  color: #bfdbfe;
}

.help-warn {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(234, 179, 8, 0.1);
  border-left: 4px solid #eab308;
  font-size: 1rem;
  color: #fef08a;
}

/* Scrollable “fake modal” map — structure only, not a photo */
.help-mock-modal {
  margin-top: 18px;
  border-radius: 14px;
  border: 2px solid rgba(228, 249, 27, 0.35);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.85) 100%);
  max-height: min(420px, 55vh);
  overflow-y: auto;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.help-mock-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--help-muted);
  margin-bottom: 10px;
  padding: 0 4px;
}
.help-mock-bar {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.help-mock-bar:last-child { margin-bottom: 0; }
.help-mock-bar--core { background: rgba(228, 249, 27, 0.08); border-color: rgba(228, 249, 27, 0.2); }
.help-mock-bar--media { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.25); }
.help-mock-bar--notes { background: rgba(249, 115, 22, 0.1); border-color: rgba(249, 115, 22, 0.25); }
.help-mock-bar--report { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.3); }
.help-mock-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.45);
  color: var(--help-accent);
}

.help-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.help-pill {
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--help-border);
  color: #cbd5e1;
  font-weight: 600;
}
.help-pill--primary { border-color: rgba(34, 197, 94, 0.5); color: #86efac; background: rgba(34, 197, 94, 0.1); }
.help-pill--blue { border-color: rgba(59, 130, 246, 0.5); color: #93c5fd; }

.help-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
@media (max-width: 640px) { .help-dual { grid-template-columns: 1fr; } }

.help-dual-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--help-border);
  background: rgba(0, 0, 0, 0.35);
}
.help-dual-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--help-accent);
}
.help-dual-card p { margin: 0; font-size: 0.88rem; color: #cbd5e1; line-height: 1.5; }

.help-structure {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--help-border);
  font-size: 0.92rem;
  color: #e2e8f0;
}
.help-structure strong { color: var(--help-accent); display: block; margin-bottom: 10px; }
.help-structure ol { margin: 0; padding-left: 1.35rem; }
.help-structure li { margin-bottom: 10px; line-height: 1.5; }
.help-structure li:last-child { margin-bottom: 0; }

#helpNoResults { display: none; padding: 24px; text-align: center; color: var(--help-muted); }
#helpNoResults.is-visible { display: block; }

@media (max-width: 860px) {
  .help-layout { flex-direction: column; }
  .help-sidebar {
    position: relative;
    max-height: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--help-border);
  }
}

/* ── Numbered legend: mirrors the yellow badges on screenshots ── */
.help-legend {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 16px;
}
.help-legend li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 1rem;
  color: #e2e8f0;
  line-height: 1.45;
  padding: 6px 8px;
  border-radius: 8px;
}
.help-legend li .n {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--help-accent);
  color: #111;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(0, 0, 0, 0.55);
  margin-top: 1px;
}
.help-legend li strong { color: var(--help-accent); font-weight: 700; }

/* Stacked screenshots (two shots in one article) */
.help-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }

/* "How to use this guide" block on the hero */
.help-howto {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(228, 249, 27, 0.25);
}
.help-howto h3 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--help-accent);
  font-weight: 700;
}
.help-howto ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 18px;
}
.help-howto li {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.45;
  padding-left: 18px;
  position: relative;
}
.help-howto li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--help-accent);
  font-weight: 700;
}
.help-howto li strong { color: var(--help-accent); font-weight: 700; }

/* Tighter vertical rhythm inside split articles */
.help-split .help-shot + .help-caption { margin-top: 8px; }

/* Footer */
.help-footer {
  margin-top: 36px;
  padding: 18px;
  border-top: 1px solid var(--help-border);
  font-size: 0.78rem;
  color: var(--help-muted);
  text-align: center;
}
/* ── Large screens: breathe more ── */
@media (min-width: 1400px) {
  .help-main h1 { font-size: 2.5rem; }
  .help-article h2 { font-size: 1.65rem; }
  .help-nav a { font-size: 1rem; }
  .help-mock-bar { font-size: 1rem; }
}

/* ── Read Aloud (TTS) button ── */
.help-read-btn {
  background: rgba(228, 249, 27, 0.12);
  border: 1px solid rgba(228, 249, 27, 0.3);
  border-radius: 8px;
  color: var(--help-accent);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 10px;
  float: right;
  margin-left: 12px;
  line-height: 1;
  transition: background 0.15s;
}
.help-read-btn:hover { background: rgba(228, 249, 27, 0.25); }
.help-read-btn[aria-pressed="true"] {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.help-footer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: #d9f99d;
  background: rgba(228, 249, 27, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}
