/* ------------------------------------------------------------------ *
 * Tosh Dash — Hilfebereich. Baut auf rechtliches.css auf (Farben,
 * Schrift, Kopf- und Fusszeile) und ergaenzt Seitenleiste, Bildrahmen,
 * Hinweiskaesten und Tabellen.
 * ------------------------------------------------------------------ */

.help {
  max-width: 1180px;
  margin-inline: auto;
  padding: clamp(28px, 5vw, 64px) var(--gut) clamp(56px, 8vw, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 56px;
}
@media (min-width: 960px) { .help { grid-template-columns: 230px minmax(0, 1fr); } }

/* Seitenleiste: am Desktop klebend, am Handy eine waagerechte Leiste */
.help-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.help-nav a {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-mid);
  text-decoration: none;
  white-space: nowrap;
}
.help-nav a:hover { color: var(--text); border-color: var(--ink-300); }
.help-nav a.on { color: var(--on-amber); background: var(--amber); border-color: var(--amber-ink); font-weight: 500; }
.help-nav .nav-title { display: none; }
@media (min-width: 960px) {
  .help-nav {
    position: sticky; top: calc(var(--launch-h, 0px) + 24px);
    align-self: start; flex-direction: column; overflow: visible; padding: 0;
  }
  .help-nav .nav-title {
    display: block; margin: 0 0 8px;
    font-family: var(--mono); font-size: 11px; letter-spacing: .22em;
    text-transform: uppercase; color: var(--text-low);
  }
}

.help-body h1 { font-size: clamp(32px, 4.4vw, 52px); }
.help-body h2 { font-size: 24px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--rule); }
.help-body h3 { font-family: var(--display); font-weight: 800; font-size: 18px; margin: 32px 0 0; color: var(--text); }
.help-body .lede { font-size: 19px; color: var(--text-mid); max-width: 40em; margin-top: 18px; }
.help-body p, .help-body li { max-width: 46em; }
.help-body ol { padding-left: 1.3em; color: var(--text-mid); margin: 14px 0 0; }
.help-body li { margin-top: 8px; }
.help-body code, .help-body kbd {
  font-family: var(--mono); font-size: .9em; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 6px;
}

/* Hinweiskaesten */
.note, .warn, .todo {
  margin-top: 20px; padding: 16px 18px; border-radius: 4px; max-width: 46em;
  border: 1px solid var(--ink-300); background: var(--surface-2); color: var(--text-mid); font-size: 15.5px;
}
.note strong, .warn strong, .todo strong { color: var(--text); }
.warn { border-color: var(--red); background: rgba(255, 97, 33, .08); }
.warn strong { color: var(--warn-ink); }
.todo { border-style: dashed; border-color: var(--amber-ink); background: rgba(255, 178, 0, .06); }
.todo strong { color: var(--amber-ink); }

/* Tabellen */
.help-body table { width: 100%; max-width: 860px; border-collapse: collapse; margin-top: 18px; font-size: 15px; }
.help-body th, .help-body td { text-align: left; vertical-align: top; padding: 11px 12px 11px 0; border-bottom: 1px solid var(--rule); color: var(--text-mid); }
.help-body th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--text-low); }
.help-body td:first-child { color: var(--text); white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Bilder vom Geraet: Display pixelgenau, Weboberflaeche weich */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 22px 18px; margin-top: 22px; max-width: 900px; }
.shot { margin: 0; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--ink-300); border-radius: 6px; background: var(--screen-bg);
  image-rendering: pixelated;
}
.shot.web img { image-rendering: auto; }
.shot figcaption { margin-top: 9px; font-size: 13.5px; line-height: 1.45; color: var(--text-mid); }
.shot figcaption b { display: block; color: var(--text); font-weight: 500; }

/* Einstellung + Wirkung nebeneinander */
.effect { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 32px; margin-top: 18px; align-items: start; }
@media (min-width: 760px) { .effect { grid-template-columns: minmax(0, 1fr) 380px; } }
.effect .shots { margin-top: 0; grid-template-columns: 1fr 1fr; }

/* Kacheln der Uebersicht */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.card {
  display: block; padding: 20px 20px 22px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--surface-1); text-decoration: none;
}
.card:hover { border-color: var(--amber-ink); }
.card b { display: block; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--text); }
.card span { display: block; margin-top: 6px; font-size: 14.5px; color: var(--text-mid); }

/* Problem -> Ursache -> Loesung */
.fix { margin-top: 18px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface-1); max-width: 860px; }
.fix summary { cursor: pointer; padding: 16px 18px; font-weight: 500; color: var(--text); list-style: none; }
.fix summary::-webkit-details-marker { display: none; }
.fix summary::after { content: "+"; float: right; color: var(--text-low); font-family: var(--mono); }
.fix[open] summary::after { content: "–"; }
.fix > div { padding: 0 18px 18px; }
.fix > div > :first-child { margin-top: 0; }

/* Verdrahtungsbild */
.wiring { margin-top: 22px; max-width: 760px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface-1); padding: 18px; }
.wiring svg { display: block; width: 100%; height: auto; }

.next { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 15px; }
.next a { color: var(--amber-ink); text-decoration: none; }

/* Sprungziele nicht unter der klebenden Countdown-Leiste verstecken */
.help-body [id] { scroll-margin-top: calc(var(--launch-h, 0px) + 20px); }

/* rechtliches.css gibt <main> einen Innenabstand - hier regelt ihn .help */
.help-body { padding-block: 0; }

/* Knopf zur Verdrahtung — überall dort, wo "check the wiring" steht */
.wirelink {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 11px; border: 1px solid var(--amber-line); border-radius: 3px;
  background: rgba(255, 178, 0, .08); color: var(--amber-ink);
  font-size: 14px; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap;
  vertical-align: middle;
}
.wirelink:hover { background: var(--amber); color: var(--on-amber); }
.wirelink svg { flex: 0 0 auto; }
li .wirelink, td .wirelink { margin: 4px 0 2px 4px; }

/* Fenster mit Verdrahtung und VESC-Tool-Einstellungen */
.wmodal {
  width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--ink-300); border-radius: 8px;
  background: var(--modal-bg); color: var(--text-mid); overflow: hidden;
}
.wmodal[open] { display: flex; flex-direction: column; }
.wmodal::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.wm-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--rule); }
.wm-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 19px; color: var(--text); }
.wm-close {
  width: 38px; height: 38px; border: 1px solid var(--rule); border-radius: 4px; background: none;
  color: var(--text); font-size: 24px; line-height: 1; cursor: pointer;
}
.wm-close:hover { border-color: var(--amber-ink); color: var(--amber-ink); }
.wm-body { overflow-y: auto; padding: 4px 20px 22px; -webkit-overflow-scrolling: touch; }
.wm-step { margin: 20px 0 0; font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--text); }
.wm-step b {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
  background: var(--amber); color: var(--on-amber); font-size: 13px;
}
.wm-body .wiring { margin-top: 12px; padding: 10px; }
.wm-hint { margin: 12px 0 0; font-size: 15px; }
.wm-hint strong { color: var(--text); }
.wm-set { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.wm-set > div { padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface-1); }
.wm-set span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--text-low); }
.wm-set b { display: block; margin: 5px 0 8px; font-weight: 500; font-size: 15px; color: var(--text); }
.wm-set code { font-size: 17px !important; color: var(--amber-ink) !important; }
@media (max-width: 480px) { .wm-set { grid-template-columns: 1fr; } }
.wm-body code { font-family: var(--mono); font-size: .9em; color: var(--text); background: var(--surface-2); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 6px; }
.wm-more { margin: 18px 0 0; font-size: 15px; }
.wm-more a { color: var(--amber-ink); text-decoration: none; }

/* Einstieg "Installation guide" — gerahmt, steht über allen Kacheln */
.guidecard {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 28px; align-items: center;
  margin-top: 28px; padding: clamp(20px, 3vw, 28px); text-decoration: none;
  border: 1px solid var(--amber-line); border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,178,0,.10), rgba(255,178,0,.03));
}
.guidecard:hover { background: rgba(255,178,0,.14); }
.guide-no { grid-column: 1; font-family: var(--mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--amber-ink); }
.guidecard b { grid-column: 1; font-family: var(--display); font-weight: 900; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; line-height: 1.05; color: var(--text); }
.guide-t { grid-column: 1; max-width: 38em; font-size: 15.5px; color: var(--text-mid); }
.guide-go {
  grid-column: 2; grid-row: 1 / span 3; white-space: nowrap;
  padding: 13px 24px; border-radius: 4px; background: var(--amber); color: var(--on-amber); font-weight: 600;
}
@media (max-width: 700px) {
  .guidecard { grid-template-columns: 1fr; }
  .guide-go { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 12px; }
}
/* Seitenleiste: die Anleitung hebt sich ab, auch wenn sie nicht aktiv ist */
.help-nav a[href="help-quick-start.html"]:not(.on) { border-color: var(--amber-ink); color: var(--amber-ink); }
