:root {
  --bg: #f3efe5;
  --panel: rgba(255, 252, 246, 0.92);
  --ink: #1c2a1f;
  --muted: #56645b;
  --line: rgba(31, 56, 36, 0.12);
  --accent: #1f6a4f;
  --accent-soft: #d8eadf;
  --branch: #b96d2d;
  --leaf: #2f5b8a;
  --shadow: 0 22px 50px rgba(26, 32, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(185, 109, 45, 0.18), transparent 36%),
    radial-gradient(circle at top left, rgba(31, 106, 79, 0.16), transparent 40%),
    linear-gradient(180deg, #f8f4eb 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 58ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.current-top,
.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.pid,
.node-pid,
.node-models,
.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.node-models {
  font-size: 0.82rem;
}

.flat-link,
.flat-mini,
.node-link,
.breadcrumb a {
  color: inherit;
  text-decoration: none;
  transition: color 140ms ease, opacity 140ms ease;
}

.flat-link,
.flat-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(31, 106, 79, 0.22);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
}

.flat-link {
  padding: 10px 14px;
}

.flat-mini {
  min-width: 54px;
  padding: 8px 10px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.breadcrumb a {
  color: var(--accent);
  font-weight: 700;
}

.crumb-current {
  color: var(--ink);
  font-weight: 700;
}

.crumb-sep {
  color: rgba(28, 42, 31, 0.38);
}

.tree-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.tree-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  transition: background-color 140ms ease, border-color 140ms ease, transform 120ms ease;
}

.glyph {
  width: 18px;
  height: 18px;
  margin-top: 6px;
  border-radius: 5px;
  background: var(--accent);
}

.kind-branch .glyph {
  background: var(--branch);
}

.kind-leaf .glyph {
  background: var(--leaf);
}

.node-link {
  font-size: 1.08rem;
  font-weight: 700;
}

.tree-item:hover {
  background: rgba(31, 106, 79, 0.06);
  border-color: rgba(31, 106, 79, 0.32);
}

.tree-item:active {
  transform: translateY(1px);
}

.tree-item:hover .node-link {
  color: var(--accent);
}

.node-link:hover,
.breadcrumb a:hover,
.flat-link:hover,
.flat-mini:hover {
  opacity: 0.82;
}

.node-link:focus,
.flat-link:focus,
.flat-mini:focus,
.breadcrumb a:focus {
  outline: 2px solid rgba(31, 106, 79, 0.35);
  outline-offset: 2px;
}

.empty {
  margin: 16px 0 0;
  color: var(--muted);
}

.error-panel {
  border-color: rgba(168, 63, 46, 0.2);
}

@media (max-width: 720px) {
  .shell {
    width: min(100%, calc(100% - 20px));
    padding-top: 16px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .current-top,
  .section-head,
  .tree-item {
    gap: 12px;
  }

  .tree-item {
    grid-template-columns: 16px minmax(0, 1fr);
  }

  .flat-mini {
    grid-column: 2;
    justify-self: start;
  }
}
