/* ============================================================================
   SOLARDESK Help-System Styling
   ----------------------------------------------------------------------------
   Glass-DNA, eigenständig, kompatibel mit allen Tool-Themes.
   Side-Panel von rechts, Backdrop, kollabierbare Sektionen, Inline-i-Tooltips.
   ============================================================================ */

.help-panel {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  display: flex; justify-content: flex-end;
}
.help-panel.open { pointer-events: auto; }

.help-backdrop {
  position: absolute; inset: 0;
  background: oklch(8% 0 0 / 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .26s ease;
}
.help-panel.open .help-backdrop { opacity: 1; }

.help-aside {
  position: relative;
  width: min(720px, 96vw);
  height: 100vh; overflow: hidden;
  display: flex; flex-direction: column;
  background:
    linear-gradient(135deg,
      oklch(100% 0 0 / 0.08) 0%,
      oklch(100% 0 0 / 0.025) 50%,
      oklch(100% 0 0 / 0.06) 100%),
    oklch(18% 0.018 252);
  border-left: 1px solid oklch(100% 0 0 / 0.18);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow:
    -24px 0 60px -20px oklch(0% 0 0 / 0.55),
    inset 1px 0 0 oklch(100% 0 0 / 0.20);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4,.0,.2,1);
  font-family: 'Inter', system-ui, sans-serif;
  color: oklch(96% 0.005 252);
}
.help-panel.open .help-aside { transform: translateX(0); }

/* Aurora-Halo wie Glass-Hero, dezenter */
.help-aside::before {
  content: ""; position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 50% 60% at 20% 10%, oklch(70% 0.16 252 / 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 90%, oklch(82% 0.13 70 / 0.10), transparent 60%);
  animation: help-aurora 18s ease-in-out infinite alternate;
}
@keyframes help-aurora {
  0%   { opacity: 0.5; transform: translate(0,0); }
  100% { opacity: 0.9; transform: translate(-8px, 6px); }
}

/* Header */
.help-head {
  position: relative; z-index: 1;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 28px 28px 22px;
  border-bottom: 1px solid oklch(100% 0 0 / 0.10);
}
.help-eyebrow {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 10px; letter-spacing: 0.20em; text-transform: uppercase;
  color: oklch(76% 0.14 220);
  margin-bottom: 4px;
}
.help-title {
  font-family: 'Fraunces', serif;
  font-weight: 300; font-size: 26px;
  letter-spacing: -0.018em;
  margin: 0;
  font-variation-settings: "opsz" 144;
}
.help-subtitle {
  font-size: 13px;
  color: oklch(78% 0.012 252);
  margin-top: 3px;
}
.help-close {
  margin-left: auto;
  appearance: none; border: 1px solid oklch(100% 0 0 / 0.12);
  background: oklch(100% 0 0 / 0.04);
  color: oklch(96% 0.005 252);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.help-close:hover {
  background: oklch(70% 0.20 22 / 0.18);
  border-color: oklch(70% 0.20 22 / 0.50);
}

/* TOC */
.help-toc {
  position: relative; z-index: 1;
  display: flex; gap: 6px; padding: 14px 22px;
  overflow-x: auto;
  border-bottom: 1px solid oklch(100% 0 0 / 0.08);
  scrollbar-width: thin;
}
.help-toc::-webkit-scrollbar { height: 6px; }
.help-toc::-webkit-scrollbar-thumb { background: oklch(100% 0 0 / 0.10); border-radius: 3px; }

.help-toc-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: oklch(100% 0 0 / 0.03);
  border: 1px solid oklch(100% 0 0 / 0.10);
  color: oklch(78% 0.012 252);
  font-size: 11.5px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}
.help-toc-item:hover {
  background: oklch(76% 0.14 220 / 0.15);
  border-color: oklch(76% 0.14 220 / 0.45);
  color: oklch(96% 0.005 252);
}
.help-toc-num {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 9.5px; letter-spacing: 0.12em;
  color: oklch(76% 0.14 220);
  opacity: 0.85;
}

/* Body */
.help-body {
  position: relative; z-index: 1;
  flex: 1; overflow-y: auto;
  padding: 14px 28px 28px;
  scrollbar-width: thin;
}
.help-body::-webkit-scrollbar { width: 8px; }
.help-body::-webkit-scrollbar-thumb { background: oklch(100% 0 0 / 0.12); border-radius: 4px; }

.help-sec {
  margin-bottom: 12px;
  border: 1px solid oklch(100% 0 0 / 0.10);
  border-radius: 14px;
  background: oklch(100% 0 0 / 0.022);
  overflow: hidden;
}
.help-sec-head {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: transparent;
  border: none; color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .14s;
}
.help-sec-head:hover { background: oklch(100% 0 0 / 0.04); }
.help-sec-num {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 10.5px; letter-spacing: 0.20em;
  color: oklch(82% 0.13 70);
  flex: 0 0 auto;
}
.help-sec-title {
  font-family: 'Fraunces', serif;
  font-weight: 400; font-size: 16.5px;
  letter-spacing: -0.012em;
  flex: 1;
  font-variation-settings: "opsz" 120;
}
.help-sec-chevron {
  font-size: 14px;
  color: oklch(62% 0.018 252);
  transition: transform .18s;
}
.help-sec-head[aria-expanded="true"] .help-sec-chevron { transform: rotate(180deg); }

.help-sec-body {
  padding: 6px 22px 22px 22px;
  font-size: 14px; line-height: 1.65;
  color: oklch(86% 0.008 252);
}
.help-sec-body h4 {
  font-family: 'Fraunces', serif;
  font-weight: 400; font-size: 14px;
  margin: 18px 0 6px;
  color: oklch(96% 0.005 252);
  letter-spacing: -0.005em;
}
.help-sec-body p { margin: 0 0 10px; }
.help-sec-body ul, .help-sec-body ol {
  margin: 0 0 12px; padding-left: 22px;
}
.help-sec-body li { margin-bottom: 5px; }
.help-sec-body code, .help-sec-body kbd {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  background: oklch(100% 0 0 / 0.06);
  border: 1px solid oklch(100% 0 0 / 0.10);
  border-radius: 5px;
  letter-spacing: 0.02em;
}
.help-sec-body strong { color: oklch(96% 0.005 252); font-weight: 600; }
.help-sec-body .help-callout {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid oklch(82% 0.13 70 / 0.30);
  background: oklch(82% 0.13 70 / 0.06);
  border-left: 3px solid oklch(82% 0.13 70);
  border-radius: 10px;
  font-size: 13px;
}
.help-sec-body .help-callout.tip {
  border-color: oklch(76% 0.16 152 / 0.30);
  background: oklch(76% 0.16 152 / 0.06);
  border-left-color: oklch(76% 0.16 152);
}
.help-sec-body .help-callout.warn {
  border-color: oklch(70% 0.20 22 / 0.30);
  background: oklch(70% 0.20 22 / 0.06);
  border-left-color: oklch(70% 0.20 22);
}
.help-sec-body .help-formula {
  margin: 10px 0;
  padding: 12px 16px;
  background: oklch(0% 0 0 / 0.20);
  border: 1px solid oklch(100% 0 0 / 0.10);
  border-radius: 8px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: oklch(96% 0.005 252);
}
.help-sec-body .help-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 18px;
  margin: 10px 0;
}
@media (max-width: 540px) { .help-sec-body .help-legend { grid-template-columns: 1fr; } }
.help-sec-body .help-legend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: oklch(100% 0 0 / 0.025);
  border: 1px solid oklch(100% 0 0 / 0.08);
  border-radius: 8px;
  font-size: 12.5px;
}
.help-sec-body .help-legend-icon {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: oklch(100% 0 0 / 0.04);
  border-radius: 6px;
}
.help-sec-body .help-legend-icon svg { display: block; }
.help-sec-body .help-legend-text strong {
  display: block;
  font-size: 12.5px;
  margin-bottom: 1px;
}
.help-sec-body .help-legend-text small {
  color: oklch(62% 0.018 252);
  font-size: 11px;
}

/* Footer */
.help-foot {
  position: relative; z-index: 1;
  padding: 14px 28px;
  border-top: 1px solid oklch(100% 0 0 / 0.08);
  background: oklch(0% 0 0 / 0.15);
}
.help-foot-hint {
  font-size: 11px;
  color: oklch(62% 0.018 252);
  text-align: center;
}
.help-foot-hint kbd {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 10px;
  padding: 2px 6px;
  background: oklch(100% 0 0 / 0.06);
  border: 1px solid oklch(100% 0 0 / 0.14);
  border-radius: 4px;
  margin: 0 2px;
}

/* ──────────────────────────────────────────────────────────────────
   Inline-Tooltips (data-help-tip)
   ────────────────────────────────────────────────────────────────── */
.help-tip-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px;
  margin-left: 6px;
  border-radius: 50%;
  background: oklch(100% 0 0 / 0.08);
  border: 1px solid oklch(100% 0 0 / 0.18);
  color: oklch(78% 0.012 252);
  font-family: 'Fraunces', serif;
  font-size: 9.5px; font-style: italic; font-weight: 500;
  cursor: help;
  padding: 0; vertical-align: middle;
  transition: background .14s, color .14s, border-color .14s;
}
.help-tip-icon:hover {
  background: oklch(76% 0.14 220 / 0.30);
  border-color: oklch(76% 0.14 220 / 0.55);
  color: oklch(96% 0.005 252);
}

.help-tip-pop {
  position: fixed;
  z-index: 10001;
  max-width: 320px;
  padding: 12px 14px;
  background: oklch(18% 0.018 252 / 0.96);
  border: 1px solid oklch(76% 0.14 220 / 0.40);
  border-radius: 10px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 20px 40px -10px oklch(0% 0 0 / 0.55),
    inset 0 1px 0 oklch(100% 0 0 / 0.10);
  color: oklch(96% 0.005 252);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px; line-height: 1.55;
  pointer-events: none;
  animation: help-tip-in .18s ease-out;
}
@keyframes help-tip-in {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.help-tip-pop strong { color: oklch(82% 0.13 70); }
.help-tip-pop code {
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 11.5px;
  background: oklch(100% 0 0 / 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Wenn Help offen ist, Body-Scroll disablen */
body.help-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .help-aside { transition: transform .12s linear; }
  .help-aside::before { animation: none; }
  .help-tip-pop { animation: none; }
}
