  #mt { position: relative; max-width: 1100px; margin: 0 auto;
    padding: 24px; background: #faf9f6;
    font-family: Georgia, "Times New Roman", serif; color: #333; }
  #mt h1 { font-size: 18px; font-weight: normal; letter-spacing: .5px;
    color: #6d4aff; margin: 0 0 4px 0; }
  #mt .sub { font-size: 12px; color: #999; font-style: italic;
    margin: 0 0 12px 0; }
  #mt-census { font-size: 11px; color: #888; font-style: italic;
    margin: 0 0 16px 0; border-top: 3px solid #6d4aff; padding-top: 4px; }
  #mt-search { display: block; margin: 0 0 16px 0; padding: 6px 10px;
    width: 260px; font-family: Georgia, serif; font-size: 13px;
    border: 1px solid #c8c4bd; border-radius: 5px; background: #fff;
    outline: none; box-sizing: border-box; }
  #mt-search:focus { border-color: #6d4aff; }
  #mt-count { font-size: 11px; color: #777; margin-left: 10px;
    font-style: italic; }

  #mt .tree ul { display: flex; flex-direction: column;
    justify-content: center; padding-left: 32px; list-style: none; }
  #mt .tree li { position: relative; display: flex; align-items: center;
    padding: 10px 0; }
  #mt .tree li::before { content: ''; position: absolute; left: -32px;
    top: 50%; width: 32px; border-top: 2px solid #c8c4bd; }
  #mt .tree li::after { content: ''; position: absolute; left: -32px;
    top: 50%; bottom: -50%; border-left: 2px solid #c8c4bd; }
  #mt .tree li:last-child::after { bottom: 50%; }
  #mt .tree li:only-child::after { display: none; }
  #mt .tree > ul { padding-left: 0; }
  #mt .tree > ul > li::before, #mt .tree > ul > li::after { display: none; }

  #mt li.collapsed > ul { display: none; }
  #mt li.collapsed > .person .chev::after { content: '+'; }
  #mt .person .chev::after { content: '-'; }

  #mt .person { display: inline-flex; flex-direction: column;
    min-width: 150px; max-width: 210px; padding: 4px 9px 4px 6px;
    background: #fff; border: 1px solid #d8d4cc; border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,.07); text-align: left;
    flex-shrink: 0; box-sizing: border-box;
    transition: opacity .2s, box-shadow .2s, border-color .2s,
                background .2s; }
  #mt .person:hover { border-color: #6d4aff; cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,.16); }
  #mt .prow { display: flex; align-items: center; gap: 6px; }
  #mt .person .nm { display: block; font-size: 12px; line-height: 1.25; }

  #mt .person .det { display: none; margin-top: 4px; padding-top: 4px;
    border-top: 1px solid #e5e1d8; font-size: 11px; color: #777;
    font-style: italic; line-height: 1.4; }
  #mt .person.open .det { display: block; }
  #mt .person.open { max-width: 380px; background: #ece7ff; }
  #mt .person .det .dd { display: block; }
  #mt .person .det .ds { display: block; color: #999; }

  #mt .det .species-info { display: flex; flex-wrap: wrap; gap: 6px;
    margin: 6px 0 0 0; align-items: baseline; }
  #mt .det .thumbnail { width: 110px; height: 70px; object-fit: cover;
    border-radius: 4px; border: 1px solid #ccc;
    box-shadow: 0 1px 3px rgba(0,0,0,.15); margin: 4px 0 0 0;
    cursor: zoom-in; }

  #mt .person .chev { display: inline-block; width: 16px; height: 16px;
    margin-left: 4px; line-height: 16px; text-align: center;
    color: #6d4aff; font-size: 12px; background: #e9e6df;
    border: 1px solid #d0ccc3; border-radius: 4px; cursor: pointer;
    user-select: none; flex-shrink: 0; }
  #mt .person .chev:hover { background: #6d4aff; color: #fff; }
  #mt li.childless .chev { visibility: hidden; }

  /* ---- generation colors ---- */
  #mt .p-root  { border-left: 5px solid #444; }
  #mt .p-g1 { border-left: 5px solid #C9A227; }
  #mt .p-g2 { border-left: 5px solid #8B5A2B; }
  #mt .p-g3 { border-left: 5px solid #D2622A; }
  #mt .p-g4 { border-left: 5px solid #2C7F7A; }
  #mt .p-g5 { border-left: 5px solid #4A7BAB; }
  #mt .p-g6 { border-left: 5px solid #6d4aff; }
  #mt .p-g7 { border-left: 5px solid #9d47ff; }
  #mt .p-probe { border-left: 5px dashed #aaa; }

  /* ---- timeline ---- */
  #mt .timeline { display: flex; align-items: center; margin: 6px 0 0 0;
    font-size: 10px; color: #888; }
  #mt .tl-lab { flex-shrink: 0; }
  #mt .tl-track { flex: 1; height: 8px; margin: 0 8px; position: relative;
    background: #eceae4; border-radius: 4px; }
  #mt .tl-fill { position: absolute; top: 0; height: 100%;
    border-radius: 4px;
    background: linear-gradient(to right, #6d4aff, #a994ff); }
  #mt .tl-fill.ongoing::after { content: ''; position: absolute;
    right: -4px; top: 0; width: 8px; height: 8px; border-radius: 50%;
    background: #6d4aff;
    animation: mttlpulse 1.6s ease-out infinite; }
  @keyframes mttlpulse {
    0%   { box-shadow: 0 0 0 0 rgba(109,74,255,.6); }
    100% { box-shadow: 0 0 0 10px rgba(109,74,255,0); } }
  #mt .p-probe .tl-fill { background: #bbb; }
  #mt .p-g1 .tl-fill { background: linear-gradient(to right,#C9A227,#e6cf80);}
  #mt .p-g2 .tl-fill { background: linear-gradient(to right,#8B5A2B,#c49a68);}
  #mt .p-g3 .tl-fill { background: linear-gradient(to right,#D2622A,#eb9a6c);}
  #mt .p-g4 .tl-fill { background: linear-gradient(to right,#2C7F7A,#79bdb9);}
  #mt .p-g5 .tl-fill { background: linear-gradient(to right,#4A7BAB,#8fb4d2);}
  #mt .p-g7 .tl-fill { background: linear-gradient(to right,#9d47ff,#c9a6ff);}

  #mt .dimmed { opacity: .18; }
  #mt .lineage { opacity: 1 !important; background: #ece7ff;
    border-color: #6d4aff;
    box-shadow: 0 0 0 3px #6d4aff, 0 2px 8px rgba(0,0,0,.2);
    font-weight: bold; }
  #mt .person.hit { border-color: #6d4aff !important;
    box-shadow: 0 0 0 3px rgba(109,74,255,.25); }
  @keyframes mtszpulse {
    0%   { box-shadow: 0 0 0 0 rgba(109,74,255,.55); }
    70%  { box-shadow: 0 0 0 14px rgba(109,74,255,0); }
    100% { box-shadow: 0 0 0 14px rgba(109,74,255,0); } }
  #mt .person.pulse { animation: mtszpulse 1.2s ease-out 2; }

  #mt-peek { position: absolute; top: 0; left: 0; display: none;
    min-width: 180px; max-width: 260px; padding: 8px 11px;
    background: #fff; border: 1px solid #d8d4cc;
    border-left: 5px solid #6d4aff; border-radius: 5px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 12px;
    pointer-events: none; z-index: 900; }
  #mt-peek .pn { display: block; font-size: 13px; }
  #mt-peek .pd { display: block; color: #777; font-style: italic;
    font-size: 11px; margin-top: 2px; }
  #mt-peek .thumb { display: block; width: 100%; height: auto;
    border-radius: 4px; margin-top: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2); }

  #mt .tree { box-shadow: 0 10px 40px rgba(0,0,0,.12); }

  #mt-toggle-all { position: fixed; top: 10px; right: 12px; z-index: 1050;
    font: 600 13px/1.2 system-ui, sans-serif; color: #555;
    background: #f2f2f2; border: 1px solid #ccc;
    border-left: 4px solid #9c9c9c; border-radius: 14px;
    padding: 6px 14px; cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
    transition: background .15s, transform .15s; }
  #mt-toggle-all:hover { background: #e9e9e9; transform: translateY(-1px); }

  #mt-lightbox { display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.85); z-index: 9000;
    align-items: center; justify-content: center; cursor: pointer; }
  #mt-lightbox img { max-width: 90vw; max-height: 90vh;
    border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,.4); }

  #mt-credits { margin-top: 28px; padding-top: 10px;
    border-top: 1px solid #d8d4cc; font-size: 11px; color: #777;
    font-style: italic; }
  #mt-credits p { margin: 0 0 6px 0; }
  #mt-credits a { color: #6d4aff; }
