.disciplines {
  --width: 1360px;
  --ground: #0e1319;
  --panel: #151c24;
  --line: #5f5541;
  --ink: #f0e6d0;
  --muted: #b7b5b0;
  --gold: #dac298;
  --tree-ink: #10151c;
  --tree-border: #8d795777;
}
.disciplines > header { margin-top: clamp(18px, 3vw, 32px); }
.disciplines > header h1 {
  margin-block: .15em .45em;
  font-size: clamp(1.85rem, 4.6vw, 3.1rem);
  line-height: 1.12;
  text-wrap: balance;
}
.discipline-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--tree-border); }
.discipline-controls p { margin: 0 0 0 auto; color: var(--muted); font-size: .86rem; }
.discipline-controls label, .tree-tools label { color: var(--muted); font-size: .86rem; }
.discipline-controls select, .tree-tools select, .tree-tools button {
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  padding: .35em .65em;
  background: #131a22;
  border-color: var(--tree-border);
  font-size: .9rem;
}
.discipline-controls select { width: min(100%, 315px); }
.discipline-entry {
  margin-block: 12px 18px;
  overflow-wrap: anywhere;
}
.tree-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 920px) {
  .tree-layout { grid-template-columns: minmax(0, 1fr) minmax(225px, 26%); }
}
.tree-board, .tree-inspector { min-width: 0; }
.tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 7px; }
.tree-tools select { flex: 1 1 130px; }
.tree-zoom { display: flex; gap: 4px; }
.tree-zoom button { min-width: 33px; }
.tree-zoom button:disabled { opacity: .45; cursor: default; }
.tree-tools .tree-base[aria-pressed="true"] { color: #ffe4ad; border-color: #bea575; background: #292823; }
.tree-frame {
  padding: 6px;
  border: 1px solid var(--tree-border);
  border-radius: 6px;
  background: var(--tree-ink);
  box-shadow: inset 0 0 0 3px #0a0f15, inset 0 0 0 4px #bea57526;
}
.tree-plate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(5px, 1vw, 12px);
  min-height: 39px;
  padding-inline: 6px;
  text-align: center;
}
.tree-plate b { display: flex; align-items: center; gap: 6px; color: var(--gold); font: 500 clamp(.86rem, 2vw, 1.24rem)/1.15 Georgia, serif; }
.tree-plate img { flex: 0 0 24px; width: 24px; height: 24px; object-fit: contain; }
.tree-plate span { height: 24px; background: url("art/spellbook-inlay.webp") left center / min(100%, 86px) auto no-repeat, linear-gradient(#bea57555, #bea57555) center / 100% 1px no-repeat; }
.tree-plate span:last-child { transform: scaleX(-1); }
.tree-viewport {
  overflow: auto;
  background: var(--tree-ink);
  scrollbar-color: #776a50 var(--tree-ink);
}
.tree-viewport:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.tree-canvas {
  position: relative;
  width: var(--tree-width, 100%);
  height: clamp(260px, 43vw, 400px);
  container-type: inline-size;
}
.tree-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tree-edges path { fill: none; vector-effect: non-scaling-stroke; }
.tree-edges .edge-rim { stroke: #515866; stroke-width: 2.7; }
.tree-edges .edge-core { stroke: #171e28; stroke-width: 1; }
.tree-edges .on-route .edge-rim { stroke: #a98a52; stroke-width: 3; }
.tree-edges .on-route .edge-core { stroke: #ffe3a4; stroke-width: 1; }
.tree-node {
  position: absolute;
  left: var(--node-x);
  top: var(--node-y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(22px, 7.8cqw, 36px);
  aspect-ratio: 1;
  padding: 0;
  --medallion-rim: #7d8695;
  background: radial-gradient(circle, #202c38, #121b23 67%);
  color: #bdc5d0;
  border: 1px solid var(--medallion-rim);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #262d36, inset 0 0 0 3px #7d86955e, 0 2px 3px #0009;
  font: 600 clamp(.58rem, 1.65cqw, .8rem)/1 Georgia, serif;
}
.tree-trial { --medallion-rim: #ae90c5; color: #dcc8ec; }
.tree-trial::after { content: "✧"; position: absolute; top: -4px; right: -3px; color: #ceb4e2; font-size: .65rem; }
.tree-node.on-route { --medallion-rim: #c6ac78; color: #f3e4c4; }
.tree-node[aria-pressed="true"] {
  z-index: 2;
  --medallion-rim: #f3dca4;
  color: #ffeac0;
  box-shadow: inset 0 0 0 2px #2e2d27, inset 0 0 0 3px #cbb47d8f, 0 0 0 2px #16191e, 0 0 0 3px #e6cd9380, 0 0 14px #dbc17a53;
}
.tree-node:hover { z-index: 3; border-color: #ffe3ac; }
.tree-node:focus-visible { z-index: 4; outline-offset: 2px; }
.tree-label {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 10.4cqw;
  color: #c6c5c0;
  font-size: clamp(.67rem, 1.5cqw, .86rem);
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}
.tree-node[aria-pressed="true"] .tree-label { color: #ffe2a0; font-weight: 700; }
#knives .tree-label { width: 8.8cqw; text-wrap: balance; }
.tree-label > span {
  background: var(--tree-ink);
  box-shadow: .12em 0 var(--tree-ink), -.12em 0 var(--tree-ink);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.tree-wing {
  position: absolute;
  left: var(--node-x);
  top: 2%;
  transform: translateX(-50%);
  width: 34%;
  color: #cfb782;
  font: 600 clamp(.55rem, 1.55cqw, .82rem)/1.05 Georgia, serif;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}
@container (max-width: 559px) {
  .tree-label { display: none; }
}
.tree-inspector { background: var(--tree-ink); border: 1px solid var(--tree-border); border-radius: 5px; box-shadow: inset 0 0 0 3px #0b1118; }
.form-sheet { padding: clamp(12px, 2vw, 18px); }
.form-sheet + .form-sheet { border-top: 1px solid var(--line); }
.form-sheet h3 { margin: .22em 0 .4em; font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.12; }
.form-sheet p { margin: .55em 0; }
.form-sheet .kicker { margin: 0; color: var(--gold); }
.form-sheet p:last-child { margin-bottom: 0; }
.fractal-cost { color: var(--gold); font-size: .91rem; }
.form-prereq, .next-forms, .fractal-notes { border-top: 1px solid var(--tree-border); padding-top: .6em; }
.fractal-notes { font-size: .92rem; }
.fractal-notes dt { font-weight: 650; }
.fractal-notes dd { margin: 0 0 .6em; color: var(--muted); }
.tree-help { margin-bottom: 25px; padding: 10px 0; border-top: 1px solid var(--tree-border); color: var(--muted); }
.tree-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
