#ft-app { margin: 12px 0 20px; font-size: 15px; }
.ft-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 8px; }
.ft-field { display: grid; gap: 3px; font-size: 13px; color: var(--muted); }
.ft-field select, .ft-field input { font: inherit; font-size: 15px; color: var(--ink); background: color-mix(in srgb, var(--paper) 85%, white);
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 8px; padding: 7px 9px; min-width: 200px; max-width: 100%; }
.ft-zoom { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-btn { font: inherit; font-size: 14px; background: var(--nav); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 6px 11px; cursor: pointer; min-width: 36px; }
.ft-btn:hover, .ft-btn:focus-visible { filter: brightness(1.2); }
.ft-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
.ft-key { padding: 2px 8px; border-radius: 6px; border: 2px solid color-mix(in srgb, var(--ink) 35%, transparent); background: var(--paper); }
.ft-key-living { border-style: solid; font-style: italic; }
.ft-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.ft-viewport { position: relative; height: min(72vh, 680px); overflow: hidden; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  border-radius: 12px; background: color-mix(in srgb, var(--bg) 35%, var(--paper)); touch-action: none; cursor: grab; outline-offset: 2px; }
.ft-viewport.ft-drag { cursor: grabbing; }
.ft-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: max-content; padding: 10px; }
.ft-panel { background: color-mix(in srgb, var(--paper) 85%, white); border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
  border-top: 4px solid var(--accent); border-radius: 12px; padding: 14px 16px; max-height: min(72vh, 680px); overflow: auto; font-size: 14.5px; }
.ft-panel h3 { margin: 0 0 6px; font-family: var(--display); font-size: 20px; }
.ft-panel h4 { margin: 14px 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ft-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0; }
.ft-panel dt { font-weight: 700; color: var(--muted); } .ft-panel dd { margin: 0; }
.ft-rel { margin: 6px 0; line-height: 1.6; }
.ft-plink { font: inherit; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; }
.ft-note { white-space: pre-line; font-size: 13.5px; line-height: 1.5; color: var(--ink); background: color-mix(in srgb, var(--accentSoft, #d3be93) 18%, transparent); padding: 8px 10px; border-radius: 8px; }
.ft-links { margin: 0; padding-left: 1.1em; } .ft-links li { margin: 3px 0; }
.ft-muted, .ft-hint { color: var(--muted); font-size: 13px; }
.ft-conf { font-size: 13px; margin: 0 0 6px; padding: 4px 8px; border-radius: 6px; border: 2px solid; background: var(--paper); }
/* tree layout */
.ft-tree, .ft-tree ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.ft-tree ul { padding-top: 22px; position: relative; }
.ft-tree li { position: relative; padding: 22px 6px 0; display: flex; flex-direction: column; align-items: center; }
.ft-tree > li { padding-top: 0; }
.ft-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.ft-tree ul > li::before, .ft-tree ul > li::after { content: ""; position: absolute; top: 0; height: 22px; width: 50%; border-top: 2px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.ft-tree ul > li::before { right: 50%; } .ft-tree ul > li::after { left: 50%; border-left: 2px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.ft-tree ul > li:first-child::before, .ft-tree ul > li:last-child::after { border-top: 0; }
.ft-tree ul > li:only-child::before { display: none; } .ft-tree ul > li:only-child::after { border-top: 0; }
.ft-tree ul > li:first-child::after { border-radius: 8px 0 0 0; } .ft-tree ul > li:last-child::before { border-right: 2px solid color-mix(in srgb, var(--ink) 35%, transparent); border-radius: 0 8px 0 0; }
.ft-unit { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 12px; background: color-mix(in srgb, var(--paper) 70%, transparent); }
.ft-amp { color: var(--muted); font-size: 13px; }
.ft-card { position: relative; display: grid; gap: 1px; width: 132px; min-height: 52px; padding: 7px 8px; text-align: center; font: inherit; color: var(--ink); cursor: pointer;
  background: color-mix(in srgb, var(--paper) 88%, white); border: 2px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 10px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.ft-card:hover, .ft-card:focus-visible { border-color: var(--accent); }
.ft-card.ft-sel { outline: 3px solid var(--accent); outline-offset: 1px; }
.ft-sex-M { box-shadow: inset 0 4px 0 #5b7a99, 0 2px 6px rgba(0,0,0,.08); } .ft-sex-F { box-shadow: inset 0 4px 0 #a5627a, 0 2px 6px rgba(0,0,0,.08); }
.ft-name { font-weight: 700; font-size: 13.5px; line-height: 1.25; overflow-wrap: anywhere; }
.ft-years { font-size: 12px; color: var(--muted); }
.ft-living .ft-name { font-style: italic; font-weight: 600; }
.ft-c-confirmed { border-style: solid; border-color: #3f7a4a; }
.ft-c-probable { border-style: dashed; }
.ft-c-possible { border-style: dotted; border-width: 3px; opacity: .82; background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--ink) 5%, transparent) 6px 12px); }
.ft-badge { position: absolute; top: -9px; right: -7px; width: 19px; height: 19px; border-radius: 50%; font-size: 12px; line-height: 19px; color: #fff; background: #3f7a4a; }
.ft-c-possible .ft-badge { background: #9a6b1f; }
.ft-toggle, .ft-up { font: inherit; font-size: 12px; margin-top: 4px; background: var(--paper); color: var(--link); border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); border-radius: 999px; padding: 2px 9px; cursor: pointer; }
.ft-up { margin: 0 0 6px; }
.ft-with { font-size: 11.5px; color: var(--muted); font-style: italic; margin-bottom: 2px; }
@media (max-width: 860px) {
  .ft-wrap { grid-template-columns: 1fr; }
  .ft-viewport { height: 62vh; }
  .ft-panel { max-height: none; }
  .ft-field select, .ft-field input { min-width: 0; width: 100%; }
  .ft-field { flex: 1 1 100%; }
}
.prose:has(#ft-app) { max-width: none; }
.prose:has(#ft-app) > p, .prose:has(#ft-app) > h3, .prose:has(#ft-app) > .download { max-width: 72ch; }
.ft-adopted { font-style: italic; }
.ft-xlink { margin: .6em 0 .9em; }
.ft-xbtn { display: inline-block; text-decoration: none; }
.ft-xlink { margin: .2em 0 .8em; }
.ft-xbtn { display: inline-block; font-size: 15px; font-weight: 700; padding: 9px 14px; text-decoration: none; }
.ft-hint { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(140%); z-index: 50; opacity: 0;
  border: 0; border-radius: 999px; padding: 10px 16px; font: 600 14px/1.2 var(--body, inherit); color: #fff;
  background: var(--accent, #5a3e2b); box-shadow: 0 4px 14px rgba(0,0,0,.25); transition: transform .25s, opacity .25s; pointer-events: none; max-width: calc(100% - 120px); }
.ft-hint.ft-show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
