:root {
  --bg: #fafaf7;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e4e2dc;
  --accent: #ff6a00;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, white);
  --header-bg: #ffffff;
  --header-fg: var(--fg);
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}

.site-header {
  background-color: var(--header-bg);
  color: var(--header-fg);
}
.site-header a:not(:hover) { color: var(--header-fg); }
.site-header .text-muted:not(:hover) {
  color: var(--header-fg);
  opacity: 0.6;
}

* { box-sizing: border-box; }

/* Rendered but folded away on screen; prints in full (see print.css). */
@media screen {
  .screen-hidden { display: none; }
}

.workstream-page {
  height: 100vh;
  overflow: hidden;
}
.workstream-page > footer {
  display: none;
}
.workspace-chrome {
  position: fixed;
  top: 0.9rem;
  left: 1rem;
  right: 1rem;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}
.chrome-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}
.chrome-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 92%, white);
  color: var(--fg);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  pointer-events: auto;
}
.chrome-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chrome-brand {
  max-width: 18rem;
  background: var(--header-bg);
  border-color: color-mix(in srgb, var(--header-bg) 80%, var(--line));
  color: var(--header-fg);
}
.chrome-brand:hover { color: var(--header-fg); }
.chrome-icon svg {
  width: 1rem;
  height: 1rem;
}
.workstream-workspace {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr) minmax(240px, 300px);
  grid-template-rows: minmax(0, 1fr);
  gap: 1rem;
  padding: 3.75rem 1.75rem 1.35rem;
}
.workstream-side {
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding: 0.25rem 0 0.5rem 1rem;
}
.workstream-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.workstream-title-row {
  margin-top: 0.55rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}
.workstream-title-row h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0;
}
.workstream-summary,
.workstream-note {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.workstream-note {
  color: var(--fg);
  font-style: italic;
}
.workstream-side-section {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}
.side-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.workstream-side .prose {
  font-size: 0.86rem;
  line-height: 1.45;
}


/* Slide-deck specifics carried over from the demo */
.slide { display: none; }
.slide.active { display: block; animation: fadein 0.2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.slide h1, .slide h2 { margin-top: 0; }
.slide img, #details img,
.slide video, #details video {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  margin: 0.5rem 0;
  display: block;
}
.slide-pdf {
  width: 100%;
  height: min(70vh, 680px);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
}
.slide-video {
  width: 100%;
  max-height: min(70vh, 680px);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  margin: 0.5rem 0;
  background: #000;
}
.slide-pdf-wrap {
  position: relative;
  margin: 0.5rem 0;
}
.slide-pdf-wrap .slide-pdf {
  margin: 0;
}
.slide-pdf-fs {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  color: var(--fg);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.slide-pdf-wrap:hover .slide-pdf-fs,
.slide-pdf-fs:focus-visible {
  opacity: 1;
}
.slide-pdf-fs:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.slide-pdf-wrap:fullscreen {
  background: #000;
  margin: 0;
  padding: 0;
  display: block;
}
.slide-pdf-wrap:fullscreen .slide-pdf {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}
.slide-pdf-wrap:fullscreen .slide-pdf-fs {
  opacity: 1;
  background: rgba(255, 255, 255, 0.9);
}

.slides-wrap {
  grid-column: 1 / 3;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
}
.slides-wrap.index-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.slides {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.slide-index {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  overflow-y: auto;
  padding: 0.1rem 0.15rem 0.35rem 0;
  scrollbar-width: thin;
}
.slides-wrap.index-hidden .slide-index {
  display: none;
}
.slide-index-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.slide-index-row[data-dragging="true"] { opacity: 0.45; }
.slide-index-row[data-drop-before="true"] {
  box-shadow: 0 -3px 0 var(--accent);
}
.slide-index-row[data-drop-after="true"] {
  box-shadow: 0 3px 0 var(--accent);
}
.slide-index-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.2;
  padding: 0.5rem 0.6rem 0.5rem 0.45rem;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.slide-index-item:hover,
.slide-index-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.slide-index-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}
.slide-index-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Section headings interleaved in the index. In edit mode the label is a
   button (click to rename); it keeps the same look. */
.slide-index-section-row {
  margin-top: 0.55rem;
}
.slide-index-section-row:first-child {
  margin-top: 0;
}
.slide-index-section {
  display: block;
  width: 100%;
  padding: 0.15rem 0.45rem 0.05rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
button.slide-index-section {
  cursor: pointer;
  transition: color 0.15s ease;
}
button.slide-index-section:hover {
  color: var(--accent);
}
.slide-index-section-row .slide-index-delete {
  top: 50%;
  transform: translateY(-50%);
}
.slide-index-delete {
  position: absolute;
  top: 3px;
  right: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.slide-index-delete:hover {
  color: #c0392b;
  background: rgba(0, 0, 0, 0.06);
}
.slide-index-delete svg {
  width: 13px;
  height: 13px;
}
/* On desktop the delete icon only appears when the row is hovered (or the
   button is focused via keyboard). Touch devices keep it visible. */
@media (hover: hover) and (pointer: fine) {
  .slide-index-delete {
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  }
  .slide-index-row:hover .slide-index-delete,
  .slide-index-delete:focus-visible {
    opacity: 1;
  }
}
.add-slide-index {
  justify-content: center;
  width: 100%;
  margin-top: 0.35rem;
}
.slide-controls {
  grid-column: 2;
  grid-row: 2;
  margin: 0 !important;
}
.slides-wrap.index-hidden .slides,
.slides-wrap.index-hidden .slide-controls {
  grid-column: 1;
}
.slides-wrap.is-fullscreen {
  background: var(--bg);
  width: 100vw;
  height: 100vh;
  padding: 2rem 3rem;
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1rem 1.25rem;
}
.slides-wrap.is-fullscreen.index-hidden {
  grid-template-columns: minmax(0, 1fr);
}
.slides-wrap.is-fullscreen .slide-index {
  max-height: none;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: stretch;
  padding: 0.2rem 0.2rem 0.2rem 0;
}
.slides-wrap.is-fullscreen .slides {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  display: flex;
  align-items: safe center;
  justify-content: center;
  font-size: 1.3rem;
  padding: 3rem 4rem;
}
.slides-wrap.is-fullscreen.index-hidden .slides {
  grid-column: 1;
}
.slides-wrap.is-fullscreen .slides .slide.active {
  width: 100%;
  max-width: 1100px;
}
.slides-wrap.is-fullscreen .slide h1 { font-size: 2.8rem; }
.slides-wrap.is-fullscreen .slide h2 { font-size: 2.2rem; }
.slides-wrap.is-fullscreen .slide h3 { font-size: 1.6rem; }
.slides-wrap.is-fullscreen .slide-controls {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
}
.slides-wrap.is-fullscreen.index-hidden .slide-controls {
  grid-column: 1;
}

@media (max-width: 760px) {
  .workstream-page {
    height: auto;
    overflow: auto;
  }
  .workspace-chrome {
    position: sticky;
    top: 0;
    padding: 0.75rem;
    background: var(--bg);
  }
  .workstream-workspace {
    height: auto;
    display: block;
    padding: 1rem;
  }
  .slides-wrap {
    display: block;
  }
  .slide-index {
    max-height: 11rem;
    margin-bottom: 0.75rem;
  }
  .slides {
    max-height: none;
  }
  .workstream-side {
    margin-top: 1rem;
    border-left: 0;
    padding-left: 0;
  }
}



.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}
.tag-filter {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.35rem 0.65rem;
  text-decoration: none;
}
.tag-filter:hover,
.tag-filter.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.workstream-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.workstream-tags span,
.workstream-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 1.25rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
}
.workstream-tags a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.side-tags {
  margin-top: 0.8rem;
}

/* ===== Edit mode ===== */

.hidden { display: none !important; }


.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--fg);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover { color: white; opacity: 0.92; }
.btn-sm { padding: 0.2rem 0.55rem; font-size: 0.8rem; }
.btn-ghost { border-color: transparent; }
.btn-ghost:hover { border-color: var(--line); }
.btn-danger { color: #c0392b; }
.btn-danger:hover { color: #c0392b; border-color: #c0392b; }
.modal-footer .btn-danger { margin-right: auto; }


.timeline-row[data-dragging="true"] { opacity: 0.4; }
.timeline-row[data-drop-before="true"] {
  box-shadow: inset 0 3px 0 var(--accent);
}
.timeline-row[data-drop-after="true"] {
  box-shadow: inset 0 -3px 0 var(--accent);
}


.drag-handle {
  cursor: grab;
  color: var(--muted);
  padding: 0;
  user-select: none;
  font-size: 0.9rem;
  letter-spacing: -0.12em;
  line-height: 1;
}
.drag-handle:active { cursor: grabbing; }

/* Let the editor toolbar wrap rather than scroll horizontally, so the app
   controls stay visible on narrower editor columns. */
.mdxeditor [role="toolbar"] {
  flex-wrap: wrap;
  overflow-x: visible;
  row-gap: 0.3rem;
}

/* App controls (Add / Revert / Save) live at the right of MDXEditor's own
   toolbar, pushed over with auto margin so formatting stays on the left. */
.mdx-toolbar-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.4rem;
}


.save-indicator {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 0.5rem;
}
.save-indicator[data-state="saving"] { color: var(--muted); }
.save-indicator[data-state="saved"] { color: #1e7a3a; }
.save-indicator[data-state="error"] { color: #dc2626; }

/* Add menu: a square "+" that opens a list of things to insert. */
.add-menu { position: relative; display: inline-flex; }
.add-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--fg);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.add-menu-trigger:hover,
.add-menu-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.add-menu-list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 20;
  min-width: 12rem;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.add-menu-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
}
.add-menu-item:hover { background: var(--accent-soft); }
.add-menu-item-label { font-size: 0.9rem; }
.add-menu-item-hint { font-size: 0.75rem; color: var(--muted); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Modal ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.modal-panel {
  position: relative;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: min(560px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover { color: var(--fg); }
.modal-body {
  padding: 1.2rem;
  overflow-y: auto;
}
.modal-footer {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.modal input[type="text"],
.modal input[type="date"],
.modal textarea,
.modal select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: white;
}
.modal textarea { resize: vertical; min-height: 60px; }
.modal label > span { color: var(--muted); }

/* Risk / decision block cards are Tailwind-styled in components (see
   src/components/blocks/BlockCard.tsx); only their .risk-block /
   .decision-block marker classes remain, for print.css to target. */

/* ```page-break blocks: a plain rule on screen, a forced break in print
   (print.css swaps one for the other). */
.print-page-break {
  margin: 1rem 0;
}
.print-page-break hr {
  border: none;
  border-top: 1px solid var(--line);
}


/* ===== Registers (risk register, decision log) ===== */
.register-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.register-filters .btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.register-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
}
.register-table-wrap { overflow-x: auto; }
.register-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.4;
}
.register-table th,
.register-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.register-table thead th {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.register-table tr[data-status="closed"] { opacity: 0.55; }
.register-help {
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.register-help:hover,
.register-help[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}
.register-legend {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}
.register-legend h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.register-legend p { margin: 0 0 0.75rem; font-size: 0.85rem; }
.register-legend ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.register-legend li { display: flex; align-items: baseline; gap: 0.6rem; }
/* Inside a log card the record loses its own card shell - the row's card is
   the frame - and lines up with the row's padding. */
.decision-log-detail .decision-block {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.register-legend code {
  font-size: 0.85em;
  background: var(--accent-soft);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

/* ===== Decision matrix ===== */
.decision-matrix {
  margin: 1rem 0;
  overflow-x: auto;
}
.decision-matrix table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.4;
}
.decision-matrix th,
.decision-matrix td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.decision-matrix thead th {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: transparent;
  border-bottom: 1px solid var(--line);
}
.decision-matrix tbody tr:last-child td { border-bottom: none; }
.decision-matrix .dm-option-td { font-weight: 600; white-space: nowrap; }
.decision-matrix .dm-notes-td { color: var(--muted); font-size: 0.85rem; }
.decision-matrix .dm-total-th,
.decision-matrix .dm-total-td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.decision-matrix tbody tr.is-best { background: var(--accent-soft); }
.decision-matrix tbody tr.is-best .dm-total-td {
  color: var(--accent);
  font-weight: 700;
}
.decision-matrix-empty {
  padding: 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
}

/* ---------- Sitemap ---------- */

.sitemap-wrap {
  overflow: auto;
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 1.5rem;
  margin: 1rem 0;
}
.sitemap-tree {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 100%;
}
.sitemap-node-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sitemap-node {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.875rem;
  background: var(--card);
  text-align: center;
  min-width: 7rem;
  box-shadow: var(--shadow);
}
.sitemap-node-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--fg);
}
.sitemap-node-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.125rem;
  white-space: nowrap;
}
.sitemap-children {
  display: flex;
  justify-content: center;
  padding-top: 32px;
  position: relative;
}
.sitemap-children::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  width: 1px;
  height: 50px;
  background: var(--line);
}
.sitemap-child {
  position: relative;
  padding: 32px 14px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sitemap-child::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}
.sitemap-child:first-child::before { left: 50%; }
.sitemap-child:last-child::before { right: 50%; }
.sitemap-child:first-child:last-child::before { display: none; }
.sitemap-child::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 1px;
  height: 16px;
  background: var(--line);
}
.sitemap-child:first-child:last-child::after {
  top: 0;
  height: 32px;
}
.sitemap-empty {
  text-align: center;
  padding: 1rem;
}
