/* Hilfe-Webseite /cncsoftware/hilfe/: dieselben Farbnamen wie die App (theme.css), damit text.css hier wie im
   Fenster der App aussieht. Folgt hell/dunkel des Systems; die Wahl aus der App (mycnc.theme) gilt ebenfalls. */
:root {
  --bg: #e9edf1;
  --panel: #f7f9fb;
  --panel-2: #eef2f6;
  --border: #d3dae2;
  --border-strong: #b6c1cc;
  --fg: #1c2631;
  --fg-muted: #5c6a78;
  --accent: #1f3fe0;
  --accent-soft: #e6ebff;
  --ok: #2f8a4c;
  --warn: #b7791f;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Roboto Mono', Menlo, Consolas, monospace;
  --radius: 8px;
  --kopf: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #161c2b;
    --panel: #1e2537;
    --panel-2: #273046;
    --border: #35405a;
    --border-strong: #485572;
    --fg: #e9eefa;
    --fg-muted: #a6b2cb;
    --accent: #8ea3ff;
    --accent-soft: #1c2754;
    --ok: #4fb36d;
    --warn: #e0a440;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #161c2b;
  --panel: #1e2537;
  --panel-2: #273046;
  --border: #35405a;
  --border-strong: #485572;
  --fg: #e9eefa;
  --fg-muted: #a6b2cb;
  --accent: #8ea3ff;
  --accent-soft: #1c2754;
  --ok: #4fb36d;
  --warn: #e0a440;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--kopf) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
}

/* Kopf */
.hw-kopf {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--kopf);
  padding: 0 20px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.hw-marke {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}
.hw-marke b {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hw-marke small {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}
.hw-suche {
  position: relative;
  flex: 1;
  max-width: 520px;
  margin-left: auto;
}
.hw-suche input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237b8794' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")
    no-repeat 11px center;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
}
.hw-suche input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background-color: var(--panel);
}
.hw-treffer {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgb(10 16 24 / 0.22);
}
.hw-treffer a {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}
.hw-treffer a:hover,
.hw-treffer a.an {
  background: var(--panel-2);
}
.hw-treffer b {
  font-size: 14px;
  font-weight: 600;
}
.hw-treffer small {
  color: var(--accent);
  font-size: 11.5px;
}
.hw-treffer span {
  color: var(--fg-muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.hw-treffer .leer {
  padding: 12px;
  color: var(--fg-muted);
}
.hw-sprache {
  color: var(--fg-muted);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.hw-sprache:hover {
  color: var(--accent);
}
.hw-app {
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
:root[data-theme='dark'] .hw-app {
  color: #0d1220;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .hw-app {
    color: #0d1220;
  }
}
.hw-menue {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  cursor: pointer;
}
.hw-menue span,
.hw-menue span::before,
.hw-menue span::after {
  display: block;
  width: 16px;
  height: 2px;
  margin: auto;
  background: var(--fg);
  border-radius: 2px;
  position: relative;
}
.hw-menue span::before,
.hw-menue span::after {
  content: '';
  position: absolute;
}
.hw-menue span::before {
  top: -5px;
}
.hw-menue span::after {
  top: 5px;
}

/* Spalten */
.hw-seite {
  display: grid;
  grid-template-columns: 260px minmax(0, 760px) 220px;
  justify-content: center;
  gap: 40px;
  padding: 0 24px;
}
.hw-links,
.hw-rechts {
  position: sticky;
  top: var(--kopf);
  align-self: start;
  max-height: calc(100vh - var(--kopf));
  overflow-y: auto;
  padding: 24px 0 40px;
  overscroll-behavior: contain;
}
.hw-nav h2,
.hw-rechts h2 {
  margin: 18px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.hw-nav section:first-child h2 {
  margin-top: 0;
}
.hw-nav ul,
.hw-rechts ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hw-nav a {
  display: block;
  padding: 5px 10px;
  border-radius: 7px;
  color: var(--fg);
  font-size: 14px;
  text-decoration: none;
}
.hw-nav a:hover {
  background: var(--panel-2);
}
.hw-nav a[aria-current] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.hw-rechts a {
  display: block;
  padding: 4px 0 4px 12px;
  border-left: 2px solid var(--border);
  color: var(--fg-muted);
  font-size: 13px;
  text-decoration: none;
}
.hw-rechts a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hw-haupt {
  min-width: 0;
  padding: 28px 0 56px;
}
.hw-haupt .ht {
  font-size: 15.5px;
}
.hw-haupt .ht h2 {
  font-size: 21px;
}
.hw-haupt .ht h3 {
  font-size: 16.5px;
}
.hw-kette {
  margin: 0 0 6px;
  color: var(--fg-muted);
  font-size: 13px;
}
.hw-kette a {
  text-decoration: none;
}
.hw-h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.hw-kurz {
  margin: 0 0 26px;
  color: var(--fg-muted);
  font-size: 17px;
  line-height: 1.5;
}

/* Startseite */
.hw-kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.hw-kachel {
  padding: 16px 16px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
}
.hw-kachel h2 {
  margin: 0 0 8px;
  font-size: 17px;
}
.hw-kachel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hw-kachel a {
  display: grid;
  gap: 2px;
  margin: 0 -8px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}
.hw-kachel a:hover {
  background: var(--panel-2);
}
.hw-kachel b {
  font-weight: 600;
  font-size: 14.5px;
}
.hw-kachel small {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Blättern */
.hw-blaettern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.hw-blaettern a {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}
.hw-blaettern a:hover {
  border-color: var(--accent);
}
.hw-blaettern small {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 400;
}
.hw-blaettern .nach {
  grid-column: 2;
  text-align: right;
}

.hw-fuss {
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 13px;
  text-align: center;
}
.hw-fuss a {
  color: inherit;
}

@media (max-width: 1180px) {
  .hw-seite {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 32px;
  }
  .hw-rechts {
    display: none;
  }
}
@media (max-width: 820px) {
  :root {
    --kopf: 56px;
  }
  .hw-kopf {
    gap: 8px;
    padding: 0 12px;
  }
  .hw-menue {
    display: block;
    flex: none;
  }
  .hw-marke span,
  .hw-sprache {
    display: none;
  }
  .hw-app {
    padding: 8px 10px;
    font-size: 13px;
  }
  .hw-seite {
    display: block;
    padding: 0 16px;
  }
  .hw-links {
    display: none;
  }
  .hw-nav-offen .hw-links {
    display: block;
    position: fixed;
    inset: var(--kopf) 0 0;
    z-index: 9;
    max-height: none;
    padding: 16px;
    background: var(--panel);
  }
  .hw-h1 {
    font-size: 27px;
  }
  .hw-kacheln {
    grid-template-columns: 1fr;
  }
}

/* Artikeltext des Hilfe-Centers: in der App (Fenster) und auf der Hilfe-Webseite gleich. Nutzt die Farbvariablen
   der App (--fg, --accent, --border …); die Webseite setzt dieselben Namen in hilfe.css. */
.ht {
  font-size: 14px;
  line-height: 1.62;
  color: var(--fg);
  overflow-wrap: break-word;
}
.ht > :first-child {
  margin-top: 0;
}
.ht h2 {
  margin: 1.7em 0 0.5em;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  scroll-margin-top: 12px;
}
.ht h3 {
  margin: 1.4em 0 0.35em;
  font-size: 14.5px;
  line-height: 1.35;
  scroll-margin-top: 12px;
}
.ht p,
.ht ul,
.ht ol {
  margin: 0 0 0.8em;
}
.ht ul,
.ht ol {
  padding-left: 1.3em;
}
.ht li {
  margin: 0.2em 0;
}
.ht li::marker {
  color: var(--fg-muted);
}
.ht a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}
.ht a:hover {
  text-decoration-thickness: 2px;
}
.ht strong {
  font-weight: 650;
}
.ht code,
.ht kbd {
  font-family: var(--mono);
  font-size: 0.88em;
}
.ht code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.ht pre {
  margin: 0 0 0.9em;
  padding: 10px 12px;
  border-radius: var(--radius, 8px);
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow-x: auto;
  line-height: 1.5;
}
.ht pre code {
  padding: 0;
  border: 0;
  background: none;
  white-space: pre;
  font-size: 12.5px;
}
.ht kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel-2);
  text-align: center;
  line-height: 1.5;
}
.ht figure {
  margin: 0.4em 0 1.1em;
}
.ht img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border);
  background: var(--panel-2);
}
.ht figcaption {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--fg-muted);
  line-height: 1.45;
}
.ht .tab {
  margin: 0 0 1em;
  overflow-x: auto;
}
.ht table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ht th,
.ht td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.ht th {
  font-weight: 650;
  color: var(--fg-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ht .hk {
  margin: 0 0 1em;
  padding: 9px 12px 9px 14px;
  border-radius: var(--radius, 8px);
  border: 1px solid color-mix(in srgb, var(--hk) 35%, transparent);
  border-left: 4px solid var(--hk);
  background: color-mix(in srgb, var(--hk) 9%, transparent);
  --hk: var(--accent);
}
.ht .hk-tipp {
  --hk: var(--ok);
}
.ht .hk-achtung {
  --hk: var(--warn);
}
.ht .hk strong:first-child {
  color: color-mix(in srgb, var(--hk) 75%, var(--fg));
}
/* Lexikon: Eintrag mit Code-Kopf */
.ht h3[id] + p > em:only-child {
  color: var(--fg-muted);
  font-size: 12.5px;
}
.ht :target {
  animation: ht-ziel 1.6s ease-out;
}
@keyframes ht-ziel {
  from {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
  }
  to {
    background: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ht :target {
    animation: none;
  }
}
