:root {
  color-scheme: light;
  --ink: #20312b;
  --muted: #6f7c75;
  --paper: #f7f3e8;
  --surface: #fffdf7;
  --line: #ded8ca;
  --green: #235f48;
  --green-soft: #dce9de;
  --orange: #d87535;
  --orange-soft: #f8dfcb;
  --male: #56779f;
  --male-soft: #e2ebf5;
  --female: #b7627c;
  --female-soft: #f5e1e8;
  --unknown: #867d70;
  --shadow: 0 18px 45px rgba(55, 48, 35, 0.09);
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 4%, rgba(216, 117, 53, 0.09), transparent 27rem),
    var(--paper);
}

button, input { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.page-shell { min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(93, 83, 65, 0.16);
  background: rgba(247, 243, 232, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 12px;
  color: #fff;
  background: var(--green);
  font-family: "Newsreader", serif;
  font-size: 17px;
  box-shadow: 0 8px 20px rgba(35, 95, 72, 0.2);
}

.brand strong, .brand small { display: block; }
.brand strong { font-family: "Newsreader", serif; font-size: 21px; }
.brand small { margin-top: -2px; color: var(--muted); font-size: 11px; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.quiet-button, .source-link, .icon-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.8);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.icon-button { display: inline-flex; align-items: center; gap: 7px; }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button[aria-pressed="true"] { color: #fff; border-color: var(--green); background: var(--green); }

.source-link { color: #fff; border-color: var(--green); background: var(--green); }
.quiet-button:hover, .source-link:hover { transform: translateY(-1px); }

.app-layout {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

body.sidebar-collapsed .app-layout { grid-template-columns: 0 minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { visibility: hidden; overflow: hidden; padding-inline: 0; border-right: 0; }
body.sidebar-collapsed [data-sidebar-toggle] svg { transform: scaleX(-1); }

.sidebar {
  position: sticky;
  top: 76px;
  height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.55);
}

.search-panel label {
  display: block;
  margin: 0 0 9px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.search-field:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(35, 95, 72, 0.1); }
.search-field svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 12px 0; color: var(--ink); background: transparent; }
.search-field kbd { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #f4efe3; font-size: 10px; }

.sidebar-section { min-height: 0; display: flex; flex: 1; flex-direction: column; margin-top: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 5px 10px; font-size: 13px; font-weight: 700; }
.count-badge { padding: 2px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; }
.people-list { overflow: auto; padding-right: 5px; }

.person-list-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.person-list-button:hover, .person-list-button.active { background: var(--green-soft); }
.mini-avatar, .avatar { flex: 0 0 auto; border-radius: 50%; background: var(--unknown); }
.mini-avatar { width: 28px; height: 28px; }
.male { --accent: var(--male); --accent-soft: var(--male-soft); }
.female { --accent: var(--female); --accent-soft: var(--female-soft); }
.unspecified { --accent: var(--unknown); --accent-soft: #ece8e0; }
.mini-avatar.male, .avatar.male, .legend-dot.male { background: var(--male); }
.mini-avatar.female, .avatar.female, .legend-dot.female { background: var(--female); }
.mini-avatar.unspecified, .avatar.unspecified, .legend-dot.unspecified { background: var(--unknown); }
.person-list-button span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 15px 5px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.legend div { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }

.workspace { padding: 42px clamp(24px, 4vw, 68px) 72px; overflow: hidden; }
.workspace-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.eyebrow { margin: 0 0 7px; color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: "Newsreader", serif; font-weight: 600; }
h1 { max-width: 760px; font-size: clamp(34px, 5vw, 60px); line-height: 0.98; }
h2 { font-size: 32px; }
.person-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.meta-tag { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.56); border: 1px solid var(--line); font-size: 11px; }
.generation-pill { flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 700; }

.view-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.65);
}

.view-tab {
  padding: 9px 15px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.view-tab.active { color: #fff; background: var(--green); box-shadow: 0 4px 12px rgba(35, 95, 72, .18); }

.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 26px 0 20px; }
.stat-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 247, 0.65); }
.stat-card strong { display: block; font-family: "Newsreader", serif; font-size: 25px; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.relationship-stage { padding: clamp(20px, 3vw, 34px); border: 1px solid var(--line); border-radius: 24px; background: rgba(255,253,247,.76); box-shadow: var(--shadow); }
.group-label { margin-bottom: 11px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .11em; text-align: center; text-transform: uppercase; }
.card-row { display: flex; flex-wrap: wrap; gap: 10px; }
.card-row.centered { justify-content: center; }
.empty-state { color: var(--muted); font-size: 12px; font-style: italic; }

.person-chip {
  min-width: 170px;
  max-width: 230px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}
.person-chip:hover { transform: translateY(-2px); border-color: var(--accent, var(--green)); box-shadow: 0 8px 20px rgba(52,46,35,.08); }
.person-chip .avatar { width: 32px; height: 32px; border: 5px solid var(--accent-soft, #eee); box-shadow: inset 0 0 0 7px var(--accent, var(--unknown)); }
.chip-copy { min-width: 0; flex: 1; }
.chip-copy strong, .chip-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-copy strong { font-size: 12px; }
.chip-copy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.person-chip svg { width: 14px; fill: none; stroke: var(--muted); stroke-width: 1.6; }

.tree-connector { width: 1px; height: 25px; margin: 7px auto; background: var(--line); }
.focus-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(250px, 1.4fr) minmax(150px, 1fr); gap: 20px; align-items: center; }
.relation-side { min-width: 0; }
.side-card-stack { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.side-card-stack .person-chip { min-width: 0; width: 100%; }

.focus-card { position: relative; overflow: hidden; padding: 25px; border-radius: 20px; color: #fff; background: var(--green); text-align: center; }
.focus-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -55px; top: -65px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 22px rgba(255,255,255,.05), 0 0 0 45px rgba(255,255,255,.03); }
.focus-card .focus-avatar { width: 52px; height: 52px; margin: 0 auto 12px; border: 7px solid rgba(255,255,255,.22); border-radius: 50%; background: #fff; }
.focus-card h3 { position: relative; margin: 0; font-family: "Newsreader", serif; font-size: 26px; }
.focus-card p { position: relative; margin: 6px 0 0; color: rgba(255,255,255,.72); font-size: 11px; }

.union-list { display: grid; gap: 10px; }
.union-card { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(247,243,232,.55); }
.union-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.union-head strong { color: var(--ink); }
.children-row { display: flex; flex-wrap: wrap; gap: 8px; }
.children-row .person-chip { min-width: 150px; flex: 1 1 150px; }

.branches-section { margin-top: 52px; }
.content-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 18px; }
.content-heading > p { max-width: 360px; margin: 0; color: var(--muted); font-size: 12px; }
.branch-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.branch-card { position: relative; min-height: 150px; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: var(--surface); text-align: left; cursor: pointer; }
.branch-card::after { content: attr(data-index); position: absolute; right: 12px; bottom: -15px; color: rgba(35,95,72,.08); font-family: "Newsreader", serif; font-size: 76px; }
.branch-card:hover { border-color: var(--green); transform: translateY(-2px); }
.branch-card small { color: var(--orange); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.branch-card strong { display: block; max-width: 85%; margin-top: 20px; font-family: "Newsreader", serif; font-size: 20px; line-height: 1.05; }
.branch-card span { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }

.whole-tree-panel { min-width: 0; max-width: 100%; margin-top: 26px; }
.tree-panel-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.tree-panel-head p:last-child { max-width: 650px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.tree-tools { display: flex; align-items: center; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tree-tools button { width: 32px; height: 32px; border: 0; border-radius: 8px; color: var(--ink); background: var(--paper); font-weight: 700; cursor: pointer; }
.tree-tools button:hover { color: #fff; background: var(--green); }
.tree-tools button.reset { width: auto; padding: 0 11px; }
.tree-tools span { min-width: 42px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; }
.tree-key { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.tree-key span { display: flex; align-items: center; gap: 6px; }
.tree-key i { display: inline-block; width: 22px; height: 2px; }
.partner-line { background: var(--orange); }
.descent-line { background: var(--green); opacity: .55; }
.related-line { height: 0 !important; border-top: 2px dashed var(--orange); }
.radial-ring-key { height: 8px !important; border-top: 1px dashed #8c988f; border-bottom: 1px dashed #8c988f; }
.partnership-ring-key { height: 8px !important; border-radius: 3px; background: #e8c78f; }
.tree-canvas { min-height: 660px; overflow: auto; border: 1px solid var(--line); border-radius: 20px; background-color: #fcfaf3; background-image: radial-gradient(rgba(64, 86, 75, .11) .7px, transparent .7px); background-size: 18px 18px; box-shadow: var(--shadow); }
.tree-canvas svg { display: block; transform-origin: top left; }
.tree-svg-generation { fill: var(--muted); font-size: 11px; font-family: "DM Sans", sans-serif; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.tree-svg-generation-line { stroke: #ded8ca; stroke-width: 1; stroke-dasharray: 4 7; }
.tree-svg-descent { fill: none; stroke: rgba(35, 95, 72, .52); stroke-width: 1.4; stroke-linecap: square; stroke-linejoin: miter; shape-rendering: geometricPrecision; }
.tree-svg-partner { stroke: var(--orange); stroke-width: 2.2; }
.tree-svg-related-union { fill: none; stroke: rgba(216, 117, 53, .72); stroke-width: 1.5; stroke-dasharray: 5 4; stroke-linecap: square; stroke-linejoin: miter; }
.tree-family-boundary { fill: rgba(255, 253, 247, .92); stroke: #cfc7b7; stroke-width: 1; stroke-dasharray: 3 3; rx: 15; }
.tree-family-label { fill: var(--muted); font-family: "DM Sans", sans-serif; font-size: 7.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tree-family-unit { isolation: isolate; }
.tree-svg-node { cursor: pointer; transition: opacity .15s ease; }
.tree-svg-node:hover rect { stroke-width: 2.4; filter: drop-shadow(0 5px 5px rgba(40, 46, 38, .16)); }
.tree-svg-node rect { stroke-width: 1.2; rx: 11; }
.tree-svg-node.male rect { fill: var(--male-soft); stroke: var(--male); }
.tree-svg-node.female rect { fill: var(--female-soft); stroke: var(--female); }
.tree-svg-node.unspecified rect { fill: #ece8e0; stroke: var(--unknown); }
.tree-svg-node text { fill: var(--ink); font-family: "DM Sans", sans-serif; font-size: 10px; font-weight: 700; pointer-events: none; }
.tree-svg-node .node-meta { fill: var(--muted); font-size: 7.5px; font-weight: 500; }
.tree-svg-node.selected rect { stroke: var(--orange); stroke-width: 3; filter: drop-shadow(0 0 9px rgba(216, 117, 53, .5)); }
.tree-svg-node.selected text { fill: #8b431e; }

.radial-canvas {
  width: 100%;
  max-width: 100%;
  height: 720px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  contain: layout paint;
  background-image: none;
  touch-action: none;
}
.radial-canvas > svg { margin-inline: auto; }
[data-expanded-radial-canvas] { cursor: grab; user-select: none; }
[data-expanded-radial-canvas].is-panning { cursor: grabbing; }
[data-expanded-radial-canvas].is-panning .radial-person,
[data-expanded-radial-canvas].is-panning .radial-union { cursor: grabbing; }
.radial-canvas.is-zooming .radial-person path,
.radial-canvas.is-zooming .radial-union path {
  transition: none;
  filter: none;
}
.radial-canvas.is-zooming .radial-person text,
.radial-canvas.is-zooming .radial-union text,
.radial-canvas.is-zooming .radial-guides text,
.radial-canvas.is-zooming .radial-branch-label {
  display: none;
}
.radial-sector { stroke: rgba(255,255,255,.8); stroke-width: 5; }
.radial-sector.green { fill: rgba(77, 135, 99, .10); }
.radial-sector.gold { fill: rgba(209, 159, 68, .11); }
.radial-sector.blue { fill: rgba(82, 132, 164, .10); }
.radial-sector.rose { fill: rgba(184, 102, 116, .10); }
.radial-sector.sage { fill: rgba(125, 151, 108, .11); }
.radial-sector.amber { fill: rgba(216, 117, 53, .09); }
.radial-sector.teal { fill: rgba(61, 142, 139, .10); }
.radial-sector.plum { fill: rgba(134, 103, 142, .10); }
.radial-guides circle { fill: none; stroke: rgba(57, 77, 66, .22); stroke-width: 1.2; stroke-dasharray: 5 8; }
.radial-guides circle.union-guide { stroke: rgba(180, 119, 43, .42); stroke-dasharray: 2 5; }
.radial-guides text { fill: var(--muted); font-family: "DM Sans", sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.radial-branch-label { fill: var(--green); font-family: "Newsreader", serif; font-size: 17px; font-weight: 600; }
.radial-person { cursor: pointer; }
.radial-person path { stroke: rgba(255,255,255,.96); stroke-width: 2; transition: filter .15s ease, opacity .15s ease; }
.radial-person.male path { fill: #dceaf3; }
.radial-person.female path { fill: #f2dfe2; }
.radial-person.unspecified path { fill: #e8e4dc; }
.radial-person text { fill: var(--ink); font-family: "DM Sans", sans-serif; font-size: 10px; font-weight: 700; pointer-events: none; }
.radial-person:hover path { filter: brightness(.96) drop-shadow(0 3px 4px rgba(40, 46, 38, .18)); }
.radial-person.selected path { stroke: var(--orange); stroke-width: 5; filter: drop-shadow(0 0 10px rgba(216, 117, 53, .58)); }
.radial-person.selected text { fill: #8b431e; }
.radial-union { cursor: pointer; }
.radial-union path { fill: #efdcb8; stroke: rgba(255,255,255,.96); stroke-width: 2; transition: filter .15s ease; }
.radial-union text { fill: #754f22; font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 700; pointer-events: none; }
.radial-union:hover path { fill: #e8cf9f; filter: drop-shadow(0 3px 4px rgba(72, 53, 28, .16)); }
.radial-union.selected path { stroke: var(--orange); stroke-width: 5; filter: drop-shadow(0 0 10px rgba(216, 117, 53, .58)); }

.person-context-menu {
  position: fixed;
  z-index: 60;
  width: min(230px, calc(100vw - 24px));
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(35, 49, 43, .2);
}
.person-context-heading { padding: 8px 10px 9px; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: .08em; }
.person-context-menu button { width: 100%; padding: 10px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; font-size: 12px; font-weight: 600; cursor: pointer; }
.person-context-menu button:hover, .person-context-menu button:focus-visible { outline: 0; color: #fff; background: var(--green); }

body.radial-maximized { overflow: hidden; }
body.radial-maximized .topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
}
body.radial-maximized .app-layout {
  display: block;
  min-height: 0;
  padding-top: 76px;
}
body.radial-maximized .sidebar,
body.radial-maximized .workspace-head,
body.radial-maximized .view-tabs,
body.radial-maximized [data-panel="radial-expanded"] .tree-key,
body.radial-maximized [data-panel="radial-expanded"] .tree-panel-head { display: none; }
body.radial-maximized .workspace { height: calc(100vh - 76px); padding: 0; }
body.radial-maximized [data-panel="radial-expanded"] { height: 100%; display: flex; flex-direction: column; margin: 0; }
body.radial-maximized [data-expanded-radial-canvas] { flex: 1; height: auto; min-height: 0; border-radius: 0; }
body.radial-maximized .header-actions > .tree-tools { flex: 0 0 auto; padding: 3px; border-radius: 999px; background: rgba(255, 253, 247, .82); }
body.radial-maximized .header-actions > .tree-tools button { height: 30px; }

.error-panel { padding: 30px; border: 1px solid #e7b5ad; border-radius: 18px; color: #7d3128; background: #fff1ee; }

@media (max-width: 1040px) {
  .branch-grid { grid-template-columns: repeat(2, 1fr); }
  .focus-row { grid-template-columns: 1fr 1.3fr; }
  .focus-row .relation-side:first-child { grid-column: 1 / -1; }
  .focus-row .relation-side:first-child .side-card-stack { flex-direction: row; flex-wrap: wrap; }
  body.radial-maximized .quiet-button,
  body.radial-maximized .source-link { display: none; }
}

@media (max-width: 760px) {
  .topbar { padding: 10px 15px; }
  .brand small, .quiet-button { display: none; }
  .icon-button span { display: none; }
  .app-layout { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  body.sidebar-collapsed .sidebar { display: none; }
  .sidebar-section { margin-top: 12px; }
  .people-list { display: flex; gap: 5px; overflow-x: auto; }
  .person-list-button { min-width: max-content; width: auto; }
  .legend { display: none; }
  .workspace { padding: 28px 15px 50px; }
  .workspace-head { display: block; }
  .generation-pill { display: inline-block; margin-top: 15px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .focus-row { display: flex; flex-direction: column; }
  .focus-card, .relation-side { width: 100%; }
  .side-card-stack { flex-direction: row; overflow-x: auto; }
  .side-card-stack .person-chip { min-width: 180px; }
  .content-heading { display: block; }
  .content-heading > p { margin-top: 8px; }
  .tree-panel-head { display: block; }
  .tree-tools { width: max-content; margin-top: 13px; }
  .tree-canvas { min-height: 560px; }
  .radial-canvas { height: 600px; min-height: 0; }
  body.radial-maximized .workspace { height: calc(100vh - 76px); padding: 0; }
  body.radial-maximized .topbar { justify-content: flex-end; padding-inline: 8px; }
  body.radial-maximized .topbar .brand,
  body.radial-maximized .header-actions > :not(.tree-tools):not([data-expanded-radial-maximize]) { display: none !important; }
  body.radial-maximized .header-actions { width: 100%; justify-content: flex-end; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  body.radial-maximized .header-actions::-webkit-scrollbar { display: none; }
  body.radial-maximized .header-actions > .tree-tools { display: flex !important; flex: 0 0 auto; width: auto; margin: 0; }
  body.radial-maximized .header-actions > .tree-tools button { width: 28px; height: 28px; }
  body.radial-maximized .header-actions > .tree-tools button.reset { width: auto; padding-inline: 7px; }
  body.radial-maximized .header-actions > .tree-tools span { min-width: 32px; }
  body.radial-maximized [data-expanded-radial-maximize] { display: inline-flex !important; }
  body.radial-maximized [data-expanded-radial-maximize] span { display: inline; }
  body.radial-maximized [data-expanded-radial-maximize] svg { display: none; }
}

@media (max-width: 480px) {
  .source-link { padding: 9px 11px; font-size: 11px; }
  .branch-grid { grid-template-columns: 1fr; }
  h1 { font-size: 38px; }
}
