:root{--bg:#0a0600;--panel:#0a0600;--paper:#0a0600;--ink:#ffb000;--muted:#b87a00;--purple:#ffb000;--line:#805800;--shadow:7px 8px 0 #805800;--mono:ui-monospace,"SFMono-Regular",Consolas,monospace;--sans:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font:16px var(--sans)}button,input,select{font:inherit;color:inherit}button,a{cursor:pointer}.topbar{max-width:1440px;margin:auto;padding:38px 4.5%;display:flex;justify-content:space-between;align-items:center}.brand{font-size:clamp(29px,4vw,43px);font-weight:700;letter-spacing:-2px;color:var(--ink);text-decoration:none}.brand span,.hero em{color:var(--purple);font-style:normal}.top-actions{display:flex;gap:14px}.outline{background:transparent;border:3px solid #805800;border-radius:13px;padding:13px 22px;font-weight:700;box-shadow:3px 4px 0 #805800;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.outline:hover{transform:translate(-1px,-1px);box-shadow:5px 6px 0 #805800}.small{padding:9px 13px;font-size:12px;border-width:2px;box-shadow:2px 3px 0 #805800}main{max-width:1320px;margin:auto;padding:20px 4.5% 70px}.hero{padding:78px 0 57px}.eyebrow{font:10px var(--mono);letter-spacing:1.8px;color:var(--purple);font-weight:500}.hero h1{font-size:clamp(48px,8vw,94px);line-height:.98;letter-spacing:-5px;margin:20px 0}.hero p{color:var(--muted);font-size:18px;line-height:1.6;max-width:680px}.search-card{background:var(--panel);border:3px solid var(--line);border-radius:18px;padding:22px;box-shadow:var(--shadow)}.input-row{display:flex;align-items:center;gap:14px}.branch{font-size:28px;color:var(--purple)}.input-row input{min-width:0;flex:1;background:transparent;border:0;outline:0;font-size:19px;font-weight:600}.input-row input::placeholder{color:#b87a00}.primary{border:3px solid #805800;background:var(--purple);color:#0a0600;border-radius:11px;padding:12px 21px;font-weight:700;box-shadow:3px 4px 0 #805800}.form-options{display:flex;align-items:center;gap:20px;margin:17px 0 0 42px;flex-wrap:wrap}.form-options label{display:flex;align-items:center;gap:9px;color:var(--muted);font:9px var(--mono)}.form-options input,.form-options select{width:190px;max-width:40vw;padding:8px;border:1px solid #140d00;background:var(--paper);border-radius:7px;font:11px var(--mono)}.link-button{border:0;background:none;color:var(--purple);font-weight:700}.progress{margin:32px 0;padding:22px 25px;background:#0a0600;border-left:4px solid var(--purple)}.progress-title{display:flex;align-items:center;gap:12px}.spinner{width:12px;height:12px;border-radius:50%;border:2px solid #140d00;border-top-color:var(--purple);animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}#progress-steps{margin:15px 0 0 25px;color:var(--muted);font-size:13px;line-height:2}.repo-header{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:58px 0 22px}.repo-header h2{font-size:30px;margin:7px 0}.repo-header p{color:var(--muted);margin:0}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin-bottom:25px}.metric{padding:17px;background:var(--panel);border:2px solid var(--line);border-radius:12px}.metric small{font:9px var(--mono);color:var(--muted)}.metric b{display:block;font-size:29px;margin-top:5px}.layout{display:grid;grid-template-columns:210px minmax(0,1fr);gap:18px}.tabs{display:flex;flex-direction:column;gap:7px}.tab{background:transparent;border:2px solid transparent;text-align:left;padding:13px 12px;border-radius:9px;font-weight:600}.tab.active,.tab:hover{background:var(--panel);border-color:var(--line);box-shadow:3px 3px 0 var(--line)}.views{min-width:0}.view{background:var(--paper);border:2px solid var(--line);border-radius:14px;padding:23px;min-height:520px}.view-head{display:flex;justify-content:space-between;align-items:center;gap:18px}.view h3{font-size:25px;margin:7px 0}.view-head p,.footnote{color:var(--muted);font-size:12px}.graph-tools{display:flex;justify-content:space-between;align-items:center;margin:18px 0 10px;gap:12px}.graph-tools input,.file-panel input{padding:10px 12px;border:1px solid #140d00;background:#0a0600;border-radius:8px;min-width:0}.graph-tools input{width:min(320px,70%)}#graph-stats{font:10px var(--mono);color:var(--muted)}.graph{min-height:360px;max-height:680px;overflow:auto;background:#0a0600;border:1px solid #140d00;border-radius:10px;padding:10px}.graph svg{display:block;max-width:none}.graph .placeholder{min-height:340px;display:grid;place-items:center;color:var(--muted)}.legend{display:flex;gap:18px;flex-wrap:wrap;margin-top:12px;color:var(--muted);font:9px var(--mono)}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;background:#ffd060}.dot.entry{background:#ffb000}.dot.isolated{background:#ffd060}.report{color:#ffb000;line-height:1.8;font-size:13px}.report h4{color:var(--ink);margin:23px 0 4px;font-size:13px}.report p{margin:5px 0 12px}.report pre,pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#000000;color:#ffb000;padding:15px;border-radius:9px;font:11px/1.7 var(--mono);max-height:460px;overflow:auto}.prompt-box{border-top:1px solid #0a0600;margin-top:28px;padding-top:20px}.prompt-box h3{font-size:18px}.prompt-box p{font-size:12px;color:var(--muted)}.explorer{display:grid;grid-template-columns:minmax(190px,.8fr) 1.5fr;gap:13px;margin:17px 0}.file-panel{border:1px solid #0a0600;border-radius:9px;padding:9px;max-height:550px;overflow:auto}.file-panel input{width:100%;margin-bottom:8px}.file-item{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #0a0600;background:transparent;padding:8px 5px;font:10px var(--mono);overflow-wrap:anywhere}.file-item:hover,.file-item.selected{color:var(--purple);background:#0a0600}.code-panel{min-width:0}.code-panel>div{font:10px var(--mono);color:var(--purple);padding:8px 0}footer{display:flex;justify-content:space-between;border-top:1px solid #140d00;padding:22px 0;margin-top:60px;color:var(--muted);font:9px var(--mono);letter-spacing:.8px}dialog{border:3px solid var(--line);border-radius:14px;background:var(--paper);padding:30px;min-width:280px;box-shadow:var(--shadow)}dialog a{display:block;color:var(--ink);padding:12px 0;text-decoration:none}.dialog-close{float:right;border:0;background:none;font-size:24px}@media(max-width:760px){.topbar{padding:22px 5%}.outline{padding:10px 13px;font-size:13px}.hero{padding:48px 0 35px}.hero h1{letter-spacing:-3px}.input-row{flex-wrap:wrap}.input-row input{flex-basis:calc(100% - 45px)}.primary{width:100%}.form-options{margin-left:0;gap:13px}.form-options label{width:100%;justify-content:space-between}.form-options input,.form-options select{flex:1;max-width:58%}.repo-header{align-items:flex-start;flex-direction:column}.metrics{grid-template-columns:repeat(2,1fr)}.layout{grid-template-columns:1fr}.tabs{display:grid;grid-template-columns:repeat(2,1fr)}.tab{font-size:12px;padding:10px}.view{padding:15px}.view-head{align-items:flex-start;flex-direction:column}.explorer{grid-template-columns:1fr}.file-panel{max-height:230px}footer{flex-direction:column;gap:9px}}


/* Unified neo-brutalist controls — based on the user's GitDiagram reference */
:root{
  --button-ink:#805800;
  --button-face:#0a0600;
  --button-shadow:6px 7px 0 var(--button-ink);
  --button-radius:13px;
  --button-border:4px;
}
button,.top-actions a.outline,.repo-header a.outline{
  -webkit-appearance:none;
  appearance:none;
  border:var(--button-border) solid var(--button-ink);
  border-radius:var(--button-radius);
  background:var(--button-face);
  color:var(--button-ink);
  box-shadow:var(--button-shadow);
  font:700 16px/1.15 var(--sans);
  text-decoration:none;
  transition:transform .12s ease,box-shadow .12s ease,background-color .12s ease;
  cursor:pointer;
}
button:hover,.top-actions a.outline:hover,.repo-header a.outline:hover{
  transform:translate(-2px,-2px);
  box-shadow:8px 9px 0 var(--button-ink);
}
button:active,.top-actions a.outline:active,.repo-header a.outline:active{
  transform:translate(5px,6px);
  box-shadow:1px 1px 0 var(--button-ink);
}
button:focus-visible,.top-actions a.outline:focus-visible,.repo-header a.outline:focus-visible,
a.link-button:focus-visible,input:focus-visible,select:focus-visible{
  outline:3px solid var(--purple);
  outline-offset:4px;
}
.outline,.top-actions .outline{
  min-height:58px;
  padding:14px 23px;
  border-width:4px;
  border-radius:13px;
  box-shadow:6px 7px 0 var(--button-ink);
  background:var(--bg);
  color:var(--button-ink);
}
.primary{
  min-height:56px;
  padding:13px 22px;
  border:4px solid var(--button-ink);
  border-radius:12px;
  background:var(--purple);
  color:#0a0600;
  box-shadow:6px 7px 0 var(--button-ink);
}
.primary:hover{background:#ffb000}
.small{min-height:42px;padding:9px 14px;border-width:3px;font-size:12px;box-shadow:4px 5px 0 var(--button-ink)}
.tab{
  min-height:48px;
  padding:12px 14px;
  border:3px solid var(--button-ink);
  border-radius:11px;
  background:var(--bg);
  box-shadow:4px 5px 0 var(--button-ink);
}
.tab.active{background:var(--panel);border-color:var(--button-ink);box-shadow:4px 5px 0 var(--button-ink)}
.tab:hover{background:#0a0600}
.link-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:8px 13px;
  border:3px solid var(--button-ink);
  border-radius:10px;
  background:var(--bg);
  color:var(--purple);
  box-shadow:4px 5px 0 var(--button-ink);
  font-weight:700;
  text-decoration:none;
}
.dialog-close{width:42px;height:42px;padding:0;font-size:24px}
.file-item{border:0;border-bottom:1px solid #0a0600;border-radius:0;box-shadow:none;background:transparent;font:10px var(--mono);font-weight:400;text-align:left}
.file-item:hover,.file-item:active{transform:none;box-shadow:none;background:#0a0600}
#menu{border:4px solid var(--button-ink);border-radius:15px;box-shadow:8px 9px 0 var(--button-ink)}
#menu a{border:3px solid var(--button-ink);border-radius:10px;box-shadow:4px 5px 0 var(--button-ink);padding:12px 14px;margin:10px 4px;font-weight:700}
.search-card{border:4px solid var(--button-ink);box-shadow:8px 9px 0 var(--button-ink)}
.metric{border:3px solid var(--button-ink);box-shadow:4px 5px 0 var(--button-ink)}
.view{border:3px solid var(--button-ink);box-shadow:5px 6px 0 var(--button-ink)}
@media(max-width:760px){
  .top-actions{gap:12px}
  .top-actions .outline{min-height:54px;padding:11px 15px;font-size:15px}
  .outline{min-height:48px;padding:10px 14px}
  .primary{min-height:54px}
  .tabs{gap:12px}
  .tab{min-height:48px;padding:10px 8px;font-size:12px}
  .small{min-height:40px}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}


/* CloneGitHub workspace redesign, adapted from the MIT-licensed GitDiagram UI.
   Original project: https://github.com/ahmedkhaleel2004/gitdiagram
   Copyright (c) 2024 Ahmed Khaleel — see THIRD_PARTY_NOTICES.md */
:root{
 --neo-bg:#0a0600;--neo-panel:#0a0600;--neo-panel-soft:#0a0600;
 --neo-button:#ffb000;--neo-edge:#805800;--neo-shadow:#805800;
 --neo-ink:#ffb000;--neo-muted:#b87a00;--neo-link:#ffd060;
}
body{background:var(--neo-bg);color:var(--neo-ink)}
.topbar{max-width:1440px;padding:34px 4.2% 20px}
.brand{font-size:clamp(30px,4vw,43px);letter-spacing:-2px}
.top-actions{gap:14px}
.top-actions .outline{min-height:58px;padding:13px 24px;border:4px solid #805800;border-radius:13px;background:var(--neo-bg);box-shadow:6px 7px 0 #805800;font-size:16px}
main{max-width:1320px;padding-top:8px}
.hero{padding:48px 0 35px}
.hero h1{font-size:clamp(43px,7vw,76px);letter-spacing:-3px}
.hero p{font-size:16px}
.search-card{border:3px solid var(--neo-edge);border-radius:13px;background:var(--neo-panel);box-shadow:5px 6px 0 var(--neo-shadow)}
.primary,.outline,.small,.tab,.link-button{
 border:3px solid #805800;border-radius:11px;box-shadow:4px 5px 0 #805800;
 transition:transform .12s ease,box-shadow .12s ease,background-color .12s ease;
}
.primary{background:var(--neo-button);color:#0a0600}
.primary:hover,.tool-button.featured:hover{background:#ffd060}
button:active,.outline:active,.tab:active{transform:translate(3px,4px);box-shadow:1px 1px 0 #805800}
.repo-toolbar{display:flex;flex-direction:column;align-items:center;gap:24px;margin:38px auto 18px}
.repo-pill{display:flex;align-items:center;justify-content:center;gap:13px;max-width:min(100%,760px);min-height:66px;padding:12px 20px;border:3px solid var(--neo-edge);border-radius:12px;background:var(--neo-panel);box-shadow:5px 6px 0 var(--neo-shadow);color:var(--neo-ink);text-decoration:none;font-size:clamp(14px,2vw,21px);overflow-wrap:anywhere}
.repo-pill span{font-size:23px}.repo-pill strong{min-width:0;overflow-wrap:anywhere}
.action-grid{width:min(100%,760px);display:grid;grid-template-columns:1fr 1fr;gap:16px}
.tool-button{position:relative;display:flex;align-items:center;justify-content:center;gap:12px;min-height:82px;width:100%;padding:13px 12px;border:3px solid var(--neo-edge);border-radius:12px;background:var(--neo-panel);box-shadow:5px 6px 0 var(--neo-shadow);color:var(--neo-ink);font-size:clamp(15px,2.2vw,20px);font-weight:700}
.tool-button.featured{background:var(--neo-button)}
.tool-button:disabled{opacity:.72;cursor:not-allowed}
.new-badge{padding:3px 9px;border:3px solid #805800;border-radius:999px;background:#0a0600;color:#805800;font-size:10px;font-weight:800;letter-spacing:.5px}
.export-wrap{position:relative}
.export-wrap>.tool-button{height:100%}
.export-menu{position:absolute;z-index:20;top:calc(100% + 12px);right:0;width:min(260px,80vw);padding:10px;border:3px solid #805800;border-radius:12px;background:var(--neo-panel);box-shadow:5px 6px 0 #805800}
.export-menu button{width:100%;padding:12px;text-align:left;border:2px solid #805800;border-radius:8px;background:var(--neo-bg);box-shadow:3px 3px 0 #805800;margin:4px 0;font-size:13px;font-weight:700}
.repo-description{max-width:760px;margin:0 auto 18px;text-align:center;color:var(--neo-muted);font-size:14px}
.tree-partial{max-width:760px;margin:0 auto 18px;padding:10px 14px;border:2px solid #ffd060;border-radius:12px;background:#1a1200;color:#ffd060;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.metrics{display:none!important}
.layout{display:block;margin-top:28px}
.tabs{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:0 auto 28px;max-width:100%}
.tab{min-height:76px;padding:13px 16px;border:3px solid #805800;border-radius:13px;background:var(--neo-panel-soft);box-shadow:5px 6px 0 #805800;text-align:left;font-size:clamp(13px,2vw,18px);font-weight:700}
.tab.active{background:var(--neo-panel);border-color:#805800;box-shadow:5px 6px 0 #805800}
.view{min-height:520px;padding:28px 30px;border:4px solid #805800;border-radius:23px;background:#0a0600;box-shadow:6px 7px 0 #805800}
.view h3{font-size:clamp(27px,4vw,43px);letter-spacing:-1px;margin:12px 0 18px}
.view-head p{font-size:16px;line-height:1.55;max-width:720px}
.eyebrow{font-size:11px;letter-spacing:2.8px;color:#ffb000}
.graph-tools{margin:24px 0 14px}
.graph-tools input,.file-panel input{border:2px solid #ffb000;border-radius:12px;background:#0a0600;padding:13px 16px;font-size:15px}
#graph-stats{font-size:12px;line-height:1.5}
.graph{min-height:560px;max-height:760px;padding:18px;border:2px solid #140d00;border-radius:20px;background:#0a0600;overflow:auto}
.graph svg{max-width:none}
.legend{font-size:11px;gap:24px;margin-top:18px}
.footnote{font-size:12px;line-height:1.6}
.report{font-size:15px;line-height:1.8}
.report h4{font-size:17px}
.prompt-box{margin-top:30px}
.explorer{grid-template-columns:minmax(220px,.8fr) 1.5fr}
.file-panel{border:2px solid #140d00;border-radius:12px}
.file-item{border:0;border-bottom:1px solid #0a0600;border-radius:0;box-shadow:none;background:transparent}
.file-item:hover,.file-item.selected{background:#0a0600;color:#ffb000}
footer{margin-top:70px}
#menu{border:3px solid #805800;border-radius:15px;box-shadow:7px 8px 0 #805800}
#menu a{border:2px solid #805800;border-radius:9px;box-shadow:3px 4px 0 #805800;padding:13px;margin:10px 3px;font-weight:700}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ffb000;outline-offset:4px}
@media(max-width:760px){
 .topbar{padding:24px 4% 14px}
 .top-actions{gap:10px}
 .top-actions .outline{min-height:58px;padding:11px 18px;font-size:15px}
 main{padding:8px 4.2% 52px}
 .hero{padding:28px 0 28px}
 .repo-toolbar{margin:25px auto 18px;gap:22px}
 .repo-pill{min-height:62px;padding:10px 14px;font-size:15px}
 .action-grid{gap:13px}
 .tool-button{min-height:78px;padding:10px 6px;font-size:14px;gap:8px}
 .tabs{gap:13px;margin-bottom:26px}
 .tab{min-height:76px;padding:12px 10px;font-size:13px;line-height:1.3}
 .view{padding:22px 18px;border-width:3px;border-radius:21px}
 .view-head p{font-size:14px}
 .graph{min-height:560px;padding:12px;border-radius:17px}
 .graph-tools{align-items:center}
 .graph-tools input{width:60%;font-size:14px}
 #graph-stats{max-width:38%;font-size:10px}
 .explorer{grid-template-columns:1fr}
 .file-panel{max-height:250px}
}
@media(max-width:380px){
 .tool-button{font-size:12px;min-height:70px}
 .new-badge{font-size:8px;padding:2px 5px}
 .view{padding:18px 13px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

body.has-analysis .hero,body.has-analysis .search-card{display:none!important}body.has-analysis main{padding-top:0}body.has-analysis .topbar{padding-bottom:8px}#graph.zoom-enabled{cursor:grab}#graph.zoom-enabled:active{cursor:grabbing}

.ai-settings{max-width:760px;margin:20px auto 0;padding-top:14px;border-top:1px solid #140d00;color:var(--neo-ink)}
.ai-settings summary{cursor:pointer;font-size:13px;font-weight:700;padding:8px 0}
.ai-settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:10px}
.ai-settings-grid label{display:flex;flex-direction:column;gap:7px;font:10px var(--mono);color:var(--neo-muted)}
.ai-settings-grid input,.ai-settings-grid select{width:100%;min-width:0;padding:11px 12px;border:2px solid #805800;border-radius:9px;background:#0a0600;color:#ffb000;font:13px var(--sans);box-shadow:3px 4px 0 #805800}
.ai-settings-grid .ai-key-label{grid-column:1/-1}
.ai-settings p{max-width:700px;color:var(--neo-muted);font-size:11px;line-height:1.6;margin:10px 0 2px}
@media(max-width:520px){.ai-settings-grid{grid-template-columns:1fr}.ai-settings-grid .ai-key-label{grid-column:auto}}

body.has-analysis .ai-settings:not([open]){display:none}.ai-settings{max-width:760px;margin:16px auto 22px;padding:14px 18px;border:2px solid #ffb000;border-radius:12px;background:rgba(10,6,0,0.45)}body.has-analysis .ai-settings[open]{margin:18px auto 26px;background:var(--neo-panel)}

.repo-pill .github-mark{width:24px;height:24px;flex:0 0 24px;color:var(--neo-ink)}

#graph.zoom-enabled{cursor:grab;touch-action:pan-x pan-y}#graph.zoom-enabled:active{cursor:grabbing}

#load-more-files{width:100%;margin-top:10px}

/* Architecture graph: readable layered flow */
.graph{min-height:420px;max-height:820px;padding:16px;background:#0a0600;overscroll-behavior:contain}
.graph svg{display:block;width:auto;max-width:none;height:auto}
.arch-node{cursor:pointer;outline:none}
.arch-node rect{transition:stroke-width .14s ease,filter .14s ease}
.arch-node:hover rect,.arch-node:focus rect{stroke-width:3.5;filter:drop-shadow(2px 3px 2px #b87a00)}
.graph-detail{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:14px;padding:16px 18px;border:2px solid #140d00;border-radius:13px;background:#0a0600}
.graph-detail b{display:block;color:#ffb000;font-size:14px;margin-bottom:4px}
.graph-detail p{margin:3px 0 9px;color:#b87a00;font-size:12px;line-height:1.55}
.graph-detail small{font:11px var(--mono);overflow-wrap:anywhere;color:#b87a00}
.graph-detail a{display:inline-flex;margin-top:6px;color:#ffb000;font-weight:700;font-size:12px}
@media(max-width:760px){.graph{min-height:440px;max-height:72vh;padding:10px}.graph-detail{grid-template-columns:1fr;gap:10px;padding:13px}}

.architecture-summary{margin:16px 0 12px;padding:13px 15px;border-left:4px solid #b87a00;border-radius:0 10px 10px 0;background:#0a0600;color:#ffb000;font-size:13px;line-height:1.6}
@media(max-width:760px){.architecture-summary{font-size:12px;padding:11px 12px}}

/* Architecture-first Mermaid renderer: grouped subsystems, labeled edges and a readable canvas. */
.graph{min-height:480px;max-height:820px;overflow:auto;padding:20px;background:#0a0600;border:2px solid #140d00;border-radius:16px;scrollbar-color:#b87a00 #0a0600;scrollbar-width:thin}
.graph svg{display:block;width:max-content;max-width:none;height:auto;overflow:visible}
.graph .cluster rect{fill:#0a0600!important;stroke:#140d00!important;stroke-width:1.5px!important;rx:14px}
.graph .cluster-label,.graph .cluster-label span{font-family:var(--sans)!important;font-weight:700!important;color:#ffb000!important}
.graph .nodeLabel,.graph .edgeLabel{font-family:var(--sans)!important}
.graph .edgeLabel rect{fill:#0a0600!important;opacity:.96!important;rx:5px}
.graph .edgeLabel{color:#ffb000!important;font-size:12px!important}
.graph g.node{cursor:pointer;transition:opacity .12s ease}
.graph g.node:focus{outline:3px solid #ffb000;outline-offset:3px}
.architecture-empty,.diagram-error{min-height:380px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:12px;padding:clamp(24px,5vw,64px);color:#ffb000}
.architecture-empty h3,.diagram-error b{font-size:clamp(20px,3vw,28px);color:#ffb000;margin:0}
.architecture-empty p,.diagram-error p{max-width:620px;line-height:1.7;margin:0;color:#b87a00}
.architecture-empty small{font-size:11px;color:#b87a00}
#graph.zoom-enabled{cursor:grab}
#graph.zoom-enabled:active{cursor:grabbing}
@media(max-width:760px){.graph{min-height:460px;max-height:74vh;padding:12px}.graph svg{max-width:none}.architecture-empty,.diagram-error{min-height:320px;padding:24px}}

@font-face{font-family:Inter;src:url("fonts/inter-latin.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap}
@font-face{font-family:Montserrat;src:url("fonts/montserrat-latin.woff2") format("woff2");font-style:normal;font-weight:100 900;font-display:swap}
:root{--sans:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;--display:Montserrat,Inter,ui-sans-serif,system-ui,sans-serif;--mono:ui-monospace,"SFMono-Regular",Consolas,monospace}
body{font-family:var(--sans);font-feature-settings:"cv11","ss01"}
.brand,.hero h1,.view h3,#menu-title{font-family:var(--display);text-wrap:balance}
.hero p,.view-head p,.menu-links a{ text-wrap:pretty }
.graph-tools{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.graph-tools input{flex:1 1 220px;width:auto;min-height:46px}
#graph-stats{flex:1 1 150px;font-variant-numeric:tabular-nums}
.zoom-controls{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex:0 0 auto}
.zoom-controls button{min-width:44px;min-height:44px;padding:7px 11px;border:2px solid #805800;border-radius:10px;background:#0a0600;color:#ffb000;font:700 15px var(--sans);box-shadow:2px 3px 0 #805800;transition:transform .12s ease,box-shadow .12s ease,background-color .12s ease}
.zoom-controls button:hover:not(:disabled){background:#0a0600;transform:translateY(-1px)}
.zoom-controls button:active:not(:disabled){transform:translate(1px,2px);box-shadow:0 1px 0 #805800}
.zoom-controls button:focus-visible{outline:3px solid #ffb000;outline-offset:3px}
.zoom-controls button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}
.zoom-controls output{min-width:52px;text-align:center;font:600 12px var(--mono);font-variant-numeric:tabular-nums;color:#ffb000}
#menu{width:min(430px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:min(82vh,680px);overflow:auto;margin:auto;padding:clamp(20px,5vw,32px);background:#0a0600;box-shadow:0 24px 80px #ffb00080,7px 8px 0 #805800}
#menu::backdrop{background:#ffb00099;backdrop-filter:blur(4px)}
.menu-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}
.menu-heading .eyebrow{margin:0 0 7px}
#menu-title{margin:0;color:#ffb000;font-size:clamp(24px,5vw,32px);letter-spacing:-.8px}
#menu .dialog-close{float:none;flex:0 0 44px;width:44px;height:44px;border:2px solid #805800;border-radius:10px;background:#0a0600;color:#ffb000;font:600 18px var(--sans);box-shadow:2px 3px 0 #805800}
.menu-links{display:grid;gap:10px}
#menu .menu-links a{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;margin:0;padding:12px 15px;border:1px solid #0a0600;border-radius:11px;background:#0a0600;box-shadow:0 2px 5px #ffb00012;color:#ffb000;text-decoration:none;font-size:15px;font-weight:650;transition:background-color .14s ease,border-color .14s ease,transform .14s ease}
#menu .menu-links a:hover{transform:translateY(-1px);border-color:#b87a00;background:#0a0600}
#menu .menu-links a span{color:#b87a00;font:11px var(--mono)}
#menu .menu-links .menu-primary{border-color:#805800;background:#0a0600;box-shadow:3px 4px 0 #805800;font-weight:750}
#menu .menu-links .menu-primary:hover{background:#0a0600}
@media(max-width:760px){.graph-tools{align-items:stretch;gap:10px}.graph-tools input{flex-basis:100%}#graph-stats{flex:1 1 100%;max-width:none}.zoom-controls{width:100%;justify-content:flex-start;flex-wrap:wrap}.zoom-controls button{min-height:44px}.zoom-controls #zoom-fit{flex:1 1 90px}}
@media(prefers-reduced-motion:reduce){.zoom-controls button,#menu .menu-links a{transition:none}.brand,.hero h1,.view h3,#menu-title{text-wrap:balance}}

/* Focus mode: the diagram occupies the full viewport while keeping its controls reachable. */
body.diagram-immersive{overflow:hidden;background:#0a0600}
body.diagram-immersive .topbar{display:none}
body.diagram-immersive main{width:100%;max-width:none;margin:0;padding:0}
body.diagram-immersive main>:not(#analysis){display:none!important}
body.diagram-immersive #analysis{position:fixed;inset:0;z-index:10000;display:block!important;width:100vw;height:100vh;height:100dvh;margin:0;padding:0;overflow:hidden;background:#0a0600}
body.diagram-immersive #analysis>:not(.layout){display:none!important}
body.diagram-immersive #analysis .layout{display:block;width:100%;height:100%;margin:0}
body.diagram-immersive #analysis .tabs{display:none!important}
body.diagram-immersive #analysis .views{width:100%;height:100%;min-height:0}
body.diagram-immersive #view-architecture.view{position:relative;display:flex;flex-direction:column;gap:0;width:100%;height:100%;min-height:0;max-height:none;margin:0;padding:0;overflow:hidden;border:0;border-radius:0;background:#0a0600}
body.diagram-immersive #view-architecture>:not(.graph-tools):not(#graph):not(#graph-detail){display:none!important}
body.diagram-immersive #graph-detail:not([hidden]){position:absolute;z-index:3;left:12px;right:12px;bottom:12px;max-height:45%;overflow:auto;margin:0;border:3px solid var(--line);box-shadow:var(--shadow)}
body.diagram-immersive #view-architecture .graph-tools{position:absolute;z-index:2;top:calc(env(safe-area-inset-top) + 12px);left:12px;right:12px;display:flex;justify-content:flex-end;margin:0;pointer-events:none}
body.diagram-immersive #graph-search,body.diagram-immersive #graph-stats{display:none!important}
body.diagram-immersive .zoom-controls{gap:8px;max-width:100%;padding:9px;border:1px solid #140d00;border-radius:14px;background:rgba(10,6,0,0.94);box-shadow:0 8px 28px #ffb00022;backdrop-filter:blur(12px);pointer-events:auto}
body.diagram-immersive .zoom-controls button{background:#0a0600}
body.diagram-immersive #zoom-toggle{min-width:150px;background:#0a0600}
body.diagram-immersive #zoom-toggle[aria-pressed="true"]{background:#140d00}
body.diagram-immersive #graph.graph{flex:1 1 auto;width:100%;height:100%;min-height:0;max-height:none;margin:0;padding:calc(env(safe-area-inset-top) + 82px) 18px 18px;overflow:auto;border:0;border-radius:0;background:#0a0600}
body.diagram-immersive #graph.graph svg{margin:auto}
body.diagram-immersive #graph.zoom-enabled{cursor:grab;touch-action:none}
body.diagram-immersive #graph.zoom-enabled:active{cursor:grabbing}
body.diagram-immersive #graph:focus-visible{outline:0}
@media(max-width:640px){body.diagram-immersive #view-architecture .graph-tools{top:calc(env(safe-area-inset-top) + 8px);left:8px;right:8px;justify-content:center}body.diagram-immersive .zoom-controls{gap:6px;padding:7px}body.diagram-immersive .zoom-controls button{min-width:40px;min-height:40px;padding:6px 9px}body.diagram-immersive #zoom-fit{flex:0 0 auto}body.diagram-immersive #zoom-toggle{flex:1 0 100%;min-height:42px}body.diagram-immersive #graph.graph{padding:calc(env(safe-area-inset-top) + 116px) 10px 10px}}
@media(prefers-reduced-motion:reduce){body.diagram-immersive *,body.diagram-immersive *::before,body.diagram-immersive *::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}

/* Give the architecture map the same wide, stable workspace as GitDiagram. */
main{max-width:1600px}
#graph.graph{height:min(74vh,820px);min-height:480px;max-height:820px}
@media(max-width:760px){#graph.graph{height:min(70vh,680px);min-height:420px;max-height:680px}}

/* Feature modules (scaffold): shared containers; each feature styles only its own root. */
.feature-root{display:grid;gap:16px;min-width:0}
.feature-root:empty{display:none}
.feature-pending{margin:0;padding:14px 16px;border:2px dashed #140d00;border-radius:12px;color:var(--muted);font:500 14px var(--sans)}
.feature-error{padding:14px 16px;border:2px solid #ff5533;border-radius:12px;background:#1f0a00;color:#ff5533}
.feature-error p{margin:6px 0 0;font:13px var(--mono);overflow-wrap:anywhere}
.advanced-options{margin-top:14px;padding:10px 14px;border:2px solid #140d00;border-radius:12px;background:#0a0600}
.advanced-options summary{cursor:pointer;font:700 12px var(--mono);letter-spacing:.04em;color:#ffb000}
.advanced-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:12px}
.advanced-grid label{display:grid;gap:6px;font:700 11px var(--mono);color:#ffb000}
.advanced-grid input{min-height:42px;padding:8px 10px;border:2px solid #805800;border-radius:10px;font:14px var(--mono);background:#0a0600;min-width:0}
.advanced-options p{margin:10px 0 2px;color:var(--muted);font-size:13px}
.rate-limit{margin:6px 0 0;font:12px var(--mono);color:#ffb000;text-align:center}
.rate-limit.low{color:#ff5533;font-weight:700}
@media(max-width:760px){.advanced-grid{grid-template-columns:1fr}}

/* Phones (<=430 px): the brand and the menu button fit; "Browse" duplicates the menu, so it hides. */
@media(max-width:430px){.topbar{gap:10px;padding-left:16px;padding-right:16px}.brand{font-size:26px;letter-spacing:-1.2px;min-width:0}.top-actions{gap:8px;flex-shrink:0}.top-actions a.outline[href="#analysis"]{display:none}.top-actions .outline{min-height:46px;padding:8px 12px;font-size:14px;border-width:3px;box-shadow:3px 4px 0 #805800}}

/* Architecture map interactions: hidden detail, close button, selection highlight and group legend. */
.graph-detail{position:relative}
.graph-detail[hidden]{display:none}
.graph-detail .detail-close{position:absolute;top:8px;right:8px;width:32px;height:32px;padding:0;border:2px solid #805800;border-radius:9px;background:#0a0600;box-shadow:2px 3px 0 #805800;font:700 18px/1 var(--sans)}
.graph-detail .detail-close:hover{transform:translate(-1px,-1px);box-shadow:3px 4px 0 #805800}
.graph-detail>div:first-of-type{padding-right:34px}
.graph g.node,.graph .flowchart-link,.graph .edgeLabel .label,.graph [data-id]{transition:opacity .14s ease}
.graph .cg-dim{opacity:.16}
.graph g.node.cg-selected rect,.graph g.node.cg-selected polygon,.graph g.node.cg-selected circle,.graph g.node.cg-selected path{stroke:#ffb000!important;stroke-width:3.5px!important}
.graph g.node.cg-near rect,.graph g.node.cg-near polygon,.graph g.node.cg-near circle,.graph g.node.cg-near path{stroke-width:2.5px!important}
.graph path.cg-hit{stroke:#ffb000!important;stroke-width:2.5px!important}
.legend[hidden]{display:none}
.dot.toneBlue{background:#ffd060}.dot.toneAmber{background:#ffd060}.dot.toneMint{background:#ffb000}.dot.toneRose{background:#ff5533}.dot.toneIndigo{background:#ffb000}.dot.toneTeal{background:#ffd060}.dot.toneNeutral{background:#ffb000}
/* A failed analysis: the spinner stops and the next steps are one click away. */
.progress.failed{border-left-color:#ff5533}
.progress.failed .spinner{animation:none;border-color:#ff5533}
.progress-error{margin:0;color:#ff5533;line-height:1.6}
.progress-actions,.tree-partial-actions{display:flex;flex-wrap:wrap;gap:10px;margin:10px 0 4px}
details.prompt-box>summary{cursor:pointer;font-weight:700;font-size:18px;padding:4px 0}
@media(hover:none){#bookmarklet{display:none}}

/* variant 2: Amber CRT */
html,body{background:#0a0600!important;color:#ffb000}
*:not(.dot):not(.spinner),*::before,*::after{border-radius:0px!important}
*,*::before,*::after{box-shadow:none!important}
button,.outline,.top-actions .outline,.top-actions button,#menu-open,.top-actions a.outline,.repo-header a.outline,.small{color:#ffb000}
a{color:#ffd060}
.primary{background:#ffb000!important;color:#0a0600!important}
.primary:hover{background:#ffd060!important;color:#0a0600!important}
.tool-button.featured,.tab.active{background:#ffb000!important;color:#0a0600!important}
.tool-button.featured:hover{background:#ffd060!important;color:#0a0600!important}
.new-badge{background:#ff5533!important;color:#0a0600!important;border-color:#ff5533!important}
#digest-root .dg-preview{background:#000000!important;color:#ffb000!important}
::selection{background:#ffb000;color:#0a0600}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #ffd060;outline-offset:3px}

/* UI chrome and headings in monospace; long text stays in the readable sans */
h1,h2,h3,h4,.brand,button,.tab,.tool-button,.eyebrow,label,input,select,summary,.metric,.new-badge,footer,th{font-family:var(--mono)!important}
h1,h2,h3{letter-spacing:-.02em;font-weight:700}
.search-card,.view,.repo-pill,.tool-button,.tab,.metric,.file-panel,.graph,pre,dialog,.progress,button,.outline,.primary,input,select{border-width:1px!important}
/* the diagram brings its own pale fills (GitDiagram cache and our tones): invert them as one so every diagram is dark and keeps its colour coding */
svg[id^="clonegithub-diagram-"],svg[id^="cg-feature-diagram-"]{filter:invert(1) hue-rotate(180deg) saturate(.9)}

/* inside the diagram: these values are pre-inversion (the filter flips lightness), so they read dark amber on screen */
.graph .cluster rect{fill:#fdf3dc!important;stroke:#ffdd80!important}
.graph .cluster-label,.graph .cluster-label span{color:#9e6f00!important}
.graph .edgeLabel rect{fill:#fffcf5!important}
.graph .edgeLabel{color:#9e6f00!important}
.graph g.node:focus{outline-color:#9e6f00}
.graph g.node.cg-selected rect,.graph g.node.cg-selected polygon,.graph g.node.cg-selected circle,.graph g.node.cg-selected path,.graph path.cg-hit{stroke:#9e6f00!important}
