:root{color-scheme:dark;--page:#080a0c;--panel:#111519;--panel-raised:#171d22;--ink:#f0f3f5;--muted:#9ba8b2;--soft:#71808b;--line:#29333b;--accent:#a5e2d1;--accent-ink:#09241c;--error:#ffb8ab;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;font-synthesis:none;background:var(--page);color:var(--ink)}
*{box-sizing:border-box}
body{margin:0;min-width:280px;background:var(--page);line-height:1.65}
button,input{font:inherit}
button{cursor:pointer}
a{color:inherit;text-decoration:none}
button,input,a,summary{touch-action:manipulation}
button:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:5px}
[hidden]{display:none!important}
.skip-link{position:fixed;left:20px;top:12px;z-index:20;padding:12px 18px;border-radius:8px;background:var(--accent);color:var(--accent-ink);transform:translateY(-150%)}
.skip-link:focus{transform:translateY(0)}
.site-header{max-width:1320px;margin:auto;min-height:64px;padding:8px 48px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.back-link{font-size:14px;color:var(--muted);display:inline-flex;gap:12px;align-items:center;min-height:44px}
.back-link:hover{color:var(--ink)}
.main-shell{max-width:1224px;margin:0 auto;padding:0 48px 72px}
.locked-view{width:min(100%,420px);margin:clamp(52px,13vh,140px) auto 80px}
.lock-symbol{width:40px;height:42px;margin-bottom:30px;position:relative;color:var(--accent)}
.lock-symbol:before{content:"";position:absolute;left:10px;top:1px;width:20px;height:23px;border:1.5px solid currentColor;border-radius:11px 11px 0 0}
.lock-symbol:after{content:"";position:absolute;left:4px;bottom:0;width:32px;height:25px;background:var(--page);border:1.5px solid currentColor;border-radius:6px}
.lock-symbol span{position:absolute;left:19px;top:26px;width:2px;height:7px;border-radius:1px;background:var(--accent);z-index:1}
h1{font-size:clamp(32px,5vw,42px);font-weight:600;line-height:1.3;letter-spacing:-.025em;margin:0 0 44px}
.login-form label{display:block;color:var(--muted);font-size:14px;margin-bottom:11px}
.password-row{display:flex;gap:10px}
.password-row input{width:0;flex:1;min-height:54px;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);letter-spacing:.14em}
.password-row input:hover{border-color:#43535e}
.button{border:1px solid var(--line);border-radius:11px;min-height:44px;padding:10px 16px;color:var(--ink);background:var(--panel);font-size:14px;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:14px;white-space:nowrap}
.button:hover{background:var(--panel-raised);border-color:#43535e}
.button-primary{border-color:var(--accent);background:var(--accent);color:var(--accent-ink);min-width:94px}
.button-primary:hover{background:#b9efdf;border-color:#b9efdf}
.button-quiet{background:transparent;color:var(--muted)}
.button:disabled{cursor:wait;opacity:.55}
.status{font-size:13px;color:var(--muted);line-height:1.65;margin:14px 0 0;min-height:22px}
.status[data-tone="error"]{color:var(--error)}
.login-status{margin-top:16px}
.library-status{padding:16px 0;border-top:1px solid var(--line)}
.library-heading{display:flex;align-items:baseline;justify-content:space-between;gap:16px;padding:8px 0 14px;border-bottom:1px solid var(--line);margin-bottom:16px}
.eyebrow{color:var(--accent);font-size:12px;letter-spacing:.14em;margin:0 0 12px}
.library-heading>.eyebrow{display:none}.library-heading h1{font-size:34px;line-height:1.25;margin:0;overflow-wrap:anywhere}
.library-meta{margin:0;color:var(--muted);font-size:13px}
.library-intro{margin:12px 0 0;color:var(--muted);font-size:14px}
.section-tabs{display:flex;gap:10px;margin-bottom:14px}
.section-tab{position:relative;min-height:46px;padding:10px 20px;display:inline-flex;align-items:center;justify-content:center;gap:10px;text-align:left;border:1px solid var(--line);border-radius:10px;color:var(--muted);background:var(--panel);font:inherit;transition:border-color .18s,background .18s}
.section-tab:hover{border-color:#4c5b66;background:var(--panel-raised)}
.section-tab[aria-selected="true"]{border-color:var(--accent);background:#11211d;color:var(--ink)}
.section-tab-index{font-size:10px;letter-spacing:.08em;color:var(--soft)}
.section-tab[aria-selected="true"] .section-tab-index{color:var(--accent)}
.section-tab-title{font-size:15px;font-weight:550;line-height:1.4;overflow-wrap:anywhere}
.section-tab-arrow{position:absolute;right:22px;top:57px;font-size:21px;line-height:1;color:var(--soft)}
.section-tab[aria-selected="true"] .section-tab-arrow{color:var(--accent)}
.section-tab-summary{font-size:13px;display:block;line-height:1.65;margin-top:10px;color:var(--muted);overflow-wrap:anywhere}
.map-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:10px}
.map-toolbar-title{font-size:13px;color:var(--muted);margin:0}
.map-actions{display:flex;gap:8px}
.map-actions .button{font-size:12px;min-height:36px;padding:6px 12px}
.section-panel:focus-visible{outline:2px solid var(--line);outline-offset:9px;border-radius:16px}
.map-root{border:1px solid #39554b;border-radius:14px;padding:16px 22px;background:linear-gradient(125deg,#12231d,var(--panel) 70%);position:relative}
.map-root-label{display:inline;font-size:10px;letter-spacing:.08em;color:var(--accent);margin:0 10px 0 0}
.map-root h2{display:inline;font-size:23px;font-weight:550;line-height:1.3;margin:0;overflow-wrap:anywhere}
.map-root-summary{font-size:13px;color:#bcc7ce;margin:5px 0 0;overflow-wrap:anywhere;white-space:pre-wrap}
.highlights{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin:12px 0 0;padding:10px 0 0;border-top:1px solid #2f423b}
.highlight{min-width:0}
.highlight dt{font-size:11px;color:var(--muted);margin-bottom:3px}
.highlight dd{font-size:16px;line-height:1.5;margin:0;color:var(--ink);overflow-wrap:anywhere;white-space:pre-wrap}
.section-notes{color:var(--muted);font-size:12px;margin:10px 0 0;padding-left:18px;overflow-wrap:anywhere}
.section-notes li+li{margin-top:7px}
.source-reference{font-size:12px;color:var(--soft);margin:9px 0 0;overflow-wrap:anywhere}
.node-tree{position:relative;margin:0 0 0 28px;padding:28px 0 0 30px;border-left:1px solid #385048}
.node-tree:before{content:"";position:absolute;left:-1px;top:0;height:16px;width:1px;background:var(--accent)}
.node-card{position:relative;border:1px solid var(--line);border-radius:15px;background:var(--panel);margin:0 0 16px;min-width:0}
.node-card:before{content:"";position:absolute;top:32px;right:100%;width:31px;height:1px;background:#385048}
.node-card:last-child{margin-bottom:0}
.node-card>summary{position:relative;list-style:none;padding:21px 62px 21px 23px;cursor:pointer;min-height:72px;border-radius:14px;overflow-wrap:anywhere}
.node-card>summary::-webkit-details-marker{display:none}
.node-card>summary::marker{content:""}
.node-card>summary:hover{background:#171e23}
.node-card>summary:before{content:"";position:absolute;left:-36px;top:28px;width:9px;height:9px;background:var(--page);border:1px solid #618579;border-radius:50%}
.node-title{font-size:17px;font-weight:550;display:block;line-height:1.5}
.node-summary{font-size:13px;color:var(--muted);display:block;line-height:1.7;margin-top:6px;white-space:pre-wrap}
.node-toggle{position:absolute;right:25px;top:29px;width:11px;height:11px;border-right:1.5px solid var(--muted);border-bottom:1.5px solid var(--muted);transform:rotate(45deg);transition:transform .18s}
.node-card[open]>summary .node-toggle{transform:translateY(5px) rotate(225deg);border-color:var(--accent)}
.node-card[open]>summary .node-title{color:#d1f3e9}
.node-content{padding:0 23px 22px}
.parameters{margin:0;border-top:1px solid var(--line)}
.parameter{display:grid;grid-template-columns:minmax(100px,.34fr) minmax(0,1fr);gap:20px;padding:16px 0;border-bottom:1px solid #222b32}
.parameter:last-child{border-bottom:0;padding-bottom:3px}
.parameter dt{font-size:13px;font-weight:400;color:var(--muted);overflow-wrap:anywhere}
.parameter dd{margin:0;min-width:0;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.parameter-note,.parameter-source{display:block;margin-top:7px;font-size:12px;line-height:1.7;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere}
.parameter-source{color:var(--soft)}
.node-content>.node-tree{margin-left:5px;padding:24px 0 0 23px;border-color:#2c423a}
.node-content>.node-tree>.node-card:before{width:24px}
.node-content>.node-tree>.node-card>summary:before{left:-29px}
.node-content>.node-tree>.node-card{background:#0d1114}
.node-empty{font-size:13px;color:var(--muted);margin:0;padding-top:13px}
.sources-panel{margin-top:20px;border-top:1px solid var(--line);padding:8px 0 0}
.sources-panel>summary{cursor:pointer;font-size:13px;color:var(--muted);min-height:44px;padding:8px 0}
.sources-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0 0}
.source-card{margin:0;border:1px solid var(--line);padding:18px;border-radius:12px;min-width:0}
.source-name{font-size:13px;color:#c9d3da;margin:0;overflow-wrap:anywhere}
.source-date,.source-notes{font-size:12px;color:var(--muted);margin:7px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}
.empty-library{margin:32px 0;color:var(--muted)}
/* The main stem feeds three compact branches. Details expand in place. */
.section-context{margin-top:8px;border-top:1px solid #293d35;padding-top:5px}
.section-context>summary{min-height:28px;cursor:pointer;font-size:12px;color:var(--muted);width:fit-content}
.section-context[open]>summary{color:var(--accent)}
.root-tree{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start;margin:0;padding:24px 0 0;border:0}
.root-tree:before{left:50%;top:0;height:12px;background:#385048}
.root-tree:after{content:"";position:absolute;top:12px;left:calc(100% / 6);right:calc(100% / 6);height:1px;background:#385048;pointer-events:none}
.root-tree>.node-card{margin:0;height:fit-content}
.root-tree>.node-card:before{left:50%;right:auto;top:-12px;width:1px;height:12px}
.root-tree>.node-card>summary{padding:15px 38px 15px 17px;min-height:92px}
.root-tree>.node-card>summary:before{left:calc(50% - 3px);top:-16px;width:7px;height:7px;z-index:1}
.root-tree>.node-card:nth-child(n+4):before,.root-tree>.node-card:nth-child(n+4)>summary:before{display:none}
.root-tree>.node-card>summary .node-title{font-size:15px;line-height:1.5}
.root-tree>.node-card>summary .node-summary{font-size:12px;line-height:1.6;margin-top:4px}
.root-tree>.node-card>summary .node-toggle{right:17px;top:22px;width:8px;height:8px}
.root-tree>.node-card>.node-content{padding:0 17px 17px}
.root-tree>.node-card>.node-content>.parameters>.parameter{grid-template-columns:1fr;gap:4px;padding:11px 0}
.root-tree>.node-card>.node-content>.parameters>.parameter dt{font-size:12px}
.root-tree>.node-card>.node-content>.parameters>.parameter dd{font-size:13px}
.library-status:empty{display:none}
/* Private images arrive with the authenticated API response. */
.section-image{margin:16px 0 0;border:1px solid var(--line);border-radius:14px;background:#000;overflow:hidden}
.section-image-toolbar{display:flex;justify-content:flex-end;align-items:center;gap:12px;padding:12px;background:#000}
.image-zoom-button{min-height:40px;padding:8px 14px;border:1px solid #35423d;border-radius:9px;background:#101715;color:var(--ink);font-size:13px}
.image-zoom-button:hover{background:#17251f;border-color:var(--accent)}
.section-image-scroll{min-width:0;min-height:0;overflow:auto;background:#000;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.section-image-photo{display:block;width:100%;max-width:100%;height:auto;background:#000}
.section-image-caption{padding:13px 18px 16px;margin:0;font-size:12px;line-height:1.65;color:var(--muted);background:#000;overflow-wrap:anywhere}
.section-image.is-expanded{position:fixed;inset:0;z-index:100;margin:0;width:100%;height:100vh;height:100dvh;border:0;border-radius:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;isolation:isolate;background:#000;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.section-image.is-expanded .section-image-toolbar{padding:12px 18px;border-bottom:1px solid #202b25}
.section-image.is-expanded .section-image-scroll{padding:0 12px}
.section-image.is-expanded .section-image-photo{width:auto;min-width:100%;max-width:none;height:auto;margin:0 auto}
.section-image.is-expanded .section-image-caption{padding:12px 18px;border-top:1px solid #202b25}
@media(max-width:900px){
  .main-shell{padding-left:32px;padding-right:32px}
  .site-header{padding-left:32px;padding-right:32px}
  .root-tree{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .root-tree:after{left:25%;right:25%}
  .root-tree>.node-card:nth-child(3):before,.root-tree>.node-card:nth-child(3)>summary:before{display:none}
  .root-tree>.node-card>summary{min-height:96px}
}
@media(max-width:700px){
  .site-header{min-height:60px;padding:8px 22px}
  .main-shell{padding:0 22px 40px}
  .locked-view{margin-top:clamp(50px,12vh,100px)}
  .library-heading{padding-top:10px;padding-bottom:12px;margin-bottom:14px;gap:6px;flex-direction:column;align-items:flex-start}
  .library-heading h1{font-size:30px}
  .library-meta{font-size:12px}
  .section-tabs{gap:8px;margin-bottom:12px}
  .section-tab{flex:1;min-width:0;padding:10px 12px;gap:7px;border-radius:9px}
  .section-tab-title{font-size:14px;white-space:nowrap}
  .section-tab-index{display:none}
  .map-toolbar{align-items:center;gap:10px;margin-bottom:9px}
  .map-toolbar-title{font-size:12px}
  .map-actions{gap:6px}
  .map-actions .button{padding:6px 9px;min-height:38px}
  .map-root{padding:16px}
  .map-root h2{font-size:21px}
  .highlights{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
  .highlight dd{font-size:15px}
  .node-tree{margin-left:13px;padding-left:19px;padding-top:20px}
  .node-card:before{width:20px}
  .node-card>summary:before{left:-25px}
  .node-card>summary{padding:17px 40px 17px 15px}
  .node-title{font-size:15px}
  .node-toggle{right:17px;top:24px;width:9px;height:9px}
  .node-content{padding:0 15px 17px}
  .parameter{grid-template-columns:1fr;gap:5px;padding:12px 0}
  .parameter dd{font-size:14px}
  .node-content>.node-tree{margin-left:1px;padding-left:13px}
  .node-content>.node-tree>.node-card:before{width:14px}
  .node-content>.node-tree>.node-card>summary:before{left:-19px;width:7px;height:7px;top:27px}
  .node-content>.node-tree .node-card>summary{padding-left:13px}
  .node-content>.node-tree .node-content{padding-left:13px;padding-right:13px}
  .root-tree{display:grid;grid-template-columns:1fr;gap:10px;margin:0 0 0 12px;padding:20px 0 0 17px;border-left:1px solid #385048}
  .root-tree:before{left:-1px;top:0;height:14px}
  .root-tree:after{display:none}
  .root-tree>.node-card:before,.root-tree>.node-card:nth-child(n+4):before{display:block;left:auto;right:100%;top:28px;width:18px;height:1px}
  .root-tree>.node-card>summary{padding:15px 38px 15px 16px;min-height:0}
  .root-tree>.node-card>summary:before,.root-tree>.node-card:nth-child(n+4)>summary:before,.root-tree>.node-card:nth-child(3)>summary:before{display:block;left:-22px;top:25px;width:7px;height:7px}
  .root-tree>.node-card>summary .node-toggle{top:22px}
  .sources-list{grid-template-columns:1fr}
}
@media(max-width:380px){
  .site-header{padding-left:16px;padding-right:16px}
  .main-shell{padding-left:16px;padding-right:16px}
  .section-tab{padding-left:9px;padding-right:9px}
  .section-tab-index{display:none}
  .map-toolbar{flex-wrap:wrap}
  .map-root{padding:15px}
  .button-quiet{padding-left:12px;padding-right:12px}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}
