/* Pentest BB / XSS full-page visual system.
 * Scoped to body[data-site-theme]; AD pages and shared content remain unchanged.
 * Theme presets vary background, surfaces, borders and accent.
 * Red represents denied characters / risk in every theme.
 */
body[data-site-theme]{
  color-scheme:dark;
  --x-bg:#070909;--x-shell:#080a0a;--x-panel:#0f1111;
  --x-card:#131616;--x-raised:#191d1c;--x-code:#080c0b;
  --x-line:#242b29;--x-border:#303a36;--x-fg:#f2f7f4;
  --x-text:#c1cfc9;--x-muted:#94a7a0;--x-accent:#65e49b;
  --x-accent-soft:#12271b;--x-danger:#f25768;--x-danger-soft:#32171d;
  --x-radius:10px;--x-spacing:1;
  --terminal-bg:var(--x-bg);--terminal-panel:var(--x-panel);
  --terminal-raised:var(--x-raised);--terminal-line:var(--x-line);
  --terminal-text:var(--x-fg);--terminal-secondary:var(--x-text);
  --terminal-accent:var(--x-accent);--terminal-code-bg:var(--x-code);
  --terminal-hover:var(--x-raised);
  --bg:var(--x-bg);--bg2:var(--x-shell);--card:var(--x-card);
  --border:var(--x-border);--line:var(--x-line);--fg:var(--x-fg);
  --text:var(--x-text);--muted:var(--x-muted);
  --accent:var(--x-accent);--accent-2:var(--x-accent);
  background:var(--x-bg);color:var(--x-fg);
}
/* One-click curated schemes; background AND card surface change together. */
body[data-site-theme][data-site-theme="graphite"]{
 --x-bg:#0c0f13;--x-shell:#101318;--x-panel:#14181e;--x-card:#1b2128;--x-raised:#242d37;
 --x-code:#0a0d11;--x-line:#2d343e;--x-border:#3b4653;--x-fg:#f0f4f8;--x-text:#c9d3de;--x-muted:#98a7b5;
 --x-accent:#dce4eb;--x-accent-soft:#29323b;
}
body[data-site-theme][data-site-theme="forest"]{
 --x-bg:#07110b;--x-shell:#09150e;--x-panel:#0c1a12;--x-card:#13241a;--x-raised:#1c3024;
 --x-code:#06100a;--x-line:#263b2d;--x-border:#385540;--x-fg:#e9f8ed;--x-text:#c6e4ce;--x-muted:#9ec8a8;
 --x-accent:#9be0ae;--x-accent-soft:#1b3a28;
}
body[data-site-theme][data-site-theme="ocean"]{
 --x-bg:#07121a;--x-shell:#081722;--x-panel:#101d28;--x-card:#172a38;--x-raised:#203849;
 --x-code:#071019;--x-line:#2b4252;--x-border:#3b5e73;--x-fg:#edf8ff;--x-text:#c5dfec;--x-muted:#96b6c9;
 --x-accent:#6ab8ef;--x-accent-soft:#193447;
}
body[data-site-theme][data-site-theme="violet"]{
 --x-bg:#0f0a17;--x-shell:#130e1c;--x-panel:#1a1424;--x-card:#261d33;--x-raised:#322641;
 --x-code:#0c0913;--x-line:#382c47;--x-border:#4e3b61;--x-fg:#f8f0ff;--x-text:#e0ceed;--x-muted:#b79dcc;
 --x-accent:#c29cff;--x-accent-soft:#312242;
}
body[data-site-theme][data-site-theme="cyan"]{
 --x-bg:#061315;--x-shell:#09191b;--x-panel:#102123;--x-card:#173034;--x-raised:#204044;
 --x-code:#061012;--x-line:#284347;--x-border:#396269;--x-fg:#e8fcfb;--x-text:#c0e3e3;--x-muted:#96bec0;
 --x-accent:#65d9d7;--x-accent-soft:#16383c;
}
body[data-site-theme][data-site-theme="amber"]{
 --x-bg:#17100a;--x-shell:#1b150e;--x-panel:#241c13;--x-card:#30251a;--x-raised:#3b2f21;
 --x-code:#100e0a;--x-line:#3e3225;--x-border:#604b32;--x-fg:#fff4df;--x-text:#e5d2b3;--x-muted:#bca17b;
 --x-accent:#e5b66d;--x-accent-soft:#392915;
}
body[data-site-theme][data-site-theme="copper"]{
 --x-bg:#150d0b;--x-shell:#1a100e;--x-panel:#231713;--x-card:#30201b;--x-raised:#402a23;
 --x-code:#100b0a;--x-line:#452b23;--x-border:#624338;--x-fg:#fff0e8;--x-text:#e9cec1;--x-muted:#c5a08f;
 --x-accent:#f29b76;--x-accent-soft:#43241a;
}
body[data-site-theme][data-site-theme="rose"]{
 --x-bg:#160c13;--x-shell:#1b1018;--x-panel:#241620;--x-card:#321d2b;--x-raised:#402637;
 --x-code:#120a10;--x-line:#452b3b;--x-border:#634153;--x-fg:#fff0f7;--x-text:#eecedc;--x-muted:#c89bb2;
 --x-accent:#f2a1c0;--x-accent-soft:#422032;
}
body[data-site-theme][data-site-theme="electric"]{
 --x-bg:#080c18;--x-shell:#0c1120;--x-panel:#11192b;--x-card:#182341;--x-raised:#243357;
 --x-code:#070b15;--x-line:#2b3b5d;--x-border:#405682;--x-fg:#f0f4ff;--x-text:#ccdaf7;--x-muted:#9badcc;
 --x-accent:#8dabff;--x-accent-soft:#213462;
}
body[data-site-theme][data-site-theme="olive"]{
 --x-bg:#0d1109;--x-shell:#13170d;--x-panel:#191e12;--x-card:#252b1b;--x-raised:#303923;
 --x-code:#0b0f08;--x-line:#37412a;--x-border:#50623b;--x-fg:#f3f7e7;--x-text:#d9e4c1;--x-muted:#adbf8f;
 --x-accent:#c3d77d;--x-accent-soft:#2e3b1b;
}
body[data-site-theme][data-site-theme="ice"]{
 --x-bg:#0a1116;--x-shell:#0e171e;--x-panel:#141e26;--x-card:#1a2932;--x-raised:#243640;
 --x-code:#0a1016;--x-line:#2a3c47;--x-border:#415a65;--x-fg:#edf9ff;--x-text:#c8e0e8;--x-muted:#9dbdc9;
 --x-accent:#a5d5e8;--x-accent-soft:#213844;
}
body[data-site-theme][data-site-background="soft"]{--x-bg:var(--x-shell)}
body[data-site-theme][data-site-cards="raised"]{--x-card:var(--x-raised)}
body[data-site-theme][data-site-density="relaxed"]{--x-spacing:1.18}
/* Global chrome is black on the default theme and follows the palette elsewhere. */
body[data-site-theme] :is(.content-column,.main){background:var(--x-bg)}
body[data-site-theme] .sidebar{
  background:var(--x-shell);border-right:1px solid var(--x-line);
  scrollbar-color:var(--x-border) transparent;overflow-y:auto;
  padding:22px 13px 17px;gap:0;
}
body[data-site-theme] .brand{margin:0 6px 26px;gap:11px}
body[data-site-theme] .brand-icon{background:var(--x-accent-soft);color:var(--x-accent);border-color:var(--x-border);border-radius:10px}
body[data-site-theme] .brand strong{color:var(--x-fg)}
body[data-site-theme] .brand small{color:var(--x-muted)}
body[data-site-theme] .sidebar-label{color:var(--x-muted);margin-bottom:8px}
body[data-site-theme] .sidebar nav{gap:3px}
body[data-site-theme] .side-link{color:var(--x-text);font-size:13px;padding:9px 10px;border:1px solid transparent;border-radius:9px;line-height:1.4;min-height:38px}
body[data-site-theme] .side-link:hover{background:var(--x-card);color:var(--x-fg)}
body[data-site-theme] .side-link.active{color:var(--x-accent);background:var(--x-accent-soft);border-color:var(--x-border)}
body[data-site-theme] .nav-number,body[data-site-theme] .side-link.active .nav-number{color:var(--x-accent)}
body[data-site-theme] .sidebar-bottom{border-color:var(--x-line);color:var(--x-muted);padding-top:10px;margin-top:auto;flex-shrink:0}
body[data-site-theme] .sidebar-bottom div{color:var(--x-muted)}
body[data-site-theme] .sidebar-bottom strong,body[data-site-theme] .sidebar-bottom code{color:var(--x-fg)}
body[data-site-theme] .status-dot{background:var(--x-accent)}
body[data-site-theme] .topbar{
  min-height:59px;height:auto;padding:12px clamp(16px,2.5vw,36px);
  border-bottom:1px solid var(--x-line);color:var(--x-muted);background:var(--x-bg)
}
body[data-site-theme] .topbar strong,body[data-site-theme] .topbar-end{color:var(--x-fg)}
body[data-site-theme] .topbar .width-picker{color:var(--x-muted)}
body[data-site-theme] .main{width:var(--reader-width,95%);max-width:1550px;margin:0 auto;padding:24px clamp(12px,2.2vw,32px) 58px}
body[data-site-theme] .footer{background:var(--x-bg);color:var(--x-muted);border-color:var(--x-line)}
body[data-site-theme] .menu-button{color:var(--x-fg)}
body[data-site-theme] :is(a,button,input,select,summary):focus-visible{
  outline:2px solid var(--x-accent);outline-offset:2px;
}
body[data-site-theme] ::selection{background:var(--x-accent-soft);color:var(--x-fg)}
/* Collapsible palette menu; 12 presets + independent surface and density switches. */
body[data-site-theme] .xss-appearance{border-top:1px solid var(--x-line);margin:18px 0 0;padding-top:10px;flex-shrink:0}
body[data-site-theme] .xss-appearance-summary{
  list-style:none;display:flex;gap:10px;align-items:center;cursor:pointer;
  padding:10px;border-radius:9px;color:var(--x-fg);font-weight:700;
  line-height:1.35;font-size:13px;
}
body[data-site-theme] .xss-appearance-summary::-webkit-details-marker{display:none}
body[data-site-theme] .xss-appearance-summary:hover{background:var(--x-card)}
body[data-site-theme] .xss-appearance-summary>span:nth-child(2){display:grid;gap:2px;min-width:0;flex:1}
body[data-site-theme] .xss-appearance-summary small{color:var(--x-muted);font-size:11px;font-weight:500}
body[data-site-theme] .xss-appearance-chevron{font-size:17px;color:var(--x-muted);transition:transform .15s}
body[data-site-theme] .xss-appearance[open] .xss-appearance-chevron{transform:rotate(180deg)}
body[data-site-theme] .xss-appearance-icon{color:var(--x-accent);font-size:23px;line-height:1}
body[data-site-theme] .xss-appearance-body{padding:4px 7px 11px;display:grid;gap:14px}
body[data-site-theme] .xss-appearance-fieldset{padding:0;margin:0;min-width:0;border:0}
body[data-site-theme] .xss-appearance-fieldset legend{
  color:var(--x-muted);font-size:11px;font-weight:700;
  padding:0;margin:0 0 8px;letter-spacing:.2px;
}
body[data-site-theme] .xss-palette-list{display:grid;gap:4px;max-height:275px;overflow-y:auto;scrollbar-color:var(--x-border) transparent}
body[data-site-theme] .xss-palette-option{cursor:pointer;display:block;min-width:0}
body[data-site-theme] .xss-palette-option>input{
 position:absolute;opacity:0;width:1px;height:1px;
}
body[data-site-theme] .xss-palette-option-label{
  display:flex;align-items:center;gap:7px;border:1px solid transparent;
  padding:6px 5px;border-radius:7px;background:transparent;
  color:var(--x-text);font-size:12px;line-height:1.25;
}
body[data-site-theme] .xss-palette-option:hover .xss-palette-option-label{background:var(--x-card)}
body[data-site-theme] .xss-palette-option input:checked+.xss-palette-option-label{
  color:var(--x-fg);background:var(--x-accent-soft);border-color:var(--x-border);font-weight:700;
}
body[data-site-theme] .xss-palette-option input:focus-visible+.xss-palette-option-label{outline:2px solid var(--x-accent);outline-offset:2px}
body[data-site-theme] .xss-palette-swatches{display:flex;gap:0;flex:none}
body[data-site-theme] .xss-palette-swatches i{width:13px;height:19px;display:block;border:1px solid #ffffff3d}
body[data-site-theme] .xss-palette-swatches i:first-child{border-radius:5px 0 0 5px}
body[data-site-theme] .xss-palette-swatches i:last-child{border-radius:0 5px 5px 0}
body[data-site-theme] .xss-appearance-segments{display:flex;gap:5px}
body[data-site-theme] .xss-appearance-segments label{flex:1;min-width:0;cursor:pointer;position:relative}
body[data-site-theme] .xss-appearance-segments input{position:absolute;opacity:0;width:1px;height:1px}
body[data-site-theme] .xss-appearance-segments span{
  display:flex;justify-content:center;align-items:center;min-height:32px;
  background:var(--x-panel);border:1px solid var(--x-line);border-radius:7px;
  color:var(--x-muted);font-size:11px;padding:6px 4px;text-align:center;
}
body[data-site-theme] .xss-appearance-segments input:checked+span{
  color:var(--x-accent);background:var(--x-accent-soft);border-color:var(--x-border);font-weight:700;
}
body[data-site-theme] .xss-appearance-segments input:focus-visible+span{outline:2px solid var(--x-accent);outline-offset:2px}
body[data-site-theme] .xss-appearance-reset{
  background:transparent;border:1px solid var(--x-border);color:var(--x-text);
  border-radius:7px;padding:8px 9px;cursor:pointer;font-size:12px;
}
body[data-site-theme] .xss-appearance-reset:hover{background:var(--x-card);color:var(--x-fg)}

/* CSP-safe palette previews: no style attributes in template. */
body[data-site-theme][data-site-theme] .xss-palette-option--mono{--sw-bg:#080A09;--sw-card:#141715;--sw-accent:#65E49B}
body[data-site-theme][data-site-theme] .xss-palette-option--graphite{--sw-bg:#111317;--sw-card:#222630;--sw-accent:#DCE1E8}
body[data-site-theme][data-site-theme] .xss-palette-option--forest{--sw-bg:#08120D;--sw-card:#14251A;--sw-accent:#9BE0AE}
body[data-site-theme][data-site-theme] .xss-palette-option--ocean{--sw-bg:#08131C;--sw-card:#162939;--sw-accent:#6AB8EF}
body[data-site-theme][data-site-theme] .xss-palette-option--violet{--sw-bg:#100C19;--sw-card:#251C35;--sw-accent:#C29CFF}
body[data-site-theme][data-site-theme] .xss-palette-option--cyan{--sw-bg:#071517;--sw-card:#153034;--sw-accent:#65D9D7}
body[data-site-theme][data-site-theme] .xss-palette-option--amber{--sw-bg:#18120B;--sw-card:#30251A;--sw-accent:#E5B66D}
body[data-site-theme][data-site-theme] .xss-palette-option--copper{--sw-bg:#170F0C;--sw-card:#30201B;--sw-accent:#F29B76}
body[data-site-theme][data-site-theme] .xss-palette-option--rose{--sw-bg:#190E16;--sw-card:#321D2B;--sw-accent:#F2A1C0}
body[data-site-theme][data-site-theme] .xss-palette-option--electric{--sw-bg:#090D1B;--sw-card:#182341;--sw-accent:#8DABFF}
body[data-site-theme][data-site-theme] .xss-palette-option--olive{--sw-bg:#10130C;--sw-card:#252B1B;--sw-accent:#C3D77D}
body[data-site-theme][data-site-theme] .xss-palette-option--ice{--sw-bg:#0C1218;--sw-card:#1A2932;--sw-accent:#A5D5E8}
body[data-site-theme][data-site-theme] .xss-palette-swatches i:nth-child(1){background:var(--sw-bg)}
body[data-site-theme][data-site-theme] .xss-palette-swatches i:nth-child(2){background:var(--sw-card)}
body[data-site-theme][data-site-theme] .xss-palette-swatches i:nth-child(3){background:var(--sw-accent)}


/* Whole-site common surfaces: controls and cards inherit the selected palette.
 * These overrides deliberately avoid dimensions, absolute positions, and content.
 */
body[data-site-theme] .main :is(
 .stage-tile,.home-note,.home-callout,.tracks-tile,.web-topic-card,
 .web-section,.web-section-index,.web-resources,.web-source-links,
 .theory-stage-tile,.theory-group,.theory-topic-list,.theory-article,
 .theory-article-section,.theory-search-box,.theory-concept,
 .planner-pane,.planner-result,.planner-command,.planner-radio,
 .ar-article,.ar-index,.ar-search,.ar-source-links,.ar-note,
 .workflow-group,.topic-disclosure,.phase-steps,.guide-index,
 .guide-search-box,.guide-service-header,.guide-subtopic,.guide-tree,
 .guide-topic-matrix,.recon-guide-card,.recon-guide-top,.enum-guide,
 .enum-chapter-header,.stage-context,.note-article,.lab-example,
 .command-info,.page-search,.topic-nav,.target-panel,.entry-route-grid,
 .setup-panel,.recon-guide-card-body,.enum-route-explainer
){
 background:var(--x-card);border-color:var(--x-line);color:var(--x-fg);
 box-shadow:none;
}
body[data-site-theme] .main :is(
 .stage-tile,.tracks-tile,.web-topic-card,.web-section-index,.theory-stage-tile,
 .theory-group,.planner-pane,.ar-article,.workflow-group,.topic-disclosure,
 .guide-index,.enum-guide,.target-panel
){border-radius:10px}
body[data-site-theme] .main :is(
 .home-head,.stage-header,.web-track-head,.theory-head,.planner-header,
 .ar-head,.guide-index-head,.recon-guide-top,.enum-chapter-header
) :is(h1,h2,h3,strong){
 color:var(--x-fg)
}
body[data-site-theme] .main :is(
 .home-head,.stage-header,.web-track-head,.theory-head,.planner-header,
 .ar-head,.web-section,.theory-article,.planner-pane,.ar-article
) :is(p,small){
 color:var(--x-text)
}
body[data-site-theme] .main :is(
 .stage-tile,.web-topic-card,.theory-stage-tile,.planner-pane,
 .ar-index,.ar-article,.theory-group,.guide-topic-matrix,
 .web-section,.topic-disclosure,.workflow-group
) :is(h2,h3,h4,strong){
 color:var(--x-fg)
}
body[data-site-theme] .main :is(
 .stage-tile,.web-topic-card,.theory-stage-tile,.planner-pane,
 .ar-index,.ar-article,.theory-group,.guide-topic-matrix,
 .web-section,.topic-disclosure,.workflow-group
) :is(p,small,li){
 color:var(--x-text)
}
body[data-site-theme] .main :is(
 .stage-tile,.web-topic-card,.theory-stage-tile,.planner-pane,
 .ar-index,.ar-article,.theory-group,.guide-topic-matrix,
 .web-section,.topic-disclosure,.workflow-group
) :is(a:hover,button:hover){
 border-color:var(--x-accent)
}
body[data-site-theme] .main :is(
 .stage-tile,.web-topic-card,.theory-stage-tile,.planner-pane,
 .ar-index,.ar-article,.guide-index,.workflow-group
) :is(.active,.selected,.is-active){
 background:var(--x-accent-soft);border-color:var(--x-border);color:var(--x-accent)
}
body[data-site-theme] .main :is(
 .command pre,.lab-code,.theory-article pre,.planner-command pre,
 .ar-article pre,.guide-code,.recon-guide-code,.guide-tree pre,
 .theory-code,.web-topic-source pre
){
 color:var(--x-fg);background:var(--x-code);border-color:var(--x-line)
}
body[data-site-theme] .main :is(
 input[type="text"],input[type="search"],input[type="number"],input[type="url"],
 select,textarea
){
 background:var(--x-panel);color:var(--x-fg);border-color:var(--x-border);accent-color:var(--x-accent)
}
body[data-site-theme] .main :is(
 .stage-tile:hover,.web-topic-card:hover,.theory-stage-tile:hover,
 .ar-article:hover,.guide-index-link:hover,.web-section-index a:hover
){
 border-color:var(--x-accent);background:var(--x-raised)
}
body[data-site-theme] .main :is(
 .theory-kicker,.ar-kicker,.tracks-eyebrow,.web-back-link,
 .planner-kicker,.stage-number,.nav-number,.guide-index-number
){
 color:var(--x-accent)
}
body[data-site-theme] .main :is(
 .theory-stats,.web-track-badges,.ar-metrics,.stage-context,
 .theory-notice,.home-note,.web-topic-note,.planner-private
){
 border-color:var(--x-line)
}
body[data-site-theme] .main :is(
 .theory-stats,.web-track-badges,.ar-metrics,.stage-context,
 .theory-notice,.home-note,.web-topic-note,.planner-private
) :is(p,span,small){
 color:var(--x-text)
}
body[data-site-theme] .main a:hover{color:var(--x-accent)}
body[data-site-theme] .main :is(.copy,.guide-code-top button,.planner-reset,.theory-practice-button){
 background:var(--x-panel);color:var(--x-accent);border-color:var(--x-border)
}
body[data-site-theme] .main :is(.copy,.guide-code-top button,.planner-reset,.theory-practice-button):hover{
 background:var(--x-raised);border-color:var(--x-accent)
}
body[data-site-theme] .offline-status{
 background:var(--x-accent-soft);color:var(--x-fg);border-color:var(--x-border)
}
body[data-site-theme] .offline-status strong{color:var(--x-fg)}
body[data-site-theme] .copy-toast{background:var(--x-panel);color:var(--x-fg);border-color:var(--x-border)}
@media(max-width:760px){
 body[data-site-theme] .sidebar{position:fixed;overflow-y:auto}
}
@media print{
 body[data-site-theme],body[data-site-theme] .content-column,
 body[data-site-theme] .main{background:#fff;color:#111}
 body[data-site-theme] .xss-appearance{display:none!important}
}

/* Pinned build information and real Django server connectivity. */
body[data-site-theme] .sidebar-bottom .sidebar-server-status{
  display:flex;align-items:center;min-width:0;gap:8px;margin-top:0;
  font-family:var(--mono,monospace);letter-spacing:0;
}
body[data-site-theme] .sidebar-server-status .sidebar-build-label{flex:1;min-width:0}
body[data-site-theme] .sidebar-server-status [data-server-status-label]{
  font:700 12px/1.5 var(--mono,monospace);white-space:nowrap;color:var(--x-muted)
}
body[data-site-theme] .sidebar-server-status .server-status-light{
  width:9px;height:9px;flex:0 0 9px;border-radius:50%;background:#84908e;box-shadow:0 0 0 2px #84908e28
}
body[data-site-theme] .sidebar-server-status[data-state="online"] .server-status-light{
  background:#37d67a;box-shadow:0 0 0 2px #37d67a33
}
body[data-site-theme] .sidebar-server-status[data-state="online"] [data-server-status-label]{color:#37d67a}
body[data-site-theme] .sidebar-server-status[data-state="offline"] .server-status-light{
  background:#f06161;box-shadow:0 0 0 2px #f0616133
}
body[data-site-theme] .sidebar-server-status[data-state="offline"] [data-server-status-label]{color:#f06161}
