/* ======= Page-specific styles ======= */

/* ==== Overzicht ==== */
.hero {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal-light) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 32px 36px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.15), transparent 70%);
}
.hero h1 { color: white; font-size: 2.5rem; margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,.9); font-size: 1.05rem; margin: 0 0 16px; max-width: 640px; }
.hero .version-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  color: white;
  padding: 8px 18px;
  border-radius: 24px;
  font-family: "Fredoka";
  font-size: 1rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.hero .version-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

.how-to-read {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 24px 28px;
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.how-to-read h2 { color: var(--teal-dark); }
.how-to-read .dlist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 16px;
}
.how-to-read .dlist .item {
  padding: 14px 16px;
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--teal-light);
}
.how-to-read .dlist .item h4 {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-family: "Fredoka";
}
.how-to-read .dlist .item p {
  font-size: .88rem;
  color: var(--ink-soft);
  margin: 0;
}

/* ==== Rollen categoriëen ==== */
.category-block {
  margin-bottom: 26px;
}
.category-block__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.category-block__roles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.role-card {
  display: block;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  position: relative;
}
.role-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--teal-light);
  text-decoration: none;
}
.role-card__name {
  font-weight: 600;
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.3;
}
.role-card__short { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.role-card__meta {
  display: flex; gap: 10px; margin-top: 8px; font-size: .78rem; color: var(--muted);
}
.role-card__meta strong { color: var(--teal-dark); font-weight: 600; }
.role-card__dot {
  position: absolute;
  top: 14px; right: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

/* ==== Rol-detail ==== */
.role-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.role-hero__icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--teal-dark);
  color: white;
  font-family: "Fredoka";
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}
.role-hero__meta { flex: 1; min-width: 0; }
.role-hero__meta h1 { margin: 0; }
.role-hero__meta .chips { margin-top: 10px; }

/* ==== Werkstroom rij ==== */
.ws-row {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.ws-row:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.ws-row:last-child { border-bottom: 0; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.ws-row:hover { background: #FAFDFC; }
.ws-row__id {
  font-family: ui-monospace, monospace;
  font-size: .78rem;
  color: var(--blue);
  font-weight: 500;
}
.ws-row__name { font-weight: 500; }
.ws-row__actions { display: flex; gap: 8px; align-items: center; }

.ws-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

/* ==== Activity card ==== */
.activity {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.activity__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
}
.activity__title { font-weight: 600; font-size: 1rem; color: var(--ink); }
.activity__num {
  color: var(--muted);
  font-size: .78rem;
  font-family: ui-monospace, monospace;
}
.activity__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 18px;
  margin-top: 10px;
  font-size: .82rem;
}
.activity__meta .kv-inline { color: var(--ink-soft); }
.activity__meta .kv-inline strong { color: var(--muted); font-weight: 500; display: inline-block; min-width: 90px; }
.activity__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.activity__kort {
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: #F6FAF9;
  border-left: 3px solid var(--teal-light);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}
.activity__toel {
  margin: 6px 0 2px;
  font-size: 0.92rem;
}
.activity__toel > summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 500;
  padding: 4px 0;
  list-style: none;
}
.activity__toel > summary::-webkit-details-marker { display: none; }
.activity__toel > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}
.activity__toel[open] > summary::before { transform: rotate(90deg); }
.activity__toel-body {
  padding: 10px 12px 12px 18px;
  border-left: 2px solid #E0EDEB;
  margin: 4px 0 8px 4px;
  color: var(--ink);
}
.activity__toel-body p { margin: 0 0 10px; line-height: 1.5; }
.activity__toel-body p:last-child { margin-bottom: 0; }
.activity__toel-body strong { color: var(--teal-dark); }
.activity__rationale {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--panel-alt);
  border-left: 2px solid var(--teal-light);
  border-radius: 4px;
  font-size: .85rem;
  color: var(--ink-soft);
}
.activity__fallback {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 8px;
}
.activity__fallback code { font-size: .78rem; }

/* ==== Cockpit viewer ==== */
.cockpit-narrative {
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--panel-alt), var(--panel));
  border-radius: var(--radius-sm);
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.6;
  border-left: 3px solid var(--orange);
  margin-bottom: 16px;
}
.cockpit-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.cockpit-section__title {
  font-weight: 600;
  font-family: "Fredoka";
  color: var(--teal-dark);
  margin: 0 0 4px;
  font-size: 1.02rem;
}
.cockpit-section__content {
  font-size: .85rem;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

/* ==== Keten viewer ==== */
.chain-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color .15s;
}
.chain-card:hover { border-color: var(--teal-light); }
.chain-card__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-bottom: 8px;
}
.chain-card__id {
  font-family: ui-monospace, monospace;
  font-size: .78rem;
  background: var(--teal-dark);
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
}
.chain-card__name {
  font-family: "Fredoka";
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  margin: 0;
}
.chain-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 12px;
  align-items: center;
}
.chain-node {
  padding: 8px 12px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .82rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chain-node--anchor { background: var(--teal-dark); color: white; border-color: var(--teal-dark); }
.chain-node--milestone { background: var(--orange); color: white; border-color: var(--orange); }
.chain-arrow { color: var(--muted); padding: 0 6px; font-size: .9rem; }

.chain-guards h4, .chain-milestones h4 {
  margin-top: 16px; color: var(--teal-dark); font-family: "Fredoka";
}

/* ==== Endpoint card ==== */
.endpoint-card, .gov-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.endpoint-card h3, .gov-card h3 { margin: 0 0 6px; color: var(--teal-dark); font-family: "Fredoka"; }
.endpoint-card__type, .gov-card__type {
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.endpoint-card__id {
  font-family: ui-monospace, monospace;
  font-size: .78rem;
  color: var(--blue);
  margin-top: 8px;
}

/* ==== Uitleg ==== */
.uitleg-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
}
.uitleg-section h2 { color: var(--teal-dark); font-family: "Fredoka"; }
.uitleg-section ol, .uitleg-section ul { padding-left: 22px; }
.uitleg-section li { margin-bottom: 6px; }

/* ==== Legend ==== */
.legend {
  display: flex; flex-wrap: wrap; gap: 18px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .82rem;
  margin-bottom: 16px;
}
.legend__group { display: flex; align-items: center; gap: 6px; }
.legend__group strong { color: var(--muted); font-weight: 500; margin-right: 6px; }

/* ==== Cockpit contract sections ==== */
.cockpit-purpose {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-light));
  color: white;
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.cockpit-purpose h3 { color: white; margin: 0 0 6px; font-family: "Fredoka"; }
.cockpit-purpose p { margin: 0; font-size: .95rem; line-height: 1.55; }

/* ==== JSON inspector ==== */
.raw-toggle {
  margin-top: 20px;
}
.raw-toggle summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .85rem;
  padding: 8px 0;
}

@media (max-width: 720px) {
  .ws-row { grid-template-columns: 1fr; gap: 4px; padding: 12px; }
  .ws-row__id { order: 1; }
  .ws-row__name { order: 2; }
  .ws-row__actions { order: 3; margin-top: 6px; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 1.8rem; }
  .role-hero { flex-direction: column; text-align: center; }
}

/* ===== Anomalie-pagina ===== */
.nav__count--warn {
  background: var(--orange);
  color: #fff;
}
.nav__anom { font-weight: 600; }

.anom-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.anom-toc {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 0.88rem;
}
.anom-toc h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--teal-dark);
}
.toc-group { margin-bottom: 16px; }
.toc-label {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  color: #fff;
}
.toc-p1 .toc-label { background: #D7263D; }
.toc-p2 .toc-label { background: #E07A00; }
.toc-p3 .toc-label { background: #8D7000; }
.toc-p4 .toc-label { background: #6B7280; }
.anom-toc ul {
  margin: 0;
  padding: 0 0 0 8px;
  list-style: none;
}
.anom-toc li {
  margin: 3px 0;
  line-height: 1.3;
  word-break: break-all;
}
.anom-toc a {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
  font-family: monospace;
  font-size: 0.82rem;
}
.anom-toc a:hover { text-decoration: underline; }
.anom-toc .toc-title {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  word-break: normal;
}
.anom-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  line-height: 1.55;
  color: var(--ink);
}
.anom-content h1 { font-size: 1.6rem; color: var(--teal-dark); margin-top: 0; }
.anom-content h2 {
  font-size: 1.25rem;
  color: var(--teal-dark);
  margin-top: 32px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--teal-light);
}
.anom-content h3.anom-h3 {
  margin: 26px 0 10px;
  font-size: 1.05rem;
  padding: 8px 12px;
  background: #F6FAF9;
  border-left: 4px solid var(--teal-dark);
  border-radius: 4px;
}
.anom-content h3.anom-h3 .anom-ws-link {
  font-family: monospace;
  color: var(--teal-dark);
  text-decoration: none;
  margin-right: 6px;
}
.anom-content h3.anom-h3 .anom-ws-link:hover { text-decoration: underline; }
.anom-content h3.anom-h3 .anom-h3-title { color: var(--ink); font-weight: 600; }
.anom-content blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--orange);
  background: #FFF7EE;
  color: var(--ink);
  font-style: italic;
}
.anom-content hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.anom-content table.md-table {
  border-collapse: collapse;
  margin: 12px 0;
  width: 100%;
  font-size: 0.92rem;
}
.anom-content table.md-table th,
.anom-content table.md-table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.anom-content table.md-table th { background: #F0F6F5; font-weight: 600; }
.anom-content ul.md-list, .anom-content ol.md-list {
  margin: 8px 0;
  padding-left: 24px;
}
.anom-content ul.md-list li, .anom-content ol.md-list li { margin: 3px 0; }
.anom-content code {
  background: #F0F4F3;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.86em;
}
.anom-content p { margin: 8px 0; }
.anom-content strong { color: var(--teal-dark); }

@media (max-width: 900px) {
  .anom-layout { grid-template-columns: 1fr; }
  .anom-toc {
    position: static;
    max-height: none;
  }
}

.review-callout { border-left: 4px solid var(--orange); background: #FFF7EE; }
.review-callout__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-callout__badge {
  background: var(--orange); color: #fff;
  padding: 4px 10px; border-radius: 4px;
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.3px;
}
.btn {
  display: inline-block;
  background: var(--teal-dark); color: #fff;
  padding: 8px 16px; border-radius: 6px;
  text-decoration: none; font-weight: 600;
  transition: background 0.15s;
}
.btn:hover { background: var(--teal-light); }

.anom-content { max-width: 100%; overflow-x: auto; }
.anom-content table.md-table { table-layout: auto; width: 100%; word-break: normal; }
.anom-content table.md-table th,
.anom-content table.md-table td { word-break: normal; overflow-wrap: anywhere; }
