:root {
  --pcer-blue: #134093;
  --pcer-cyan: #00b2ef;
  --pcer-yellow: #ffe27f;
  --pcer-text: #444;
  --pcer-heading: #333;
  --pcer-muted: #767676;
  --pcer-border: #e5e5e5;
  --pcer-bg: #f8f8f8;
  --pcer-shadow: 0 5px 15px rgba(0,0,0,.08);
  --pcer-shadow-large: 0 14px 25px rgba(0,0,0,.16);
}

* { box-sizing: border-box; }

html {
  font-family: Open Sans, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pcer-text);
  background: #fff;
}

body {
  margin: 0;
  background: var(--pcer-bg);
  color: var(--pcer-text);
}

.pcer-guide button,
.pcer-guide input { font: inherit; }

.pcer-guide button { color: inherit; }

.pcer-guide a {
  color: var(--pcer-blue);
  text-decoration: none;
}

.pcer-guide a:hover,
.pcer-guide a:focus-visible {
  color: #000;
  text-decoration: underline;
}

.pcer-guide h1,
.pcer-guide h2,
.pcer-guide h3,
.pcer-guide p,
.pcer-guide ul,
.pcer-guide ol {
  margin-top: 0;
}

.pcer-guide.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px 32px;
}

.guide-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
  min-width: 240px;
}

.search-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--pcer-border);
  background: #fff;
  color: var(--pcer-text);
  padding: 0 42px 0 12px;
  outline: none;
}

.search-input:focus {
  background-color: var(--pcer-yellow);
  border-color: #000;
}

.search-input::placeholder { color: #333; }

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pcer-muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--pcer-border);
  box-shadow: var(--pcer-shadow-large);
  display: none;
  max-height: min(520px, calc(100vh - 120px));
  overflow-y: auto;
  z-index: 1020;
}

.search-results.open { display: block; }

.result-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--pcer-border);
  background: #fff;
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
}

.result-item:last-child { border-bottom: 0; }

.result-item:hover,
.result-item:focus-visible {
  background: var(--pcer-bg);
  outline: none;
}

.result-title {
  display: block;
  color: var(--pcer-heading);
  font-weight: 700;
  line-height: 1.35;
}

.result-meta {
  display: block;
  margin-top: 3px;
  color: var(--pcer-muted);
  font-size: .875rem;
}

.btn {
  border: 1px solid var(--pcer-border);
  background: #fff;
  color: var(--pcer-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  font-size: .875rem;
  line-height: 42px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: .1s ease-in-out;
  transition-property: color, background-color, border-color, box-shadow;
  white-space: nowrap;
}

.btn:hover,
.btn:focus-visible {
  background: transparent;
  border-color: #b2b2b2;
  color: var(--pcer-heading);
  outline: none;
  text-decoration: none;
}

.btn.primary {
  background: var(--pcer-blue);
  border-color: transparent;
  color: #fff;
}

.btn.primary:hover,
.btn.primary:focus-visible {
  background: var(--pcer-cyan);
  color: #333;
}

.btn:disabled {
  background: #f8f8f8;
  border-color: var(--pcer-border);
  color: var(--pcer-muted);
  cursor: default;
}

.btn.small {
  min-height: 34px;
  line-height: 32px;
  padding: 0 15px;
}

.hero {
  margin: 0 0 24px;
  padding: 0;
}

.eyebrow,
.root-number,
.answer-label,
.node-meta,
.followup-meta {
  color: var(--pcer-muted);
  font-size: .875rem;
  line-height: 1.4;
}

.eyebrow {
  display: inline-block;
  color: var(--pcer-blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 10px;
}

.hero h1 {
  color: var(--pcer-heading);
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  max-width: 100%;
}

.lead {
  color: var(--pcer-text);
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 850px;
  margin-bottom: 0;
}

.root-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.root-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-height: 230px;
  width: 100%;
  background: #fff;
  border: 0;
  border-top: 6px solid var(--pcer-blue);
  box-shadow: var(--pcer-shadow);
  color: var(--pcer-text);
  padding: 26px;
  text-align: left;
  cursor: pointer;
  transition: box-shadow .1s ease-in-out, border-color .1s ease-in-out;
}

.root-card:nth-child(2) { border-top-color: var(--pcer-yellow); }

.root-card:hover,
.root-card:focus-visible {
  box-shadow: var(--pcer-shadow-large);
  border-top-color: var(--pcer-cyan);
  outline: none;
}

.root-question {
  color: var(--pcer-heading);
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.root-answer {
  color: var(--pcer-text);
  margin-bottom: auto;
}

.guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.guide-topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.back-button { align-self: stretch; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  background: #fff;
  border-left: 4px solid var(--pcer-yellow);
  box-shadow: var(--pcer-shadow);
  padding: 10px 14px;
}

.crumb {
  border: 0;
  background: transparent;
  color: var(--pcer-blue);
  cursor: pointer;
  display: inline-block;
  max-width: 360px;
  overflow: hidden;
  padding: 3px 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb:hover,
.crumb:focus-visible {
  color: #000;
  text-decoration: underline;
  outline: none;
}

.crumb.current {
  color: #000;
  cursor: default;
  text-decoration: none;
}

.separator {
  color: var(--pcer-text);
  margin: 0 10px;
}

.article-card,
.panel-card {
  background: #fff;
  box-shadow: var(--pcer-shadow);
  color: var(--pcer-text);
}

.article-card { overflow: hidden; }

.question-header {
  background: #fff;
  border-bottom: 1px solid var(--pcer-border);
  padding: 26px 34px;
}

.question-title {
  margin: 14px 0 0;
  color: var(--pcer-heading);
  font-size: clamp(1.55rem, 2.6vw, 2rem);
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-block;
  background: var(--pcer-bg);
  color: var(--pcer-muted);
  font-size: .875rem;
  line-height: 1.5;
  margin: 0 6px 6px 0;
  padding: 2px 10px;
  text-transform: uppercase;
}

.pill.accent {
  background: var(--pcer-blue);
  color: #fff;
}

.article-body {
  padding: 34px;
  border-bottom: 1px solid var(--pcer-border);
}

.answer-label {
  color: var(--pcer-blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 18px;
}

.answer-content {
  max-width: 840px;
  color: var(--pcer-text);
  font-size: 1.03rem;
  overflow-wrap: anywhere;
}

.answer-content p { margin-bottom: 20px; }

.answer-content h3 {
  color: var(--pcer-blue);
  font-size: 1.4rem;
  line-height: 1.4;
  font-weight: 400;
  margin: 36px 0 12px;
}

.answer-content h3:first-child { margin-top: 0; }

.answer-content ul { padding-left: 30px; }

.source-block {
  background: var(--pcer-bg);
  border-left: 4px solid var(--pcer-yellow);
  padding: 18px;
  margin-top: 28px;
}

.next-section {
  padding: 28px 34px 34px;
  scroll-margin-top: 32px;
}

.section-heading {
  color: var(--pcer-heading);
  font-size: 1.25rem;
  line-height: 1.4;
  font-weight: 400;
  margin: 0 0 18px;
}

.followup-list { display: grid; gap: 14px; }

.followup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: 100%;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--pcer-border);
  border-left: 4px solid var(--pcer-blue);
  color: var(--pcer-text);
  text-align: left;
  cursor: pointer;
  transition: .1s ease-in-out;
  transition-property: border-color, background-color, box-shadow;
}

.followup-card:hover,
.followup-card:focus-visible {
  background: var(--pcer-bg);
  border-left-color: var(--pcer-cyan);
  box-shadow: var(--pcer-shadow);
  outline: none;
}

.followup-title {
  display: block;
  color: var(--pcer-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.followup-meta {
  display: block;
  margin-top: 4px;
}

.arrow {
  color: var(--pcer-blue);
  font-size: 1.35rem;
  font-weight: 700;
}

.empty-state {
  background: #c6eefb;
  color: var(--pcer-blue);
  padding: 15px;
  border-left: 4px solid var(--pcer-cyan);
}

.side-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
}

.panel-card { padding: 18px; }

.panel-title {
  color: var(--pcer-heading);
  font-size: 1.15rem;
  line-height: 1.4;
  font-weight: 400;
  margin: 0 0 14px;
}

.path-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.path-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  color: var(--pcer-muted);
  font-size: .875rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.path-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--pcer-bg);
  color: var(--pcer-muted);
  border: 1px solid var(--pcer-border);
  font-size: .75rem;
}

.path-item.current {
  color: var(--pcer-heading);
  font-weight: 700;
}

.path-item.current .path-index {
  background: var(--pcer-blue);
  border-color: var(--pcer-blue);
  color: #fff;
}

.panel-followups { display: grid; gap: 8px; }

.panel-followup {
  display: block;
  width: 100%;
  border: 1px solid var(--pcer-border);
  border-left: 4px solid var(--pcer-cyan);
  background: #fff;
  color: var(--pcer-heading);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.panel-followup:hover,
.panel-followup:focus-visible {
  background: var(--pcer-bg);
  border-left-color: var(--pcer-blue);
  outline: none;
}

.mobile-next { display: none; }

.hidden { display: none !important; }

@media (max-width: 959px) {
  .pcer-guide.page {
    padding: 14px 24px 96px;
  }

  .guide-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .search-wrap {
    max-width: none;
    min-width: 0;
  }

  .root-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .side-panel { display: none; }

  .guide-topbar {
    grid-template-columns: 1fr;
  }

  .breadcrumb { min-height: 44px; }

  .mobile-next {
    display: grid;
    position: fixed;
    left: 24px;
    right: 24px;
    bottom: 10px;
    z-index: 1000;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: #fff;
    box-shadow: var(--pcer-shadow-large);
    padding: 10px;
  }
}

@media (max-width: 639px) {
  .pcer-guide.page {
    padding: 12px 15px 92px;
  }

  .guide-toolbar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .search-wrap {
    grid-column: 1 / -1;
  }

  .guide-toolbar > .btn {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero { margin-bottom: 20px; }

  .lead { font-size: 1rem; }

  .root-card {
    min-height: 0;
    padding: 22px 20px;
  }

  .root-question { font-size: 1.2rem; }

  .question-header,
  .article-body,
  .next-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .answer-content { font-size: 1rem; }

  .crumb {
    max-width: 100%;
    white-space: normal;
  }

  .separator { margin: 0 8px; }

  .mobile-next {
    left: 10px;
    right: 10px;
  }
}


/* WCAG 2.1 accessibility hardening */
.pcer-guide button:focus-visible,
.pcer-guide input:focus-visible,
.pcer-guide a:focus-visible,
.pcer-guide [tabindex="-1"]:focus-visible,
.crumb:focus-visible,
.followup-card:focus-visible,
.panel-followup:focus-visible,
.root-card:focus-visible,
.result-item:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

.pcer-guide [tabindex="-1"]:focus {
  outline: none;
}

.answer-content,
.answer-content a,
.followup-title,
.root-question,
.crumb,
.result-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.crumb.current {
  cursor: default;
}

.next-section {
  scroll-margin-top: 120px;
}

@media (forced-colors: active) {
  .btn,
  .root-card,
  .followup-card,
  .panel-followup,
  .article-card,
  .panel-card,
  .breadcrumb,
  .search-input,
  .search-results,
  .result-item {
    border: 1px solid CanvasText;
  }
}


/* Mobile breadcrumb simplification: hide breadcrumb trail on small screens. */
@media (max-width: 959px) {
  .guide-topbar {
    display: flex;
    align-items: stretch;
  }

  .breadcrumb {
    display: none !important;
  }

  .back-button {
    width: auto;
    min-width: 96px;
  }
}


/* Content-focused update */
.pcer-guide.page {
  max-width: 1100px;
}

.hero {
  max-width: 1100px;
  margin-bottom: 30px;
  margin: 0 auto 30px;
}

.hero h1 {
  margin-bottom: 18px;
}

.intro-text {
  max-width: 1100px;
  color: var(--pcer-text);
  font-size: 1.08rem;
  line-height: 1.65;
  /* Desktop: Blocksatz */
  text-align: justify;
  hyphens: auto;
}

/* Mobile: linksbündig */
@media (max-width: 639px) {
  .intro-text {
    text-align: left;
  }
}

.intro-text p {
  margin: 0 0 16px;
}

.root-number,
.node-meta,
.followup-meta,
.side-panel,
.panel-card,
.panel-followups,
.path-list,
.path-item {
  display: none !important;
}

.guide-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.article-card {
  width: 100%;
}

.question-header {
  padding-top: 22px;
  padding-bottom: 22px;
}

.question-title {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.35;
}

.article-body {
  background: #fff;
}

.answer-label {
  font-size: .95rem;
  margin-bottom: 14px;
}

.answer-content {
  max-width: 900px;
  font-size: 1.13rem;
  line-height: 1.68;
  color: #333;
}

.answer-content p {
  margin-bottom: 22px;
}

.answer-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
}

.section-heading {
  color: var(--pcer-blue);
  font-weight: 700;
}

.followup-card {
  min-height: 64px;
}

.followup-title {
  font-size: 1.05rem;
}

.mobile-next .btn.primary {
  white-space: normal;
  line-height: 1.25;
}

@media (max-width: 959px) {
  .guide-grid {
    max-width: none;
  }
}

@media (max-width: 639px) {
  .intro-text {
    font-size: 1rem;
    line-height: 1.58;
  }

  .answer-content {
    font-size: 1.05rem;
    line-height: 1.62;
  }
}


.empty-state p {
  margin: 0 0 12px;
}

.empty-state .empty-restart-button {
  margin-top: 4px;
}

/* Markdown/source rendering hardening */
.answer-content a { word-break: break-word; overflow-wrap: anywhere; }
.answer-section { margin-bottom: 20px; }
.source-block { background: #f6f8fb; border-left: 4px solid var(--pcer-yellow); border-radius: 10px; padding: 18px 20px; margin: 30px 0 8px; }
.source-block h3 { margin-top: 0 !important; }
.source-block p { margin-bottom: 12px; }
.source-list { list-style: none; padding-left: 0 !important; margin: 12px 0 0; }
.source-list li { position: relative; padding-left: 20px; margin: 8px 0; }
.source-list li::before { content: "↗"; position: absolute; left: 0; color: var(--pcer-blue); font-weight: 700; }


/* Improved Markdown rendering for answer sections and sources */
.answer-content .answer-section {
  margin: 0 0 24px;
}

.answer-content .answer-section h3,
.answer-content > h3 {
  display: block;
  color: var(--pcer-blue);
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 36px 0 12px;
}

.answer-content .answer-section:first-child h3,
.answer-content > h3:first-child {
  margin-top: 0;
}

.answer-content .answer-section p {
  margin: 0 0 18px;
}

.answer-content .source-block {
  display: block;
  background: #f6f8fb;
  border-left: 5px solid var(--pcer-yellow);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 34px 0 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

.answer-content .source-block h3 {
  display: block;
  color: var(--pcer-blue);
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 12px !important;
}

.answer-content .source-block p {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.55;
}

.answer-content .source-list {
  list-style: none;
  padding-left: 0 !important;
  margin: 10px 0 0;
}

.answer-content .source-list li {
  position: relative;
  padding-left: 22px;
  margin: 9px 0;
  line-height: 1.45;
}

.answer-content .source-list li::before {
  content: "↗";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--pcer-blue);
  font-weight: 700;
}

.answer-content .source-block a {
  font-weight: 700;
}
