/* Hilfe: wiederverwendbare, bewusst ruhige Inhaltsbausteine */

.help-layout,
.help-layout * {
  box-sizing: border-box;
}

.help-content {
  min-width: 0;
}

.help-content :where(h2, h3, p, li, a, summary, dd, dt) {
  overflow-wrap: anywhere;
}

.help-heading {
  display: grid;
  min-height: 100px;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 0 8px 18px;
}

.help-heading-icon {
  justify-self: center;
  color: var(--green-800);
  transform: scale(1.36);
  transform-origin: center;
}

.help-heading-copy {
  min-width: 0;
}

.help-eyebrow,
.help-heading h1,
.help-heading p {
  margin: 0;
}

.help-eyebrow {
  color: #896400;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.help-heading h1 {
  margin-top: 2px;
  color: var(--green-950);
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1.08;
}

.help-heading h1 + p {
  max-width: 760px;
  margin-top: 7px;
  color: #365344;
  line-height: 1.55;
}

.help-panel,
.help-search,
.help-toc,
.help-info,
.help-cta,
.help-tech-status,
.help-faq details,
.help-knowledge-card,
.help-rule-card,
.help-topic-card {
  border: 1px solid var(--cream-300);
  border-radius: 10px;
  background: rgb(255 255 255 / 90%);
  box-shadow: 0 4px 13px rgb(39 50 36 / 8%);
}

.help-panel {
  margin-bottom: 18px;
  padding: 24px;
}

.help-section {
  min-width: 0;
  margin-top: 28px;
  scroll-margin-top: 160px;
}

.help-section:first-child {
  margin-top: 0;
}

.help-section-heading {
  margin-bottom: 15px;
}

.help-section-heading h2,
.help-section > h2,
.help-panel > h2 {
  margin: 0;
  color: var(--green-950);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.72rem);
  line-height: 1.2;
}

.help-section-heading p,
.help-section > h2 + p,
.help-panel > h2 + p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

/* Suche und progressive Filterung */

.help-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
  padding: 18px;
  background:
    linear-gradient(120deg, rgb(231 239 231 / 78%), rgb(255 253 248 / 96%));
}

.help-search-field {
  min-width: 0;
}

.help-search label,
.help-search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--green-950);
  font-weight: 800;
}

.help-search-input-wrap {
  position: relative;
}

.help-search input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 46px 10px 14px;
  border: 1px solid #a9b9ad;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.help-search input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.help-search input[type="search"]:focus-visible {
  border-color: var(--green-700);
  outline: 3px solid rgb(240 194 65 / 48%);
  outline-offset: 1px;
}

.help-search-symbol {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--green-700);
  border-radius: 50%;
  pointer-events: none;
  transform: translateY(-58%);
}

.help-search-symbol::after {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--green-700);
  content: "";
  transform: rotate(45deg);
}

.help-search-clear {
  min-height: 48px;
  padding: 9px 17px;
  border: 1px solid var(--green-700);
  border-radius: 8px;
  color: var(--green-800);
  background: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.help-search-clear:hover {
  color: #fff;
  background: var(--green-800);
}

.help-filter-status {
  grid-column: 1 / -1;
  min-height: 1.25em;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.help-filter-empty {
  margin: 18px 0 0;
  padding: 20px;
  border: 1px dashed var(--cream-400);
  border-radius: 9px;
  color: #40574a;
  background: #fffdf8;
  text-align: center;
}

[data-help-filter-item][hidden],
[data-help-filter-empty][hidden] {
  display: none !important;
}

/* Themenkarten */

.help-topic-grid,
.help-knowledge-grid,
.help-rule-grid,
.help-tech-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.help-topic-card {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 19px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.help-topic-card:hover {
  border-color: rgb(7 95 49 / 42%);
  box-shadow: 0 7px 18px rgb(39 50 36 / 13%);
  transform: translateY(-2px);
}

.help-topic-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--green-800);
  background: var(--green-100);
  font-size: 1.2rem;
  font-weight: 800;
}

.help-topic-copy {
  min-width: 0;
}

.help-topic-card h2,
.help-topic-card h3 {
  margin: 0;
  color: var(--green-950);
  font-family: var(--font-display);
  font-size: 1.09rem;
  line-height: 1.25;
}

.help-topic-card p {
  margin: 6px 0 24px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.48;
}

.help-topic-card > a,
.help-topic-card .help-card-link {
  position: absolute;
  right: 18px;
  bottom: 15px;
  color: var(--green-800);
  font-weight: 800;
}

.help-topic-card > a::after,
.help-topic-card .help-card-link::after,
.help-inline-link::after {
  margin-left: 6px;
  color: var(--gold);
  content: "›";
}

/* Inhaltsverzeichnis */

.help-toc {
  margin-bottom: 22px;
  padding: 18px 20px;
  border-left: 4px solid var(--gold);
}

.help-toc h2,
.help-toc h3 {
  margin: 0 0 9px;
  color: var(--green-950);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.help-toc ul,
.help-toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 20px;
  margin: 0;
  padding-left: 20px;
}

.help-toc a,
.help-inline-link {
  color: var(--green-800);
  font-weight: 750;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.help-inline-link {
  display: inline-flex;
  align-items: center;
  margin-top: 11px;
}

/* Hinweise */

.help-info {
  position: relative;
  margin: 18px 0;
  padding: 18px 20px 18px 56px;
  border-left: 5px solid var(--green-700);
  background: linear-gradient(110deg, #eef6ef, #fff);
}

.help-info::before {
  position: absolute;
  top: 17px;
  left: 18px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green-700);
  content: "i";
  font-family: Georgia, serif;
  font-weight: 800;
}

.help-info--warning {
  border-left-color: #c57b00;
  background: linear-gradient(110deg, #fff7df, #fff);
}

.help-info--warning::before {
  background: #a96800;
  content: "!";
  font-family: inherit;
}

.help-info--important {
  border-left-color: #a83d32;
  background: linear-gradient(110deg, #fff0ec, #fff);
}

.help-info--important::before {
  background: #a83d32;
  content: "!";
  font-family: inherit;
}

.help-info--success {
  border-left-color: #35825a;
}

.help-info--success::before {
  background: #35825a;
  content: "✓";
  font-family: inherit;
}

.help-info h2,
.help-info h3,
.help-info strong:first-child {
  display: block;
  margin: 0 0 4px;
  color: var(--green-950);
}

.help-info p {
  margin: 0;
  line-height: 1.55;
}

.help-info p + p {
  margin-top: 8px;
}

/* Schrittfolgen */

.help-steps {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 18px 0;
  padding: 0;
  counter-reset: help-step;
  list-style: none;
}

.help-steps > li {
  position: relative;
  min-width: 0;
  min-height: 64px;
  padding: 15px 18px 15px 67px;
  border: 1px solid var(--cream-300);
  border-radius: 9px;
  background: #fff;
  counter-increment: help-step;
}

.help-steps > li::before {
  position: absolute;
  top: 13px;
  left: 15px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--green-950);
  background: #fff9e6;
  content: counter(help-step);
  font-weight: 900;
}

.help-steps h2,
.help-steps h3,
.help-steps strong:first-child {
  display: block;
  margin: 0 0 3px;
  color: var(--green-950);
}

.help-steps p {
  margin: 0;
  color: #40574a;
  line-height: 1.5;
}

/* Fragen und Antworten */

.help-faq {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.help-faq details {
  min-width: 0;
  overflow: clip;
}

.help-faq summary {
  position: relative;
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 48px 13px 17px;
  color: var(--green-950);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.help-faq summary::-webkit-details-marker {
  display: none;
}

.help-faq summary::after {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 10px;
  height: 10px;
  margin-top: -7px;
  border-right: 2px solid var(--green-700);
  border-bottom: 2px solid var(--green-700);
  content: "";
  transform: rotate(45deg);
  transition: transform 150ms ease, margin 150ms ease;
}

.help-faq details[open] summary {
  border-bottom: 1px solid var(--cream-300);
  background: #fffdf8;
}

.help-faq details[open] summary::after {
  margin-top: -2px;
  transform: rotate(225deg);
}

.help-faq-answer {
  padding: 15px 18px 18px;
  color: #365344;
  line-height: 1.6;
}

.help-faq-answer > :first-child {
  margin-top: 0;
}

.help-faq-answer > :last-child {
  margin-bottom: 0;
}

/* Wissens-, Regel- und Technikbausteine */

.help-knowledge-card,
.help-rule-card,
.help-tech-status {
  min-width: 0;
  padding: 19px;
}

.help-knowledge-card h2,
.help-knowledge-card h3,
.help-rule-card h2,
.help-rule-card h3,
.help-tech-status h2,
.help-tech-status h3 {
  margin: 0 0 6px;
  color: var(--green-950);
  font-family: var(--font-display);
  font-size: 1.08rem;
}

.help-knowledge-card p,
.help-rule-card p,
.help-tech-status p {
  margin: 0;
  color: #40574a;
  line-height: 1.52;
}

.help-knowledge-card p + p,
.help-rule-card p + p,
.help-tech-status p + p {
  margin-top: 8px;
}

.help-rule-card {
  border-top: 4px solid var(--green-700);
}

.help-rule-card--warning {
  border-top-color: #c57b00;
}

.help-rule-card--important {
  border-top-color: #a83d32;
}

.help-tech-status {
  position: relative;
  padding-left: 50px;
}

.help-tech-status::before {
  position: absolute;
  top: 21px;
  left: 20px;
  width: 13px;
  height: 13px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #76837b;
  box-shadow: 0 0 0 2px #76837b;
  content: "";
}

.help-tech-status--ok::before {
  background: #35825a;
  box-shadow: 0 0 0 2px #35825a;
}

.help-tech-status--warning::before {
  background: #c57b00;
  box-shadow: 0 0 0 2px #c57b00;
}

.help-tech-status--problem::before {
  background: #a83d32;
  box-shadow: 0 0 0 2px #a83d32;
}

.help-status-label {
  display: inline-block;
  margin-top: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #315043;
  background: var(--green-100);
  font-size: 0.75rem;
  font-weight: 850;
}

/* Handlungsaufforderungen */

.help-cta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 22px 24px;
  border-color: rgb(221 163 0 / 55%);
  background:
    radial-gradient(circle at 100% 0, rgb(240 194 65 / 22%), transparent 43%),
    #fffdf8;
}

.help-cta-copy {
  min-width: 0;
}

.help-cta h2,
.help-cta h3,
.help-cta p {
  margin: 0;
}

.help-cta h2,
.help-cta h3 {
  color: var(--green-950);
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.help-cta p {
  margin-top: 5px;
  color: #40574a;
  line-height: 1.5;
}

.help-cta-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 9px;
}

.help-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 17px;
  border: 1px solid var(--green-800);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(110deg, var(--green-900), var(--green-700));
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.help-button--secondary {
  color: var(--green-800);
  background: #fff;
}

.help-button:hover {
  filter: brightness(1.06);
}

.help-button:focus-visible,
.help-search-clear:focus-visible,
.help-faq summary:focus-visible,
.help-topic-card a:focus-visible,
.help-toc a:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
}

@media (max-width: 920px) {
  .help-topic-grid,
  .help-knowledge-grid,
  .help-rule-grid,
  .help-tech-grid {
    grid-template-columns: 1fr;
  }

  .help-toc ul,
  .help-toc ol {
    grid-template-columns: 1fr;
  }

  .help-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .help-cta-actions {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .help-heading {
    min-height: auto;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 2px 7px 15px;
  }

  .help-heading-icon {
    transform: scale(0.96);
  }

  .help-heading h1 {
    font-size: 1.5rem;
  }

  .help-heading h1 + p {
    font-size: 0.94rem;
    line-height: 1.45;
  }

  .help-panel {
    padding: 18px;
  }

  .help-section {
    margin-top: 22px;
    scroll-margin-top: 132px;
  }

  .help-search {
    grid-template-columns: minmax(0, 1fr);
    padding: 15px;
  }

  .help-search-clear {
    justify-self: start;
  }

  .help-filter-status {
    grid-column: auto;
  }

  .help-topic-card {
    padding: 16px;
  }

  .help-topic-card > a,
  .help-topic-card .help-card-link {
    right: 16px;
    bottom: 13px;
  }

  .help-toc {
    padding: 16px 17px;
  }

  .help-info {
    padding: 16px 16px 16px 50px;
  }

  .help-info::before {
    top: 15px;
    left: 14px;
  }

  .help-cta {
    padding: 19px;
  }
}

@media (max-width: 420px) {
  .help-layout {
    max-width: 100%;
  }

  .help-heading {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .help-heading-icon {
    transform: scale(0.82);
  }

  .help-heading h1 {
    font-size: 1.32rem;
  }

  .help-eyebrow {
    font-size: 0.68rem;
  }

  .help-panel,
  .help-search,
  .help-toc,
  .help-cta,
  .help-knowledge-card,
  .help-rule-card,
  .help-tech-status {
    padding-right: 13px;
    padding-left: 13px;
  }

  .help-topic-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 14px 13px;
  }

  .help-topic-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .help-info {
    padding-right: 13px;
    padding-left: 46px;
  }

  .help-info::before {
    left: 11px;
  }

  .help-steps > li {
    padding: 14px 13px 14px 56px;
  }

  .help-steps > li::before {
    left: 11px;
    width: 33px;
    height: 33px;
  }

  .help-faq summary {
    padding-right: 42px;
    padding-left: 13px;
  }

  .help-faq summary::after {
    right: 15px;
  }

  .help-faq-answer {
    padding-right: 13px;
    padding-left: 13px;
  }

  .help-tech-status {
    padding-left: 45px;
  }

  .help-tech-status::before {
    left: 15px;
  }

  .help-cta-actions,
  .help-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-topic-card,
  .help-faq summary::after {
    transition: none;
  }

  .help-topic-card:hover {
    transform: none;
  }
}
