/* Lineage Lens PoC. License: AGPL-3.0-only. Copyleft: no copying without share-alike. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: #14161c; color: #ece8dd; font-family: system-ui, "Segoe UI", sans-serif; overflow-x: hidden; }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.mark { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 35% 35%, #f0d48a, #C39A3B 55%, #5c4512);
  box-shadow: 0 0 18px rgba(195,154,59,.45); }
.cursive { font-family: "Segoe Script", "Brush Script MT", "Apple Chancery", cursive; font-size: 34px; margin: 0; color: #f0d48a; letter-spacing: .5px; animation: settle 1.6s ease-out; }
@keyframes settle { from { opacity: 0; letter-spacing: 6px; } to { opacity: 1; letter-spacing: .5px; } }
.tag { margin: 2px 0 0; color: #b9b2a2; font-size: 13px; }
.searchwrap { position: relative; flex: 1 1 260px; max-width: 520px; }
.searchwrap input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #3a3f4d; background: #1d2029; color: #ece8dd; font-size: 15px; }
#searchResults { position: absolute; z-index: 30; left: 0; right: 0; top: 46px; background: #22252f; border: 1px solid #3a3f4d; border-radius: 10px; overflow: hidden; }
#searchResults button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #30343f; color: #ece8dd; padding: 9px 12px; font-size: 14px; cursor: pointer; }
#searchResults button span { color: #a49e8f; font-size: 12px; }
.doors { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; }
.doorbtn { background: #1d2029; color: #ece8dd; border: 1px solid #3a3f4d; padding: 9px 16px; border-radius: 999px; font-size: 15px; cursor: pointer; }
.doorbtn.active { border-color: #C39A3B; color: #f0d48a; box-shadow: inset 0 0 0 1px #C39A3B; }
.filterbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px 16px; color: #cfc9ba; font-size: 14px; }
.filterbar select { background: #1d2029; color: #ece8dd; border: 1px solid #3a3f4d; border-radius: 8px; padding: 6px; }
.chk { display: inline-flex; gap: 6px; align-items: center; }
.fileops { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.btn { background: #262a36; color: #ece8dd; border: 1px solid #454b5c; border-radius: 8px; padding: 7px 12px; font-size: 13.5px; cursor: pointer; }
.btn.danger { border-color: #7a3b3b; color: #f0b4b4; }
.filelabel, .stats { padding: 0 16px; margin: 4px 0; color: #a49e8f; font-size: 13px; }
.changebanner { margin: 6px 16px; padding: 10px 12px; background: #2b2413; border: 1px solid #C39A3B; border-radius: 10px; color: #f0d48a; font-size: 14px; }
main { padding: 6px 16px 16px; }
#brainCanvas { width: 100%; height: min(540px, 62vh); display: block; border-radius: 14px; background: radial-gradient(ellipse at 50% 40%, #1e2434 0%, #12141b 70%); border: 1px solid #2b2f3c; touch-action: none; }
.hint { color: #98917f; font-size: 12.5px; line-height: 1.5; }
#treeWrap { overflow: auto; border: 1px solid #2b2f3c; border-radius: 14px; background: linear-gradient(#191c24, #14161c); }
#treeSvg { min-width: 640px; width: 100%; height: auto; display: block; }
.archbar { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.archbar select { background: #1d2029; color: #ece8dd; border: 1px solid #3a3f4d; border-radius: 8px; padding: 7px; }
.count { color: #a49e8f; font-size: 13px; }
.tablewrap { overflow: auto; border: 1px solid #2b2f3c; border-radius: 12px; max-height: 560px; }
table.arch { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.arch th { position: sticky; top: 0; background: #22252f; text-align: left; padding: 8px 10px; color: #f0d48a; }
table.arch td { padding: 7px 10px; border-top: 1px solid #262a35; }
table.arch tr[data-person] { cursor: pointer; }
table.arch tr[data-person]:hover td { background: #1e222d; }
.wiki { max-width: 860px; }
.wiki h2 { font-size: 26px; margin: 6px 0 10px; color: #f4efe2; }
.wiki h3 { color: #f0d48a; margin: 18px 0 6px; font-size: 17px; }
.wiki a { color: #9ec2ff; }
.infobox { float: right; width: 250px; max-width: 46%; background: #1d2029; border: 1px solid #3a3f4d; border-radius: 12px; padding: 10px 14px; margin: 0 0 12px 14px; }
.infobox dl { margin: 0; }
.infobox dt { color: #a49e8f; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; margin-top: 8px; }
.infobox dd { margin: 2px 0 0; font-size: 14.5px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 5px 0; border-bottom: 1px solid #262a35; font-size: 14px; }
.etype { display: inline-block; min-width: 52px; color: #f0d48a; font-size: 12px; }
.srcn { color: #98917f; font-size: 12px; }
.conflict { background: #2b2113; border: 1px solid #b97f16; border-radius: 10px; padding: 9px 12px; margin-top: 10px; font-size: 14px; }
.changenote { background: #16281a; border: 1px solid #3f7a4a; border-radius: 10px; padding: 4px 14px 10px; }
.fam { font-size: 14.5px; line-height: 1.7; }
footer { padding: 8px 16px 22px; color: #8d8776; font-size: 12.5px; line-height: 1.55; border-top: 1px solid #262a35; margin: 0 16px; }
body.at-start .doors, body.at-start .filterbar, body.at-start .searchwrap,
body.at-start .filelabel, body.at-start .stats, body.at-start main, body.at-start footer { display: none; }
#startPanel { max-width: 760px; margin: 10px auto 30px; padding: 6px 18px 10px; }
#startPanel[hidden] { display: none; }
.starttitle { font-size: 30px; line-height: 1.25; color: #f4efe2; margin: 12px 0 20px; }
.steplabel { font-size: 26px; font-weight: 700; color: #f0d48a; margin: 20px 0 10px; }
#dropZone { border: 3px dashed #C39A3B; border-radius: 16px; background: #1b1e28; min-height: 190px;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 22px; cursor: pointer; }
#dropZone p { font-size: 21px; line-height: 1.5; color: #ece8dd; margin: 0; max-width: 520px; }
#dropZone.over { background: #2b2413; border-color: #f0d48a; }
.dropmsg { font-size: 19px; line-height: 1.5; background: #262a36; border: 1px solid #454b5c; border-radius: 10px; padding: 12px 14px; }
#step2Btn { background: #C39A3B; color: #191408; border: 0; border-radius: 14px; font-size: 25px; font-weight: 700;
  padding: 20px 30px; cursor: pointer; width: 100%; }
#step2Btn:hover { background: #d9ae4e; }
.startsub { font-size: 17px; line-height: 1.55; color: #cfc9ba; }
.blanktree { margin: 4px 0 6px; text-align: center; }
.blanktree svg { width: min(340px, 80%); height: auto; }
.blanktree figcaption { font-size: 19px; color: #b9b2a2; margin-top: 2px; }
.practice { margin-top: 26px; border-top: 1px solid #2b2f3c; padding-top: 18px; }
.starttoggle { font-size: 20px; font-weight: 700; color: #f0d48a; margin-right: 16px; }
.starttoggle input { width: 22px; height: 22px; accent-color: #C39A3B; }
.chk input[type="checkbox"] { accent-color: #C39A3B; }
#practiceBtn { background: none; border: 1px solid #454b5c; color: #ece8dd; border-radius: 10px; font-size: 18px; padding: 12px 20px; cursor: pointer; }
@media (max-width: 480px) {
  .cursive { font-size: 27px; }
  #brainCanvas { height: 430px; }
  .infobox { float: none; width: 100%; max-width: 100%; margin-left: 0; }
  .fileops { margin-left: 0; }
}
