/* =============================================================================
   Pentest Search Engine — Global Styles (Light/Dark)
   -----------------------------------------------------------------------------
   PURPOSE
   - Skin layer on top of Bootstrap (no grid/layout changes unless noted)
   - Centralize colors/typography/tokens and shared UI primitives

   HOW TO USE
   - Prefer these classes over inline styles in templates.
   - Add `data-theme="dark"` on <html> or <body> to enable dark mode.

   APPLIES TO
   - index.html (search page UI, left tree, results cards, right config panel)
   - admin_panel.html (sidebar + dynamic content frame)
   - admin_section_* (commands, tools, variables, mitre tables & modals)

   PREFIX
   - Reusable skins prefixed with `ps-` to avoid Bootstrap collisions.
============================================================================= */


/* ============================================================================
   1) THEME TOKENS
   - Design tokens for light/dark modes (colors, radii, fonts, shadows, etc.)
   - Editing tokens changes the whole app consistently.
============================================================================= */

/* Light mode tokens */
/* :root */
:root {
  --ps-bg: #ffffff;
  --ps-surface: #FAFAFA;
  --ps-surface-2: #eef1f7;
  --ps-text: #000000;
  --ps-muted: #475467;
  --ps-primary: #60a5fa;
  --ps-success: #04D04F;
  --ps-warning: #f59e0b;
  --ps-danger: #dc3545;
  --ps-border: #e5e7eb;
  --ps-ph: #A73E53;
  --ps-tt: #000000;
  --ps-value: #000000;
  --ps-shadow: 0 8px 24px rgba(16,24,40,.08);
  --ps-radius-sm: 6px;
  --ps-radius: 10px;
  --ps-radius-lg: 12px;
  --ps-focus: 0 0 0 2px color-mix(in srgb, var(--ps-primary) 25%, transparent);
  --admin-sidebar-top: 130px;
  --right-panel-top: 88px;
  --right-panel-position: sticky;
  --ps-search-page-max-width: 1920px;
  --ps-searchbar-h: 50px;
  --ps-card-glow: color-mix(in srgb, var(--ps-card-accent) 35%, transparent);
  --ps-card-grad-a: color-mix(in srgb, var(--ps-primary) 42%, transparent);
  --ps-card-grad-b: color-mix(in srgb, var(--ps-warning) 26%, transparent);
  --rail-top-a: color-mix(in srgb, var(--ps-primary) 40%, transparent);
  --rail-top-b: color-mix(in srgb, var(--ps-warning) 24%, transparent);
  --rail-border: color-mix(in srgb, var(--ps-border) 92%, transparent);
  --rail-glow: color-mix(in srgb, var(--rail-accent) 30%, transparent);
  --ps-footer-border: color-mix(in srgb, #000 12%, var(--ps-footer-bg));
  --cp-bg-2: color-mix(in srgb, var(--ps-surface) 94%, var(--ps-bg) 6%);
  --cp-item-pad-y: 8px;
  --cp-item-pad-x: 10px;
  --cp-item-font: 0.95rem;
  --modal-body-max-h: 96vh;
  /* Core palette */
  /* was #000000; softened for better hierarchy/readability */
  /* Typography */
  --ps-font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
             Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
             "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
  --ps-font-mono: "Roboto", ui-monospace, SFMono-Regular, Menlo, Monaco,
                  Consolas, "Liberation Mono", monospace;
  

  
  /* Radii */
  /* Focus ring */
  /* Sticky offsets / layout tokens */
  /* Search page width cap */
  --bs-code-color: var(--ps-text); /* or any hex you like */
  --ps-topbar-h: 56px;        /* header height */
  /* NEW: themeable colors for the top bar and its menu buttons */
  --ps-topbar-bg: #22355c;    /* top menu background color */
  --ps-menu-accent: #f59e0b;  /* menu buttons/links color */
  --ps-float-1: color-mix(in srgb, #73829B 20%, transparent); /* matches topbar */
  --ps-float-2: color-mix(in srgb, #BFA984 16%, transparent); /* matches menu */
  --ps-float-3: color-mix(in srgb, #BFCBDA 14%, transparent); /* soft blue accent */
  --ps-float-4: color-mix(in srgb, #22c55e 14%, transparent); /* soft green accent */
  /* tweakable accents for results */
  --ps-card-accent: var(--ps-warning);         /* nice link to your menu accent */
  /* Rails palette (harmonize with your topbar + menu accent) */
  --rail-accent: var(--ps-warning); /* your #f59e0b */
  --ps-footer-h: 38px;               /* 💡 adjust height here */
  --ps-footer-bg: color-mix(in srgb, var(--ps-topbar-bg) 96%, #000 4%);  /* matches top-bar tone */
  --ps-footer-fg: #e8eaed;           /* text color */
  --ps-footer-font-size: 1 rem;    /* text size */
  /* ---- Sizing knobs ---- */
  --cp-modal-max-w: 1620px;  /* overall modal max width */
  --cp-left-w: 240px;        /* left nav column width  */
  --cp-mid-w:  340px;        /* middle list width      */
  --cp-h:      72vh;         /* interior height        */
  /* ---- Look & feel ---- */
  --cp-sep:    var(--ps-border); /* column separators        */
  --cp-bg:     var(--ps-surface);/* base pane background     */
  /* ---- Middle list item metrics (text rows) ---- */
  --modal-max-w: 1460px; /* default for any .modal--sizable unless overridden */
}



/* Dark mode overrides */
/* :root[data-theme="dark"] */
:root[data-theme="dark"] {
  --ps-bg: #0f1115;
  --ps-surface: #171a21;
  --ps-surface-2: #3A414F;
  --ps-text: #e5e7eb;
  --ps-muted: #a1a7b3;
  --ps-primary: #60a5fa;
  --ps-success: #04D04F;
  --ps-warning: #F59E0B;
  --ps-danger: #f87171;
  --ps-border: #2b2f3a;
  --ps-ph: #D0425F;
  --ps-tt: #ffffff;
  --ps-value: #FFFFFF;
  --ps-shadow: 0 8px 24px rgba(0,0,0,.55);
  --ps-topbar-bg: #22355c;
  --ps-menu-accent: #f59e0b;
  --ps-float-1: color-mix(in srgb, #73829B 26%, transparent);
  --ps-float-2: color-mix(in srgb, #BFA984 22%, transparent);
  --ps-float-3: color-mix(in srgb, #BFCBDA 20%, transparent);
  --ps-float-4: color-mix(in srgb, #34d399 20%, transparent);
  --ps-card-glow: color-mix(in srgb, var(--ps-card-accent) 55%, transparent);
  --rail-border: color-mix(in srgb, var(--ps-border) 70%, transparent);
  --rail-glow: color-mix(in srgb, var(--rail-accent) 45%, transparent);
  --ps-footer-bg: color-mix(in srgb, var(--ps-topbar-bg) 96%, #000 4%);
  --ps-footer-fg: #e8eaed;
  /* keep same tones or adjust if you prefer different dark footer */
}

/* =========================================================
   Left Rail — Color tokens (light)
========================================================= */
:root {
  --rail-bg:            var(--ps-surface);
  --rail-border:        var(--ps-border);
  --rail-text:          var(--ps-text);
  --rail-muted:         var(--ps-muted, #6b7280);

  /* category accents */
  --rail-tool:          var(--ps-primary);     /* tools color */
  --rail-article:       #8b5cf6;              /* articles color (violet) */

  /* states */
  --rail-hover-bg:      color-mix(in srgb, var(--rail-tool) 7%, var(--rail-bg));
  --rail-active-bg:     color-mix(in srgb, var(--rail-tool) 12%, var(--rail-bg));
  --rail-active-ring:   color-mix(in srgb, var(--rail-tool) 55%, transparent);
}

/* =========================================================
   Left Rail — Color tokens (dark)
========================================================= */
:root[data-theme="dark"] {
  --rail-bg:            var(--ps-surface);
  --rail-border:        var(--ps-border);
  --rail-text:          var(--ps-text);
  --rail-muted:         var(--ps-muted, #9ca3af);

  --rail-tool:          #60a5fa;              /* lighter primary for dark */
  --rail-article:       #a78bfa;              /* lighter violet for dark */

  --rail-hover-bg:      color-mix(in srgb, var(--rail-tool) 11%, var(--rail-bg));
  --rail-active-bg:     color-mix(in srgb, var(--rail-tool) 18%, var(--rail-bg));
  --rail-active-ring:   color-mix(in srgb, var(--rail-tool) 60%, transparent);
}


/* ===== Monospace for code and commands (shared rule) ===== */
:root { --cmd-font-size: .95rem; } /* tweak once, used everywhere */

code, pre, kbd, samp,
.command-text {
  font-family: var(--ps-font-mono);
  font-size: var(--cmd-font-size);
  font-variant-ligatures: none;     /* avoid fancy ligatures in code */
  font-feature-settings: "calt" 0;  /* keep monospaced appearance clean */
}

/* Optional: keep pre/code readable line-height */
pre, code { line-height: 1.4; }


/* ============================================================================
   2) GLOBAL BASICS
   - Base typography, links, inputs, and generic button skins
============================================================================= */


/* body */
html, body { height: 100%; }

body {
  background: var(--ps-bg);
  color: var(--ps-text);
  font-family: var(--ps-font);
  line-height: 1.55;
  padding-top: var(--ps-topbar-h);
  scroll-padding-top: var(--ps-topbar-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}




/* Links */
/* a, a:visited */
a, a:visited {
 color: var(--ps-primary); text-decoration: none; 
}


/* a:hover */
a:hover {
  text-decoration: underline;
}



/* Inputs (text/url/search/select/textarea) */
/* input[type="text"], input[type="url"], input[type="search"],
textarea, select, .ps-input, .ps-select, .ps-textarea */
input[type="text"], input[type="url"], input[type="search"],
textarea, select, .ps-input, .ps-select, .ps-textarea {
  background: var(--ps-surface);
  color: var(--ps-text);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);

}


/* input[type="text"]:focus, input[type="url"]:focus, input[type="search"]:focus,
textarea:focus, select:focus, .ps-input:focus, .ps-select:focus, .ps-textarea:focus */
input[type="text"]:focus, input[type="url"]:focus, input[type="search"]:focus,
textarea:focus, select:focus, .ps-input:focus, .ps-select:focus, .ps-textarea:focus {
  outline: none;
  border-color: var(--ps-ph);
  box-shadow: var(--ps-focus);

}



/* Buttons (semantic skins layered over Bootstrap) */
/* .ps-btn */
.ps-btn {
  border-radius: var(--ps-radius);
}


/* .ps-btn--primary */
.ps-btn--primary {
 background: var(--ps-primary); color: #fff; border: 1px solid var(--ps-primary); 
}


/* .ps-btn--light */
.ps-btn--light {
 background: var(--ps-surface); color: var(--ps-text); border: 1px solid var(--ps-border); 
}


/* .ps-btn--danger */
.ps-btn--danger {
 background: var(--ps-danger);  color: #fff; border: 1px solid var(--ps-danger); 
}


/* .ps-btn--ghost */
.ps-btn--ghost {
 background: transparent; color: var(--ps-text); border: 1px solid var(--ps-border); 
}


/* .ps-btn--outline */
.ps-btn--outline {
 background: transparent; color: var(--ps-text); border: 1px solid var(--ps-primary); 
}



/* Button hover microfeedback */
/* .ps-btn:hover */
.ps-btn:hover {
  filter: brightness(0.98);
}




/* ============================================================================
   3) LAYOUT / CONTAINERS
   - Panels, side panels, and sticky behavior used across pages
============================================================================= */


/* =========================================================
   LAYOUT: APP RAILS
   - Stable 3-column responsive shell
   - Desktop: left rail | main | right rail
   - Tablet (<1100px): hide left rail, keep main | right
   - Mobile (<840px): stack all vertically
   ========================================================= */

.ps-rails {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  align-items: start;
  gap: 16px;
  max-width: var(--ps-search-page-max-width);
  margin: 0 auto;
  padding: 16px;
}

/* Left rail (tactic filters, tool filter list, etc.) */
.ps-left-rail {
  position: relative;
  display: block;
  min-width: 0;
}

/* Main content column (search results / article / etc.) */
.ps-main,
.ps-main-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
}

/* Right rail (variables panel, MITRE info etc.) */
.ps-right-rail {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Tablet breakpoint:
   Collapse left rail offscreen (hidden).
   Keep main + right.
   We keep grid for predictability, but set first col to 0.
*/
@media (max-width: 1100px) {
  .ps-rails {
    grid-template-columns: 0px 1fr 280px;
  }
  .ps-left-rail {
    display: none;
  }
}

/* Narrow breakpoint:
   Stack everything vertically.
   Right rail moves below main.
*/
@media (max-width: 840px) {
  .ps-rails {
    grid-template-columns: 1fr;
  }

  .ps-left-rail,
  .ps-right-rail {
    display: block;
    order: initial;
  }

  /* Mobile order:
     1. Filters (left rail content)
     2. Main results
     3. Variables panel (right rail content)
     If you want a different order, swap these order values.
  */
  .ps-left-rail { order: 1; }
  .ps-main,
  .ps-main-col { order: 2; }
  .ps-right-rail {
    order: 3;
    margin-top: 16px;
  }
}



/* Generic card/panel surface */
/* .ps-panel */
.ps-panel {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);
}

/* When the left rail is shown in app mode, kill the soft background halo */
.ps-left-rail.ps-left-rail--active {
  background: transparent;
  box-shadow: none;
  border: 0;
}



/* =========================================================
   Left Rail — Base skin
========================================================= */
.ps-left-rail {
  background: var(--rail-bg);
  color: var(--rail-text);
  border-right: 1px solid var(--rail-border);
}

/* Ensure links inherit and don’t use browser default blues */
.ps-left-rail a {
  color: inherit;
  text-decoration: none;
}
.ps-left-rail a:focus-visible {
  outline: 2px solid var(--rail-active-ring);
  outline-offset: 2px;
  border-radius: .375rem;
}

/* =========================================================
   Left Rail — List items (shared)
========================================================= */
.ps-left-rail .rail-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 8px 10px;
  border-radius: .5rem;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
  color: var(--rail-text);
}
.ps-left-rail .rail-item:hover {
  background: var(--rail-hover-bg);
}
.ps-left-rail .rail-item.active {
  background: var(--rail-active-bg);
  box-shadow: 0 0 0 1px var(--rail-active-ring) inset;
}

/* Optional muted subtitle/metadata */
.ps-left-rail .rail-item .meta { color: var(--rail-muted); font-size: .85em; }

/* =========================================================
   Left Rail — Category accents
   (add .is-tool or .is-article on the item/link)
========================================================= */
.ps-left-rail .rail-item.is-tool .title,
.ps-left-rail .rail-item.is-tool .icon {
  color: var(--rail-tool);
}
.ps-left-rail .rail-item.is-article .title,
.ps-left-rail .rail-item.is-article .icon {
  color: var(--rail-article);
}

/* Stronger accent when active */
.ps-left-rail .rail-item.is-tool.active .title,
.ps-left-rail .rail-item.is-tool.active .icon {
  color: color-mix(in srgb, var(--rail-tool) 85%, var(--rail-text));
}
.ps-left-rail .rail-item.is-article.active .title,
.ps-left-rail .rail-item.is-article.active .icon {
  color: color-mix(in srgb, var(--rail-article) 85%, var(--rail-text));
}

/* =========================================================
   Left Rail — Badges / counts (optional)
========================================================= */
.ps-left-rail .badge {
  background: transparent;
  border: 1px solid var(--rail-border);
  color: var(--rail-muted);
}
.ps-left-rail .rail-item.active .badge {
  border-color: var(--rail-active-ring);
  color: var(--rail-text);
}


/* ============================================================================
   4) ADMIN — LEFT SIDEBAR
   - Sticky sidebar in admin_panel.html
============================================================================= */

/* .ps-admin-sidebar */
.ps-admin-sidebar {
  position: sticky;
  top: var(--admin-sidebar-top);
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  background: var(--ps-surface);
  box-shadow: var(--ps-shadow);

}


/* .ps-admin-sidebar .list-group-item.active */
.ps-admin-sidebar .list-group-item.active {
  background: color-mix(in srgb, var(--ps-primary) 100%, transparent);
  border-color: transparent;
  color: #fff;

}


/* ============================================================================
   5) INDEX — LEFT TREE (categories & tools list)
   - Sidebar tree styles on the search page
============================================================================= */



/* 
.tools-list { margin-top: 4px; margin-left: 15px; }
*/


/* ============================================================================
   6) INDEX — RESULTS (cards + command pills + explanation text)
============================================================================= */



/* ============================================================================
   7) TABLES — SHARED (Admin sections)
   - Common table skin/hover/sticky headers/truncation
============================================================================= */

/* .ps-table */
.ps-table {
  background-color: var(--ps-bg);
  color: var(--ps-text);
  border-color: var(--ps-border);
 background: var(--ps-bg); color: var(--ps-text); border-color: var(--ps-border); 
}


/* .ps-table th, .ps-table td */
.ps-table th, .ps-table td {
  border-color: var(--ps-border);
}



/* .sticky-head th */
.sticky-head th {
  background: var(--ps-surface);

  position: sticky; top: 0; z-index: 2;
}



/* .table-hover tbody tr:hover */
.table-hover tbody tr:hover {
  background-color: color-mix(in srgb, var(--ps-primary) 12%, transparent);
  cursor: pointer;

}

/* .text-truncate */
.text-truncate {
 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 
}


/* ============================================================================
   8) TABLES — LAYOUT HELPERS (width presets, fixed layout, scroll wrapper)
============================================================================= */

/* Fixed layout + full width */
/* .ps-table--fixed */
.ps-table--fixed {
  table-layout: fixed;
  width: 100%;

}



/* Shared scroll wrapper for tall tables */
/* .ps-table-wrap */
.ps-table-wrap {
  max-height: calc(100vh - 270px);
  overflow: auto;

}


/* MITRE column widths (add <colgroup> with 3 <col> in template and class="ps-cols-mitre") */
/* .ps-cols-mitre col:nth-child(1) */
.ps-cols-mitre col:nth-child(1) {
  width: 26%;
}


/* .ps-cols-mitre col:nth-child(2) */
.ps-cols-mitre col:nth-child(2) {
  width: 37%;
}


/* .ps-cols-mitre col:nth-child(3) */
.ps-cols-mitre col:nth-child(3) {
  width: 37%;
}

/* Optional presets (uncomment if you add matching <colgroup> in templates)
.ps-cols-tools  col:nth-child(1) { width: 22%; }
.ps-cols-tools  col:nth-child(2) { width: 28%; }
.ps-cols-tools  col:nth-child(3) { width: 40%; }
.ps-cols-tools  col:nth-child(4) { width: 10%; }

.ps-cols-cmds   col:nth-child(1) { width: 20%; }
.ps-cols-cmds   col:nth-child(2) { width: 45%; }
.ps-cols-cmds   col:nth-child(3) { width: 20%; }
.ps-cols-cmds   col:nth-child(4) { width: 15%; }
*/


/* ============================================================================
   9) TABLE CELLS — SPECIALS (MITRE “data-box” and normalization)
============================================================================= */

/* Default “chip-like” data box cell */
/* .data-box */
.data-box {
  display: block;
  padding: 6px 8px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: var(--ps-surface);
  min-height: 36px;

}



/* In tables we prefer flat text, not chips */
/* .ps-table .data-box */
.ps-table .data-box {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: auto;

}


/* ============================================================================
   10) MODALS — Shared skin (all pages)
   - Styling the modal body; size is controlled by Bootstrap classes on .modal-dialog
============================================================================= */

/* .modal-content.text-dark */
.modal-content.text-dark {
  border-radius: var(--ps-radius-lg);
  box-shadow: var(--ps-shadow);
  color: var(--ps-text);

}


/* .modal-content .form-label */
.modal-content .form-label {
  font-weight: 600;
}



/* .modal-content code.command-text */
.modal-content code.command-text {
  color: var(--ps-text) !important;

}
/* Bulk-delete modal: slightly wider but still responsive */
.modal-dialog.ps-modal--wide {
  /* Bootstrap 5 reads this CSS var for dialog width */
  --bs-modal-width: min(2200px, 95vw);
}

/* ============================================================================
   11) RIGHT CONFIG PANEL (index.html)
   - Labels/notes for the variable config list on the search page
============================================================================= */

/* .ps-config-label */
.ps-config-label {
  font-weight: 600;
}


/* .ps-config-hint */
.ps-config-hint {
 font-size: 0.85rem; color: var(--ps-muted); 
}



/* Variable “pill” header inside right panel */
/* .ps-var-pill */
/* .ps-var-pill — needs attention: conflicting values present */
.ps-var-pill {
  display: block;
  display: flex;
  padding: 6px 8px;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-sm);
  background: var(--ps-surface);
  font-weight: 600;
  gap: 8px;
  line-height: 1.35;
  transition: transform .06s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
  /* structure / shape */
  align-items: center;      /* vertical center */
  /* sizing */
  padding: 4px 10px;        /* (later override kept) */
  /* base background (later override kept) */
  /* interactions (from your “command pill” behavior) */
  cursor: pointer;          /* hand pointer like commands */
  user-select: none;        /* avoid text highlight on click */
}


/* .ps-var-value */
.ps-var-value {
 display: flex; align-items: center; gap: 6px; 
}



/* .ps-var-remove:hover */
.ps-var-remove:hover {
  filter: brightness(0.9);
  border-color: var(--ps-danger);
  background: color-mix(in srgb, var(--ps-danger) 10%, transparent);
}


/* ============================================================================
   12) TOASTS — Mini toast helper
============================================================================= */

/* #miniToast.text-bg-success */
#miniToast.text-bg-success {
 background: var(--ps-success) !important; color: #00F108; 
}


/* #miniToast.text-bg-danger */
#miniToast.text-bg-danger {
 background: var(--ps-danger)  !important; color: #00F108; 
}




/* ============================================================================
   13) UTILITIES — Opt-in helpers and generic utilities
============================================================================= */

/* .ps-shadow */
.ps-shadow {
  box-shadow: var(--ps-shadow);
}


/* .ps-border */
.ps-border {
 border: 1px solid var(--ps-border); border-radius: var(--ps-radius); 
}


/* .ps-surface */
.ps-surface {
  background: var(--ps-surface);
}


/* .ps-surface2 */
.ps-surface2 {
  background: var(--ps-surface-2);
}


/* .ps-rounded */
.ps-rounded {
  border-radius: var(--ps-radius);
}


/* .ps-rounded-sm */
.ps-rounded-sm {
  border-radius: var(--ps-radius-sm);
}


/* .ps-rounded-lg */
.ps-rounded-lg {
  border-radius: var(--ps-radius-lg);
}


/* .ps-bold */
.ps-bold {
  font-weight: 700;
}


/* .ps-italic */
.ps-italic {
  font-style: italic;
}


/* .ps-underline */
.ps-underline {
  text-decoration: underline;
}



/* Explicit muted utility (opt-in) */
/* .ps-muted-tx */
.ps-muted-tx {
  color: var(--ps-muted);
}



/* Admin Section - JSON Import Modal Page - Notes / developer notes */
/* .ps-note */
.ps-note {
  background: color-mix(in srgb, var(--ps-warning) 12%, transparent);
  border: 1px dashed var(--ps-warning);
  padding: 8px;
  border-radius: var(--ps-radius-sm);

}


/* .ps-dev-note */
.ps-dev-note {
  background: color-mix(in srgb, var(--ps-primary) 10%, transparent);
  border-left: 1px solid var(--ps-primary);
  padding: 8px 10px;
  border-radius: var(--ps-radius-sm);

}



/* Cursor/visibility helpers */
/* .cursor-pointer */
.cursor-pointer {
  cursor: pointer;
}


/* .is-collapsed */
.is-collapsed {
  display: none;
}


/* .category-label.show-all */
.category-label.show-all {
  font-weight: 600;
}

/* Preserve newlines inside command text (blocks show as multiple lines) */
.ps-prewrap {
  white-space: pre-wrap;   /* keep \n as line breaks */
  word-break: break-word;  /* avoid overflow on very long tokens */
}


/* ============================================================================
   14) LEGACY COMPAT (keep existing markup rendering)
   - Allows older templates to render correctly without edits
============================================================================= */


/* .form-text */
.form-text {
  color: var(--ps-muted);
}


/* .tool-link */
.tool-link {
  color: var(--ps-primary);
}


/* .section-divider */
.section-divider {
  border-color: var(--ps-border);
}


/* .mitre-link */
.mitre-link {
  font-style: normal;
}


/* .tags-wrap */
.tags-wrap {
  color: var(--ps-muted);
}




/* ============================================================================
   15) INDEX PAGE — Page width cap & search box width
============================================================================= */

/* Container width (fallback-safe) */
/* .container */
.container {
  max-width: var(--ps-search-page-max-width) !important;
  box-sizing: border-box;

  /* fix: ensure the canonical var name wins */
}

/* Make only this page/container wider */
.container--wide {
  --ps-search-page-max-width: 1800px; /* pick your width */
}


/* Small helper for the theme toggle chip */
/* .theme-toggle */
.theme-toggle {
  border: 1px solid var(--ps-border);
  background: var(--ps-surface);
  color: var(--ps-text);
  border-radius: var(--ps-radius-sm);
  padding: 4px 10px;
  font-size: .9rem;
  line-height: 1;

}

/* .theme-toggle:hover */
.theme-toggle:hover {
  filter: brightness(.98);
}



 /* Global search box width helper (used in centered admin section headers) */
/* .search-box-wide */
.search-box-wide {

  min-width: 280px;  /* ensure it’s never too tiny */
  max-width: 480px;  /* cap width */
  flex: 1;           /* allow flex grow in header row */
}



/* ============================================================================
   16) VARIABLE VALUE COLORS (optional semantic variants)
============================================================================= */

/* .ps-var-val */
.ps-var-val {
  color: var(--ps-text);
}


/* .ps-var-val--primary */
.ps-var-val--primary {
  color: var(--ps-primary);
}


/* .ps-var-val--success */
.ps-var-val--success {
  color: var(--ps-success);
}


/* .ps-var-val--warning */
.ps-var-val--warning {
  color: var(--ps-warning);
}


/* .ps-var-val--danger */
.ps-var-val--danger {
  color: var(--ps-danger);
}



/* =========================
   Bootstrap "light" fixups
   (prevents white boxes in dark mode)
   ========================= */

/* 1) Input group label chip */
/* .input-group-text */
.input-group-text {
  background-color: var(--ps-surface);
  color: var(--ps-text);
  border-color: var(--ps-border);

}



/* 2) Table header that uses .table-light */
/* .table thead.table-light,
.table-light > :not(caption) > * > * */
.table thead.table-light,
.table-light > :not(caption) > * > * {
  background-color: var(--ps-surface) !important;
  color: var(--ps-text) !important;
  border-color: var(--ps-border) !important;

}


/* 3) Generic "light background" utilities from Bootstrap */
/* [data-theme="dark"] .bg-light,
[data-theme="dark"] .list-group-item.bg-light */
[data-theme="dark"] .bg-light,
[data-theme="dark"] .list-group-item.bg-light {
  background-color: var(--ps-surface) !important;
  color: var(--ps-text) !important;

}



/* 4) Borders & bodies on tables/panels */

/* .ps-panel,
.modal-content.text-dark */
.ps-panel,
.modal-content.text-dark {
  background-color: var(--ps-surface);
  color: var(--ps-text);
  border-color: var(--ps-border);
  box-shadow: var(--ps-shadow);

}


/* 5) If any "right side panel" still uses old hard-coded colors,
      force it to follow tokens (safe for both themes) */
/* .side-panel */
.side-panel {
  background-color: var(--ps-surface) !important;
  border-color: var(--ps-border) !important;
  color: var(--ps-text) !important;
  position: sticky;
  top: var(--right-panel-top);
  max-height: calc(100vh - var(--right-panel-top) - 16px);
  overflow: auto;
  background: var(--ps-surface);
  border: 1px solid var(--rail-border);
  border-radius: 14px;
  box-shadow: var(--ps-shadow);
  padding: 12px;
  isolation: isolate;
}


/* 6) Muted/explanation text: uses tokens (and won’t turn white) */
/* .tags-text,
.small.text-muted,
.ps-muted,
.ps-config-hint */
.tags-text,
.small.text-muted,
.ps-muted,
.ps-config-hint {
  color: var(--ps-muted) !important;

}



/* Truncate long variable values in left panel */
/* .ps-var-truncate */
.ps-var-truncate {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;

  max-width: 180px;     /* adjust width to fit your panel */
}


/* Let the code pill stay visible (so the tooltip can escape),
   clamp only the inner text */
/* .result-item .command-text */
.result-item .command-text {
  overflow: visible;
}

 /* ensure tooltip isn’t clipped */

/* .result-item .command-text .cmd-text */
.result-item .command-text .cmd-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;

  -webkit-line-clamp: 1;      /* show 1 line for command */
}




/* .result-item .explanation */
.result-item .explanation {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;

  -webkit-line-clamp: 3;      /* show 3 lines */
}


/* Placeholders in commands: bold red, no highlight box */
/* .command-text .ph,
.command-text .ps-placeholder */
.command-text .ph,
.command-text .ps-placeholder {
  font-weight: 700 !important;
  background: transparent !important;
  border: 0 !important;

  color: var(--ps-ph) !important;  /* red (light/dark aware) */
}

/* Applied value styling: bold + distinct (not placeholder red, not base text) */
.command-text .ps-value {
  font-weight: 700 !important;
  color: var(--ps-value) !important;
  background: transparent !important;
  border: 0 !important;
  font-style: italic !important;
}




/* .sidebar-tree a.tool-item */
.sidebar-tree a.tool-item {
  display: flex;                 /* name | count */
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-decoration: none;
}

/* Counter pill */
.sidebar-tree .tool-count {
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--rail-chip-bg, var(--ps-surface-2));
  border: 1px solid var(--rail-border);
  color: var(--ps-muted);
}

/* Active state harmony */
.tool-item.active .tool-count {
  background: color-mix(in srgb, var(--rail-accent) 12%, var(--ps-surface-2));
  color: var(--ps-text);
  border-color: color-mix(in srgb, var(--rail-accent) 35%, var(--rail-border));
}



/* Add a little vertical spacing between items (optional) */
/* .sidebar-tree a.tool-item + a.tool-item */
.sidebar-tree a.tool-item + a.tool-item {
  margin-top: 0.25rem;

}









/*------------------------------------------------------------------------------ Hero --------------------------------------------------*/
/*------------------------------------------------------------------------------ Hero --------------------------------------------------*/


/* =========================================================
   Hero + Rotating Words
   - Token-driven, minimal, baseline-aligned rotator
   - No hard-coded blues; uses --ps-warning
========================================================= */

/* -------- Icon tint helpers (tokenized for easy theming) -------- */
.icon-blue   { color: var(--ps-icon-blue,   #8506D4); }
.icon-cyan   { color: var(--ps-icon-cyan,   #06b6d4); }
.icon-indigo { color: var(--ps-icon-indigo, #6366f1); }
.icon-mint   { color: var(--ps-icon-mint,   #10b981); }

/* -------- Hero --------------------------------------------------- */

:root { --ps-topbar-offset: 0px; } /* add once near your tokens (safe default) */
.ps-hero {
  position: relative;
  isolation: isolate;
   margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  padding: clamp(1.25rem, 4vw, 4rem);
  border-radius: 16px;
  background: transparent;
  overflow: visible;
  box-shadow: none;
}

.ps-hero-title {
  margin: 0 0 .4rem 0;
  font-size: clamp(1.7rem, 2.6vw + 1rem, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;               /* reference line-height for rotator */
}

.ps-hero-sub {
  margin: 0 0 1rem 0;
  color: var(--ps-text-muted);
}

/* Search chips */
.ps-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
  margin-bottom: 2rem;
  color: var(--ps-warning);
}

.ps-chip {
  --bs-btn-padding-y: .3rem;
  --bs-btn-padding-x: .6rem;
  border-radius: 10px;
  /*color: var(--ps-warning);*/
}

/* Theme-aware focus ring (no hard-coded blue) */
.ps-hero-search .ps-hero-input:focus {
  outline: none;
  border-color: var(--ps-muted);
}





/* -------- Features (glass cards) -------------------------------- */
.ps-hero-features { margin-top: .5rem; }

.ps-feature {
  border: 0;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(4px);
}
.ps-feature .card-body { padding: 2rem; }

.ps-feature-ico {
  font-size: 1.7rem;
  margin-bottom: .35rem;
}

/* Light-mode glass that mirrors dark vibe */
:root:not([data-theme="dark"]) .ps-feature {
  background: color-mix(in srgb, #ffffff 70%, transparent);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  border: 1px solid color-mix(in srgb, #F3F4F5 8%, #ffffff 0%);
  box-shadow:
    0 8px 20px color-mix(in srgb, #000 2%, transparent),
    0 0 0 1px color-mix(in srgb, #000 2%, transparent);
}


/* -------- Features (Fixed size cards) -------------------------------- */
.ps-hero-features {
  /* single knob controls all four card heights */
  --hero-card-h: 220px;         /* try 200–260px to taste */
}

.ps-hero-features .ps-feature {
  height: var(--hero-card-h);
  display: flex;                /* let body stretch to full height */
}

.ps-hero-features .ps-feature .card-body {
  display: flex;
  flex-direction: column;       /* icon → text → (optional) CTA at bottom */
  width: 100%;
}

/* Keep icon near the top (you already had a small margin) */
.ps-hero-features .ps-feature-ico {
  margin-bottom: .35rem;
}

/* Clamp descriptive copy so it doesn’t grow the card */
.ps-hero-features .ps-feature p {
  margin-bottom: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;        /* clamp to 3 lines; adjust if needed */
  -webkit-box-orient: vertical;
}

/* If you have a CTA or link inside the card, pin it to the bottom */
.ps-hero-features .ps-feature .btn,
.ps-hero-features .ps-feature .stretched-link,
.ps-hero-features .ps-feature .ps-feature-cta {
  margin-top: auto;
}

/* On phones, let cards auto-size so nothing important is clipped */
@media (max-width: 575.98px) {
  .ps-hero-features .ps-feature { height: auto; }
  .ps-hero-features .ps-feature p { -webkit-line-clamp: unset; }
}


.ps-hero .ps-hero-features.row { --bs-gutter-x: 1.50rem; }

/* -------- Rotator (movie-cast slide) ----------------------------- */
/* Perfectly baseline-aligned with the title line-height */

.ps-hero-title .ps-rotator {
  display: inline-grid;
  vertical-align: baseline;
  overflow: hidden;
  height: 1lh;                    /* track == current line-height */
  grid-auto-rows: 1lh;
  line-height: inherit;           /* inherit 1.1 from title */
  align-items: baseline;
  font-size: 6.0rem;
}

/* Fallback where 1lh isn't supported */
@supports not (height: 1lh) {
  .ps-hero-title .ps-rotator {
    height: calc(1em * 1.1);      /* 1.1 = title line-height */
    grid-auto-rows: calc(1em * 1.1);
  }
}

/* Hidden sizer to stabilize width (longest word) */
.ps-hero-title .ps-rotator .ps-rotator-sizer {
  display: inline-block;
  visibility: hidden;
  white-space: nowrap;
  overflow: hidden;
  height: 0;
  line-height: inherit;
}

/* Slots overlap; pivot on baseline for smooth slide */
.ps-hero-title .ps-rotator .slot {
  grid-area: 1 / 1;
  align-self: baseline;
  position: static;
  font: inherit;
  line-height: inherit;
  transform-origin: left bottom;
  will-change: transform, opacity;
}

/* Keyframes (single source of truth) */
@keyframes psCastIn  { 0% { transform: translateY(100%); opacity: 0; }
                       100%{ transform: translateY(0);   opacity: 1; } }
@keyframes psCastOut { 0% { transform: translateY(0);    opacity: 1; }
                       100%{ transform: translateY(-100%); opacity: 0; } }

/* Assign animations */
.ps-rotator .in  { animation: psCastIn  420ms ease-out both; }
.ps-rotator .out { animation: psCastOut 420ms ease-in  both; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .ps-rotator .in, .ps-rotator .out { animation: none; }
}

/* Subtle emphasis for the hero counter number */
.ps-counter {
  font-weight: 1000;
  letter-spacing: .02em;
  font-size: 1.1rem;
}




/* === Hero search spacing tweak (narrow only the hero) === */
.ps-hero #searchForm .form-control,
.ps-hero #searchForm .btn {
  margin-top: 0.5rem;   /* was 3.25rem; adjust to taste (e.g., 0, .5rem, .75rem) */
  height: 70px
}

/* Optional: tighten spacing under the "Search..." line itself */
.ps-hero .ps-hero-sub {
  margin-bottom: 0.5rem; /* was 1rem */
}



/*------------------------------------------------------------------------------ Top Menu --------------------------------------------------*/
/*------------------------------------------------------------------------------ Top Menu --------------------------------------------------*/
/* =========================================================
   Top Menu (fixed, full-bleed, theme-aware)
   Tokens: --ps-topbar-bg, --ps-topbar-h, --ps-warning
========================================================= */

/* Safe default if not defined elsewhere */
:root { --ps-topbar-h: 56px; }

/* Fixed bar + color contract */
/* Fixed bar + color contract */
.ps-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  width: 100%;
  z-index: 1040; /* below Bootstrap backdrop(1050)/modal(1055) */
  margin: 0; border-radius: 0;
  background: var(--ps-topbar-bg);
  border-bottom: 1px solid color-mix(in srgb, #000 12%, var(--ps-topbar-bg));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* Color contract: default text is white; bootstrap link hover is orange */
  color: #fff;
  --bs-link-color: #fff;
  --bs-link-hover-color: var(--ps-warning);
}

/* Offset page content below fixed bar */
body { padding-top: var(--ps-topbar-h); }


/* Links inherit bar color (no UA/Bootstrap blue) */
.ps-topbar a { color: inherit; text-decoration: none; }

/* Layout */
.ps-topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem;
  min-height: var(--ps-topbar-h);
  padding-inline: .75rem;
  width: 100%; max-width: 1200px; margin-inline: auto;
}
.ps-left, .ps-topbar-right { display: inline-flex; align-items: center; }
.ps-left { gap: 2.75rem; }
.ps-topbar-right { gap: .5rem; }

/* Menu container (spacing only) */
.ps-menu {
  display: inline-flex; align-items: center; gap: 1rem;
  list-style: none; margin: 0; padding: 0;
}

/* =========================================================
   Topbar Button — simple, text-only
   default: white; hover: orange; selected: white + orange underline
========================================================= */
.ps-topbtn{
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  height: 36px; padding: 0 .25rem;
  background: transparent; border: 0; border-radius: 0;
  color: inherit; /* inherit white from bar */
  font-weight: 700; font-size: .95rem; line-height: 1; text-decoration: none;
  cursor: pointer; transition: color .15s ease;
}

/* Use more specific selector so it always wins over generic link rules */
.ps-topbar .ps-topbtn:hover { color: var(--ps-warning); }

/* Selected / active: keep white, add orange underline */
.ps-topbtn[aria-current="page"],
.ps-topbtn.is-active{
  color: inherit; /* still white */
    text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ps-warning);
}

/* Selected + hover: keep underline orange, still white text */
.ps-topbar .ps-topbtn[aria-current="page"]:hover,
.ps-topbar .ps-topbtn.is-active:hover{
  color: inherit;
  text-decoration-color: var(--ps-warning);
}

/* Icons match text color */
.ps-topbtn i { color: currentColor; }

/* Disabled */
.ps-topbtn[disabled],
.ps-topbtn[aria-disabled="true"]{
  opacity: .55; cursor: not-allowed; pointer-events: none;
}

/* Icon-only keeps comfortable hit area */
.ps-topbtn--icon{ width: 36px; height: 36px; padding: 0; }

/* Logo badge */
.ps-logo {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; min-width: 36px; padding: 0 .5rem;
  border-radius: 8px; text-decoration: none;
  background: color-mix(in srgb, #000 10%, var(--ps-topbar-bg));
  color: #fff; font-weight: 800; letter-spacing: .04em;
  transition: background .15s ease;
}
.ps-logo:hover { background: color-mix(in srgb, #000 18%, var(--ps-topbar-bg)); }



/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .ps-topbtn, .ps-logo { transition: none; }
}



/*------------------------------------------------------------------------------ Floating Object Background---------------------------------*/
/*------------------------------------------------------------------------------ Floating Object Background---------------------------------*/

/* === Floating background shapes (soft, performance-friendly) === */


/* Container that sits behind everything */
/* .floating-bg */
.floating-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;

  z-index: 0;                 /* stays behind content; your topbar is 1040 */
  pointer-events: none;        /* clicks pass through */
  /* gentle fallback gradient under shapes */
  background:
    radial-gradient(1200px 800px at 10% -10%, color-mix(in srgb, #3C4F71 10%, transparent), transparent 70%),
    radial-gradient(1000px 700px at 110% 10%, color-mix(in srgb, #f59e0b 8%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, #3C4F71 6%, transparent), transparent 40%);
}



/* Individual shape */
/* .floating-shape */
.floating-shape {
  position: absolute;
  width: 160px;
  height: 160px;
  background: var(--ps-float-1);
  filter: blur(0.5px) saturate(110%);
  will-change: transform;
  opacity: var(--alpha, 0.55);

  border-radius: 42% 58% 63% 37% / 52% 44% 56% 48%;  /* organic blob */
  box-shadow:
    0 10px 30px color-mix(in srgb, currentColor 20%, transparent),
    inset 0 0 40px color-mix(in srgb, #fff 8%, transparent);
  animation:
    ps-float-y var(--dur-y, 36s) linear infinite,
    ps-drift-x var(--dur-x, 28s) ease-in-out infinite alternate,
    ps-rotate var(--dur-r, 60s) linear infinite;
  mix-blend-mode: normal; /* keep contrast reliable */
}



/* Accent color utilities applied dynamically */
/* .flt-c1 */
.flt-c1 {
 background: var(--ps-float-1); color: #3C4F71; 
}


/* .flt-c2 */
.flt-c2 {
 background: var(--ps-float-2); color: #f59e0b; 
}


/* .flt-c3 */
.flt-c3 {
 background: var(--ps-float-3); color: #60a5fa; 
}


/* .flt-c4 */
.flt-c4 {
 background: var(--ps-float-4); color: #22c55e; 
}



/* Animation keyframes */
@keyframes ps-float-y {
  0%   { transform: translateY(10vh); }
  50%  { transform: translateY(-15vh); }
  100% { transform: translateY(10vh); }
}
@keyframes ps-drift-x {
  0%   { transform: translateX(-6vw); }
  100% { transform: translateX(6vw); }
}
@keyframes ps-rotate {
  0%   { rotate: 0deg;   border-radius: 42% 58% 63% 37% / 52% 44% 56% 48%; }
  50%  { rotate: 180deg; border-radius: 58% 42% 37% 63% / 44% 52% 48% 56%; }
  100% { rotate: 360deg; border-radius: 42% 58% 63% 37% / 52% 44% 56% 48%; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .floating-shape { animation: none; transform: none !important; }
}


/* Hide the floating background whenever search UI/results are present.
   Matches: the search results list (#results-list), any result card (.result-item),
   or the results-page search box (#searchInput). */
/* html:has(#results-list),
html:has(.result-item),
html:has(#searchInput) */
html:has(#results-list),
html:has(.result-item),
html:has(#searchInput) {

  /* we’re on the results state */
}



/* html:has(#results-list) .floating-bg,
html:has(.result-item) .floating-bg,
html:has(#searchInput) .floating-bg */
html:has(#results-list) .floating-bg,
html:has(.result-item) .floating-bg,
html:has(#searchInput) .floating-bg {
  display: none !important;

}




/* html.has-results .floating-bg */
html.has-results .floating-bg {
  display: none !important;
}



/* === Taller search bar (index.html > #searchForm) === */


/* Apply to BOTH header and hero search bars */
/* #searchForm .form-control,
#searchFormTop .form-control */
#searchForm .form-control,
#searchFormTop .form-control {
  height: var(--ps-searchbar-h);
  padding: 0 1rem;
  margin-top: 3.25rem;
  font-size: 1.1rem;
  line-height: 1.25;
  border-radius: 10px 0 0 10px;

}



/* #searchForm .btn,
#searchFormTop .btn */
#searchForm .btn,
#searchFormTop .btn {
  height: var(--ps-searchbar-h);
  padding: 0 1rem;
  margin-top: 3.25rem;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  border-radius: 0 10px 10px 0;

}



/* Keep consistent rounded corners */
/* #searchForm .input-group > :first-child,
#searchFormTop .input-group > :first-child */
#searchForm .input-group > :first-child,
#searchFormTop .input-group > :first-child {
  border-radius: 10px 0 0 10px;
}



/* #searchForm .input-group > :last-child,
#searchFormTop .input-group > :last-child */
#searchForm .input-group > :last-child,
#searchFormTop .input-group > :last-child {
  border-radius: 0 10px 10px 0;
}







/*------------------------------------------------------------------------------ Center/Search Panel UI---------------------------------*/
/*------------------------------------------------------------------------------ Center/Search Panel UI---------------------------------*/
/* ============================================================================
   RESULTS UI REFRESH — prettier center cards & command pills
   - Replaces old .ps-result-card + list-group overrides
   - Works with <li class="ps-card result-card result-item">
============================================================================= */





/* Base surface for pretty cards */
/* .ps-card */
.ps-card {
  position: relative;
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: 14px;
  box-shadow: var(--ps-shadow);

}



/* Search results card */
/* .result-card */
.result-card {
  padding: 14px 16px;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  overflow: hidden;

  isolation: isolate; /* keeps glow under children */
}





/* Header row tweaks */
/* .result-card .d-flex */
.result-card .d-flex {
  align-items: center;
}


/* .result-card h5 */
.result-card h5 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .01em;
  color: color-mix(in srgb, var(--ps-card-accent) 80%, var(--ps-text));

}



/* Softer action button (used for “More”) */
/* .btn-soft */
.btn-soft {
  --soft-bg: color-mix(in srgb, var(--ps-warning) 16%, transparent);
  --soft-bd: color-mix(in srgb, var(--ps-text) 35%, transparent);
  --soft-tx: color-mix(in srgb, var(--ps-text) 92%, #ffffff 8%);
  background: var(--soft-bg);
  border: 1px solid var(--soft-bd);
  color: var(--soft-tx);

}


/* .btn-soft:hover */
.btn-soft:hover {
  background: color-mix(in srgb, var(--ps-card-accent) 100%, transparent);
  border-color: color-mix(in srgb, var(--ps-card-accent) 55%, transparent);
  color: --ps-text;

}



/* Command list rhythm */
/* .result-card > ul */
.result-card > ul {
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;

}


/* .result-card > ul > li */
.result-card > ul > li {
  margin: 6px 0;
}



/* Command pills: highlight + copy affordance + pointer */
/* .result-card code.command-text */
.result-card code.command-text {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--ps-font-mono);
  font-size: .95rem;
  line-height: 1.2;
  padding: .35rem .55rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--ps-border) 60%, transparent);
  color: var(--ps-text);
  transition: transform .06s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;

  cursor: pointer;                            /* hand pointer */
  background: linear-gradient(180deg,
              color-mix(in srgb, var(--ps-surface-2) 84%, transparent),
              color-mix(in srgb, var(--ps-surface) 92%, transparent));
}



/* .result-card code.command-text:hover */
.result-card code.command-text:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ps-card-accent) 35%, var(--ps-border));
  box-shadow: 0 1px 18px color-mix(in srgb, var(--ps-card-accent) 12%, transparent);

}








/* Tactic/explanation text */
/* .result-card .small.text-muted */
.result-card .small.text-muted {
 color: var(--ps-muted) !important; font-size: .92rem; 
}


/* .result-card [data-filter-note] */
.result-card [data-filter-note] {
  color: var(--ps-muted);
}



/* Slightly tighter center column look */
/* .ps-main.stack */
.ps-main.stack {
  gap: 14px;

}



/* (Optional) mini count / header above results, if you add one later
.ps-results-header {
  display: flex; align-items: baseline; gap: .75rem;
  margin-bottom: .5rem;
}
.ps-results-header .count { color: var(--ps-muted); font-size: .95rem; }
*/





/* ============================================================================
   LEFT & RIGHT RAIL REFRESH — refined panels + list items
   - Applies to: .sidebar-tree (left) and .side-panel (right)
   - No HTML changes needed
============================================================================= */

/* Right panel - spacing for the Refresh Values button */
#rightPanel #refreshValuesBtn { margin-top: 4px; }




/* RIGHT rail: stay sticky with its own internal scroll cap (unchanged) */


/* LEFT rail inner panel: scroll when taller than viewport */
/* .sidebar-tree */
.sidebar-tree {
  top: auto;
  background: var(--ps-surface);
  border: 1px solid var(--rail-border);
  border-radius: 14px;
  box-shadow: var(--ps-shadow);
  padding: 12px;
  isolation: isolate;

  position: static;    /* wrapper .ps-left-rail is the sticky one */
  max-height: calc(100vh - var(--right-panel-top) - 16px); /* cap to viewport */
  overflow: auto;      /* enable internal scroll when needed */
}










/* -------- LEFT RAIL ITEMS (categories/tools/articles) ---------- */

/* .category-item,
.tool-item */
.category-item,
.tool-item {
  display: block;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--ps-muted);
  border-left: 5px solid transparent;
  margin: 1px 5;
  border-radius: 8px;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .08s ease;

}



/* .category-item:hover,
.tool-item:hover */
.category-item:hover,
.tool-item:hover {
  background: color-mix(in srgb, var(--rail-accent) 12%, transparent);
  border-left-color: color-mix(in srgb, var(--rail-accent) 55%, transparent);
  color: color-mix(in srgb, var(--ps-text) 90%, white 10%);
  transform: translateX(1px);

}



/* .category-item.active,
.category-label.active,
.tool-item.active */
.category-item.active,
.category-label.active,
.tool-item.active {
  background: color-mix(in srgb, var(--rail-accent) 18%, transparent);
  border-left-color: var(--rail-accent);
  color: color-mix(in srgb, var(--ps-text) 92%, white 8%);
  font-weight: 600;

}



/* Article links in left rail keep the item look */


/* Small dividers within left rail sections */
/* .sidebar-tree .section-divider */
.sidebar-tree .section-divider {
  margin: 10px 0;
}



/* -------- RIGHT RAIL (config panel) ---------- */

/* Section header: toned, compact */
/* .side-panel .side-panel__header */
.side-panel .side-panel__header {
  color: color-mix(in srgb, var(--ps-text) 84%, white 16%);
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  opacity: .95;
  margin: 6px 2px 8px;

}


/* Left rail section headers ("Tools", "Articles") */
.side-section__header {
  color: color-mix(in srgb, var(--ps-text) 84%, white 16%);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  opacity: .95;
  margin: 4px 2px 6px;
}

/* Right rail: center the Control Panel button at the top */
#rightPanel > div:first-child {
  display: flex;
  justify-content: center;   /* horizontally center the inner wrapper */
}

#rightPanel > div:first-child > .ms-2 {
  margin-left: 0 !important; /* neutralize Bootstrap's left margin */
  width: 100%;               /* give it full row width to center reliably */
  display: flex;
  justify-content: center;   /* center the button itself */
}

#rightPanel #cpOpenBtn.cp-btn {
  margin: 6px 0 8px;         /* tidy spacing below the rail top */
  align-self: center;
}



/* Right-rail small badges / chips (if present) */
/* .side-panel .badge */
.side-panel .badge {
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--rail-accent) 40%, transparent);
  background: color-mix(in srgb, var(--rail-accent) 16%, transparent);

}



/* -------- Scrollbar polish (panels only) ---------- */

/* WebKit blink-based browsers */
/* .sidebar-tree::-webkit-scrollbar,
.side-panel::-webkit-scrollbar */
.sidebar-tree::-webkit-scrollbar,
.side-panel::-webkit-scrollbar {
  width: 10px;
}


/* .sidebar-tree::-webkit-scrollbar-thumb,
.side-panel::-webkit-scrollbar-thumb */
.sidebar-tree::-webkit-scrollbar-thumb,
.side-panel::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ps-muted) 25%, transparent);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;

}


/* .sidebar-tree::-webkit-scrollbar-thumb:hover,
.side-panel::-webkit-scrollbar-thumb:hover */
.sidebar-tree::-webkit-scrollbar-thumb:hover,
.side-panel::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--ps-muted) 40%, transparent);

}



/* Firefox */
/* .sidebar-tree, .side-panel */
.sidebar-tree, .side-panel {
  scrollbar-color: color-mix(in srgb, var(--ps-muted) 25%, transparent) transparent;
  scrollbar-width: thin;

}




/* === Unified dropdown UI (left + right rails) === */
/* .sidebar-tree .form-select,
.side-panel  .form-select */
.sidebar-tree .form-select,
.side-panel  .form-select {
  background-color: var(--ps-surface);
  color: var(--ps-text);
  border: 1px solid var(--ps-border);
  box-shadow: none;

  /* keep native caret (no appearance/background-image overrides) */
  border-radius: 10px;            /* same on both sides */
  
}



/* same small size feel on both (you already use .form-select-sm) */
/* .sidebar-tree .form-select.form-select-sm,
.side-panel  .form-select.form-select-sm */
.sidebar-tree .form-select.form-select-sm,
.side-panel  .form-select.form-select-sm {
  padding-top: .375rem;
  padding-bottom: .375rem;

  font-size: .95rem;              /* slightly bigger than default sm */
  min-height: 36px;               /* consistent height */
}



/* consistent focus ring on both */
/* .sidebar-tree .form-select:focus,
.side-panel  .form-select:focus */
.sidebar-tree .form-select:focus,
.side-panel  .form-select:focus {
  outline: none;
  border-color: var(--rail-accent, var(--ps-primary));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--rail-accent, var(--ps-primary)) 30%, transparent);

}




/* === Unified command copy affordance (works in cards, modals, admin) === */
/* .command-text */
.command-text {

  cursor: pointer;          /* hand pointer everywhere */
  position: relative;       /* positioning context for tooltip */
  overflow: visible;        /* let tooltip escape the code box */
}





/* Ensure tooltips aren’t clipped inside Bootstrap modals */
/* .modal .command-text */
.modal .command-text {
  overflow: visible;
}




/* Make the left rail itself sticky (same pattern as the right) */
/* .ps-left-rail */
.ps-left-rail {
  position: sticky;
  top: var(--right-panel-top);

  align-self: flex-start; /* ensure the column starts at the top of the row */
}



/* The inner panel should scroll internally instead of being sticky too
.ps-left-rail .sidebar-tree {
  position: static; 
  max-height: calc(100vh - var(--right-panel-top) - 16px);
  overflow: auto;
}

*/


/* One-line MITRE header (labels + buttons on a single row) */
/* .mitre-inline */
.mitre-inline {
  display: flex;
  align-items: center;
  gap: .75rem;

  flex-wrap: nowrap;        /* keep on one line */
  overflow-x: auto;         /* allow horizontal scroll if too long */
  white-space: nowrap;      /* prevent wrapping of labels/buttons */
}


/* .mitre-label */
.mitre-label {
  font-weight: 600;
  color: var(--ps-muted);
  margin-right: .25rem;

}

/* .mitre-inline .btn-link */
.mitre-inline .btn-link {
  text-decoration: none;
}


/* .mitre-inline .btn-link:hover */
.mitre-inline .btn-link:hover {
  text-decoration: underline;
}



/* =======================================================
   RIGHT PANEL (index.html) — Variables (sections, values, pills)
   -------------------------------------------------------
   This block consolidates the right-panel variables UI:
   - Variable section card
   - Section header
   - Values list
   - Value “pill” rows (base + hover + interactions)
   - Radio styling inside pills
   - Delete (×) visibility on hover/focus
   - Accordion frame (when using ps-acc-item)
   NOTE: Values unchanged; duplicates removed; comments clarified.
======================================================= */

/* --- Variable section “card” (container for one variable) --- */
/* .ps-var-section */
.ps-var-section {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 10px 12px;
  box-shadow: var(--ps-elevation-xs);

}


/* --- Section header (variable title) --- */
/* .ps-var-section .ps-config-label */
.ps-var-section .ps-config-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;

}

/* --- Values list inside a section --- */
/* .ps-var-section [data-values] */
.ps-var-section [data-values] {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;

  gap: 4px;                /* space between each value row */
}



/* --- Value “pill” row (base) ---
   Effective values come from your later override:
   - background: var(--ps-surface)
   - padding: 4px 10px
   Includes structural props from earlier block (border, radius, layout). */


/* --- Value pill hover (generic) ---
   Keeps your warning-tinted hover used outside the scoped media rule. */
/* .ps-var-pill:hover */
.ps-var-pill:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ps-warning) 35%, var(--ps-border));
  box-shadow: 0 1px 18px color-mix(in srgb, var(--ps-warning) 12%, transparent);

  background: linear-gradient(180deg,
              color-mix(in srgb, var(--ps-surface-2) 84%, transparent),
              color-mix(in srgb, var(--ps-surface) 92%, transparent));
}



/* --- Value pill hover (right rail only, on hover-capable devices) ---
   Your later, scoped hover using primary tint takes precedence in .ps-right-rail. */
@media (hover:hover) {
  .ps-right-rail .ps-var-pill:hover {
    background: color-mix(in srgb, var(--ps-primary) 7%, var(--ps-surface-2));
    border-color: color-mix(in srgb, var(--ps-primary) 35%, var(--ps-border));
    box-shadow: 0 1px 18px color-mix(in srgb, var(--ps-primary) 10%, transparent);
  }
}

/* --- Make whole pill clickable; let clicks bubble to the pill ---
   (Keep controls non-interactive so the pill handles the click)
*/
/* .ps-var-pill input[type="radio"],
.ps-var-pill label */
.ps-var-pill input[type="radio"],
.ps-var-pill label {
  pointer-events: none;

}

/* --- Delete “×” visibility: hidden by default, show on hover/focus --- */
/* .ps-var-pill .ps-var-remove */
.ps-var-pill .ps-var-remove {
  opacity: 0;
  visibility: hidden;

  transition: opacity .12s ease, visibility 0s linear .12s; /* delay visibility so it fades cleanly */
}


/* .ps-var-pill:hover .ps-var-remove,
.ps-var-pill:focus-within .ps-var-remove */
.ps-var-pill:hover .ps-var-remove,
.ps-var-pill:focus-within .ps-var-remove {
  opacity: 1;
  visibility: visible;
  transition: opacity .12s ease, visibility 0s;

}


/* Touch devices (no hover): keep delete visible */
@media (hover: none) {
  .ps-var-pill .ps-var-remove {
    opacity: 1;
    visibility: visible;
    transition: none;
  }
}

/* --- Delete “×” button styles (inside pill) --- */
/* .ps-var-remove */
.ps-var-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--ps-border);
  background: var(--ps-surface);
  cursor: pointer;
  color: var(--ps-danger);
  font-weight: 700;

}


/* --- Radio styling inside right-rail pills ---
   - Selected color uses your --ps-ph token for ring + dot
   - No focus halo
   - Slight scale-up so it fits taller pills
*/
/* .ps-right-rail .form-check-input[type="radio"]:checked */
.ps-right-rail .form-check-input[type="radio"]:checked {
  background-color: var(--ps-ph) !important;
  border-color: var(--ps-ph) !important;
  background-image: radial-gradient(var(--ps-ph) 45%, transparent 46%) !important;

}


/* .ps-right-rail .form-check-input[type="radio"]:focus,
.ps-right-rail .form-check-input[type="radio"]:focus-visible */
.ps-right-rail .form-check-input[type="radio"]:focus,
.ps-right-rail .form-check-input[type="radio"]:focus-visible {
  box-shadow: none !important;
  outline: 0 !important;

}


/* .ps-right-rail .form-check-input[type="radio"] */
.ps-right-rail .form-check-input[type="radio"] {
  transform-origin: center;

  transform: scale(1.15);   /* 1.1–1.2 looks good */
  margin-top: 0;            /* avoid vertical drift */
}

/* Specific styling for the Control Panel button text color */
.cp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  line-height: 1.2;
  font-size: .9rem;

  padding: .5rem .9rem;

  background: color-mix(in srgb, var(--ps-warning) 70%, transparent);
  color: #000 !important;

  border: 1px solid var(--ps-border);
  border-radius: .5rem;

  cursor: pointer;
  transition:
    background-color .12s ease,
    border-color .12s ease,
    color .12s ease,
    box-shadow .12s ease;
}



  .cp-btn:hover {
  color: #fff !important;  /* or whatever color you want for the label */
  background: var(--ps-warning);
  border: 1px solid var(--ps-border);
  }

/* pressed / focus states for Control Panel button to kill Bootstrap blue */
.cp-btn:focus,
.cp-btn:focus-visible,
.cp-btn:active {
  color: #fff !important;
  background: var(--ps-warning);
  border: 1px solid var(--ps-border);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--ps-warning) 35%, transparent);
  outline: none;
}

.cp-btn:active {
  filter: brightness(0.95);
}

/* =======================================================
   RIGHT PANEL — Variables Accordion (frame around sections)
   -------------------------------------------------------
   Provides the accordion shell when using ensureSection(name)
   to create ps-acc-item with collapse.
======================================================= */

/* Accordion host */
/* #configVarsContainer.ps-accordion */
#configVarsContainer.ps-accordion {
  display: block;

}

/* One accordion item (matches .ps-var-section look) */
/* .ps-acc-item */
.ps-acc-item {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-elevation-xs);
  margin-bottom: 10px;
  overflow: hidden;

}


/* Accordion header button (title row) */
/* .ps-acc-head */
.ps-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: color-mix(in srgb, var(--ps-surface-2) 80%, transparent);
  border: 0;
  cursor: pointer;
  padding: 10px 12px;       /* matches section padding */
  font-weight: 600;         /* same emphasis as section header */
  padding: 4px 12px;    /* was 10px 12px — raises height cleanly */
  /* or: min-height: 44px;  keeps a consistent tap target */
  align-items: center;    /* keep text/caret vertically centered */
}



/* Caret indicator + rotation when expanded */
/* .ps-acc-caret */
.ps-acc-caret {
 flex: 0 0 auto; transition: transform .18s ease; 
}


/* .ps-acc-head[aria-expanded="true"] .ps-acc-caret */
.ps-acc-head[aria-expanded="true"] .ps-acc-caret {
  transform: rotate(180deg);
}



/* Accordion body (wraps the values list) */
/* .ps-acc-body */
.ps-acc-body {
  background: var(--ps-surface);
  border-top: 1px solid var(--ps-border);

  padding: 10px 12px 12px;  /* matches section spacing */
}



/* Values list inside accordion body (same as section values) */
/* .ps-acc-body [data-values] */
.ps-acc-body [data-values] {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;

  gap: 4px;                 /* space between each value row */
}



/* Taller accordion header row */


/* Larger title text (variable name) */
/* .ps-acc-head .ps-config-label */
.ps-acc-head .ps-config-label {
  cursor: pointer;
  font-size: 15px;        /* try 14–16px */
  line-height: 1.1;       /* keeps the row compact */
}



@media (min-width: 1200px) {
  .ps-acc-head { padding: 4px 12px; }
  .ps-acc-head .ps-config-label { font-size: 14px; text-decoration: underline; }
}


/* Accordion header title: indicate it opens the edit modal */

@media (hover:hover) {
  .ps-acc-head .ps-config-label:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}

/* =====================================================================================================================================================
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  RIGHT PANEL (index.html) — Variables (sections, values, pills)  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
======================================================================================================================================================== */


/* Right rail – hint above Apply */
/* .ps-update-hint */
.ps-update-hint {
  margin-top: 8px;
  margin-bottom: 10px;
  color: var(--ps-muted);
  font-size: 12px;
  line-height: 1.3;

}


/* More modal — make tags look like badges */
/* .modal .tags-text */
.modal .tags-text {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;

}


/* .modal .tags-text .ps-badge */
.modal .tags-text .ps-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ps-text);
  background: color-mix(in srgb, var(--ps-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--ps-primary) 30%, var(--ps-border));

}



/* Optional: softer variant if your modal is dark */
/* .modal .tags-text .ps-badge.ps-badge--soft */
.modal .tags-text .ps-badge.ps-badge--soft {
  background: color-mix(in srgb, var(--ps-surface-2) 85%, transparent);
  border-color: var(--ps-border);

}




/* ============================================================================
   GLOBAL FOOTER (appears on all pages via base.html)
   - All aspects are theme tokens: height, background, text color, font size
============================================================================= */



/* Footer base */
/* Footer — in normal flow; shows only when content ends */
.ps-footer {
  position: relative;               /* was: fixed */
  left: auto; right: auto; bottom: auto;
  height: auto;                     /* natural height */
  display: flex;
  align-items: center;
  background: var(--ps-bg);
  color: var(--ps-text);
  border-top: 1px solid var(--ps-border);
  box-shadow: none;                 /* no floating shadow */
  z-index: auto;
}





/* Footer inner layout (max width + spacing) */
.ps-footer-inner {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: 0 .75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--ps-footer-font-size);
  min-height: var(--ps-footer-h);
}

/* Links */
.ps-footer a {
  color: color-mix(in srgb, var(--ps-menu-accent) 80%, #fff 20%);
  text-decoration: none;
}
.ps-footer a:hover { text-decoration: underline; }

/* Copy / minor text */
.ps-footer-copy { opacity: .95; }

/* Let <main> grow so footer sits at the bottom on short pages */
main {
  flex: 1 0 auto;
  min-height: 0;
}



/* === In-page article preview clamping (index center panel) ===
   Usage: <div class="article-content ps-clamp" style="--clamp-lines: 8;">
   Adjust --clamp-lines per template to choose how many lines to show.
*/
/* .ps-clamp */
.ps-clamp {
  position: relative;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--clamp-lines);
  overflow: hidden;

  --clamp-lines: 8;                      /* default if not overridden inline */
  display: -webkit-box;                  /* enables line clamp */
}



/* Subtle bottom fade so the truncation feels natural */
/* .ps-clamp::after */
.ps-clamp::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, var(--ps-bg, #0f1115));

  left: 0; right: 0; bottom: 0;
  height: 3.5rem;                        /* fade height */
  /* Fade from transparent to the page bg; tweak for dark/light via tokens */
}



/* :root[data-theme="light"] .ps-clamp::after */
:root[data-theme="light"] .ps-clamp::after {
  background: linear-gradient(180deg, transparent, var(--ps-bg, #ffffff));

}





/* Article cards (index previews) */
/* .ps-article-card,
.ps-article-snippet */
.ps-article-card,
.ps-article-snippet {
  padding: 16px 18px;
  margin-bottom: 12px;

  border-radius: 14px;            /* harmonize with .ps-card */
}



/* Optional: nicer heading rhythm inside cards */
/* .ps-article-card h1,
.ps-article-snippet h3 */
.ps-article-card h1,
.ps-article-snippet h3 {
  margin-top: 0;
}





/* Clamp article until "read more" is clicked */
/* .ps-article-clamp */
.ps-article-clamp {
  overflow: hidden;
  position: relative;

  max-height: 560px;   /* tune for your layout */
}


/* .ps-article-clamp.is-expanded */
.ps-article-clamp.is-expanded {
  max-height: none;

}


/* .ps-article-more */
.ps-article-more {
  text-align: right;
}















/* ===========================
   Articles_Browse (cards list)
   =========================== */
/* .ps-article-list */
.ps-article-list {
  display: flex;
  flex-direction: column;
  gap: 12px;

}



/* Card container (the whole card is a link) */
/* .ps-card-link */
.ps-card-link {
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;

  display: block;                 /* anchor behaves like a full card */
  color: inherit;                 /* use card text color */
  text-decoration: none;          /* no underline on the block itself */
  cursor: pointer;                /* hand pointer on hover */
}



/* Ensure no underline for any links inside the card (normal & hover) */
/* .ps-card-link,
.ps-card-link * ,
.ps-card-link a,
.ps-card-link a:hover,
.ps-card-link a:focus */
.ps-card-link,
.ps-card-link * ,
.ps-card-link a,
.ps-card-link a:hover,
.ps-card-link a:focus {
  text-decoration: none !important;

}



/* Subtle lift and accent on hover */
@media (hover:hover) {
  .ps-card-link:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--ps-card-accent) 35%, var(--ps-border));
    box-shadow: 0 1px 18px color-mix(in srgb, var(--ps-card-accent) 12%, transparent),
                var(--ps-shadow);
  }
}

/* Inner spacing */
/* .ps-article-row */
.ps-article-row {
  padding: 14px 16px;
}



/* .ps-article-head */
.ps-article-head {
  display: flex;
  flex-direction: column;
  gap: 4px;

}



/* Title: base and hover (no underline, but color/size change) */
/* .ps-article-title */
.ps-article-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.25;
  transition: color .15s ease, font-size .15s ease;

  font-size: 1.35rem;          /* base size */
  color: var(--ps-warning);        /* black in light, white in dark */
}



/* Hover: bigger + warning color (no underline) */
/* .ps-card-link:hover .ps-article-title */
.ps-card-link:hover .ps-article-title {
  color: var(--ps-warning);

  font-size: 1.55rem;          /* slightly larger on hover */
}



/* Date directly under the title */
/* .ps-article-date */
.ps-article-date {
  color: var(--ps-muted);
  font-size: .95rem;
  margin-top: 4px;

}



/* Teaser (2–3 lines). You can change lines via --clamp inline. */
/* .ps-article-excerpt */
/* .ps-article-excerpt — needs attention: conflicting values present */
.ps-article-excerpt {
  position: relative;
  margin: 8px 0 0;
  color: var(--ps-muted);
  color: color-mix(in srgb, var(--ps-text) 85%, transparent);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 4px;
}



/* Multi-line clamp utility */
/* .ps-lineclamp */
.ps-lineclamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  -webkit-line-clamp: var(--clamp, 3); /* default 3 lines */
}



/* Footer (tags at the bottom) */
/* .ps-article-foot */
.ps-article-foot {
  margin-top: 8px;
}



/* .ps-article-tags */
.ps-article-tags {
  font-size: .85rem;
  opacity: .95;
  color: var(--ps-muted);

  font-family: var(--ps-font-mono);  /* distinct from the title font */
}





/* -----------------------------------------------------------
   TinyMCE output: keep media inside the article box
   (applies only on the article view page)
----------------------------------------------------------- */
/* .tinymce-output img */
.tinymce-output img {
  box-shadow: 0 1px 10px color-mix(in srgb, #000 12%, transparent);

  max-width: 100%;       /* never overflow container width */
  height: auto;          /* keep aspect ratio */
  display: block;        /* avoid inline gaps */
  margin: 12px auto;     /* center by default */
  border-radius: 8px;    /* match your card radius */
}



/* Soft cap for very tall images so first load isn’t overwhelming */
/* .tinymce-output img:not(.no-cap) */
.tinymce-output img:not(.no-cap) {
  max-height: min(70vh, 820px);
  object-fit: contain;

}



/* TinyMCE often uses <figure class="image"><img><figcaption> */
/* .tinymce-output figure.image */
.tinymce-output figure.image {
  margin: 16px 0;
}


/* .tinymce-output figure.image img */
.tinymce-output figure.image img {
  margin: 0 auto;
}


/* .tinymce-output figure.image figcaption */
.tinymce-output figure.image figcaption {
  font-size: 0.9rem;
  line-height: 1.35;
  opacity: .8;
  text-align: center;
  margin-top: 6px;

}



/* Keep other embeds contained too */
/* .tinymce-output iframe,
.tinymce-output video,
.tinymce-output table */
.tinymce-output iframe,
.tinymce-output video,
.tinymce-output table {
  max-width: 100%;

}


/* .tinymce-output table */
.tinymce-output table {
  display: block;
  -webkit-overflow-scrolling: touch;

  overflow-x: auto;      /* horizontal scroll if needed */
}



/* Prevent layout breakage from long words/URLs around media */
/* .tinymce-output */
.tinymce-output {
  overflow-wrap: anywhere;
  word-break: normal;

}



/* Admin Delete button tone */
/* .btn-outline-danger:hover */
.btn-outline-danger:hover {
  background: color-mix(in srgb, var(--ps-danger) 15%, transparent);
  color: var(--ps-danger);
  border-color: var(--ps-danger);

}






/* =============================================================================
   ARTICLE READER (Medium-like)
   - Applies only on article_view.html where we added .article-page / .article-read
   - Removes boxed card look; centers readable column; optimizes typography
============================================================================= */

/* Collapse rails for a distraction-free reader */
/* Collapse rails for a distraction-free reader */
.ps-rails.article-page {
  /* keep the reader width cap */
  max-width: 1200px;
  margin-inline: auto;

  /* ✅ reset the 3-col grid to a single column for article pages */
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
}

/* Explicitly hide rails (you already had this; keep as-is) */
.ps-rails.article-page .ps-left-rail,
.ps-rails.article-page .ps-right-rail {
  display: none;
}




/* .ps-rails.article-page .ps-left-rail,
.ps-rails.article-page .ps-right-rail */
.ps-rails.article-page .ps-left-rail,
.ps-rails.article-page .ps-right-rail {

  display: none;                    /* hide side rails on article pages */
}



/* .ps-rails.article-page .ps-main */
.ps-rails.article-page .ps-main {
  flex: 1 1 auto;
  min-width: 0;

}



/* The actual reader column (replace the boxed .ps-panel) */
/* .article-read */
.article-read {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: 100ch;
  margin: 0 auto;
  overflow-wrap: anywhere;
  word-break: normal;
  /* kill the card look */
  /* comfortable reading measure */
  padding: 0;                       /* let content breathe naturally */
}

/* Make title + tags use the same reader width as the body
   (explicit width so flex-column doesn't keep them full-width) */
.article-page .ps-main > .article-head,
.article-page .ps-main > .article-read {
  width: 100%;
  max-width: 1200ch;
  margin-inline: auto;
  align-self: center; /* ensure centering within flex column */
}


/* Light spacing polish for the tag row */
.article-page .ps-main > .article-head .article-meta {
  margin-bottom: 12px;
}


/* Headline treatment (Medium-ish scale & rhythm) */
/* .article-page .ps-main > h1 */
.article-page .ps-main > h1 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-size: clamp(2rem, 2.2vw + 1.4rem, 3rem);
  margin: 24px 0 12px;

  /* responsive size from ~32px to ~48px */
}



/* Optional: soften tag row under title without box visuals changing elsewhere */
/* .article-page .ps-main .badge */
.article-page .ps-main .badge {
  font-weight: 500;

}

/* Prev/Next article link size */
.article-page .ps-main > .d-flex.justify-content-between a {
  font-size: 1.2rem;   /* change to your desired size (e.g., 1rem, 1.1rem) */
  line-height: 2.3;
}


/* Make sure TinyMCE output can’t overflow (images, tables, iframes) */
/* .article-read img */
.article-read img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;

}



/* .article-read figure.image */
.article-read figure.image {
  margin: 16px 0;
}


/* .article-read figure.image img */
.article-read figure.image img {
  margin: 0 auto;
}


/* .article-read figure.image figcaption */
.article-read figure.image figcaption {
  font-size: 0.95rem;
  line-height: 1.35;
  opacity: .85;
  text-align: center;
  margin-top: 6px;

}



/* .article-read iframe,
.article-read video,
.article-read table */
.article-read iframe,
.article-read video,
.article-read table {
  max-width: 100%;

}



/* .article-read table */
.article-read table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;

}


/* ABOUT PAGE — reuse article reader layout, with its own adjustable width */
.ps-rails.about-page .ps-main > .article-read {
  width: 100%;
  /* Change this value whenever you want tighter/wider text measure on About */
  max-width: var(--about-max-width, 100ch);
  margin-inline: auto;
  align-self: center;
  padding: 0; /* keep it naked (no panel/padding) */

  line-height: 1.2;
  letter-spacing: -0.01em;

  margin: 24px 0 12px;
    width: 100%;
  max-width: 1200ch;
  margin-inline: auto;
  align-self: center; /* ensure centering within flex column */
}



/* Prevent long URLs/words from breaking the layout */


/* Article list summary styling */



/* =================================================================== */
/* Control Panel (CP) — layout + unified orange accent (left-rail)     */
/* Targets #cpModal only; no global overrides                          */
/* =================================================================== */

#cpModal{
  /* Reuse the left-rail accent in CP */
  --cp-accent: var(--rail-accent);
}

/* --- Density tweak (optional) -------------------------------------- */
#cpModal.cp-compact .cp-item{
  font-size:.9rem;
  padding:5px 6px;
  line-height:1.5;
}

/* --- Modal sizing --------------------------------------------------- */
#cpModal .cp-modal-dialog{ max-width: var(--cp-modal-max-w); }

/* --- Body + grid ---------------------------------------------------- */
#cpModal .modal-body{ background: var(--cp-bg); }

#cpModal .cp-grid{
  display:grid;
  grid-template-columns: var(--cp-left-w) var(--cp-mid-w) 1fr;
  height: var(--cp-h);
  min-height:620px;
  max-height: calc(100vh - 180px);
  overflow:hidden; /* panes scroll individually */

  /* NEW: breathing room + inner padding for a modern, carded layout */
  column-gap: 12px;
  padding: 10px;
}


/* --- Panes & separators -------------------------------------------- */
/* Panes: carded look (no hard column rules) */
#cpModal .cp-left,
#cpModal .cp-mid,
#cpModal .cp-right{
  background: var(--ps-surface);
  border: 1px solid var(--cp-sep);
  border-radius: 12px;
  box-shadow: var(--ps-shadow);
}

/* kill old column dividers; the card borders now define the separation */
#cpModal .cp-left{ border-right: none; }
#cpModal .cp-mid { border-right: none; }

#cpModal .cp-left-inner,
#cpModal .cp-mid-inner,
#cpModal .cp-right-inner{
  height:100%;
  overflow:auto;
  padding:12px;

  /* ensure content doesn't hug the rounded edges too tightly */
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* =================================================================== */
/* Control Panel (CP) styles                                           */
/* Scoped to #cpModal only                                             */
/* =================================================================== */

/* Accent harmonization (matches LEFT rail’s orange) */
#cpModal {
  /* Links in CP use the rail accent */
  --bs-link-color: var(--cp-accent);
}

/* 1) Left-nav list-group (Arguments section button/tab) */
#cpModal .list-group {
  /* Make active items match the left rail selection */
  --bs-list-group-active-bg: var(--cp-accent);
  --bs-list-group-active-border-color: var(--cp-accent);
  --bs-list-group-active-color: #fff;
}

#cpModal #cpNav .list-group-item:hover {
  background: color-mix(in srgb, var(--cp-accent) 12%, transparent);
}

/* Make CP left-nav items look like middle-column .cp-item rows */
#cpModal #cpNav .list-group-item {
  /* mirror .cp-item base */
  display: block;
  padding: var(--cp-item-pad-y) var(--cp-item-pad-x);
  border-radius: var(--ps-radius-sm);
  font-size: var(--cp-item-font);
  color: var(--ps-text);
  cursor: pointer;
  user-select: none;
  text-decoration: none;

  /* neutralize Bootstrap list-group chrome in this nav only */
  background: transparent;
  border: 0;
  /* ensure consistent spacing if BS adds margins between items */
  margin: 0;
  transition:
    background-color .12s ease,
    border-color .12s ease,
    color .12s ease,
    box-shadow .12s ease,
    transform .06s ease;
}

/* Hover: same tint as .cp-item:hover */
#cpModal #cpNav .list-group-item:hover,
#cpModal #cpNav .list-group-item:focus {
  background: color-mix(in srgb, var(--cp-accent) 12%, transparent);
  text-decoration: none;
  outline: none;
}

/* Active: same look as .cp-item.cp-active */
#cpModal #cpNav .list-group-item.active,
#cpModal #cpNav .list-group-item[aria-current="true"] {
  background: color-mix(in srgb, var(--cp-accent) 18%, transparent);
  border-left: 3px solid var(--cp-accent);
  padding-left: calc(var(--cp-item-pad-x) - 3px);
  font-weight: 600;
  box-shadow: 0 1px 8px color-mix(in srgb, var(--cp-accent) 12%, transparent);

  /* keep text readable like .cp-item (don’t force white) */
  color: var(--ps-text);
}

/* Make sure Bootstrap's active variables don’t flip colors here */
#cpModal #cpNav .list-group-item.active {
  --bs-list-group-active-bg: transparent;           /* we set bg above */
  --bs-list-group-active-border-color: transparent; /* not used */
  --bs-list-group-active-color: var(--ps-text);     /* keep text tone */
}




/* 2) Middle-column items (argument rows) */
#cpModal .cp-items {
  padding-bottom: 12px;
}

#cpModal .cp-item {
  display: block;
  padding: var(--cp-item-pad-y) var(--cp-item-pad-x);
  border-radius: var(--ps-radius-sm);
  font-size: var(--cp-item-font);
  color: var(--ps-text);
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

#cpModal .cp-item:hover {
  background: color-mix(in srgb, var(--cp-accent) 12%, transparent);
}

#cpModal .cp-item.cp-active {
  background: color-mix(in srgb, var(--cp-accent) 18%, transparent);
  border-left: 3px solid var(--cp-accent);
  padding-left: calc(var(--cp-item-pad-x) - 3px);
  font-weight: 600;
  box-shadow: 0 1px 8px color-mix(in srgb, var(--cp-accent) 12%, transparent);
}

/* CP mid list: arguments that have values = green */
#cpModal .cp-item.cp-has-values {

  color: var(--ps-success);          /* ✅ green text */
}

/* When an arg both has values and is active, also tint the left accent */
#cpModal .cp-item.cp-active.cp-has-values {
  border-left-color: var(--ps-success);
}

/* 3) Sticky filter row above middle column list */
#cpModal .cp-filter {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ps-surface);
  border-bottom: 1px solid var(--cp-sep);
  padding: 8px 8px;
  margin-bottom: 8px !important;

  /* modern docked feel */
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px color-mix(in srgb, #000 10%, transparent);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

#cpModal .cp-filter .form-control {
  border-color: var(--ps-border);
  box-shadow: none;
}

/* 4) Right detail header + fields */
#cpModal .cp-right-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ps-surface);
    border-bottom: none;
  box-shadow: none;
  padding: 10px 10px;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#cpModal .cp-right-header #cpDetailTitle {
  font-size: 1.1rem;
  font-weight: 900;
}

#cpModal .cp-detail .cp-field {
  margin-bottom: .95rem;
}

#cpModal .cp-detail .cp-label {
  font-weight: 500;
  margin-bottom: .25rem;
}

/* Chips inside details */
#cpModal .cp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--ps-radius-sm);
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  margin: 0 6px 6px 0;
}

#cpModal .cp-chip .x {
  cursor: pointer;
}

/* Optional subheading style within detail pane */
#cpModal .cp-section-heading {
  font-weight: 700;
  margin: 10px 0 4px;
  font-size: .9rem;
  color: var(--ps-muted);
}

/* 5) Footer polish */
#cpModal .ps-cp-footer {
  border-top: 1px solid var(--ps-border);
  background: color-mix(in srgb, var(--ps-surface) 92%, var(--ps-bg));
  padding-block: .9rem;
}

/* 6) Empty state hint */
#cpModal .ps-empty-hint {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--ps-muted);
  border: 1px dashed color-mix(in srgb, var(--ps-border) 70%, transparent);
  border-radius: .5rem;
  background: color-mix(in srgb, var(--ps-surface) 96%, transparent);
}

/* 7) Footer action buttons ("Reset All Arguments", "Done") */
#cpModal .cp-action-btn {
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.2;
  border-radius: var(--ps-radius);
  padding: .5rem .9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .12s ease,
              border-color .12s ease,
              color .12s ease,
              box-shadow .12s ease;
}

/* Solid variant (e.g. "Done") */
#cpModal .cp-action-btn.cp-action-btn--solid {
  background: var(--cp-accent);
  border-color: var(--cp-accent);
  color: #fff;
}

/* Outline variant (e.g. "Reset All Arguments") */
#cpModal .cp-action-btn.cp-action-btn--outline {
  background: transparent;
  border-color: var(--cp-accent);
  color: var(--ps-text);
}

#cpModal .cp-action-btn.cp-action-btn--outline:hover {
  background: var(--cp-accent);
  border-color: var(--cp-accent);
  color: var(--ps-text);
}

/* Disabled state for CP action buttons (attribute or class) */
#cpModal .cp-action-btn:disabled,
#cpModal .cp-action-btn.disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}


/* If a utility class is used on the next container */
#cpModal #cpDetail,
#cpModal #cpDetail > .border-top,
#cpModal #cpDetail > .border-bottom {
  border-top: 0 !important;
  border-bottom: 0 !important;
}

/* If an <hr> is present directly above the empty-state block */
#cpModal #cpDetail > hr {
  display: none;
}

/* If a pseudo-element is used to render the divider on the header/content */
#cpModal .cp-right-header::before,
#cpModal .cp-right-header::after,
#cpModal #cpDetail::before,
#cpModal #cpDetail::after {
  content: none !important;
}



/* Center the empty state inside the detail panel */
#cpModal #cpDetail {
  position: relative;
}

/* When the detail panel is in "empty" mode, center its contents.
   We target the common muted/placeholder area but keep it scoped. */
#cpModal #cpDetail .cp-empty,                 /* preferred if you can add this class */
#cpModal #cpDetail .empty-state,              /* alternate class if present */
#cpModal #cpDetail .ps-muted:only-child {
  display: flex;
  flex-direction: column;     /* stack lines vertically */
  align-items: center;
  justify-content: center;
  gap: .4rem;                 /* space between lines */
  min-height: 220px;
  text-align: center;
  margin: 0;
  white-space: normal;        /* ensure normal wrapping for <p> text */
}

/* Tidy default paragraph spacing inside the empty state */
#cpModal #cpDetail .ps-muted:only-child p {
  margin: 0;
}





/* Selector overrides for any non-standard fields in CP */
#cpModal .form-control {
  border-color: var(--ps-border, #d0d5dd);
}
#cpModal .form-control:focus,
#cpModal .form-control:focus-visible {
  border-color: var(--cp-accent, #ff7a18);
  box-shadow: none;
  outline: none;
}






/* ===== Generic modal sizing utility ===== */


/* .modal--sizable .modal-dialog */
.modal--sizable .modal-dialog {
  max-width: var(--modal-max-w);
}


/* .modal--sizable .modal-body */
.modal--sizable .modal-body {
 max-height: var(--modal-body-max-h); overflow: auto; 
}



/* Optional: small-screen guard (Bootstrap already does a lot here) */
@media (max-width: 575.98px) {
  .modal--sizable .modal-dialog { max-width: calc(100% - 2rem); }
}




/* Reserve the right-rail width but don’t show its content when used as a spacer */
/* .ps-right-rail.is-placeholder */
.ps-right-rail.is-placeholder {

  visibility: hidden;           /* keeps the layout space */
}


/* .ps-right-rail.is-placeholder * */
.ps-right-rail.is-placeholder * {

  display: none !important;     /* ensure nothing is interactable/readable */
}


/* .d-none */
.d-none {
  display: none !important;
}


/* Position the tiny bubble on the code chip */
/* code.command-text */
code.command-text {
  position: relative;
}

      /* parent */

/* Position the tiny bubble on the code chip */
code.command-text { position: relative; }      /* parent */
.copied-tooltip   { 
  position: absolute; 
  top: 1.6em; left: .25rem;
  background-color: var(--ps-success);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: .72rem;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--ps-success) 30%, transparent);
  opacity: 0;
  transition: opacity .15s ease-in-out;
    right: -3.5rem;
  left: auto;
  white-space: nowrap;
  z-index: 1056;
}
.copied-tooltip.is-visible { opacity: 1; }



/* Keep it above app chrome but under modals */
/* .toast */
.toast {
  z-index: 1070;
}


/* #mitreDef */
#mitreDef {
  z-index: 1080;
}

 /* optional: ensure MITRE modal sits above toasts */

/* =========================================================
   Offcanvas Drawers (MITRE + Article)
   - Unified style & layout
   - Behavioral assumptions:
     - MITRE drawer: static z-index via CSS (1105)
     - Article drawer: dynamic z-index via JS forceLayering()
========================================================= */

/* Backdrop needs to sit below drawers, above rest of app */
.offcanvas-backdrop {
  z-index: 1100;
}

/* Shared panel chrome for both drawers */
.mitre-canvas,
.article-canvas {
  background: var(--ps-surface);
  color: var(--ps-text);
  border: 1px solid var(--ps-border);
  /* box-shadow intentionally NOT set here because each drawer
     uses a directional shadow that matches its side */
  /* z-index:
     - mitre-canvas gets a static custom z-index below
     - article-canvas gets z-index at runtime via JS */
}

/* ========================
   MITRE drawer (left side)
   ======================== */

/* Width / sizing / stacking for MITRE */
.mitre-canvas {
  width: min(33.333vw, 720px);
  min-width: 520px;
  max-width: 720px;
  z-index: 1105; /* sits above backdrop */
  /* edge divider on the right side of the drawer */
  border-right: 1px solid var(--ps-border, #333);
  /* shadow projects into the page from the left */
  box-shadow: 6px 0 22px rgba(0,0,0,.18);
}

@media (max-width: 1200px) {
  .mitre-canvas {
    min-width: 380px;
    width: min(40vw, 640px);
  }
}
@media (max-width: 992px) {
  .mitre-canvas {
    min-width: 360px;
    width: min(90vw, 640px);
  }
}

/* Shape and border radius for the MITRE drawer when anchored left */
.mitre-canvas.offcanvas-start {
  border-radius: 16px 16px 16px 0;
  /* keep border-right from above */
}

/* MITRE definition body formatting inside the left drawer */
.mitre-def-block {
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ps-text);
}

/* Regular paragraphs */
.mitre-def-block .mitre-para {
  margin: 0 0 .75rem 0;
  color: var(--ps-text);
}

/* Blank line / paragraph break.
   We render it as extra vertical gap, no visible text. */
.mitre-def-block .mitre-para-break {
  margin: 0 0 1rem 0;
  line-height: 1rem;
  min-height: 0; /* just acts like spacing */
  color: transparent;
}

/* Bulleted lists for technique steps / behaviors */
.mitre-def-block .mitre-list {
  margin: 0 0 1rem 1.25rem;   /* indent the list a bit */
  padding: 0;
  list-style: disc;
  color: var(--ps-text);
}

.mitre-def-block .mitre-list li {
  margin-bottom: .5rem;
  line-height: 1.4;
  font-size: .9rem;
  color: var(--ps-text);
}


/* ========================
   Article drawer (right side)
   ======================== */

/* Width / sizing / visual for Article preview */
.article-canvas.offcanvas-end {
  width: 1100px;           /* tweak this number if you want wider/narrower */
  max-width: 90vw;
  border-left: 1px solid var(--ps-border);
  border-radius: 16px 16px 0 16px;
  /* subtle shadow projecting into the page from the right */
  box-shadow: -6px 0 22px rgba(0,0,0,.18);
  /* note: z-index is set dynamically in JS via forceLayering() */
}

/* ==================================
   Headers for both drawers
   ================================== */

/* Drawer header (top bar with title / close button) */
.mitre-canvas .offcanvas-header,
.article-canvas .offcanvas-header {
  position: sticky;
  top: 0;
  z-index: 20;

  display: flex;
  align-items: flex-start;
  gap: .75rem;

  background: color-mix(in srgb, var(--ps-surface) 90%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-bottom: 1px solid var(--ps-border);

  padding: 12px 16px;
  margin: 0; /* kill default header spacing */
}

/* Drawer header title */
.mitre-canvas .offcanvas-header .offcanvas-title,
.article-canvas .offcanvas-header .offcanvas-title {
  flex: 1 1 auto;
  margin: 0;

  font-size: .9rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ps-muted);
}

/* Drawer header close button */
.mitre-canvas .offcanvas-header .btn-close,
.article-canvas .offcanvas-header .btn-close {
  flex: 0 0 auto;
  opacity: .7;
}
.mitre-canvas .offcanvas-header .btn-close:hover,
.article-canvas .offcanvas-header .btn-close:hover {
  opacity: 1;
}

/* ==================================
   Body area for both drawers
   ================================== */

/* Offcanvas body: scrolling region, padding, readable baseline line-height */
.mitre-canvas .offcanvas-body,
.article-canvas .offcanvas-body {
  position: relative;
  max-height: 100vh;
  overflow-y: auto;

  padding: 16px;
  line-height: 1.5;
}

/* ==================================
   Article drawer internals
   ================================== */

/* Sticky "Open in Full Page →" header that we inject via JS */
.article-preview-header {
  position: sticky;
  top: 0;
  z-index: 30;

  display: flex;
  justify-content: flex-start;

  background: color-mix(in srgb, var(--ps-surface) 94%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-bottom: 1px solid var(--ps-border);

  padding: 12px 16px;

  /* pull edge-to-edge within the body padding,
     then restore normal flow afterwards */
  margin: -16px -16px 16px -16px;

  border-radius: 12px 12px 0 0;
}

/* Button in the sticky article header */
.article-preview-header .btn {
  font-weight: 600;
  font-size: .8rem;
  line-height: 1.2;

  border-radius: var(--ps-radius-sm);
  border: 1px solid var(--ps-border);

  background: var(--ps-surface);
  color: var(--ps-text);

  box-shadow: 0 1px 6px color-mix(in srgb, #000 10%, transparent);
}
.article-preview-header .btn:hover {
  background: color-mix(in srgb, var(--ps-primary) 8%, var(--ps-surface));
  border-color: color-mix(in srgb, var(--ps-primary) 40%, var(--ps-border));
  box-shadow: 0 1px 12px color-mix(in srgb, var(--ps-primary) 18%, transparent);
  text-decoration: none;
}

/* Article body text rhythm inside the article drawer */
.article-preview-content {
  color: var(--ps-text);
  font-size: .95rem;
  line-height: 1.6;
}

.article-preview-content h1,
.article-preview-content h2,
.article-preview-content h3,
.article-preview-content h4 {
  color: var(--ps-text);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 1rem;
  margin-bottom: .5rem;
}

.article-preview-content p {
  color: var(--ps-text);
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: .9rem;
}

.article-preview-content .small,
.article-preview-content .text-muted {
  color: var(--ps-muted) !important;
  font-size: .8rem;
  line-height: 1.4;
}

/* ==================================
   MITRE drawer internals
   ================================== */

#mitreDefName {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: .5rem;
  color: var(--ps-text);
}

#mitreDefText {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 12px;

  font-size: .9rem;
  line-height: 1.4;
  color: var(--ps-text);

  box-shadow: 0 1px 8px color-mix(in srgb, #000 12%, transparent);
}










/* ============================================================================
   "More" Modal Refresh (ps-modal-rich)
   - modern surface
   - sticky header row
   - cleaner command rows
   - consistent spacing and tags
   - NO behavioral changes
   ----------------------------------------------------------------------------
   HOW TO USE:
   Add class="modal--sizable ps-modal-rich" on the <div class="modal ...">
   Keep all existing data attributes / IDs / JS hooks.
============================================================================ */

/* Root modal surface treatment */
.ps-modal-rich .ps-modal-surface {
  background: var(--ps-surface);
  color: var(--ps-text);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius-lg);
  box-shadow: var(--ps-shadow);
  overflow: hidden; /* so the rounded corners are visually clean */
}

/* Sticky header bar inside the modal */
.ps-modal-rich .modal-headbar {
  position: sticky;
  top: 0;
  z-index: 10;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;

  background: color-mix(in srgb, var(--ps-surface) 92%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-bottom: 1px solid var(--ps-border);

  padding: 12px 16px;
  margin: 0;
}

/* Left block in header (title + meta block stacked) */
.ps-modal-rich .modal-head-titles {
  flex: 1 1 auto;
  min-width: 0;
}

.ps-modal-rich .modal-headbar .modal-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ps-text);
  letter-spacing: -0.01em;
  word-break: break-word;
}

.ps-modal-rich .modal-head-meta {
  margin-top: .25rem;
  color: var(--ps-muted) !important;
  line-height: 1.3;
  font-size: .8rem;
  font-weight: 400;
  word-break: break-word;
}

/* Close button in header */
.ps-modal-rich .modal-headbar .btn-close {
  flex: 0 0 auto;
  opacity: .7;
}
.ps-modal-rich .modal-headbar .btn-close:hover {
  opacity: 1;
}

/* Modal body wrapper */
.ps-modal-rich .modal-mainblock {
  padding: 16px;
  line-height: 1.5;
  color: var(--ps-text);
  background: var(--ps-surface);
}

/* Section block inside modal body */
.ps-modal-rich .ps-modal-section {
  background: transparent;
  border-radius: var(--ps-radius);
  margin-bottom: 16px;
  color: var(--ps-text);
}

/* Optional description text block at top of modal */
.ps-modal-rich .ps-modal-desc {
  font-size: .9rem;
  line-height: 1.4;
  color: var(--ps-muted);
}

/* Tags row -> pill badges (reuses your existing .tags-text container) */
.ps-modal-rich .tags-text {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.ps-modal-rich .tags-text .ps-badge,
.ps-modal-rich .tags-text .badge,
.ps-modal-rich [data-all-tags] .badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--ps-text);
  background: color-mix(in srgb, var(--ps-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--ps-primary) 30%, var(--ps-border));
  box-shadow: 0 1px 6px color-mix(in srgb, #000 12%, transparent);
}

/* subtle divider between sections */
.ps-modal-rich .ps-modal-sep {
  border: 0;
  border-top: 1px solid var(--ps-border);
  margin: 8px 0 16px;
}

/* Commands list spacing / card feel
   NOTE: we do NOT rename .commands-list or li[data-command-row]
   because ps-mitre.js and ps-commands.js rely on them.
*/
.ps-modal-rich .commands-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Each logical row (li[data-command-row]) becomes a little card block */
.ps-modal-rich .commands-list li[data-command-row] {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);

  padding: 12px 12px;
  margin-bottom: 10px;
}

/* MITRE breadcrumb row inside each command block */
.ps-modal-rich .commands-list li[data-command-row] .mitre-inline {
  margin-bottom: .5rem;
  
}

/* Command chip inside modal (reuse global .command-text but tighten space a bit here) */
.ps-modal-rich .commands-list li[data-command-row] code.command-text {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--ps-font-mono);
  font-size: var(--cmd-font-size, .95rem);
  line-height: 1.2;
  padding: .4rem .6rem;
  border-radius: 10px;
  cursor: pointer;
    font-size: .9rem;   /* make smaller */
  line-height: 1.3;

  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--ps-surface-2) 84%, transparent),
    color-mix(in srgb, var(--ps-surface) 92%, transparent)
  );
  border: 1px solid color-mix(in srgb, var(--ps-border) 60%, transparent);
  box-shadow: 0 1px 6px color-mix(in srgb, #000 10%, transparent);

  transition: transform .06s ease,
              border-color .12s ease,
              box-shadow .12s ease,
              background .12s ease;
}
.ps-modal-rich .commands-list li[data-command-row] code.command-text:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ps-warning) 35%, var(--ps-border));
  box-shadow: 0 1px 18px color-mix(in srgb, var(--ps-warning) 12%, transparent);
}

/* Explanation text under each command */
.ps-modal-rich .commands-list li[data-command-row] .explanation {
  font-size: 1.0rem;
  line-height: 1.4;
  margin-top: .5rem;
  color: var(--ps-muted) !important;
}


/* ULTIMATE OVERRIDE: MITRE breadcrumb row inside "More" modal */
.ps-modal-rich .mitre-inline,
.ps-modal-rich .mitre-inline * {
  font-size: 0.8rem;   /* <-- tweak this */
  line-height: 1.4;
  color: color-mix(in srgb, var(--ps-warning) 72%, transparent)
}

.ps-modal-rich .mitre-inline .btn.btn-link:hover,
.ps-modal-rich .mitre-inline .btn-link:hover {
  text-decoration: underline;
  color: var(--ps-warning);
}


/* MITRE summary / tag clusters near bottom (if present in modal)
   Just tighten it visually.
*/
.ps-modal-rich [data-mitre-summary],
.ps-modal-rich [data-all-tags] {
  background: var(--ps-surface);
  color: var(--ps-text);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);

  padding: 12px;
  margin-top: 16px;

  overflow-x: auto;
  max-width: 100%;
  white-space: normal;
}


.ps-modal-rich [data-mitre-summary] p {
  font-size: .8rem;
  line-height: 1.4;
  color: var(--ps-text);
  margin: 0 0 .5rem;
}
.ps-modal-rich [data-mitre-summary] p strong {
  font-weight: 600;
  color: var(--ps-muted);
  margin-right: .25rem;
}

/* Make tactic/technique/sub-technique mini-links in summary look like subtle pills */
.ps-modal-rich [data-mitre-summary] .btn.btn-link,
.ps-modal-rich [data-mitre-summary] .btn-link {
  padding: 0 .4rem;
  font-size: .8rem;
  line-height: 1.3;
  border-radius: var(--ps-radius-sm);

  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  color: var(--ps-text);
  text-decoration: none;
}
.ps-modal-rich [data-mitre-summary] .btn.btn-link:hover,
.ps-modal-rich [data-mitre-summary] .btn-link:hover {
  text-decoration: underline;
  background: color-mix(in srgb, var(--ps-primary) 8%, var(--ps-surface));
  border-color: color-mix(in srgb, var(--ps-primary) 40%, var(--ps-border));
}

/* "Copy All" button row that you already have at the bottom of the modal:
   we'll just give it breathing room by letting your existing markup
   inherit spacing. If you have a footer container, give it this class. */
.ps-modal-rich .modal-footer,
.ps-modal-rich .ps-modal-footer {
  border-top: 1px solid var(--ps-border);
  background: color-mix(in srgb, var(--ps-surface) 92%, var(--ps-bg));
  padding: 12px 16px;
}



/* Card-like block for tool description in More modal */
.ps-modal-rich .ps-modal-cardblock {
  background: var(--ps-surface);
  color: var(--ps-text);
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  box-shadow: var(--ps-shadow);

  padding: 12px 12px;
  font-size: .9rem;
  line-height: 1.4;

  overflow-x: auto;
  max-width: 100%;
  white-space: normal;
}


/* Wider Bootstrap tooltip body for readability */
.tooltip {
  opacity: 1 !important; /* ensure fully solid tooltip */
}

.tooltip .tooltip-inner {
  max-width: 500px;
  white-space: normal;
  line-height: 1.5;
  font-size: 1rem;
  background-color: var(--ps-tt);
  color: var(--ps-surface);
}

