:root {
  --ground: #F5F6F1;
  --surface: #FFFFFF;
  --ink: #15211A;
  --ink-2: #2C3A31;
  --muted: #4A5850;
  --line: #DDE1D8;
  --line-2: #EEF0EA;
  --head: #F0F3EC;
  --vine: #1F4A2E;
  --vine-2: #2E6B43;
  --leaf: #9BD08F;
  --pumpkin: #E8681E;
  --pumpkin-ink: #B4470C;
  --pumpkin-tint: #FCE9DC;
  --pumpkin-line: #F3D3BF;
  --dmg: #7A2424;
  --display: 'Bricolage Grotesque', 'Archivo', system-ui, sans-serif;
  --body: 'Archivo', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.45; font-variant-numeric: tabular-nums; }
a { color: var(--pumpkin-ink); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--pumpkin); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -0.015em; margin: 0; }
h3 { margin: 0; font-weight: 700; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; left: -9999px; }

/* Header */
.top { background: var(--vine); color: #fff; }
.top .bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; padding: 12px 0; }
.brand span { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.nav { display: flex; flex-wrap: wrap; gap: 0 24px; flex: 1 1 360px; }
.nav a { color: #E4EFE3; text-decoration: none; padding: 20px 0 17px; border-bottom: 3px solid transparent; font-weight: 500; }
.nav a.on { color: #fff; border-bottom-color: var(--pumpkin); font-weight: 600; }
.search { display: flex; gap: 8px; flex: 0 1 360px; min-width: 240px; }
.search input { flex: 1; min-width: 0; height: 38px; border: 0; border-radius: 8px; padding: 0 12px; background: #fff; color: var(--ink); }
.btn { height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid #C9CFC4; background: #fff; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.btn.primary { background: var(--pumpkin); border-color: var(--pumpkin); color: var(--ink); font-weight: 700; }
.btn.dark { background: var(--vine); border-color: var(--vine); color: #fff; }
.btn:hover { border-color: var(--ink); }

/* Layout pieces */
main { min-height: 60vh; }
.page { padding-top: 24px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.panel > .ph { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.panel > .ph h2 { font-size: 20px; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: #EEF0EA; color: var(--ink); }
.tag.dmg { background: #F5E4E4; color: var(--dmg); }
.tag.exh { background: var(--pumpkin-tint); color: #8A3608; }
.tag.ok { background: #E2EFE0; color: var(--vine); }
.seg { display: inline-flex; border: 1px solid #C9CFC4; border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: #fff; padding: 0 12px; height: 34px; cursor: pointer; font-weight: 500; }
.seg button + button { border-left: 1px solid #C9CFC4; }
.seg button.on { background: var(--vine); color: #fff; }
.tabs { display: flex; gap: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; padding: 10px 0; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--pumpkin); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 0; }
.facts > div { padding: 12px 16px; border-right: 1px solid var(--line-2); }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 4px 0 0; font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.01em; }
.facts dd small { display: block; font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--head); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr:hover td { background: #FAFBF8; }
.tbl .w { font-family: var(--display); font-weight: 800; font-size: 17px; white-space: nowrap; }
.tbl .w.big { font-size: 20px; }
.tbl .w.first { color: var(--pumpkin-ink); }
.tbl .cross { font-family: var(--mono); font-size: 12.5px; }
.tbl a.row-link { color: var(--ink); text-decoration: none; }
.tbl a.row-link:hover { text-decoration: underline; }

/* Hero */
.hero { background: var(--vine); color: #fff; padding: 40px 0 80px; }
.hero .wrap { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.hero h1 { font-size: 52px; line-height: 1.02; letter-spacing: -0.025em; max-width: 640px; }
.hero p { color: #D8E6DA; font-size: 18px; max-width: 580px; margin: 12px 0 0; }
.ticket { background: #fff; color: var(--ink); border-radius: 10px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); flex: 1 1 360px; max-width: 460px; }
.ticket .th { display: flex; justify-content: space-between; border-bottom: 1px dashed #C9CFC4; padding-bottom: 12px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; color: var(--muted); }
.ticket .big { font-family: var(--display); font-weight: 800; font-size: 72px; line-height: 1; letter-spacing: -0.03em; margin-top: 16px; }
.ticket .big small { font-size: 26px; margin-left: 6px; }
.ticket dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed #C9CFC4; }
.ticket dt { font-size: 12px; color: var(--muted); }
.ticket dd { margin: 0; font-weight: 700; font-size: 18px; }
.float-card { margin-top: -44px; position: relative; }

/* Pedigree */
.ped-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ped-tools .grow { flex: 1; }
/* The pedigree breaks out of the page column to use the whole window; the page scrolls, not the tree. */
.ped-full { margin-left: min(0px, calc(50% + 24px - 50vw)); margin-right: min(0px, calc(50% + 24px - 50vw)); }
.ped-scroll { overflow-x: auto; overflow-y: hidden; background: #FAFBF8; cursor: grab; }
.ped-scroll.panning { cursor: grabbing; user-select: none; }
.ped-full .split > .side { flex-basis: 280px; }
.ped-side-inner { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.ped-canvas { position: relative; }
.ped-line { position: absolute; background: #B9C2B4; }
.ped-line.dash { background: transparent; border-top: 2px dashed var(--pumpkin-ink); }
.pnode { position: absolute; }
.pcard { width: 100%; text-align: left; border-radius: 8px; padding: 8px 12px; border: 1px solid #C9CFC4; background: #fff; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-start; gap: 3px; height: 100%; line-height: 1.3; overflow: hidden; }
.pcard .role { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; padding-right: 26px; }
.pcard .nm { font-family: var(--mono); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .sb { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard.root { background: var(--vine); border-color: var(--vine); color: #fff; }
.pcard.root .role, .pcard.root .sb { color: #C9DCCB; }
.pcard.sel { box-shadow: 0 0 0 2px var(--pumpkin); }
.pcard.pseudo { background: #FAFBF8; border-style: dashed; cursor: default; }
.pcard.amb { background: #FFF8F2; border: 1px dashed var(--pumpkin-ink); }
.pcard .grew { margin-top: 4px; padding-top: 4px; border-top: 1px dashed #D9DED3; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard.root .grew { border-top-color: rgba(255,255,255,0.25); color: #E4EFE3; }
.pcard .grew b { font-family: var(--mono); font-weight: 600; }
.plantcard { position: absolute; line-height: 1.3; border-radius: 8px; padding: 7px 12px; background: var(--pumpkin-tint); border: 1px dashed #E3A47C; font-size: 12px; display: flex; flex-direction: column; gap: 1px; cursor: pointer; text-align: left; }
.plantcard .role { font-size: 11px; color: #8A3608; }
.plantcard .nm { font-family: var(--mono); font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.plantcard.none { background: #F7F5F2; border-color: #C9CFC4; cursor: default; }
.plantcard.none .role { color: var(--muted); }
.ptog { position: absolute; right: -13px; width: 26px; height: 26px; border-radius: 6px; border: 1px solid #8E9A90; background: #fff; font-weight: 700; cursor: pointer; padding: 0; line-height: 1; z-index: 2; }
.ptog.compact { right: -10px; width: 20px; height: 20px; border-radius: 5px; font-size: 13px; }
/* Fruit names sit over the card button so they can be real links. */
.pname { position: absolute; left: 13px; top: 27px; max-width: calc(100% - 32px); font-family: var(--mono); font-weight: 600; font-size: 13px; line-height: 17px; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2; }
.pname:hover, .pname:focus-visible { color: var(--pumpkin-ink); text-decoration: underline; text-underline-offset: 2px; }
.pname.on-root { color: #fff; }
.pname.on-root:hover, .pname.on-root:focus-visible { color: #fff; }
.pname.compact { left: 10px; top: 0; line-height: 26px; font-size: 12px; max-width: calc(100% - 50px); }
.pcard.compact { padding: 0; border-radius: 6px; }
.pcard.pline { display: block; padding: 0 10px; line-height: 24px; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.pcard.pline { color: var(--ink); text-decoration: none; cursor: pointer; }
a.pcard.pline:hover { text-decoration: underline; }
.phbtn.compact { top: 2px; right: 13px; height: 20px; width: 24px; }
.phbtn { position: absolute; top: 6px; right: 20px; width: 26px; height: 22px; border-radius: 6px; border: 1px solid transparent; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 3; color: var(--muted); }
.phbtn:hover, .phbtn:focus-visible { background: #EEF0EA; border-color: #C9CFC4; }
.phbtn.has { color: var(--pumpkin-ink); }
.phbtn.on-root { color: #C9DCCB; }
.phbtn.on-root.has { color: #F4A56A; }
.phbtn.on-root:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
.phtip { position: fixed; z-index: 50; width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(21,33,26,0.16); padding: 8px; font-size: 12.5px; line-height: 1.4; display: none; }
.phtip.show { display: block; }
.phtip button.thumb { display: block; width: 100%; padding: 0; border: 0; background: #E9ECE4; border-radius: 6px; overflow: hidden; cursor: zoom-in; }
.phtip img { display: block; width: 100%; height: 180px; object-fit: cover; }
.phtip .cap { margin-top: 6px; }
.phtip .cap b { font-family: var(--mono); font-weight: 600; }
.phtip .none { height: 120px; border-radius: 6px; background: #F5F6F1; border: 1px dashed #C9CFC4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-align: center; padding: 8px; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(21,33,26,0.72); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal .dlg { background: #fff; border-radius: 10px; max-width: min(1100px, 96vw); max-height: 94vh; display: flex; flex-direction: column; overflow: hidden; }
.modal .dlg img { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; background: #15211A; }
.modal .bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 16px; font-size: 14px; }
.modal .bar b { font-family: var(--mono); }
.hdr-photo { width: 120px; height: 90px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); padding: 0; cursor: zoom-in; background: #E9ECE4; flex: none; }
.hdr-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ped-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .main { flex: 999 1 640px; min-width: 0; }
.split > .side { flex: 1 1 320px; min-width: 0; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; margin: 0; padding: 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; }
.callout { border-radius: 10px; padding: 16px; background: var(--pumpkin-tint); border: 1px solid var(--pumpkin-line); }
.callout h3 { font-size: 15px; margin-bottom: 6px; }
.empty { padding: 24px; color: var(--muted); }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }

footer.site { background: #15211A; color: #C8D6CA; margin-top: 48px; }
footer.site .wrap { padding: 24px; font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer.site a { color: #fff; }

@media (max-width: 640px) {
  .hero h1 { font-size: 38px; }
  .ticket .big { font-size: 56px; }
  .wrap { padding: 0 16px; }
}
