/* Shared compact controls. Load after page styles and theme.css.
   Keep native form semantics; image cards and content rows are not controls. */
:root {
  --control-height: 32px;
  --control-radius: 10px;
  --control-font: 12px;
  --control-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234c6b59' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
  --control-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b2c9b8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --control-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b2c9b8' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  }
}
:is(.site-page, .plant-page) {
  --control-border: color-mix(in srgb, var(--ink) 22%, var(--bg));
  --control-hover-border: color-mix(in srgb, var(--accent) 55%, var(--bg));
}

/* Explicit heights and appearance also apply to Safari's native selects. */
:root :is(.site-page, .plant-page) :is(select, input[type="search"], input[type="text"], input[type="number"], input[type="email"]),
:root #help-search {
  box-sizing: border-box;
  height: var(--control-height);
  min-height: var(--control-height);
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background-color: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--control-font);
  font-weight: 400;
  line-height: 1.3;
  box-shadow: none;
}
:root :is(.site-page, .plant-page) select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 30px;
  background-image: var(--control-chevron);
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  cursor: pointer;
  text-overflow: ellipsis;
}
:root :is(.site-page, .plant-page) :is(input[type="search"], input[type="text"], input[type="email"]) { -webkit-appearance: none; appearance: none; }
:root :is(.site-page, .plant-page) input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
:root input[type="number"]::-webkit-inner-spin-button,
:root input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:root :is(.site-page, .plant-page) :is(select, input, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
:root :is(.site-page, .plant-page) :is(select, input):hover:not(:disabled) { border-color: var(--control-hover-border); }
:root :is(.site-page, .plant-page) :is(input, textarea)::placeholder { color: var(--muted); opacity: .85; }
:root :is(#danmaku-text, #market-feedback-text) { padding: 10px; border-color: var(--control-border); border-radius: var(--control-radius); }

/* Action buttons share one frame; primary actions retain their fill. */
:root :is(.button, .nav-cta, .market-action, .market-nav-trigger, .atlas-reset, .atlas-more, .atlas-parent-back, .guide-more, .guide-dialog button, .guide-photo-choice, .help-nav a, .scene-options button, .experience-heading button, .dialog-heading button, .evening-trigger) {
  box-sizing: border-box;
  min-height: var(--control-height);
  padding: 6px 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  font-family: inherit;
  font-size: var(--control-font);
  font-weight: 550;
  line-height: 18px;
  text-decoration: none;
  cursor: pointer;
}
:root :is(.button, .nav-cta, .market-action, .atlas-reset, .atlas-more, .guide-more, .help-nav a, .evening-trigger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
:root :is(.button, .nav-cta) { border-color: transparent; }
:root :is(#danmaku-send, #market-feedback-send) { min-height: var(--control-height); padding: 6px 10px; border: 1px solid transparent; border-radius: var(--control-radius); font-family: inherit; font-size: var(--control-font); font-weight: 550; line-height: 18px; }
:root :is(.market-action, .market-nav-trigger, .atlas-reset, .atlas-more, .atlas-parent-back, .guide-more, .guide-dialog button, .help-nav a, .experience-heading button, .dialog-heading button, .evening-trigger) {
  background: var(--card);
  color: var(--accent);
}
:root :is(.market-action, .atlas-reset, .atlas-more, .help-nav a, .evening-trigger):hover:not(:disabled) { background: var(--soft); border-color: var(--control-hover-border); }
:root :is(.site-page, .plant-page) :is(button, select, input):disabled { cursor: default; }

/* Header: equal frames, aligned glyphs, and a shorter language selector. */
:root .site-language select,
:root .site-theme > summary,
:root .site-header .mobile-menu > summary {
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background-color: var(--card);
}
:root :is(.site-page, .plant-page) .site-language select { width: 100px; max-width: 100px; padding-inline-start: 9px; font-size: 11px; }
:root .site-theme > summary,
:root .site-header .mobile-menu > summary { width: var(--control-height); padding: 6px; }
:root .site-theme > summary > svg,
:root .site-header .mobile-menu > summary > svg { width: 16px; height: 16px; }
:root .arrow-button { width: var(--control-height); height: var(--control-height); padding: 6px; border: 1px solid var(--control-border); border-radius: var(--control-radius); background: var(--card); }
:root .site-theme-menu { width: 196px; padding: 5px; border-radius: 12px; }
:root .site-theme-menu button { min-height: var(--control-height); padding: 6px 8px; font-size: var(--control-font); line-height: 18px; border-radius: 7px; gap: 8px; }
:root .site-header .nav-cta { min-height: var(--control-height); padding-inline: 13px; }

/* Keep filter groups compact instead of stretching every field across a row. */
:root .market-filters { max-width: 900px; gap: 10px; align-items: end; }
:root .atlas-filters { max-width: 820px; gap: 10px; }
:root .atlas-filters.atlas-parent-filters { max-width: 620px; }
:root .market-navigation .store-switch { flex: 0 1 auto; width: 160px; max-width: 100%; }
:root .rank-search { width: min(100%, 160px); }
:root .insight-select select { max-width: 172px; }
:root .guide-controls input { width: min(280px, 100%); }
:root .monstera-filters input { flex-basis: 200px; max-width: 320px; }
:root #help-search { display: block; max-width: 580px; margin-block: 10px 18px; }
@media (width > 1100px) {
  :root .market-filters { grid-template-columns: minmax(150px, 1.5fr) repeat(2, minmax(112px, 1fr)) repeat(2, minmax(92px, .8fr)) minmax(106px, 1fr) minmax(118px, 1fr); }
}

/* Segmented tabs are a compact group, with the same corner geometry. */
:root .hub-switch { border-radius: var(--control-radius); }
:root :is(.hub-switch button, .atlas-switch button, .atlas-roles button) {
  min-height: var(--control-height);
  padding: 6px 10px;
  border-radius: 7px;
  font-size: var(--control-font);
  line-height: 18px;
}
:root .atlas-source-button { min-height: var(--control-height); }
:root .danmaku-controls button { min-height: var(--control-height); border-radius: var(--control-radius); font-size: var(--control-font); }
:root .danmaku-launch { padding: 6px 10px; }
:root .danmaku-controls svg { width: 18px; height: 18px; }
:root .danmaku-controls:not(.is-expanded) .danmaku-launch { width: var(--control-height); height: var(--control-height); padding: 6px; }
:root .danmaku-menu { border-radius: 12px; }
:root .danmaku-menu button { padding: 6px 8px; line-height: 18px; border-radius: 7px; }
@media (max-width: 1000px) {
  :root .site-header .nav-shell { grid-template-columns: minmax(0, 1fr) auto var(--control-height) var(--control-height); }
  :root .site-header .nav-shell > .nav-cta { display: none; }
}
@media (max-width: 900px) {
  :root { --control-height: 36px; }
  /* Keep idle text compact; focus uses 16px to prevent iPhone keyboard zoom. */
  :root :is(.site-page, .plant-page) :is(select, input[type="search"], input[type="text"], input[type="number"], input[type="email"]),
  :root #help-search { font-size: 14px; }
  :root :is(.site-page, .plant-page) :is(input[type="search"], input[type="text"], input[type="number"], input[type="email"]):focus,
  :root #help-search:focus { font-size: 16px; }
  :root .site-header .site-language select,
  :root .plant-page .site-language select { width: 90px; max-width: 90px; font-size: 11px; }
  :root .market-navigation.has-page-title #market-nav-trigger { width: var(--control-height); }
  :root .market-navigation .store-switch { width: 160px; }
  :root .insight-select select { max-width: 190px; }
}
@media (max-width: 620px) {
  :root .danmaku-controls:not(.is-expanded) .danmaku-launch { border-top-right-radius: 0; border-bottom-right-radius: 0; }
}
@media (max-width: 360px) {
  :root .site-header .site-language select { width: 76px; max-width: 76px; padding-inline: 7px 22px; font-size: 11px; background-position: right 5px center; background-size: 12px; }
  :root .market-navigation .store-switch { width: 148px; }
}

/* Palette, type and segmented controls copied from the current website. */
html[data-visual="botanical-glass"] {
  --glass-bg: #eff5f0;
  --glass-ink: #203b2f;
  --glass-muted: #586c60;
  --glass-card: #ffffffc9;
  --glass-accent: #286348;
  --glass-soft: #e3ede5;
  --glass-line: #ffffffd6;
  --glass-rule: #c8d6cb;
  --glass-nav: #f3f8f1;
  --glass-overlay: #f9fcf8;
  --glass-overlay-line: #d5e1d6;
  --glass-shadow: 0 14px 42px #315c4110;
  --glass-radius: 28px;
  --glass-ui: -apple-system,BlinkMacSystemFont,"SF Pro Display","PingFang SC",sans-serif;
  --site-nav-height: 68px;
  background:var(--glass-nav);
}
html[data-visual="botanical-glass"] { --glass-divider:rgba(32,70,47,.10); --glass-menu:var(--glass-overlay); }
html[data-visual="botanical-glass"] { --glass-card:#f9fcf8; --glass-nav:#f2f7f0; }
html[data-visual="botanical-glass"][data-theme="dark"] {
  --glass-bg: #17211c;
  --glass-ink: #f2f5f2;
  --glass-muted: #a1ada6;
  --glass-card: #25362bc9;
  --glass-accent: #a0d4b7;
  --glass-soft: #314335;
  --glass-line: #ffffff12;
  --glass-rule: #46544b;
  --glass-nav: #1c2a22;
  --glass-overlay: #22342a;
  --glass-overlay-line: #455c4b;
  --glass-shadow: 0 12px 40px #0002;
}
html[data-visual="botanical-glass"][data-theme="dark"] { --glass-divider:rgba(220,241,225,.10); }
html[data-visual="botanical-glass"][data-theme="dark"] { --glass-card:#25362b; --glass-nav:#1c2a22; }
html[data-visual="botanical-glass"] body:is(.site-page,.plant-page) {
  --bg:var(--glass-bg); --ink:var(--glass-ink); --muted:var(--glass-muted); --card:var(--glass-card);
  --accent:var(--glass-accent); --soft:var(--glass-soft); --line:var(--glass-line); --rule:var(--glass-rule);
  --nav-bg:var(--glass-nav); --serif:var(--glass-ui); --control-border:var(--glass-line);
  --control-height:34px; --control-font:12px; --control-radius:11px;
  background:var(--bg); color:var(--ink); font-family:var(--glass-ui); -webkit-font-smoothing:antialiased;
}
html[data-visual="botanical-glass"] body:is(.site-page,.plant-page) { background:radial-gradient(ellipse at 90% 4%,#d9e7ce80,transparent 45%),radial-gradient(ellipse at 5% 30%,#c9e2d34a,transparent 40%),var(--bg); background-attachment:fixed; }
html[data-visual="botanical-glass"] .atlas-switch { display:inline-flex; border:0; padding:4px; background:var(--soft); border-radius:13px; gap:2px; }
html[data-visual="botanical-glass"] .atlas-switch button { border:0; padding:8px 18px; font-weight:450; font-size:13px; border-radius:10px; }
html[data-visual="botanical-glass"] .atlas-switch button[aria-pressed="true"] { border:0; background:var(--card); color:var(--ink); box-shadow:0 1px 5px #132f1e12; }
html[data-visual="botanical-glass"] .atlas-switch button { padding:7px 12px; font-size:12px; }
html[data-visual="botanical-glass"] :is(h1,h2,h3) { font-family:var(--glass-ui); }

:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#203c2e;background:#eef2ef;font-size:16px;--ink:#203c2e;--muted:#52685b;--green:#286346;--amber:#966124;--edge:#85998d;--rule:#c5cfc8}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:3px solid #25754e;outline-offset:3px}a{color:var(--green)}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px max(20px,calc((100vw - 1440px)/2));background:#fff;border-bottom:1px solid #aabcb0}.brand{display:flex;align-items:center;gap:9px;text-decoration:none;font-weight:750;letter-spacing:-.4px}.brand img{border-radius:7px}.preview-tag{font-size:12px;color:#4c6153;background:#edf3ee;border:1px solid #a6b9ab;border-radius:6px;padding:6px 9px}main{max-width:1440px;padding:28px 28px 48px;margin:auto}.intro{margin-bottom:24px}.eyebrow{font-size:11px;letter-spacing:.13em;color:#526b5a;margin:0 0 9px;font-weight:650}.intro h1{font-size:clamp(26px,3vw,38px);font-weight:650;letter-spacing:-.045em;margin:0 0 12px}.intro>p:last-child{margin:0;color:var(--muted);font-size:15px;line-height:1.65}.view-tabs{display:flex;border:1px solid #81998a;border-radius:10px;background:#e2eae4;padding:4px;width:max-content;max-width:100%;margin-bottom:18px}.view-tabs button{border:1px solid transparent;border-radius:7px;color:#3c5948;background:transparent;padding:10px 20px;font-size:14px;min-height:44px}.view-tabs button[aria-pressed=true]{color:#fff;background:#285d42;border-color:#1b4a32;font-weight:650;box-shadow:0 2px 4px #23433018}.filters{display:flex;gap:14px;align-items:end;flex-wrap:wrap;padding:16px;background:#fff;border:1px solid #8da294;border-radius:12px;box-shadow:0 3px 7px #223b2d07;margin-bottom:20px}label{display:grid;gap:7px;font-size:14px;font-weight:600;color:#36523e}input,select{height:44px;color:#233b2c;background:#fff;border:1px solid #7a9282;border-radius:7px;padding:10px 12px;min-width:0}select{appearance:none;min-width:180px;padding-right:34px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b5846' stroke-width='2'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}input::placeholder{color:#697d70}#record-query{width:260px}.secondary{background:#f1f6f1;border:1px solid #819a88;color:#214d32;border-radius:7px;padding:10px 14px;font-size:14px;min-height:44px;font-weight:550}.secondary:hover{background:#e1ede2}.workspace{background:#fff;border:1px solid #7b9383;border-radius:14px;overflow:hidden;box-shadow:0 4px 16px #253d2e09}.workspace-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 22px;border-bottom:1px solid #b7c7bb}.workspace h2{font-size:23px;margin:0 0 7px;letter-spacing:-.025em}.workspace-heading p:last-child{font-size:13px;margin:0;color:#536b5b}.chart-tools{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;padding:12px 20px;background:#f6f8f5;border-bottom:1px solid #becdc1}.legend{display:flex;flex-wrap:wrap;gap:14px;font-size:12px;color:#3e5c48}.legend span{display:flex;align-items:center;gap:7px}.legend span::before{content:"";width:22px;border-top:2px solid var(--green)}.legend .partner-line::before{border-color:var(--amber)}.zoom-controls{display:flex;align-items:center;gap:4px}.zoom-controls button{display:grid;place-items:center;min-width:34px;min-height:34px;padding:5px 9px;border:1px solid #81988a;border-radius:6px;background:#fff;color:#2d5039;font-size:13px}.zoom-controls output{min-width:45px;text-align:center;font-size:13px}.zoom-controls #zoom-fit{margin-left:7px}.chart-viewport{overflow:auto;overscroll-behavior-x:contain;background:#fff;max-height:660px;scrollbar-width:thin;scrollbar-color:#8da594 #edf2ee;cursor:grab}.chart-viewport.is-dragging{cursor:grabbing;user-select:none}#chart-stage{position:relative}#chart-world{position:absolute;top:20px;left:20px;transform-origin:0 0;background:#fff}.world-title{position:absolute;top:0;font-size:13px;color:#455e4f;font-weight:550}.family-lines{position:absolute;inset:0;pointer-events:none}.family-lines path{fill:none;stroke:var(--green);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.family-lines .partner-link{stroke:var(--amber)}.family-lines .junction{fill:#fff;stroke:#496e55;stroke-width:2}.root-node{position:absolute;display:flex;align-items:center;justify-content:center;gap:12px;min-height:72px;width:240px;padding:12px 20px;border:2px solid #326347;background:#edf5ed;border-radius:10px;color:#193f28}.root-node strong{font-size:17px;line-height:1.4}.root-node small{display:block;font-size:11px;color:#4d6c56;margin-bottom:5px}.leaf-icon{flex:none;width:34px;height:44px;color:#51785b}.partner-node{position:absolute;display:grid;gap:5px;align-content:center;width:138px;min-height:78px;padding:10px;border:1px solid #789580;border-radius:8px;background:#fff;color:#254430;text-align:start}.partner-node small{font-size:11px;color:#775527}.partner-node strong{font-size:14px;line-height:1.4;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.role-chip{position:absolute;padding:4px 7px;border:1px solid #afc5b3;border-radius:5px;color:#456b50;background:#f0f6f0;font-size:11px}.offspring-card{position:absolute;width:176px;min-height:216px;padding:10px;border:1px solid #789580;border-radius:10px;background:#fff;text-align:start;color:#243e2b;box-shadow:0 3px 8px #243f2b08}.offspring-card:hover,.partner-node:hover{border-color:#285d3c;box-shadow:0 3px 12px #22402b18}.offspring-card img{display:block;width:154px;height:126px;object-fit:contain;border-radius:5px;background:#f4f6f1;border:1px solid #d2dbd0}.offspring-card .image-label{display:block;margin-top:7px;font-size:10px;color:#647868;line-height:1.4}.offspring-card strong{display:block;font-size:14px;line-height:1.4;overflow-wrap:anywhere;margin:5px 0}.offspring-card .merchant{display:block;font-size:11px;color:#5d7263}.chart-foot{display:flex;align-items:center;justify-content:space-between;gap:16px;border-top:1px solid #bdccc0;background:#f8faf7;padding:12px 18px;font-size:12px;color:#4d6453}.chart-foot button{border:0;padding:7px;background:none;color:#286044;font-size:12px;text-decoration:underline;text-underline-offset:3px}.data-note{font-size:12px;line-height:1.8;color:#546b5b;max-width:1000px;margin:12px 0 28px}.naming-section{border:1px solid #8da594;background:#fff;border-radius:12px;padding:22px}.section-title{display:flex;align-items:end;justify-content:space-between;gap:16px;border-bottom:1px solid #c4d2c6;padding-bottom:16px;margin-bottom:16px}.section-title h2{margin:0;font-size:22px}.section-title>span{font-size:12px;color:#526a59}.naming-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.naming-card{padding:16px;border:1px solid #b3c5b6;border-radius:8px;background:#fcfdfb}.naming-card .term{font-size:22px;font-weight:700;color:#285c3a}.naming-card h3{font-size:14px;margin:6px 0 10px}.naming-card p{font-size:13px;line-height:1.85;margin:0 0 10px;color:#435e4b}.naming-card .mini-formula{padding:8px;border:1px solid #c3d2c4;border-radius:5px;background:#eef4eb;color:#2e5f3d;font-size:12px;line-height:1.7}.naming-source{font-size:12px;line-height:1.9;margin-bottom:0;color:#576d5d}.preview-footer{font-size:12px;color:#617467;margin-top:24px}.workspace.is-fullscreen{position:fixed;inset:8px;z-index:20;display:flex;flex-direction:column;box-shadow:0 0 0 20px #e7eee9}.workspace.is-fullscreen .chart-viewport{flex:1;max-height:none}.workspace.is-fullscreen .workspace-heading{padding-block:12px}.workspace.is-fullscreen .workspace-heading .eyebrow{display:none}.formula-card{position:absolute;width:248px;min-height:462px;padding:16px;background:#fff;border:1px solid #7b9582;border-radius:10px}.formula-parents{display:grid;grid-template-columns:1fr 24px 1fr;gap:4px;align-items:center;text-align:center;min-height:105px}.formula-parents button{padding:8px 5px;border:1px solid #a5baa9;border-radius:6px;background:#f4f8f2;color:#2a4b35;font-size:13px;min-height:83px;overflow-wrap:anywhere}.formula-parents small{display:block;font-size:11px;color:#60785f;margin-bottom:6px}.cross-sign{font-size:25px;color:#31563d}.formula-arrow{text-align:center;height:45px;font-size:28px;line-height:42px;color:#547c5d}.formula-photo{width:214px;height:172px;object-fit:contain;background:#f5f7f2;border:1px solid #c5d3c6;border-radius:6px}.formula-card .image-label{font-size:11px;color:#617463;margin:7px 0}.formula-card h3{font-size:15px;line-height:1.5;margin:5px 0;color:#254430}.formula-card .merchant{display:block;font-size:12px;color:#607365}.formula-card .record-open{border:1px solid #8da893;background:#f1f7ef;border-radius:5px;padding:7px 10px;color:#2d5a3b;font-size:12px;margin-top:9px;min-height:34px}dialog{width:min(730px,calc(100vw - 24px));max-height:88dvh;border:1px solid #71917a;border-radius:14px;background:#fff;color:#233e2d;padding:20px}dialog::backdrop{background:#122b1dd6}.dialog-heading{display:flex;align-items:start;justify-content:space-between;gap:15px;border-bottom:1px solid #c0cec2;padding-bottom:14px}.dialog-heading h2{font-size:20px;margin:0;line-height:1.5;overflow-wrap:anywhere}.dialog-heading button{border:1px solid #819c88;border-radius:6px;min-height:40px;background:#edf4e9;color:#2a5234;padding:8px 13px;flex:none}#dialog-content{font-size:14px;line-height:1.85}#dialog-content img{display:block;width:100%;max-height:48dvh;object-fit:contain;background:#f3f6f0;border:1px solid #bdcfc0;border-radius:7px;margin:14px 0}#dialog-content a{display:block;padding:7px 0}#dialog-content dl{display:grid;grid-template-columns:64px 1fr;gap:7px;margin-block:16px}#dialog-content dt{color:#5b715f}#dialog-content dd{margin:0;color:#243e2b;overflow-wrap:anywhere}.empty-world{padding:50px 22px;color:#56705e;max-width:400px;line-height:1.8}@media(max-width:700px){.topbar{padding:12px 16px}.brand{font-size:15px}.preview-tag{font-size:11px;padding:5px 7px}main{padding:22px 14px 34px}.intro{margin-bottom:18px}.intro h1{font-size:27px;line-height:1.4}.intro>p:last-child{font-size:14px}.intro .eyebrow{font-size:10px}.view-tabs{width:100%}.view-tabs button{flex:1;padding:9px 10px}.filters{gap:12px;padding:12px}.filters label{flex:1;min-width:0;font-size:13px}.filters label:first-child{flex-basis:0}select,#record-query{width:100%;min-width:0;font-size:16px}.filters .secondary{font-size:13px;max-width:120px;padding:10px}.workspace-heading{padding:16px 14px;gap:10px}.workspace h2{font-size:19px}.workspace-heading .secondary{font-size:12px;padding:8px 10px;min-height:38px}.workspace-heading .eyebrow{font-size:10px}.workspace-heading p:last-child{font-size:12px;line-height:1.6}.chart-tools{padding:10px 12px;gap:10px}.legend{font-size:11px;gap:12px}.zoom-controls{width:100%;justify-content:end}.chart-viewport{max-height:65dvh}.chart-foot{padding:10px 12px;display:block;line-height:1.65}.chart-foot button{padding:7px 0;display:block}.data-note{font-size:12px}.naming-section{padding:16px 12px}.section-title{display:block}.section-title h2{font-size:20px}.section-title>span{display:block;margin-top:9px}.naming-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.naming-card{padding:12px 10px}.naming-card .term{font-size:21px}.naming-card h3{font-size:14px;line-height:1.6}.naming-card p{font-size:13px;line-height:1.75}.naming-card .mini-formula{font-size:11px;padding:7px}.workspace.is-fullscreen{inset:5px}.workspace.is-fullscreen .workspace-heading h2{font-size:17px}.workspace.is-fullscreen .chart-tools{padding-block:8px}.workspace.is-fullscreen .chart-foot{padding:7px 12px}.workspace.is-fullscreen .chart-foot button{display:inline;margin-left:10px}.workspace.is-fullscreen .chart-foot span{font-size:11px}.preview-footer{line-height:1.8}}
:root { --network-mother:#28734f; --network-father:#a06c26; }
[hidden] { display:none!important; }
.network-pager { display:flex; align-items:center; gap:8px; }
.page-navigation { display:flex; align-items:center; gap:8px; }
.viewer-options { display:contents; }
.workspace .chart-tools .viewer-tools-toggle,#compact-naming-help { display:none; }
.network-pager button { min-height:34px; padding:6px 10px; border:1px solid #819a88; border-radius:6px; background:#fff; color:#284f38; font-size:13px; }
.network-pager button:disabled { color:#829186; border-color:#c1cec4; cursor:default; background:#f5f7f4; }
.network-pager span { min-width:66px; text-align:center; font-size:12px; color:#4f6657; }
.network-pager button,.network-pager span { white-space:nowrap; }
.rotation-hint { display:none; }
.network-column-title { position:absolute; margin:0; font-size:14px; font-weight:600; color:#536d5a; }
.network-lines { position:absolute; inset:0; pointer-events:none; }
.network-lines path { fill:none; stroke-width:2; stroke-linecap:round; }
.network-lines .mother { stroke:var(--network-mother); }
.network-lines .father { stroke:var(--network-father); }
.network-lines .offspring-link { stroke:#506e59; }
.network-lines circle { fill:#fff; stroke:#506e59; stroke-width:1.8; }
.network-root { position:absolute; width:172px; height:86px; padding:10px 12px; display:grid; align-content:center; gap:5px; border:2px solid #326c49; border-radius:10px; background:#e9f2e8; color:#234b32; text-align:start; }
.network-root small { font-size:11px; color:#58735e; }
.network-root strong { font-size:16px; line-height:1.35; overflow-wrap:anywhere; }
.network-root>span { font-size:11px; color:#58735e; }
.network-parent { position:absolute; width:168px; height:58px; padding:8px 10px; border:1px solid #7d9887; border-radius:8px; color:#294333; background:#fff; text-align:start; }
.network-parent>span { position:absolute; top:-10px; left:10px; border:1px solid #98b1a0; background:#fff; padding:1px 6px; border-radius:4px; font-size:11px; line-height:16px; }
.network-parent>span.role-mother { color:var(--network-mother); border-color:#8aaf97; background:#f3f8f1; }
.network-parent>span.role-father { color:#876123; border-color:#bca57d; background:#fffaf1; }
.network-parent strong { font-size:14px; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.network-child { position:absolute; display:flex; align-items:center; gap:9px; width:190px; height:60px; border:1px solid #7d9887; border-radius:8px; background:#fff; padding:8px; color:#244431; text-align:start; }
.network-child>img { width:34px; height:40px; flex:none; object-fit:contain; border:1px solid #c0cfc3; border-radius:4px; background:#f4f7f1; }
.network-child-copy { min-width:0; }
.network-child strong { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; font-size:14px; line-height:1.3; }
.network-child small { display:block; font-size:10px; color:#617566; line-height:1.3; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.network-basis { position:absolute; color:#718376; font-size:10px; line-height:1.3; }
.network-basis { width:190px; }
.network-basis .pairing-role { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:var(--ink); font-size:11px; line-height:1.35; }
.network-basis small { display:block; font-size:10px; margin-top:2px; }
.role-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:10px 20px; border-bottom:1px solid var(--rule); }
.role-toolbar>span { font-size:13px; color:var(--muted); overflow-wrap:anywhere; }
.role-toolbar .atlas-switch { flex:none; }
.role-toolbar .atlas-switch button { background:transparent; color:var(--accent); }
.workspace-heading>#full-view { flex:none; white-space:nowrap; }
.role-chip { width:max-content; max-width:168px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.35; }
.role-chip[data-root-role="father"] { color:#876123; border-color:#bca57d; background:#fffaf1; }
.formula-root-role { display:block; color:var(--accent); font-size:12px; line-height:1.5; margin-bottom:10px; overflow-wrap:anywhere; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .role-toolbar { padding:4px 12px; }
@media(max-width:700px) and (orientation:portrait) {
  .role-toolbar { padding:8px 12px; justify-content:center; }
  .role-toolbar>span { font-size:12px; }
  .role-toolbar .atlas-switch { width:100%; justify-content:center; }
  .role-toolbar .atlas-switch button { flex:1; padding-inline:7px; }
}
.network-parent.is-traced,.network-child.is-traced { border-color:#286c45; box-shadow:0 0 0 2px #286c4524; background:#f1f7ec; }
#chart-world[data-traced]:not([data-traced=""]) .network-branch:not(.is-traced) { opacity:.17; }
#chart-world[data-traced]:not([data-traced=""]) :is(.network-parent,.network-child):not(.is-traced) { opacity:.48; }
.network-branch.is-traced path { stroke-width:3; }
.workspace.network-mode .chart-tools { gap:10px; }
.workspace.network-mode .chart-viewport { background:linear-gradient(#fcfdfb,#fff 60%); }
.workspace.network-mode #chart-world { background:transparent; }
.workspace.network-mode .legend .parent-line::before { border-color:var(--network-mother); }
.workspace.network-mode .legend .partner-line::before { border-color:var(--network-father); }
.workspace.is-fullscreen,.landscape-view .workspace { position:fixed; inset:0; width:auto; height:100dvh; z-index:20; display:flex; flex-direction:column; border:0; border-radius:0; box-shadow:0 0 0 20px #eef2ee; padding-top:env(safe-area-inset-top,0px); }
.landscape-view .workspace { padding-left:env(safe-area-inset-left,0px); padding-right:env(safe-area-inset-right,0px); }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .chart-viewport { flex:1; min-height:0; max-height:none; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .workspace-heading { min-height:42px; padding:8px 14px; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .workspace-heading .eyebrow { display:none; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .workspace-heading h2 { display:inline; font-size:16px; margin-right:14px; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) #family-count { display:inline; font-size:12px; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) #full-view { min-height:32px; padding:5px 10px; font-size:12px; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .chart-tools { padding:7px 12px; flex-wrap:nowrap; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .zoom-controls { width:auto; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .chart-foot { display:flex; align-items:center; min-height:30px; padding:4px 12px; font-size:11px; }
:is(.workspace.is-fullscreen,.landscape-view .workspace) .chart-foot button { display:inline; font-size:11px; padding:3px; }
.landscape-view .rotation-hint { display:none; }
@media(max-width:700px) and (orientation:portrait) {
  .rotation-hint { display:flex; align-items:center; gap:10px; border-bottom:1px solid #adc1b1; background:#eaf3e7; padding:10px 14px; color:#335b40; }
  .rotate-symbol { font-size:30px; line-height:1; }
  .rotation-hint strong { display:block; font-size:13px; margin-bottom:3px; }
  .rotation-hint small { display:block; font-size:11px; line-height:1.6; color:#5d7561; }
  .workspace.network-mode .chart-tools { flex-wrap:wrap; }
  .workspace.network-mode .legend { flex:1; }
  .workspace.network-mode .network-pager { gap:5px; }
  .workspace.network-mode .network-pager button { min-height:32px; padding:5px 7px; font-size:12px; }
  .workspace.network-mode .network-pager span { min-width:56px; font-size:11px; }
  .workspace.network-mode .zoom-controls { flex-basis:100%; }
  .view-tabs button { padding-inline:7px; font-size:13px; }
}
/* Formula view follows the atlas's wrapping card grid, without a chart canvas. */
.workspace.formula-mode .chart-tools { display:flex; justify-content:center; }
.formula-mode .rotation-hint { display:none; }
.formula-mode #chart-world { position:static; display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr)); align-items:start; gap:14px; background:transparent; }
.formula-mode #chart-stage { padding:18px; }
.formula-mode .chart-viewport { overflow:visible; max-height:none; cursor:auto; }
.formula-mode .formula-card { position:static; width:auto; min-width:0; min-height:0; padding:17px 18px 15px; border-radius:14px; }
.formula-mode .formula-photo { display:block; width:100%; height:auto; aspect-ratio:4/3; }
.formula-mode .formula-parents { grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr); }
.formula-mode .formula-parents button { min-width:0; }
.formula-mode .empty-world { grid-column:1/-1; }
.workspace.formula-mode.is-fullscreen .chart-viewport { overflow-y:auto; overflow-x:hidden; }
@media(max-width:640px) {
  .formula-mode #chart-world { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .formula-mode #chart-stage { padding:10px; }
  .formula-mode .formula-card { padding:11px 10px 9px; border-radius:12px; }
  .formula-mode .formula-parents { grid-template-columns:minmax(0,1fr) 14px minmax(0,1fr); gap:2px; }
  .formula-mode .formula-parents button { padding:5px 3px; font-size:11px; line-height:1.4; }
  .formula-mode .formula-parents small { font-size:10px; }
  .formula-mode .cross-sign { font-size:20px; }
  .formula-mode .formula-root-role { font-size:11px; }
  .formula-mode .formula-card h3 { font-size:14px; }
  .formula-mode .formula-arrow { height:30px; line-height:28px; font-size:23px; }
}
@media(orientation:landscape) and (min-width:560px) and (max-width:1100px) and (max-height:600px) {
  .landscape-view .workspace-heading { min-height:40px; padding:5px 12px; }
  .landscape-view .chart-tools { min-height:42px; padding:5px 10px; gap:8px; }
  .landscape-view .legend { font-size:11px; gap:8px; }
  .landscape-view .legend span { gap:4px; }
  .landscape-view .legend span::before { width:18px; }
  .landscape-view .zoom-controls { gap:3px; }
  .landscape-view .zoom-controls button { min-height:30px; min-width:30px; padding:4px 7px; font-size:12px; }
  .landscape-view .zoom-controls output { min-width:38px; }
  .landscape-view .network-pager { gap:5px; }
  .landscape-view .network-pager button { min-height:30px; padding:4px 7px; font-size:12px; }
  .landscape-view .network-pager span { font-size:11px; min-width:60px; }
  .landscape-view .chart-foot { min-height:26px; line-height:1.4; }
}
/* Keep range controls inside the viewer in every layout, including fullscreen. */
.chart-tools { display:grid; grid-template-columns:1fr auto; }
.chart-tools .legend { grid-column:1; grid-row:1; }
.chart-tools .zoom-controls { grid-column:2; grid-row:1; width:auto; }
.chart-tools .network-pager { grid-column:1/-1; grid-row:2; justify-content:center; }
.network-pager #show-all[aria-pressed="true"] { background:var(--soft); }
@media(min-width:1240px) {
  .chart-tools { grid-template-columns:auto 1fr auto; }
  .chart-tools .network-pager { grid-column:2; grid-row:1; }
  .chart-tools .zoom-controls { grid-column:3; }
}
@media(max-width:700px) and (orientation:portrait) {
  .chart-tools { grid-template-columns:1fr; }
  .chart-tools .legend { justify-content:center; }
  .chart-tools .network-pager { flex-wrap:wrap; gap:7px; }
  .chart-tools .zoom-controls { grid-column:1; grid-row:3; justify-content:center; }
  .page-navigation { gap:5px; }
}
/* Phone landscape keeps only two fixed rows; optional tools float over the chart. */
.workspace.compact-landscape {
  display:grid; grid-template-columns:minmax(0,1fr) auto auto;
  grid-template-rows:36px 36px minmax(0,1fr); column-gap:6px;
  padding-inline:env(safe-area-inset-left,0px) env(safe-area-inset-right,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
.workspace.compact-landscape .workspace-heading,
.workspace.compact-landscape .role-toolbar { display:contents; }
.workspace.compact-landscape .workspace-heading>div {
  grid-column:1; grid-row:1; min-width:0; overflow:hidden;
  display:flex; align-items:center; padding-left:10px;
}
.workspace.compact-landscape .workspace-heading h2 { display:block; margin:0; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workspace.compact-landscape :is(#family-count,#role-subject,.chart-foot,.rotation-hint) { display:none; }
.workspace.compact-landscape #full-view { grid-column:3; grid-row:1; align-self:center; margin-right:8px; }
.workspace.compact-landscape .role-toolbar .atlas-switch { grid-column:2; grid-row:1; align-self:center; padding:2px; }
.workspace.compact-landscape .chart-tools {
  grid-column:1/-1; grid-row:2; position:relative; z-index:1;
  display:flex; justify-content:space-between; flex-wrap:nowrap;
  min-width:0; min-height:0; padding:2px 8px; gap:6px; border-top:1px solid var(--rule);
}
.workspace.compact-landscape .network-pager { justify-content:start; gap:5px; min-width:0; }
.workspace.compact-landscape .page-navigation { gap:4px; }
.workspace.compact-landscape .network-pager span { font-size:11px; }
.workspace.compact-landscape .viewer-tools-toggle { display:block; flex:none; }
.workspace.compact-landscape #chart-viewport { grid-column:1/-1; grid-row:3; min-width:0; min-height:0; }
.workspace.compact-landscape .viewer-options {
  display:none; position:absolute; top:calc(100% + 6px); right:8px;
  max-width:calc(100vw - 24px); max-height:calc(100dvh - 90px); overflow:auto;
  padding:10px; border:1px solid var(--rule); border-radius:var(--control-radius);
  background:var(--card); box-shadow:var(--glass-shadow); z-index:2;
}
.workspace.compact-landscape.viewer-tools-open .viewer-options { display:flex; flex-direction:column; gap:9px; }
.workspace.compact-landscape .viewer-options .legend { font-size:11px; }
.workspace.compact-landscape .viewer-options .zoom-controls { width:auto; flex-basis:auto; }
.workspace.compact-landscape #compact-naming-help { display:block; text-align:start; }

/* Share the live site's palette, type and control tokens; content nodes retain
   the diagram's separate parent-role colors and readable content boundaries. */
html[data-visual="botanical-glass"] body.lineage-preview {
  --green:var(--accent);
  --network-mother:var(--accent);
  color:var(--ink);
  font-family:var(--glass-ui);
}
html[data-visual="botanical-glass"] .lineage-preview .topbar {
  background:var(--nav-bg); border-color:var(--line); padding-block:12px;
}
html[data-visual="botanical-glass"] .lineage-preview .brand { gap:10px; }
html[data-visual="botanical-glass"] .lineage-preview .brand .wordmark {
  width:124px; height:34px; object-fit:contain; border-radius:0;
  filter:brightness(0) saturate(100%) invert(18%) sepia(30%) saturate(700%) hue-rotate(98deg);
}
html[data-visual="botanical-glass"] .lineage-preview .preview-tag {
  border:1px solid var(--control-border); border-radius:999px; background:var(--soft); color:var(--muted);
}
html[data-visual="botanical-glass"] .lineage-preview :where(.secondary,.zoom-controls button,.network-pager button,#dialog-close,.record-open) {
  border:1px solid var(--control-border); border-radius:var(--control-radius);
  background:var(--card); color:var(--accent); box-shadow:none;
  min-height:var(--control-height); font-size:var(--control-font); font-weight:550; line-height:18px; padding:6px 10px;
}
html[data-visual="botanical-glass"] .lineage-preview :where(.secondary,.zoom-controls button,.network-pager button,#dialog-close,.record-open):hover:not(:disabled) {
  background:var(--soft); border-color:var(--control-hover-border);
}
html[data-visual="botanical-glass"] .lineage-preview .network-pager button:disabled {
  border-color:var(--control-border); color:var(--muted); background:var(--card); opacity:.45;
}
html[data-visual="botanical-glass"] .lineage-preview #record-query {
  height:var(--control-height); min-height:var(--control-height); border:1px solid var(--control-border);
  border-radius:var(--control-radius); background:var(--card); color:var(--ink); font-size:var(--control-font); font-weight:400;
}
html[data-visual="botanical-glass"] .lineage-preview #record-query::placeholder { color:var(--muted); opacity:.85; }
html[data-visual="botanical-glass"] .lineage-preview .filters,
html[data-visual="botanical-glass"] .lineage-preview .workspace,
html[data-visual="botanical-glass"] .lineage-preview .naming-section {
  background:var(--card); border:1px solid var(--line); border-radius:var(--glass-radius); box-shadow:var(--glass-shadow);
}
html[data-visual="botanical-glass"] .lineage-preview .workspace-heading,
html[data-visual="botanical-glass"] .lineage-preview .chart-tools,
html[data-visual="botanical-glass"] .lineage-preview .chart-foot { border-color:var(--rule); }
html[data-visual="botanical-glass"] .lineage-preview .chart-tools,
html[data-visual="botanical-glass"] .lineage-preview .chart-foot { background:var(--glass-overlay); color:var(--muted); }
html[data-visual="botanical-glass"] .lineage-preview .chart-viewport { background:var(--glass-overlay); }
html[data-visual="botanical-glass"] .lineage-preview .network-root,
html[data-visual="botanical-glass"] .lineage-preview .root-node { background:var(--soft); color:var(--ink); border-color:var(--accent); border-radius:14px; }
html[data-visual="botanical-glass"] .lineage-preview :where(.network-parent,.network-child,.partner-node,.offspring-card,.formula-card) {
  color:var(--ink); background:var(--glass-overlay); border-color:var(--rule); border-radius:12px;
}
html[data-visual="botanical-glass"] .lineage-preview :where(.network-parent.is-traced,.network-child.is-traced) {
  background:var(--soft); border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent);
}
html[data-visual="botanical-glass"] .lineage-preview :where(.intro>p:last-child,.eyebrow,label,.data-note,.preview-footer,.naming-source,.network-column-title) { color:var(--muted); }
html[data-visual="botanical-glass"] .lineage-preview .rotation-hint { background:var(--soft); color:var(--ink); border-color:var(--rule); }
html[data-visual="botanical-glass"] .lineage-preview .naming-card { background:var(--glass-overlay); border-color:var(--glass-overlay-line); border-radius:14px; }
html[data-visual="botanical-glass"] .lineage-preview :where(.naming-card .term,.naming-card .mini-formula) { color:var(--accent); }
html[data-visual="botanical-glass"] .lineage-preview .naming-card .mini-formula { background:var(--soft); border-color:var(--glass-overlay-line); border-radius:var(--control-radius); }
html[data-visual="botanical-glass"] .lineage-preview dialog { background:var(--glass-overlay); color:var(--ink); border-color:var(--glass-overlay-line); border-radius:24px; }
html[data-visual="botanical-glass"] .lineage-preview :where(.workspace.is-fullscreen,.landscape-view .workspace) { border-radius:0; box-shadow:none; }
html[data-visual="botanical-glass"] body.landscape-view .workspace { border-radius:0; }
@media(max-width:900px) {
  html[data-visual="botanical-glass"] .lineage-preview #record-query { font-size:14px; }
  html[data-visual="botanical-glass"] .lineage-preview #record-query:focus { font-size:16px; }
}
html[data-visual="botanical-glass"] .lineage-preview .workspace.compact-landscape { border:0; }
html[data-visual="botanical-glass"] .lineage-preview .workspace.compact-landscape :is(.network-pager button,#full-view,#viewer-tools-toggle) {
  min-height:28px; padding:4px 8px; font-size:11px; line-height:18px;
}
html[data-visual="botanical-glass"] .lineage-preview .workspace.compact-landscape .role-toolbar button {
  min-height:28px; padding:3px 7px; font-size:11px; line-height:18px;
}

/* Keep both filters on one row, including compact phone layouts. */
.lineage-preview .filters .family-field { display:grid; gap:7px; flex:0 1 260px; min-width:0; }
.lineage-preview .filters .family-field label { display:block; }
.lineage-preview .filters #family-select[hidden] { display:none; }
.lineage-preview .family-picker { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; height:var(--control-height); min-height:var(--control-height); padding:6px 10px; border:1px solid var(--control-border); border-radius:var(--control-radius); background:var(--card); color:var(--ink); text-align:left; font:inherit; font-size:var(--control-font); }
.lineage-preview #family-selected-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lineage-preview .family-picker>span:last-child { color:var(--accent); font-size:20px; line-height:1; }
.lineage-preview .family-picker:focus-visible, .lineage-preview .family-option:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.lineage-preview .family-picker-dialog { width:min(520px,calc(100vw - 24px)); padding:20px; max-height:min(80dvh,640px); overflow:auto; }
.lineage-preview .picker-search-label { display:block; margin:14px 0 7px; font-size:13px; color:var(--muted); }
.lineage-preview #family-query { display:block; width:100%; min-height:40px; padding:8px 12px; border:1px solid var(--rule); border-radius:var(--control-radius); background:var(--card); color:var(--ink); font:inherit; font-size:16px; }
.lineage-preview #family-results-count { font-size:12px; color:var(--muted); margin:12px 0 8px; }
.lineage-preview #family-results { display:grid; gap:5px; max-height:calc(80dvh - 220px); overflow:auto; padding:3px; }
.lineage-preview .family-option { display:grid; gap:4px; width:100%; text-align:left; padding:10px 12px; border:1px solid var(--rule); border-radius:var(--control-radius); background:var(--card); color:var(--ink); font:inherit; }
.lineage-preview .family-option[aria-selected=true], .lineage-preview .family-option:hover { background:var(--soft); border-color:var(--accent); }
.lineage-preview .family-option strong { font-size:14px; font-weight:600; }
.lineage-preview .family-option small,.lineage-preview .picker-empty { font-size:12px; color:var(--muted); }
.lineage-preview #family-results-more { margin-top:10px; }
.lineage-preview .parent-picture { display:block; width:52px; height:56px; flex:none; overflow:hidden; border:1px solid var(--rule); border-radius:7px; background:var(--card); }
.lineage-preview .parent-picture :is(img,svg) { display:block; width:100%; height:100%; object-fit:contain; }
.lineage-preview .parent-copy { display:grid; align-content:center; gap:3px; min-width:0; }
.lineage-preview .parent-copy strong { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.lineage-preview .root-node { height:72px; min-height:72px; padding:6px 12px; gap:10px; }
.lineage-preview .root-node .parent-copy { flex:1; }
.lineage-preview .root-node .parent-copy small { margin:0; font-size:10px; line-height:12px; color:var(--muted); }
.lineage-preview .root-node .parent-copy strong { font-size:16px; line-height:1.2; }
.lineage-preview .network-root { display:flex; align-items:center; gap:8px; padding:8px; }
.lineage-preview .network-root .parent-picture { width:38px; height:48px; }
.lineage-preview .network-root .leaf-icon { width:30px; height:38px; flex:none; }
.lineage-preview .network-root .parent-copy { flex:1; }
.lineage-preview .network-root .parent-copy strong { font-size:14px; line-height:1.25; }
.lineage-preview .network-root .parent-copy small { font-size:10px; line-height:12px; color:var(--muted); }
.lineage-preview .formula-parents .parent-picture { width:38px; height:40px; margin:0 auto 4px; }
.lineage-preview .formula-parents .formula-parent-label { font-size:9px; margin-top:4px; }
@media(max-width:900px) {
  .lineage-preview .filters .family-field { flex:1; }
  .lineage-preview .family-picker { font-size:14px; }
  .lineage-preview .family-picker-dialog { padding:16px; }
}

/* Parent portraits are scoped to each source merchant and pairing. */
.lineage-preview .parent-no-photo { display:flex; flex:none; align-items:center; justify-content:center; width:32px; height:40px; border:1px dashed var(--rule); border-radius:6px; font-size:9px; line-height:1.3; color:var(--muted); background:var(--soft); }
.lineage-preview .parent-merchant-pictures { display:flex; flex:none; align-items:start; gap:4px; width:64px; height:56px; }
.lineage-preview .parent-merchant-pictures .merchant-portrait { display:grid; justify-items:center; gap:2px; width:30px; }
.lineage-preview .parent-merchant-pictures .parent-picture { width:29px; height:34px; }
.lineage-preview .parent-merchant-pictures .merchant-portrait small { font-size:7px; line-height:8px; max-height:16px; overflow:hidden; text-align:center; margin:0; color:var(--muted); }
.lineage-preview .network-parent { display:flex; align-items:center; gap:7px; }
.lineage-preview .network-parent>span:is(.parent-picture,.parent-no-photo) { position:static; left:auto; top:auto; width:30px; height:36px; padding:0; font-size:8px; }
.lineage-preview .network-parent strong { min-width:0; font-size:12px; }
.lineage-preview .partner-node { display:flex; align-items:center; gap:6px; height:78px; }
.lineage-preview .partner-node .parent-picture { width:32px; height:44px; }
.lineage-preview .partner-copy { min-width:0; }
.lineage-preview .partner-copy small { display:block; margin-bottom:4px; font-size:10px; }
.lineage-preview .partner-copy strong { font-size:12px; line-height:1.3; }
.lineage-preview .root-parent-source { display:flex; align-items:center; gap:6px; border:1px solid var(--rule); background:var(--soft); color:var(--ink); text-align:left; padding:5px; border-radius:6px; }
.lineage-preview .root-parent-source .source-parent-copy { display:grid; gap:3px; min-width:0; }
.lineage-preview .root-parent-source strong { font-size:11px; line-height:1.2; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.lineage-preview .root-parent-source small { color:var(--muted); font-size:9px; line-height:11px; }
.lineage-preview .root-parent-source .parent-picture { width:32px; height:42px; }
.lineage-preview .role-chip.root-parent-source { width:160px; max-width:160px; height:60px; }
.lineage-preview .network-current-parent { border:0; padding:0; height:32px; background:transparent; width:190px; gap:5px; }
.lineage-preview .network-current-parent .parent-picture,.lineage-preview .network-current-parent .parent-no-photo { width:24px; height:30px; font-size:7px; }
.lineage-preview .network-current-parent strong { font-size:10px; -webkit-line-clamp:1; }
.lineage-preview .network-current-parent small { margin:0; font-size:9px; }
.lineage-preview .formula-parents .parent-no-photo { margin:0 auto 4px; width:38px; height:40px; }
.lineage-preview .formula-parents .formula-parent-label { font-size:9px; line-height:1.4; }
