/* Sitemap graph page. Uses the sf-* tokens from styles.css. */
.sitemap-page{--edge-fwd:rgb(0 0 0 / .4);--edge-back:rgb(0 0 0 / .4);--edge-out:var(--sf-green);--edge-in:var(--sf-cobalt);--edge-unexpected:var(--sf-red);--edge-chain:rgb(0 0 0 / .8);--edge-return:var(--sf-pink)}
.back-link{color:var(--sf-white);border:1px solid rgb(255 255 255 / .7);border-radius:var(--sf-radius-full);padding:6px 14px;font-size:12px;letter-spacing:.02em;white-space:nowrap}
.back-link:hover{background:var(--sf-white);color:var(--sf-black);text-decoration:none}
.graph-main{padding:20px 24px 0;overflow:visible}
.graph-main>*{max-width:none}
.graph-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.graph-heading h1{font-size:30px}
.graph-heading p{margin:8px 0 0;font-size:13px;color:var(--muted);line-height:1.3;max-width:720px}
.graph-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.graph-toolbar>button{font-size:12px}
.graph-toolbar .zoom-controls{margin-left:0}
.segmented{display:inline-flex;border:1px solid var(--line-strong);border-radius:var(--sf-radius-full);padding:2px;background:var(--sf-white)}
.segmented button{border:0;padding:5px 12px;font-size:12px;background:transparent}
.segmented button[aria-pressed=true],#labels-toggle[aria-pressed=true]{background:var(--sf-black);color:var(--sf-white);border-color:var(--sf-black)}
.graph-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:16px;height:calc(100vh - var(--header) - 128px);min-height:480px}
.graph-side{overflow:auto;border:1px solid var(--line);border-radius:var(--sf-radius-md);padding:14px 14px 18px;background:var(--sf-white)}
.side-block>summary{cursor:pointer;font-weight:700;font-size:14px;padding:4px 0 8px;letter-spacing:-.01em}
.side-block+.side-block{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}
.side-hint{font-size:12px;color:var(--muted);line-height:1.35;margin:4px 0 10px}
.area-row{display:flex;align-items:center;gap:8px;padding:3px 0;font-size:13px}
.area-row input{width:16px;height:16px;margin:0;accent-color:var(--sf-black);flex-shrink:0}
.area-row input:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.area-swatch{width:14px;height:14px;border-radius:4px;flex-shrink:0;border:1px solid rgb(0 0 0 / .15)}
.area-name{flex:1;border:0;background:none;padding:3px 6px;text-align:left;font-weight:500;letter-spacing:0;font-size:13px;border-radius:var(--sf-radius-full)}
.area-name:hover{background:var(--wash)}
.area-count{font-size:11px;font-weight:600;background:var(--wash-2);border-radius:var(--sf-radius-full);padding:1px 7px}
.area-bulk{display:flex;gap:6px;margin-top:8px}
.area-bulk button{font-size:12px;padding:4px 12px}
.legend{list-style:none;margin:0 0 10px;padding:0;font-size:12px;line-height:1.3}
.legend li{display:flex;align-items:center;gap:8px;margin:6px 0}
.legend svg{flex-shrink:0}
.lg-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;display:inline-block}
.lg-observed{background:var(--sf-green)}
.lg-withheld{border:2px solid var(--sf-black);background:var(--sf-white)}
.lg-source{background:var(--sf-cobalt)}
.lg-blocked{background:var(--sf-yellow)}
.lg-tag,.node-tag{font-size:10px;font-weight:700;letter-spacing:.02em;border:1px solid var(--sf-pink);background:var(--pink-wash);color:var(--sf-black);border-radius:var(--sf-radius-full);padding:1px 7px;white-space:nowrap}
.lg-edge{stroke-width:2.5;fill:none}
.lg-edge.fwd{stroke:var(--edge-fwd)}
.lg-edge.back{stroke:var(--edge-back);stroke-dasharray:6 4}
.lg-edge.auto{stroke:var(--edge-fwd);stroke-dasharray:1.5 4;stroke-linecap:round;stroke-width:3}
.lg-edge.unexpected{stroke:var(--edge-unexpected)}
.lg-edge.out{stroke:var(--edge-out);stroke-width:3.5}
.lg-edge.in{stroke:var(--edge-in);stroke-width:3.5}
.graph-stage{position:relative;min-width:0;display:flex;flex-direction:column}
.graph-viewport{position:relative;flex:1;overflow:hidden;border:1px solid var(--line);border-radius:var(--sf-radius-md);background-color:var(--wash);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23000' fill-opacity='.1'/%3E%3C/svg%3E");cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.graph-viewport:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.graph-viewport.dragging{cursor:grabbing}
.graph-world{position:absolute;left:0;top:0;transform-origin:0 0}
.graph-edges{position:absolute;left:0;top:0;overflow:visible;pointer-events:none}
.graph-edges path{fill:none;stroke-width:1.6;transition:opacity .12s}
.graph-edges .e-fwd{stroke:var(--edge-fwd)}
.graph-edges .e-back{stroke:var(--edge-back);stroke-dasharray:7 5}
.graph-edges .e-auto{stroke:var(--edge-fwd);stroke-dasharray:1.5 5;stroke-linecap:round;stroke-width:2.4}
.graph-edges .e-unexpected{stroke:var(--edge-unexpected);stroke-width:2.4}
.graph-edges .e-hidden{display:none}
.graph-world.tracing .graph-edges path{opacity:.08}
.graph-world.tracing .graph-edges path.e-out,.graph-world.tracing .graph-edges path.e-in{opacity:1;stroke-width:3.4}
.graph-edges path.e-out{stroke:var(--edge-out)}
.graph-edges path.e-in{stroke:var(--edge-in)}
.graph-edges path.e-unexpected.e-out,.graph-edges path.e-unexpected.e-in{stroke:var(--edge-unexpected)}
.cluster{position:absolute;border:1.5px solid var(--cl);border-radius:var(--sf-radius-md);background:var(--wash)}
.cluster-label{position:absolute;z-index:1;left:0;bottom:100%;margin-bottom:4px;background:var(--sf-white);padding:2px 6px;border-radius:var(--sf-radius-sm);font-weight:800;letter-spacing:-.01em;color:var(--sf-black);white-space:nowrap;transform-origin:0 100%;font-size:16px;line-height:1}
.edge-label{position:absolute;transform:translate(-50%,-50%);background:var(--sf-white);border:1px solid var(--line-strong);border-radius:var(--sf-radius-full);font-size:11px;font-weight:600;padding:2px 8px;white-space:nowrap;pointer-events:none;display:none;max-width:220px;overflow:hidden;text-overflow:ellipsis;line-height:1.3}
.edge-label.l-unexpected{border-color:var(--sf-red);color:var(--sf-black)}
.edge-label.l-auto{border-style:dashed}
.show-labels .edge-label:not(.l-hidden),.edge-label.l-on{display:block}
.graph-world.tracing .edge-label.l-on{z-index:3}
.node{position:absolute;display:flex;flex-direction:column;background:var(--sf-white);border:1px solid var(--line-strong);border-radius:var(--sf-radius-sm);color:var(--sf-black);text-decoration:none;font-weight:400;overflow:hidden;box-shadow:var(--shadow);transition:opacity .12s}
.node:hover{text-decoration:none}
.node::before{content:'';height:5px;flex-shrink:0;background:var(--ac)}
.node:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.node.withheld{border-style:dashed;border-color:rgb(0 0 0 / .45)}
.node-body{display:flex;gap:9px;padding:7px 9px;min-height:0;flex:1}
.node-thumb{width:34px;height:74px;flex-shrink:0;border-radius:4px;overflow:hidden;background:var(--wash);border:1px solid var(--line)}
.node-thumb img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
.node-thumb.none{border:1px dashed var(--line-strong);display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--subtle)}
.node-text{min-width:0;display:flex;flex-direction:column;gap:4px}
.node-title{font-size:13px;font-weight:700;line-height:1.15;letter-spacing:-.01em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.node-status{font-size:11px;color:var(--muted);display:flex;align-items:center;gap:5px;white-space:nowrap}
.node-status .node-tag{margin-left:2px;padding:0 6px}
.node-status .lg-dot{width:8px;height:8px}
.node-area{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.node-tags{display:flex;gap:4px}
.mode-shots .node-body{flex-direction:column;gap:6px;padding:8px 10px 10px}
.mode-shots .node-thumb{width:100%;height:auto;aspect-ratio:402/874;border-radius:6px}
.mode-shots .node-thumb.none{flex-direction:column;gap:6px;padding:10px;text-align:center;font-size:12px;line-height:1.3;color:var(--muted)}
.mode-shots .node-thumb.none strong{color:var(--sf-black)}
.node-counts{font-size:11px;color:var(--muted)}
.graph-world.tracing .node{opacity:.28}
.graph-world.tracing .node.n-focus,.graph-world.tracing .node.n-near{opacity:1}
.node.n-focus{outline:3px solid var(--sf-green);outline-offset:2px}
.node.n-pinned{outline:3px solid var(--sf-black);outline-offset:2px}
.node.n-filtered{opacity:.12!important;pointer-events:none}
.graph-info{position:absolute;right:12px;top:12px;width:min(340px,calc(100% - 24px));max-height:calc(100% - 70px);overflow:auto;background:var(--sf-white);border:1px solid var(--line-strong);border-radius:var(--sf-radius-md);box-shadow:0 4px 16px rgb(0 0 0 / .12);padding:14px 16px;font-size:12px;z-index:4}
.graph-info h2{font-size:17px;font-weight:700;margin:0 0 6px;line-height:1.1;letter-spacing:-.01em;overflow-wrap:anywhere}
.graph-info h3{font-size:11px;letter-spacing:.08em;font-weight:700;margin:12px 0 4px;text-transform:uppercase}
.graph-info ul{margin:0;padding-left:16px;line-height:1.35}
.graph-info li{margin:2px 0;overflow-wrap:anywhere}
.graph-info .meta{color:var(--muted);display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.graph-info .open-link{display:inline-block;margin-top:12px;background:var(--sf-green);color:var(--sf-black);padding:7px 16px;border-radius:var(--sf-radius-full);font-weight:600;letter-spacing:.02em}
.graph-info .open-link:hover{text-decoration:none;opacity:.9}
.graph-info .info-close{position:absolute;right:8px;top:8px;width:30px;height:30px;padding:0;font-size:16px;line-height:1}
.graph-info .k-unexpected{color:var(--sf-black);font-weight:700;border-bottom:2px solid var(--sf-red)}
.graph-help{font-size:12px;color:var(--muted);margin:8px 0 12px;line-height:1.35}
@media(max-width:1100px){.graph-layout{grid-template-columns:220px minmax(0,1fr)}}
@media(max-width:760px){.graph-main{padding:14px 16px 0}
.back-link{padding:5px 11px}
.graph-heading h1{font-size:26px}
.graph-toolbar{gap:6px}
.graph-toolbar .refresh-label{display:none}
.graph-layout{display:flex;flex-direction:column;height:auto}
.graph-side{order:2;max-height:none}
.graph-stage{order:1;height:70vh;min-height:420px}
.graph-info{top:auto;bottom:12px;left:12px;right:auto;max-height:55%}
.graph-help{font-size:11px;margin:6px 0 10px}
.sitemap-page .environment{display:none}}
/* Provenance link in the header; at phone width the header has room for one link, so it is reachable from the atlas sidebar instead. */
.header-meta .prov-link{margin-right:-4px}
@media(max-width:760px){.header-meta .prov-link{display:none}}
.node-tag-claim{background:var(--yellow-wash,rgb(255 171 0 / .14));border-color:var(--sf-yellow)}
/* Focus mode: one screen, the path clicked to reach it, and its next steps; everything else hidden. */
.node{cursor:pointer}
.lg-edge.chain{stroke:var(--edge-chain)}
.lg-edge.return{stroke:var(--edge-return);stroke-dasharray:7 4;stroke-width:3}
.graph-world:not(.focusing) #focus-edges,.graph-world:not(.focusing) #focus-labels{display:none}
.graph-world.focusing #edges,.graph-world.focusing #edge-labels,.graph-world.focusing #clusters,.graph-world.focusing .node.n-off{display:none}
.graph-world.focusing .node.n-filtered{opacity:1!important;pointer-events:auto}
.graph-world.focusing.tracing:not(.hovering) .node,.graph-world.focusing.tracing:not(.hovering) .graph-edges path{opacity:1}
.graph-world.focusing.tracing.hovering .focus-edges path:not(.e-out):not(.e-in){opacity:.18}
.graph-edges .e-chain{stroke:var(--edge-chain);stroke-width:2.2}
.graph-edges .e-return{stroke:var(--edge-return);stroke-dasharray:8 5;stroke-width:2.4}
.graph-edges path.e-return.e-out,.graph-edges path.e-return.e-in{stroke:var(--edge-return)}
.focus-labels .edge-label{display:block;z-index:1}
.edge-label.l-above{transform:translate(0,-100%)}
.edge-label.l-return{border:1.5px solid var(--sf-pink)}
.node.n-current{outline:3px solid var(--sf-black);outline-offset:2px}
.focus-bar{position:absolute;left:12px;top:12px;z-index:4;display:flex;align-items:center;gap:8px;max-width:calc(100% - 24px);background:var(--sf-white);border:1px solid var(--line-strong);border-radius:var(--sf-radius-full);padding:4px 4px 4px 14px;box-shadow:0 2px 10px rgb(0 0 0 / .1);font-size:12px}
.focus-bar[hidden]{display:none}
.focus-bar.with-panel{max-width:calc(100% - 388px)}
.focus-kicker{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap}
.focus-path{display:flex;list-style:none;margin:0;padding:0;overflow-x:auto;white-space:nowrap;min-width:0;scrollbar-width:none}
.focus-path li{display:flex;align-items:center}
.focus-path li+li::before{content:'→';margin:0 4px;color:var(--muted)}
.focus-path button{border:0;background:none;padding:3px 6px;font-size:12px;font-weight:500;letter-spacing:0;border-radius:var(--sf-radius-full);text-decoration:underline;text-underline-offset:2px}
.focus-path button:hover{background:var(--wash)}
.focus-path strong{font-weight:700;padding:3px 6px}
.focus-count{color:var(--muted);white-space:nowrap}
.focus-bar .focus-exit{background:var(--sf-black);color:var(--sf-white);border:1px solid var(--sf-black);font-size:12px;padding:6px 14px;white-space:nowrap;flex-shrink:0}
.focus-exit kbd{font:inherit;font-size:10px;opacity:.7;margin-left:6px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
@keyframes sf-fade-in{from{opacity:0}to{opacity:1}}
.fade-edges #edges,.fade-edges #edge-labels,.fade-edges #clusters,.fade-edges #focus-edges,.fade-edges #focus-labels{animation:sf-fade-in .24s ease-out .32s both}
@media(max-width:760px){.focus-count,.focus-exit kbd,.focus-kicker{display:none}.focus-bar{left:8px;top:8px;max-width:calc(100% - 16px);padding-left:8px}}
@media(prefers-reduced-motion:reduce){.fade-edges #edges,.fade-edges #edge-labels,.fade-edges #clusters,.fade-edges #focus-edges,.fade-edges #focus-labels{animation:none}.node,.graph-edges path{transition:none}}
.focus-bar .focus-exit:hover{background:var(--sf-green);color:var(--sf-black);border-color:var(--sf-green)}
.graph-info .info-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}
.graph-info .info-actions .open-link{margin-top:0}
.graph-info .focus-link{font-size:12px;padding:6px 14px;border-color:var(--sf-black)}
.node:focus-visible{outline:3px solid var(--focus)!important;outline-offset:3px}

/* A single map workspace, with filters above the canvas. */
.sitemap-page{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
.sitemap-page .app-header,.sitemap-page .site-nav{flex-shrink:0}
.graph-main{flex:1;min-height:0;display:flex;flex-direction:column;padding:20px 24px 0}
.graph-heading{flex-shrink:0;margin-bottom:14px;align-items:center;gap:18px}
.graph-heading h1{font-size:26px;white-space:nowrap;line-height:1.2}
.graph-toolbar{gap:8px;flex:1;justify-content:flex-end}
.graph-toolbar .zoom-controls{margin-left:0}
.graph-layout{display:flex;height:auto;min-height:0;flex:1}
.graph-stage{height:auto;min-height:0;width:100%;order:0}
.graph-viewport{min-height:180px}
.graph-caption{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--muted);padding:10px 0;flex-shrink:0}
.graph-search{width:170px;display:block}
.graph-search input{border:1px solid var(--line-strong);border-radius:999px;padding:8px 13px;font-size:12px;width:100%;background:white}
.graph-toolbar select{max-width:200px}
.toolbar-popover{position:relative}
.toolbar-popover>summary{list-style:none;cursor:pointer;border:1px solid var(--line-strong);border-radius:999px;padding:8px 13px;font-size:12px;font-weight:600;white-space:nowrap}
.toolbar-popover>summary::after{content:'⌄';margin-left:10px}
.toolbar-popover>summary::-webkit-details-marker{display:none}
.toolbar-popover[open]>summary{background:var(--sf-black);color:white}
.popover-panel{position:absolute;top:calc(100% + 8px);left:0;width:300px;max-height:min(65vh,640px);overflow:auto;background:white;border:1px solid var(--line-strong);border-radius:12px;box-shadow:0 8px 30px rgb(0 0 0 / .14);padding:16px;z-index:20}
.popover-heading{font-weight:700;font-size:14px;margin-bottom:12px}
.popover-heading small{font-size:11px;color:var(--muted);display:block;font-weight:400;margin-top:5px;line-height:1.5}
.legend-panel{left:auto;right:0;width:330px}
.legend-panel .side-hint{margin:6px 0 16px}
.area-row{padding:5px 0}
.area-bulk{border-top:1px solid var(--line);padding-top:12px}
.graph-notice{background:var(--yellow-wash);padding:10px 14px;font-size:12px;line-height:1.5;border-radius:8px;margin-bottom:12px}
.graph-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none}
.graph-empty h2{font-size:22px;margin:0}
.graph-empty p{font-size:13px;color:var(--muted)}
.graph-empty button{pointer-events:auto}
#evidence-dialog{padding:0;border:0;border-radius:12px;width:min(820px,calc(100vw - 32px));height:calc(100dvh - 48px);max-height:none;overflow:hidden;box-shadow:0 12px 60px rgb(0 0 0 / .25)}
#evidence-dialog::backdrop{background:rgb(0 0 0 / .45)}
#evidence-frame{width:100%;height:100%;border:0;display:block;background:white}
@media(max-width:1200px){.graph-heading{align-items:flex-start}.graph-toolbar{justify-content:flex-start}.graph-heading h1{width:100%}}
@media(max-width:760px){
 .graph-main{padding:14px 12px 0}
 .graph-heading{gap:12px}
 .graph-heading h1{font-size:24px}
 .graph-toolbar{gap:6px}
 .graph-toolbar .zoom-controls{margin-left:0}
 .graph-search{flex:1;min-width:150px}
 .graph-caption>span:last-child{display:none}
 .graph-toolbar .refresh-label{display:none}
 .graph-toolbar>button,.graph-toolbar select{font-size:11px}
 .popover-panel{position:fixed;top:190px;left:12px;right:12px;width:auto;max-height:55vh}
 .graph-info{max-width:calc(100% - 24px)}
 #evidence-dialog{width:calc(100vw - 16px);height:calc(100dvh - 16px);margin:8px}
}
.view-options-panel{display:flex;flex-direction:column;gap:14px;width:270px}
.view-options-panel .segmented{align-self:flex-start}
.view-options-panel>button{align-self:flex-start;font-size:12px}
@media(min-width:1201px){.graph-heading h1{width:auto}.graph-toolbar{justify-content:flex-end}}
.graph-stage{flex:1}
@media(max-height:540px){.sitemap-page{overflow:auto;min-height:540px}.graph-main{min-height:380px}}
