/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --surface-2: #fafbfc;
  --line:      #e2e5ea;
  --line-soft: #eef0f3;
  --text:      #1b2027;
  --muted:     #6b737d;
  --faint:     #98a0aa;
  --accent:    #3f6fd8;
  --accent-2:  #eaf0fd;
  --danger:    #c0392b;
  --shadow:    0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.08);
  --shadow-lg: 0 18px 48px rgba(16,24,40,.18);
  --r:  10px;
  --r-lg: 16px;
  --side-w: 288px;
  --drawer-w: 340px;
  --sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}
:root[data-ui-theme="dark"] {
  --bg:        #0f1218;
  --surface:   #171b23;
  --surface-2: #1c212b;
  --line:      #2a313d;
  --line-soft: #222833;
  --text:      #e8edf4;
  --muted:     #98a4b4;
  --faint:     #6d7a8c;
  --accent:    #6ea8ff;
  --accent-2:  #1d2a42;
  --danger:    #e5766a;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }

/* The browser's own `[hidden] { display: none }` is a user-agent rule, so any
   author rule setting `display` beats it. Panels, modals and field groups all
   set display, so without this they stay on screen -- invisible ones sitting on
   top of the page and swallowing every click. */
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar {
  height: 62px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { font-size: 24px; line-height: 1; }
.brand h1 {
  font-size: 18px; letter-spacing: -.2px; outline: none;
  border-radius: 6px; padding: 1px 5px; margin-left: -5px;
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand h1:hover  { background: var(--line-soft); }
.brand h1:focus  { background: var(--accent-2); box-shadow: 0 0 0 2px var(--accent); }
.brand-sub { margin: 1px 0 0 0; font-size: 12px; color: var(--muted); }

.toolbar { display: flex; align-items: center; gap: 8px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover  { background: var(--surface-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-soft); }
.btn.icon { width: 34px; padding: 0; justify-content: center; font-size: 15px; }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ico { font-size: 13px; opacity: .9; }
.spacer { flex: 1; }

/* Shown only on phones / only on larger screens. */
.only-mobile { display: none !important; }

/* Backdrop behind the slide-in people list on mobile. */
.scrim { display: none; position: fixed; inset: 0; z-index: 70;
         background: rgba(12,16,22,.44); }
body.nav-open .scrim { display: block; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button {
  height: 34px; min-width: 36px; padding: 0 10px;
  background: var(--surface); border: 0; border-right: 1px solid var(--line);
  cursor: pointer; font-size: 14px;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); }

.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 40px; min-width: 208px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 5px; z-index: 60;
}
.menu button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; background: none; border: 0; border-radius: 7px; cursor: pointer;
}
.menu button:hover { background: var(--line-soft); }
.menu hr { margin: 5px 4px; }

/* ── Shell ─────────────────────────────────────────────────────────────── */
.shell { display: flex; flex: 1; min-height: 0; }

.sidebar {
  width: var(--side-w); flex: 0 0 var(--side-w);
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
  transition: margin-left .18s ease;
}
/* Fully tucked away — the top-bar ☰ brings it back, so no sliver is needed. */
.sidebar.collapsed { margin-left: calc(-1 * var(--side-w)); }

.side-head { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line-soft); }
.side-head input {
  flex: 1; height: 34px; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
}
.side-head input:focus { outline: none; border-color: var(--accent); background: var(--surface); }

.side-tools {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--line-soft);
}
.side-count { font-size: 12px; color: var(--faint); }

.people { flex: 1; overflow-y: auto; margin: 0; padding: 6px; list-style: none; }
.person-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer;
}
.person-row:hover { background: var(--line-soft); }
.person-row.active { background: var(--accent-2); }
.person-row input { flex: 0 0 auto; cursor: pointer; accent-color: var(--accent); }
.person-row .who { min-width: 0; flex: 1; }
.person-row .nm {
  display: block; font-size: 13.5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.person-row .dt { display: block; font-size: 11.5px; color: var(--faint); }
.person-row.dimmed .nm, .person-row.dimmed .dt { opacity: .42; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.dot.M { background: #3f7fb5; } .dot.F { background: #c4657f; }
.dot.X { background: #7f74b8; } .dot.U { background: #9aa3ad; }

.side-foot { padding: 10px; border-top: 1px solid var(--line-soft); }

/* ── Canvas ────────────────────────────────────────────────────────────── */
.canvas-wrap { flex: 1; position: relative; overflow: hidden; }
.canvas {
  position: absolute; inset: 0; overflow: hidden;
  cursor: grab; touch-action: none; background: var(--bg);
}
.canvas.dragging { cursor: grabbing; }
.stage { position: absolute; transform-origin: 0 0; will-change: transform; }
.stage svg { display: block; border-radius: 12px; box-shadow: var(--shadow); }

.canvas-hint, .zoom-badge {
  position: absolute; bottom: 14px;
  padding: 6px 11px; font-size: 12px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line); border-radius: 20px;
  backdrop-filter: blur(6px); pointer-events: none;
  transition: opacity .3s;
}
.canvas-hint { left: 14px; }
.zoom-badge  { right: 14px; font-variant-numeric: tabular-nums; }
.canvas-hint.fade { opacity: 0; }

/* ── Detail drawer ─────────────────────────────────────────────────────── */
.drawer {
  width: var(--drawer-w); flex: 0 0 var(--drawer-w);
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer h2 { font-size: 17px; letter-spacing: -.2px; }
.drawer .sub { color: var(--muted); font-size: 12.5px; margin: 3px 0 0; }
/* Header and footer stay put; only the middle scrolls, so Close (top) and
   Save (bottom) are always reachable without scrolling the panel. */
.drawer-head {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  flex: 0 0 auto; padding: 16px 18px; border-bottom: 1px solid var(--line-soft);
}
.drawer-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 18px 16px; }
.drawer-foot {
  flex: 0 0 auto; padding: 12px 18px;
  border-top: 1px solid var(--line-soft); background: var(--surface-2);
}
.drawer section { margin-top: 20px; }
.drawer section > h3 {
  font-size: 11px; letter-spacing: .9px; text-transform: uppercase;
  color: var(--faint); margin-bottom: 8px;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.rel-list { display: flex; flex-direction: column; gap: 6px; }
.rel {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: 9px; font-size: 13px;
}
.rel .grow { flex: 1; min-width: 0; }
.rel .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel .meta { display: block; font-size: 11.5px; color: var(--faint); }
.rel button { background: none; border: 0; cursor: pointer; color: var(--faint); padding: 2px 4px; }
.rel button:hover { color: var(--text); }
.rel.link { cursor: pointer; }
.rel.link:hover { border-color: var(--accent); }
.rel.child { margin-left: 18px; }
.rel .pl { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.rel .pl:hover { color: var(--accent); }
.rel button.txt {
  flex: 0 0 auto; padding: 3px 8px; font-size: 11.5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.rel button.txt:hover { color: var(--text); border-color: var(--faint); }
.rel button.txt.danger:hover { color: var(--danger); border-color: var(--danger); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { color: var(--faint); font-size: 12.5px; font-style: italic; }

/* The founding families a person descends from, with their share of each. */
.line-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.line-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 6px; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 20px;
}
.line-chip i { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.line-chip b { font-weight: 500; color: var(--faint); }

/* Editing a person in place, inside the drawer. */
.detail-form .field { margin-bottom: 8px; }
.detail-form .field > span { font-size: 11px; }
.detail-form .field input, .detail-form .field select { height: 30px; font-size: 13px; }
.detail-form .field textarea { font-size: 13px; }
.detail-form .grid-2 { gap: 0 8px; }
.detail-form .row { margin: 2px 0 10px; gap: 14px; }

/* Shown over the tree while it is filtered to one person's relatives. */
.focus-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 28px);
  padding: 5px 6px 5px 14px; font-size: 12.5px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--accent); border-radius: 20px;
  box-shadow: var(--shadow); backdrop-filter: blur(6px); z-index: 5;
}
.focus-banner strong { font-weight: 600; }

/* ── Panel (view settings) ─────────────────────────────────────────────── */
.panel {
  position: fixed; top: 70px; right: 16px; width: 340px; max-height: calc(100vh - 92px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); z-index: 70;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 16px; overflow-y: auto; }
.saved-views { display: flex; flex-direction: column; gap: 8px; }
.row-tight { display: flex; gap: 6px; }
.row-tight select, .row-tight input { flex: 1; min-width: 0; }

.panel.wide { width: 460px; }
.note { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.note.tight { margin: 8px 0 0; font-size: 11.5px; }
.mini { font-size: 11px; letter-spacing: .9px; text-transform: uppercase;
        color: var(--faint); margin-bottom: 8px; }

.badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px;
  background: var(--accent); color: #fff;
  border-radius: 9px; font-size: 11px; font-weight: 600;
}

/* Invite links */
.invite-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.invite {
  padding: 10px 12px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: 10px;
}
.invite .top { display: flex; align-items: center; gap: 8px; }
.invite .lbl { flex: 1; font-size: 13px; }
.invite .lbl em { color: var(--faint); font-style: normal; }
.url {
  display: block; margin-top: 6px; padding: 7px 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 7px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  overflow-x: auto; white-space: nowrap; color: var(--muted);
}
.invite.off { opacity: .5; }
.invite button {
  background: none; border: 0; cursor: pointer; color: var(--faint);
  padding: 2px 5px; font-size: 13px;
}
.invite button:hover { color: var(--text); }

/* Security checklist */
.check-item {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 9px 0; border-bottom: 1px solid var(--line-soft);
}
.check-item:last-child { border-bottom: 0; }
.check-item .sig {
  flex: 0 0 16px; width: 16px; height: 16px; margin-top: 1px;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 10px; font-weight: 700; color: #fff;
}
.check-item.ok   .sig { background: #3f9a63; }
.check-item.warn .sig { background: #d08a20; }
.check-item.bad  .sig { background: var(--danger); }
.check-item.info .sig { background: var(--faint); }
.check-item .txt { min-width: 0; }
.check-item .t { display: block; font-size: 13px; font-weight: 500; }
.check-item .d { display: block; margin-top: 2px; font-size: 11.5px;
                 color: var(--muted); line-height: 1.5; }

/* Inbox */
.sub {
  padding: 13px 14px; margin-bottom: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft); border-left: 3px solid var(--accent);
  border-radius: 10px;
}
.sub.approved { border-left-color: #3f9a63; }
.sub.rejected { border-left-color: var(--faint); opacity: .65; }
.sub h4 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.sub .who { font-size: 12px; color: var(--faint); }
.sub .msg {
  margin: 8px 0 0; padding: 8px 10px; font-size: 12.5px; line-height: 1.5;
  background: var(--surface); border-radius: 7px; color: var(--muted);
}
.sub dl {
  display: grid; grid-template-columns: auto 1fr; gap: 3px 12px;
  margin: 10px 0 0; font-size: 12.5px;
}
.sub dt { color: var(--faint); }
.sub dd { margin: 0; }
.sub .actions { display: flex; gap: 6px; margin-top: 12px; }
.sub .outcome { margin: 8px 0 0; font-size: 12px; color: var(--faint); }
.btn.good { background: #3f9a63; border-color: #3f9a63; color: #fff; }
.btn.good:hover { filter: brightness(1.08); }

/* ── Forms ─────────────────────────────────────────────────────────────── */
.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block; font-size: 11.5px; font-weight: 500;
  color: var(--muted); margin-bottom: 4px;
}
.field input, .field select, .field textarea, .row-tight input, .row-tight select {
  width: 100%; height: 34px; padding: 0 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r);
}
.field textarea { height: auto; padding: 8px 10px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-2);
}
.field input::placeholder { color: var(--faint); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.row { display: flex; gap: 18px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
.check.tiny { font-size: 12px; color: var(--muted); }
.check em { color: var(--faint); font-style: normal; }
.hint { margin: 2px 0 0; font-size: 11.5px; color: var(--faint); }
.form-error { flex: 1; margin: 0; color: var(--danger); font-size: 12.5px; }

/* ── Modals ────────────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(12,16,22,.44); backdrop-filter: blur(2px);
}
.modal {
  width: min(760px, 100%); max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal.narrow { width: min(560px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line-soft); background: var(--surface-2);
}
.modal-foot .btn:not(.primary):not(.danger) { margin-left: auto; }
.modal-foot .btn.primary { margin-left: 0; }
.group { padding-bottom: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.group:last-child { border-bottom: 0; margin-bottom: 0; }
.relation-group h3 { font-size: 13px; margin-bottom: 10px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  padding: 11px 18px; z-index: 120;
  background: var(--text); color: var(--surface);
  border-radius: 22px; box-shadow: var(--shadow-lg); font-size: 13px;
  animation: rise .18s ease;
}
.toast.bad { background: var(--danger); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ── Responsive & print ────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .drawer { position: fixed; right: 0; top: 62px; bottom: 0; z-index: 50; box-shadow: var(--shadow-lg); }
}

/* ── Phones & small tablets ────────────────────────────────────────────── */
@media (max-width: 760px) {
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }

  /* The top bar wraps instead of overflowing, so every action stays reachable
     and finger-sized. */
  .topbar { height: auto; flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
  .brand { order: 1; flex: 1 1 auto; }
  .topbar > .only-mobile { order: 0; }
  .toolbar { order: 2; width: 100%; flex-wrap: wrap; gap: 6px; }
  .toolbar .btn { flex: 0 0 auto; }
  .brand h1 { max-width: 62vw; font-size: 17px; }

  /* The people list becomes a slide-in drawer over the tree. */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
    width: min(320px, 86vw); flex-basis: min(320px, 86vw);
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .sidebar.collapsed { transform: translateX(-100%); margin-left: 0; }
  .sidebar.collapsed > *:not(.side-head) { opacity: 1; pointer-events: auto; }

  /* The person panel fills the screen — room to read and to type. Header and
     footer stay pinned; only the middle scrolls. */
  .drawer { position: fixed; inset: 0; width: 100%; z-index: 85; }

  /* Bigger, easier-to-hit controls, and 16px inputs so iOS does not zoom in
     every time a field is focused. */
  .btn { height: 40px; padding: 0 14px; }
  .btn.small { height: 36px; }
  .btn.icon { width: 40px; }
  .seg button { height: 40px; min-width: 42px; }
  .field input, .field select, .field textarea,
  .row-tight input, .row-tight select { height: 44px; font-size: 16px; }
  .detail-form .field input, .detail-form .field select { height: 42px; font-size: 16px; }
  .detail-form .field textarea { font-size: 16px; }
  .rel button.txt { padding: 8px 12px; font-size: 13px; }
  .check input { width: 18px; height: 18px; }

  .grid-3, .grid-2, .detail-form .grid-2 { grid-template-columns: 1fr; }

  /* View / Inbox / Share panels become sheets rather than floating cards. */
  .panel, .panel.wide {
    position: fixed; inset: auto 0 0 0; top: auto; width: 100%;
    max-height: 86vh; border-radius: var(--r-lg) var(--r-lg) 0 0;
  }

  /* So does the Export menu. Hung off its button it ran past the edge of the
     screen, with half the options cut off. */
  .menu {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    min-width: 0; padding: 10px 10px 16px;
    border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 95;
  }
  .menu button { padding: 13px 12px; font-size: 15px; }
  .menu hr { margin: 8px 6px; }

  .focus-banner { left: 8px; right: 8px; transform: none; justify-content: space-between; }
}

/* On a phone the modals fill the screen instead of floating in the middle. */
@media (max-width: 560px) {
  .modal-back { padding: 0; align-items: stretch; }
  .modal, .modal.narrow { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
}
@media print {
  .topbar, .sidebar, .drawer, .panel, .canvas-hint, .zoom-badge, .toast { display: none !important; }
  body, .canvas, .canvas-wrap { overflow: visible; height: auto; background: #fff; }
  .shell { display: block; height: auto; }
  .canvas { position: static; }
  .stage { position: static !important; transform: none !important; }
  .stage svg { box-shadow: none; width: 100%; height: auto; }
}

#stage .kin-muted { opacity: .12; }
.generation-filter { margin: 0 14px 10px; }
#stage .ft-card.kin-selected .ft-plate { stroke-width: 3.5; stroke: var(--text, #253047); }
#stage .ft-card, #stage .ft-edge, #stage .ft-drop { transition: opacity .15s; }
