/* ============================================================
   HiddenLayer APE Stylesheet

   Organization
   1. Design Tokens
   2. Reset & Base
   3. Header & Navigation
   4. Search & Results
   5. Page Layout
   6. Matrix & Categories
   7. Cards & Accordions
   8. Objectives Page
   9. Industry Page
   10. Modal & Prompt Examples
   11. Graph Page
   12. Detail Pages
   13. Contribute Page
   14. About Page
   15. Animations
   16. Responsive Breakpoints
   17. Footer & Floating Actions
   ============================================================ */

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
  --bg:           #09151E;
  --bg-card:      #102436;
  --bg-header:    #09151E;
  --accent:       #37C980;
  --accent-dim:   #37C980;
  --text:         #FAFAFA;
  --text-muted:   rgba(250,250,250,0.5);
  --border:       rgba(250,250,250,0.08);
  --highlight-bg: rgba(55, 201, 128, 0.25);
  --highlight-color: #37C980;
  --shadow-card:  0 2px 8px rgba(0,0,0,0.35);
  --shadow-hover:  0 6px 20px rgba(0,0,0,0.55);
  --radius:       8px;
  --font:         'Work Sans', system-ui, sans-serif;
  --transition:   0.2s ease;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: grid; 
  grid-template-rows: auto minmax(0, 1fr) auto;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
}

a:hover { text-decoration: underline; }

mark {
  background: var(--highlight-bg);
  color: var(--highlight-color);
  border-radius: 2px;
  padding: 0 1px;
}

footer a:hover {
  color: var(--text);
}

#modal-body {
  padding: 20px 18px;
  overflow-y: auto;
}

.modal-examples-list li a:hover {
  text-decoration: underline;
}

.detail-breadcrumbs a:hover {
  color: var(--text);
}

.detail-meta h2 {
  margin: 0 0 10px;
  font-size: 0.98rem;
  color: var(--text);
}

body:has(#controls) {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ============================================================
   Header & Navigation
   ============================================================ */
header {
  background: #102436;
  border-bottom: 1px solid var(--border);
  padding: 9px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 6px;
  position: sticky;
  top: 0;
  z-index: 100;
}

header > .nav-logo { grid-column: 1; grid-row: 1 / 3; align-self: center; }

.header-center { grid-column: 2; grid-row: 1; }

.header-actions { grid-column: 3; grid-row: 1 / 3; align-self: center; }

header > #main-nav { grid-column: 2; grid-row: 2; display: flex; justify-content: center; gap: 4px; }

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  flex-shrink: 0;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: clamp(0.72rem, 1.3vw, 0.8rem);
  font-weight: 500;
  font-family: var(--font);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 12px;
  min-height: 32px;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.header-btn:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.header-btn svg {
  fill: currentColor;
  flex-shrink: 0;
}

#site-title {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  line-height: 1.25;
  font-weight: 600;
  color: #FAFAFA;
  letter-spacing: -0.01em;
  text-align: center;
}

.matrix-scroll .category-header {
  height: 96px;
  min-height: 96px;
  max-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  margin-bottom: 12px;
  text-align: center;
}

#objectives-content .category-header {
  padding: 0;
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.card:hover > .card-header .card-name,
.card:hover > .objective-expand-toggle .card-name {
  color: var(--accent);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.card-header-text { flex: 1; min-width: 0; }

#modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

header > #main-nav {
  position: static;
  background: none;
  border: none;
  padding: 0;
  min-height: auto;
}

header > .nav-logo-link {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}

.nav-logo {
  height: clamp(22px, 4vw, 34px);
  width: auto;
  display: block;
}

.nav-logo-link {
  display: inline-block;
}

.nav-logo-link:hover {
  text-decoration: none;
}

.nav-link {
  font-size: clamp(0.75rem, 1.4vw, 0.85rem);
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 18px;
  border-radius: 6px;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  background: rgba(55,201,128,0.1);
}

.detail-nav-section-title {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 6px 10px;
}

.detail-example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-objective-nav-item.depth-1 {
  margin-bottom: 2px;
}

.detail-objective-nav-item.depth-1 .detail-technique-link {
  border-radius: 6px;
}

.detail-example-header.standalone {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.category-name-btn,
.card-header {
  color: inherit;
  text-decoration: none;
}

.category-name-btn:hover,
.card-header:hover {
  text-decoration: none;
}

.matrix-scroll .objective-category .category-header {
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  padding: 8px 6px;
}

.objective-card .card-header,
.objective-card-header {
  width: 100%;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font);
}

.objective-category,
.objective-card,
.objective-card .card-header,
.objective-card-header,
.objective-impact-btn,
.objective-impact-name,
.objective-card .card-name {
  min-width: 0;
  max-width: 100%;
}

.objective-card .card-header {
  align-items: center;
  min-height: 58px;
}

.integrity-domain-header {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.integrity-domain .objective-card .card-header {
  min-height: 40px;
  padding: 8px 12px;
}

header {
  position: relative;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  padding: 9px 24px;
}

header > #main-nav {
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.header-actions {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-logo-link {
  grid-column: 1;
  justify-self: start;
}

.header-actions {
  grid-column: 3;
  justify-self: end;

  position: static;
  transform: none;
}

.integrity-domain-header,
.objective-subtype-header {
  gap: 0;
}

.objective-group-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.objective-nested-panel .objective-card .card-header {
  min-height: 38px;
  padding: 8px 10px;
}

#content.objectives-matrix .objective-impact-group .objective-card .card-header {
  min-height: 40px;
  padding: 8px 12px;
}

.card:hover > .card-header .card-name,
.card:hover > .objective-expand-toggle .card-name {
  color: var(--accent);
}

.objective-nested-panel .card:hover > .card-header .card-name,
.objective-nested-panel .card:hover > .objective-expand-toggle .card-name {
  color: var(--accent);
}

.detail-nav-section-title {
  margin: 0 6px 14px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(250, 250, 250, 0.52);
}

/* ============================================================
   Search & Results
   ============================================================ */
#controls {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.search-wrap {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

#search-input,
#graph-search-input {
  width: 100%;
  padding: 10px 44px 10px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input::placeholder,
#graph-search-input::placeholder { color: var(--text-muted); }

#search-input:focus,
#graph-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(55,201,128,0.15);
}

#clear-btn,
#graph-clear-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 8px;
  border-radius: 50%;
  display: none;
  line-height: 1;
  transition: color var(--transition);
}

#clear-btn:hover,
#graph-clear-btn:hover { color: var(--text); }

#clear-btn.visible,
#graph-clear-btn.visible { display: block; }

#results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  min-height: 1.2em;
}

#content.search-mode {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  gap: 0;
}

#content.search-mode .search-result-card {
  width: 100%;
  margin-bottom: 8px;
}

.search-result-tactic {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  margin-bottom: 3px;
}

.search-result-name {
  text-align: left !important;
  font-size: 1rem !important;
  margin-bottom: 0 !important;
}

.search-result-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#no-results {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  display: none;
}

#no-results.visible { display: block; }

#no-results p { font-size: 1rem; margin-bottom: 8px; }

#no-results small { font-size: 0.8rem; }

#graph-controls .search-wrap { width: 100%; max-width: 800px; }

#graph-results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  min-height: 1.2em;
}

#graph-no-results {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
}

#graph-no-results[hidden] { display: none; }

#graph-no-results p { font-size: 1rem; margin-bottom: 8px; }

#graph-no-results small { font-size: 0.8rem; }

#graph-svg.searching .graph-node {
  opacity: 0.08;
  transition: opacity 0.2s ease;
}

#graph-svg.searching .graph-node.match {
  opacity: 1;
}

#graph-svg.searching .edge-tactic,
#graph-svg.searching .edge-tech {
  opacity: 0.04;
}

#graph-svg.searching .edge-tech.match {
  opacity: 1;
}

#graph-svg.searching .edge-tactic.match {
  opacity: 1;
  stroke-opacity: 1;
  stroke-width: 2.5;
}

#graph-svg.searching .graph-node-center {
  opacity: 1;
}

.detail-sidebar-search {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  margin-bottom: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.detail-sidebar-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(55,201,128,0.15);
}

.detail-sidebar-search::placeholder {
  color: var(--text-muted);
}

#results-count:empty {
  display: none;
}

/* ============================================================
   Page Layout
   ============================================================ */
main {
  flex: 1;
  padding-top: 8px;
  width: 100%;
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  min-height: 0;
  overflow-y: auto;
  align-self: start;
}

.content-section {
  margin-bottom: 72px;
}

.section-label {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #37C980;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.content-section:first-of-type {
  margin-top: 0;
}

main {
  overflow-x: hidden;
}

/* ============================================================
   Matrix & Categories
   ============================================================ */
.matrix-scroll-wrap {
  position: relative;
}

.matrix-scroll-wrap::before,
.matrix-scroll-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.25s ease;
}

.matrix-scroll-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
  opacity: 0;
}

.matrix-scroll-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
  opacity: 0;
}

.matrix-scroll-wrap.scroll-fade-left::before { opacity: 1; }

.matrix-scroll-wrap.scroll-fade-right::after { opacity: 1; }

.matrix-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-card);
}

.matrix-scroll::-webkit-scrollbar {
  display: block;
  height: 10px;
}

.matrix-scroll::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 999px;
}

.matrix-scroll::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 999px;
}

.matrix-scroll .category {
  display: flex;
  flex-direction: column;
}

.matrix-scroll .category-name-btn {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matrix-scroll .category-name {
  display: block;
  line-height: 1.25;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  text-align: center;
}

#content {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  align-content: start;
}

.category {
  min-width: 0;
}

#objectives-content .category {
  flex: unset;
  width: 100%;
  max-width: none;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 18px;
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  display: flex;
  align-items: stretch;
}

#objectives-content .category:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(250,250,250,0.15);
}

#objectives-content .category-name {
  color: #D0FFEF;
  text-align: center;
  min-width: 0;
  flex: 1 1 auto;
  white-space: normal;
  overflow-wrap: break-word; 
  word-break: normal; 
  line-height: 1.32;
}

#objectives-content .category:hover .category-name {
  color: var(--accent);
}

.category-name {
  font-size: 1.17rem;
  font-weight: 600;
  color: #D0FFEF;
  letter-spacing: 0.02em;
  text-align: center;
}

.category-name-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
  -webkit-user-select: none;
  transition: color var(--transition);
}

.category-name-btn:hover .category-name,
.category-name-btn:focus .category-name {
  color: var(--accent);
}

.tactic-arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1;
  margin-left: 4px;
  transition: color var(--transition);
}

.category-name-btn:hover .tactic-arrow,
.category-name-btn:focus .tactic-arrow {
  color: var(--accent);
}

#content.objectives-matrix {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}

#content.objectives-matrix {
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 44px;
  align-items: start;
  max-width: 1680px;
  margin: 0 auto;
}

#content.objectives-matrix .objective-column-heading {
  min-height: 52px !important;
  margin-bottom: 2px !important;
}

#content.objectives-matrix 
.objective-category[data-impact-id="HLG02"] 
.objective-impact-group::before {
  background: #37C980;
}

#content.objectives-matrix 
.objective-category[data-impact-id="HLG01"] 
.objective-impact-name {
  color: #59B2FF;
}

#content.objectives-matrix 
.objective-category[data-impact-id="HLG02"] 
.objective-impact-name {
  color: #37C980;
}

#content.objectives-matrix 
.objective-category[data-impact-id="HLG03"] 
.objective-impact-name {
  color: #FFCE02;
}

#content.objectives-matrix 
.objective-category[data-impact-id="HLG01"] 
.objective-heading-link:hover 
.objective-impact-name {
  color: #A8DBFF;
  text-shadow: 0 0 10px rgba(89,178,255,0.35);
}

#content.objectives-matrix 
.objective-category[data-impact-id="HLG02"] 
.objective-heading-link:hover 
.objective-impact-name {
  color: #8DFFC2;
  text-shadow: 0 0 10px rgba(55,201,128,0.35);
}

#content.objectives-matrix 
.objective-category[data-impact-id="HLG03"] 
.objective-heading-link:hover 
.objective-impact-name {
  color: #FFF07A;
  text-shadow: 0 0 10px rgba(255,206,2,0.35);
}

#content.objectives-matrix .objective-category .objective-column-heading {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  text-align: center;
}

#content.objectives-matrix .objective-category .objective-heading-link {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center !important;
  justify-content: flex-start;
  text-align: center !important;
}

#content.objectives-matrix .objective-category .objective-heading-copy {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center !important;
  text-align: center !important;
}

#content.objectives-matrix .objective-category .objective-impact-name,
#content.objectives-matrix .objective-category .objective-impact-description {
  width: 100%;
  text-align: center !important;
}

#content.objectives-matrix .objective-impact-group {
  position: relative;
  padding: 18px 20px 14px;
  margin-bottom: 14px;
  background: rgba(16, 36, 54, 0.62);
  border: 1px solid rgba(250, 250, 250, 0.10);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

#content.objectives-matrix .objective-impact-group::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--domain-accent, var(--accent));
}

#content.objectives-matrix .objective-impact-group-confidentiality {
  --domain-accent: #59B2FF;
}

#content.objectives-matrix .objective-impact-group-integrity {
  --domain-accent: #37C980;
}

#content.objectives-matrix .objective-impact-group-availability {
  --domain-accent: #FFCE02;
}

#content.objectives-matrix .objective-impact-group .objective-group-description {
  display: block;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(250, 250, 250, 0.68);
}

#content.objectives-matrix .objective-impact-group .integrity-domain-divider {
  height: 1px;
  margin: 16px 0 10px;
  background: linear-gradient(to right, var(--domain-accent), transparent);
  opacity: 0.8;
}

#content.objectives-matrix .objective-impact-group > .objective-subtype-cards,
#content.objectives-matrix .objective-impact-group .objective-subtype-cards {
  position: relative;
}

#content.objectives-matrix .objective-impact-group .objective-card {
  margin-bottom: 7px;
  background: rgba(16, 36, 54, 0.9);
}

#content.objectives-matrix .objective-impact-group .objective-card .card-name {
  font-size: 0.86rem;
}

/* ============================================================
   Cards & Accordions
   ============================================================ */
#objectives-content .card-chevron {
  flex: 0 0 auto;
  align-self: center;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(250,250,250,0.15);
}

.card-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: #FAFAFA;
  margin-bottom: 4px;
  text-align: center;
}

.card-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 2px;
}

.card-share {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  background: none;
  border: none;
  font-family: var(--font);
}

.card-share:hover { color: var(--accent); background: rgba(55,201,128,0.08); }

.objective-card .card-name {
  line-height: 1.35;
}

.objective-impact-name,
.objective-card .card-name {
  overflow-wrap: anywhere;
}

.objective-card .card-name {
  text-align: left;
  font-weight: 600;
  line-height: 1.35;
}

.integrity-domain .objective-card .card-name {
  font-size: 0.86rem;
}

.objective-expand-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font);
}

.objective-card-expandable > .objective-expand-toggle {
  cursor: pointer;
}

.objective-card-expandable.expanded > .objective-expand-toggle .objective-expand-chevron {
  color: var(--accent);
}

.objective-expand-chevron {
  transition: transform var(--transition), color var(--transition);
}

.objective-nested-panel {
  padding: 0 12px 10px 12px;
  border-top: 1px solid rgba(250, 250, 250, 0.08);
}

.objective-nested-panel[hidden] {
  display: none;
}

.objective-nested-panel .objective-card {
  margin: 8px 0 0;
  background: rgba(9, 21, 30, 0.42);
  border-color: rgba(250, 250, 250, 0.09);
  box-shadow: none;
}

.objective-nested-panel .objective-card .card-name {
  font-size: 0.82rem;
}

.objective-nested-panel .objective-nested-panel {
  margin-left: 8px;
  padding-right: 0;
}

.card:hover .objective-nested-panel .card-name {
  color: #FAFAFA;
}

.card-chevron,
.objective-expand-chevron {
  transform: none !important;
  transition: color var(--transition);
}

.objective-card-expandable.expanded > .objective-expand-toggle .objective-expand-chevron {
  transform: none !important;
  color: var(--accent);
}

.objective-nested-panel {
  position: relative;
  margin-left: 12px;
  padding: 0 12px 10px 14px;
  border-top: 1px solid rgba(250, 250, 250, 0.08);
}

.objective-nested-panel::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: rgba(55, 201, 128, 0.28);
}

.objective-card-expandable.expanded > .objective-nested-panel::before {
  background: rgba(55, 201, 128, 0.55);
  box-shadow: 0 0 10px rgba(55, 201, 128, 0.18);
}

/* ============================================================
   Objectives Page
   ============================================================ */
#objectives-content {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
  margin: 0 auto;
}

.detail-technique-list,
.detail-objective-subtype-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.detail-objective-subtype-list {
  margin: 4px 0 10px 14px;
  padding-left: 12px;
  border-left: 3px solid rgba(55, 201, 128, 0.28);
}

.detail-objective-subtype-list .detail-technique-link {
  padding: 7px 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(250, 250, 250, 0.78);
}

.detail-objective-subtype-list .detail-technique-link:hover {
  color: var(--text);
  background: rgba(55, 201, 128, 0.08);
}

.detail-objective-subtype-list .detail-technique-link.active {
  color: var(--text);
  background: rgba(55, 201, 128, 0.16);
  box-shadow: inset 3px 0 0 var(--accent);
}

.detail-objective-child-indicator,
.detail-objective-child-spacer {
  display: inline-block;
  width: 12px;
  margin-right: 6px;
  color: var(--text-muted);
}

.objective-category {
  min-width: 0;
  width: 100%;
}

.objective-impact-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font);
}

.objective-impact-name {
  font-size: 1.08rem;
  line-height: 1.28;
}

.objective-impact-name,
.objective-impact-description {
  text-align: left;
}

.objective-category {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.objective-column-heading {
  min-height: 64px;
  margin-bottom: 4px;
}

.objective-heading-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
}

.objective-heading-link:hover {
  text-decoration: none;
}

.objective-heading-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 64px;
  color: var(--accent);
  background: rgba(55, 201, 128, 0.08);
  border: 1px solid rgba(55, 201, 128, 0.42);
  box-shadow: 0 0 28px rgba(55, 201, 128, 0.08);
  font-size: 1.55rem;
}

.objective-heading-copy {
  align-items: flex-start;
}

.objective-impact-name {
  display: block;
  text-align: left;
  color: var(--text);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.objective-heading-link:hover .objective-impact-name {
  color: var(--accent);
}

.objective-impact-description {
  display: block;
  color: rgba(250, 250, 250, 0.68);
  font-size: 0.95rem;
  line-height: 1.45;
}

.objective-card {
  margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(19, 43, 64, 0.96), rgba(16, 36, 54, 0.96));
  border-color: rgba(89, 178, 255, 0.18);
}

.integrity-domain {
  position: relative;
  padding: 18px 20px 14px;
  margin-bottom: 14px;
  background: rgba(16, 36, 54, 0.62);
  border: 1px solid rgba(250, 250, 250, 0.10);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.integrity-domain::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--domain-accent, var(--accent));
}

.integrity-domain-behavioral {
  --domain-accent: #FF9F2E;
}

.integrity-domain-system {
  --domain-accent: #A997FF;
}

.integrity-domain-other {
  --domain-accent: #B2C4D4;
}

.integrity-domain-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  color: var(--domain-accent);
  border: 1px solid color-mix(in srgb, var(--domain-accent) 45%, transparent);
  background: color-mix(in srgb, var(--domain-accent) 12%, transparent);
  font-size: 1.1rem;
}

.integrity-domain-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.integrity-domain-title {
  color: var(--domain-accent);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}

.integrity-domain-description {
  color: rgba(250, 250, 250, 0.68);
  font-size: 0.86rem;
  line-height: 1.45;
}

.integrity-domain-divider {
  height: 1px;
  margin: 16px 0 10px;
  background: linear-gradient(to right, var(--domain-accent), transparent);
  opacity: 0.8;
}

.integrity-domain .objective-card {
  margin-bottom: 7px;
  background: rgba(16, 36, 54, 0.9);
}

.detail-brand-logo,
.objective-heading-icon,
.integrity-domain-icon {
  display: none !important;
}

.objective-heading-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
}

.objective-heading-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.objective-impact-name,
.objective-impact-description {
  text-align: left;
}

.objective-column-heading {
  min-height: 70px;
}

.objective-group-description {
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(250, 250, 250, 0.68);
}

.detail-objective-subtype-list {
  margin: 4px 0 10px 14px;
  padding-left: 12px;
  border-left: 3px solid rgba(55, 201, 128, 0.28);
}

.detail-objective-subtype-list .detail-technique-link {
  padding: 7px 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(250, 250, 250, 0.78);
}

.detail-objective-subtype-list .detail-technique-link.active {
  background: rgba(55, 201, 128, 0.16);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--text);
}

.detail-selector-panel {
  margin-bottom: 24px;
}

/* ============================================================
   Industry Page
   ============================================================ */
#industry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.industry-placeholder {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.industry-placeholder:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(250,250,250,0.15);
}

.industry-name {
  font-size: 1.17rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #D0FFEF;
  text-align: center;
  overflow-wrap: break-word;
}

.industry-placeholder:hover .industry-name {
  color: var(--accent);
}

/* ============================================================
   Modal & Prompt Examples
   ============================================================ */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#modal-overlay[hidden] { display: none; }

#modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  width: 100%;
  max-width: 960px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#modal-category {
  font-size: 0.92rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 4px;
  line-height: 1;
  transition: color var(--transition);
}

#modal-close:hover { color: var(--text); }

#modal-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 14px;
  line-height: 1.3;
}

#modal-detail {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.75;
  white-space: pre-wrap;
}

.modal-examples-label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 20px;
  margin-bottom: 8px;
}

.modal-tactic-name {
  font-size: 1rem;
  color: var(--text);
}

.modal-examples-list {
  margin: 0;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-examples-list li {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-examples-list li a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

#modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

#modal-share {
  margin-top: 16px;
}

.modal-example-num {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 16px;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-example-code {
  margin-top: 8px;
  background: #FAFAFA;
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-example-code code {
  font-family: 'Roboto Mono', monospace;
  font-size: 1rem;
  color: #102436;
  line-height: 1.7;
}

.modal-example-disclaimer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

/* ============================================================
   Graph Page
   ============================================================ */
.graph-page main {
  overflow-x: auto;
}

.graph-page #graph-main {
  height: calc(100vh - 300px);
  min-height: 0;
  overflow: hidden;
}

#graph-controls {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#graph-legacy-btn,
#graph-reset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font);
  padding: 6px 10px;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition);
}

#graph-legacy-btn:hover,
#graph-reset-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

#graph-expand-all-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--font);
  padding: 6px 10px;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition);
}

#graph-expand-all-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

#graph-results-panel {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px 16px;
  max-height: 340px;
  overflow-y: auto;
}

#graph-results-panel[hidden] { display: none; }

#graph-results-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 800px;
  margin: 0 auto;
}

#graph-svg .graph-node .node-circle,
#graph-svg .graph-node-center .node-circle {
  fill: var(--bg-card);
}

#graph-svg .graph-node-tech.branch-lit .node-circle,
#graph-svg .graph-node-tech.match .node-circle,
#graph-svg .graph-node-tactic.match .node-circle {
  fill: var(--bg-card);
}

.graph-page main {
  padding: 0;
  max-width: none;
  display: flex;
}

#graph-main {
  position: relative;
}

#graph-svg {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  cursor: grab;
}

#graph-svg:active {
  cursor: grabbing;
}

.graph-node {
  cursor: grab;
}

.graph-node-tactic,
.graph-node-tech {
  cursor: default;
}

.graph-node:active {
  cursor: grabbing;
}

.graph-node-center {
  cursor: grab;
}

.graph-node-center .node-circle {
  fill: var(--bg-card);
  stroke: var(--accent);
  stroke-width: 2.5;
}

.graph-node-tactic .node-circle {
  fill: var(--bg-card);
  stroke: var(--accent);
  stroke-width: 5;
  transition: fill 0.15s;
}

.graph-node-tech .node-circle {
  fill: var(--bg-card);
  stroke-width: 5;
  transition: fill 0.15s, stroke 0.15s;
}

.edge-tactic {
  stroke: rgba(55,201,128,0.3);
  stroke-width: 1.5;
  fill: none;
}

.edge-tech {
  stroke-width: 1;
  fill: none;
}

.node-label-center {
  font-family: var(--font);
  font-size: 26px;
  font-weight: 600;
  fill: var(--accent);
  pointer-events: none;
}

.node-label-tactic {
  font-family: var(--font);
  font-size: 16.5px;
  font-weight: 500;
  fill: #D0FFEF;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.node-label-tech {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  fill: rgba(250,250,250,0.85);
  pointer-events: none;
}

.node-label-tech-inside {
  font-family: var(--font);
  font-weight: 600;
  fill: rgba(250,250,250,0.9);
}

.graph-node-tactic.color-0 .node-circle { stroke: #37C980; }

.graph-node-tactic.color-0:hover .node-circle { fill: rgba(55,201,128,0.15); }

.graph-node-tactic.color-0 .node-label-tactic { fill: #37C980; }

.graph-node-tech.color-0 .node-circle { stroke: rgba(55,201,128,0.55); }

.graph-node-tech.color-0:hover .node-circle { stroke: #37C980; fill: rgba(55,201,128,0.12); }

.graph-node-tactic.color-1 .node-circle { stroke: #1385F0; }

.graph-node-tactic.color-1:hover .node-circle { fill: rgba(19,133,240,0.15); }

.graph-node-tactic.color-1 .node-label-tactic { fill: #59B2FF; }

.graph-node-tech.color-1 .node-circle { stroke: rgba(19,133,240,0.55); }

.graph-node-tech.color-1:hover .node-circle { stroke: #1385F0; fill: rgba(19,133,240,0.12); }

.graph-node-tactic.color-2 .node-circle { stroke: #D0FFEF; }

.graph-node-tactic.color-2:hover .node-circle { fill: rgba(208,255,239,0.12); }

.graph-node-tactic.color-2 .node-label-tactic { fill: #D0FFEF; }

.graph-node-tech.color-2 .node-circle { stroke: rgba(208,255,239,0.5); }

.graph-node-tech.color-2:hover .node-circle { stroke: #D0FFEF; fill: rgba(208,255,239,0.1); }

.graph-node-tactic.color-3 .node-circle { stroke: #59B2FF; }

.graph-node-tactic.color-3:hover .node-circle { fill: rgba(89,178,255,0.15); }

.graph-node-tactic.color-3 .node-label-tactic { fill: #59B2FF; }

.graph-node-tech.color-3 .node-circle { stroke: rgba(89,178,255,0.55); }

.graph-node-tech.color-3:hover .node-circle { stroke: #59B2FF; fill: rgba(89,178,255,0.12); }

.graph-node-tactic.color-4 .node-circle { stroke: #A997FF; }

.graph-node-tactic.color-4:hover .node-circle { fill: rgba(169,151,255,0.15); }

.graph-node-tactic.color-4 .node-label-tactic { fill: #A997FF; }

.graph-node-tech.color-4 .node-circle { stroke: rgba(169,151,255,0.55); }

.graph-node-tech.color-4:hover .node-circle { stroke: #A997FF; fill: rgba(169,151,255,0.12); }

.graph-node-tactic.color-5 .node-circle { stroke: #B2C4D4; }

.graph-node-tactic.color-5:hover .node-circle { fill: rgba(178,196,212,0.15); }

.graph-node-tactic.color-5 .node-label-tactic { fill: #B2C4D4; }

.graph-node-tech.color-5 .node-circle { stroke: rgba(178,196,212,0.55); }

.graph-node-tech.color-5:hover .node-circle { stroke: #B2C4D4; fill: rgba(178,196,212,0.12); }

.graph-node-tactic.color-6 .node-circle { stroke: #C46952; }

.graph-node-tactic.color-6:hover .node-circle { fill: rgba(196,105,82,0.15); }

.graph-node-tactic.color-6 .node-label-tactic { fill: #C46952; }

.graph-node-tech.color-6 .node-circle { stroke: rgba(196,105,82,0.55); }

.graph-node-tech.color-6:hover .node-circle { stroke: #C46952; fill: rgba(196,105,82,0.12); }

.graph-node-tactic.color-7 .node-circle { stroke: #FFCE02; }

.graph-node-tactic.color-7:hover .node-circle { fill: rgba(255,206,2,0.15); }

.graph-node-tactic.color-7 .node-label-tactic { fill: #FFCE02; }

.graph-node-tech.color-7 .node-circle { stroke: rgba(255,206,2,0.55); }

.graph-node-tech.color-7:hover .node-circle { stroke: #FFCE02; fill: rgba(255,206,2,0.12); }

.graph-node-tech.branch-lit.color-0 .node-circle { stroke: #37C980;  fill: rgba(55,201,128,0.15); }

.graph-node-tech.branch-lit.color-1 .node-circle { stroke: #1385F0;  fill: rgba(19,133,240,0.15); }

.graph-node-tech.branch-lit.color-2 .node-circle { stroke: #D0FFEF;  fill: rgba(208,255,239,0.12); }

.graph-node-tech.branch-lit.color-3 .node-circle { stroke: #59B2FF;  fill: rgba(89,178,255,0.15); }

.graph-node-tech.branch-lit.color-4 .node-circle { stroke: #A997FF;  fill: rgba(169,151,255,0.15); }

.graph-node-tech.branch-lit.color-5 .node-circle { stroke: #B2C4D4;  fill: rgba(178,196,212,0.15); }

.graph-node-tech.branch-lit.color-6 .node-circle { stroke: #C46952;  fill: rgba(196,105,82,0.15); }

.graph-node-tech.branch-lit.color-7 .node-circle { stroke: #FFCE02;  fill: rgba(255,206,2,0.15); }

.edge-tech.branch-lit { stroke-opacity: 0.85; }

.node-label-tactic-inside {
  font-family: var(--font);
  font-weight: 600;
  fill: #FAFAFA;
}

.node-label-tactic-count {
  font-family: var(--font);
  font-weight: 400;
  fill: rgba(250,250,250,0.72);
}

.graph-node-tactic .node-circle {
  fill: rgba(16, 36, 54, 0.92);
  stroke-width: 3;
}

.tight-paragraph-break {
  display: block;
  height: 10px;
}

/* ============================================================
   Detail Pages
   ============================================================ */
.detail-page {
  min-height: 100vh;
}

.detail-app {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 0;
  overflow: hidden;
}

.detail-sidebar {
  position: sticky;
  top: 0;
  height: auto;
  max-height: 100%;
  overflow-y: auto;
  background: #102436;
  border-right: 1px solid var(--border);
  padding: 20px 16px 28px;
}

.detail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-brand-logo {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

.detail-brand-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.detail-brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.detail-tactic-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-family: var(--font);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.detail-tactic-toggle:hover {
  background: rgba(250,250,250,0.05);
}

.detail-tactic-toggle.active-parent {
  background: rgba(250,250,250,0.06);
}

.detail-tactic-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.detail-tactic-chevron {
  display: inline-block;
  width: 12px;
  transition: transform var(--transition);
  color: var(--text-muted);
  flex-shrink: 0;
}

.detail-tactic-toggle.expanded .detail-tactic-chevron {
  transform: rotate(90deg);
}

.detail-technique-list {
  list-style: none;
  margin: 4px 0 10px;
  padding: 0;
}

.detail-technique-link {
  display: block;
  padding: 8px 10px 8px 22px;
  border-radius: 8px;
  color: rgba(250,250,250,0.85);
  font-size: 0.88rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.detail-technique-link:hover {
  background: rgba(250,250,250,0.05);
  color: var(--text);
  text-decoration: none;
}

.detail-technique-link.active {
  background: rgba(55,201,128,0.14);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}

.detail-main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  max-width: none;
  margin: 0;
}

.detail-page-wrap {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.detail-mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.detail-toggle-nav {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
}

.detail-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 18px;
}

.detail-breadcrumbs a {
  color: var(--text-muted);
}

.detail-headline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}

.detail-hero,
.detail-meta,
.detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.detail-hero {
  padding: 24px;
}

.detail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(55,201,128,0.35);
  background: rgba(55,201,128,0.08);
  color: #D0FFEF;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.detail-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.08;
  color: var(--text);
}

.detail-hero-desc {
  margin: 0;
  color: rgba(250,250,250,0.82);
  font-size: 1rem;
  line-height: 1.75;
  max-width: none;
}

.detail-meta {
  padding: 18px;
  position: sticky;
  top: 24px;
}

.detail-meta-row {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.detail-meta-row:first-of-type {
  border-top: 0;
  padding-top: 4px;
}

.detail-meta-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.detail-meta-value {
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.detail-panel {
  padding: 22px;
}

.detail-panel h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  color: var(--text);
}

.detail-panel p,
.detail-panel li {
  color: rgba(250,250,250,0.84);
  line-height: 1.75;
  font-size: 0.95rem;
}

.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(250,250,250,0.04);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text);
}

.detail-example-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.detail-example-box pre {
  margin: 0;
  padding: 0px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.7;
  overflow: auto;
  font-family: 'Roboto Mono', monospace;
}

.detail-list-clean {
  margin: 0;
  padding-left: 18px;
}

.detail-empty {
  color: var(--text-muted);
  font-style: italic;
}

.detail-tactic-inline-link {
  color: var(--text);
  text-decoration: none;
}

.detail-tactic-inline-link:hover {
  text-decoration: none;
}

.detail-tactic-inline-link.active {
  color: var(--text);
}

.detail-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.detail-table th,
.detail-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.detail-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
}

.detail-table td {
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(250,250,250,0.84);
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.detail-table-name {
  white-space: nowrap;
}

.detail-table-empty {
  color: var(--text-muted);
  font-style: italic;
}

.detail-tactic-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-tactic-row .detail-tactic-toggle {
  width: 36px;
  min-width: 36px;
  padding: 10px 8px;
  justify-content: center;
}

.detail-tactic-row .detail-tactic-inline-link {
  flex: 1;
  display: block;
  padding: 10px 10px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.detail-tactic-row .detail-tactic-inline-link:hover {
  background: rgba(250,250,250,0.05);
  text-decoration: none;
}

.detail-tactic-row .detail-tactic-inline-link.active {
  background: rgba(250,250,250,0.06);
}

.detail-accordion-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 14px;
}

.detail-accordion-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-accordion-toggle:hover {
  background: rgba(250,250,250,0.04);
}

.detail-accordion-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.detail-accordion-toggle.expanded .detail-tactic-chevron {
  transform: rotate(90deg);
}

.detail-accordion-panel {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.unknown-technique-flash {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;

  max-width: 420px;
  width: calc(100% - 32px);

  padding: 14px 44px 14px 16px;
  border: 1px solid rgba(224, 92, 92, 0.35);
  border-radius: 12px;
  background: #1f1416;
  color: var(--text-main);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.unknown-technique-flash strong {
  display: block;
  margin-bottom: 4px;
}

.unknown-technique-flash span {
  color: var(--text-muted);
}

.unknown-technique-flash button {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}

.unknown-technique-flash {
  animation: flash-slide-in 220ms ease-out;
}

.prompt-highlight {
  background: rgba(55, 201, 128, 0.28);
  color: #FAFAFA;
  border-radius: 3px;
  padding: 0 2px;
}

#detail-example-prompts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-prompt-example {
  border-top: 1px solid var(--border);
  padding: 14px;
}

.detail-prompt-example:first-child {
  border-top: 0;
}

.detail-prompt-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.detail-prompt-example pre {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.7;
  overflow: auto;
  font-family: 'Roboto Mono', monospace;
}

.detail-prompt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.detail-prompt-label {
  margin-bottom: 0;
}

.detail-prompt-copy {
  border: 1px solid var(--border);
  background: rgba(250,250,250,0.04);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 0.74rem;
  cursor: pointer;
}

.detail-prompt-copy:hover {
  color: var(--accent);
  border-color: rgba(55,201,128,0.45);
}

.detail-prompt-note {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-style: italic;
}

#detail-example-prompts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-prompt-box {
  background: var(--bg);
}

.detail-prompt-example {
  border-top: 0;
}

.detail-prompt-box .detail-prompt-example + .detail-prompt-example {
  border-top: 1px solid var(--border);
}

.detail-prompt-group-label {
  padding: 10px 14px;
  background: rgba(250,250,250,0.03); 
  border-bottom: 1px solid var(--border);

  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;

  border-top-left-radius: 12px;
  border-top-right-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

}

.detail-tactic-block {
  margin-bottom: 4px;
}

.detail-tactic-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-tactic-row .detail-tactic-toggle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

.detail-tactic-toggle {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.detail-tactic-chevron {
  width: 12px;
  color: rgba(250, 250, 250, 0.58);
  transform: none !important;
  transition: color var(--transition);
}

.detail-tactic-toggle.expanded .detail-tactic-chevron {
  transform: none !important;
  color: var(--accent);
}

.detail-tactic-row .detail-tactic-inline-link {
  flex: 1;
  display: block;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.detail-tactic-row .detail-tactic-inline-link:hover {
  background: rgba(250, 250, 250, 0.05);
  color: var(--text);
  text-decoration: none;
}

.detail-tactic-row .detail-tactic-inline-link.active {
  background: rgba(250, 250, 250, 0.06);
  color: var(--text);
  box-shadow: none;
}

.detail-technique-list {
  list-style: none;
  margin: 4px 0 12px 48px;
  padding: 0;
}

.detail-technique-link {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: rgba(250, 250, 250, 0.82);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.detail-technique-link:hover {
  background: rgba(55, 201, 128, 0.08);
  color: var(--text);
  text-decoration: none;
}

.detail-technique-link.active {
  background: rgba(55, 201, 128, 0.16);
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--text);
}

/* ============================================================
   Contribute Page
   ============================================================ */
.contribute-page {
  max-width: 1200px;
}

.contribute-intro {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.contribute-intro p {
  color: rgba(250,250,250,0.84);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 16px;
}

.contribute-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.contribute-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.contribute-button:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}

.contribute-panel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.contribute-panel {
  display: flex;
  flex-direction: column;
}

.contribute-panel h2 {
  color: var(--accent);
}

.contribute-panel p + p {
  margin-top: 12px;
}

.form-section {
  position: relative;
  padding: 32px 0 8px;

  background:
    radial-gradient(
      ellipse at center top,
      rgba(89, 178, 255, 0.22) 0%,
      rgba(19, 133, 240, 0.14) 40%,
      rgba(19, 133, 240, 0.06) 70%,
      transparent 100%
    );
}

.form-intro {
  max-width: 720px;
  margin: 0 auto 24px;
  color: rgba(250,250,250,0.72);
  text-align: center;
  line-height: 1.7;
}

.form-frame-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.ape-form-frame {
  display: block;
  width: 100%;
  height: 1100px;
  border: 0;
  border-radius: 12px;
  background: rgba(55,201,128,0),
}

@media (max-width: 640px) {
  .form-frame-shell {
    padding: 10px;
    border-radius: 16px;
  }

  .ape-form-frame {
    height: 1200px;
  }
}

/* ============================================================
   About Page
   ============================================================ */
.about-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.about-panel {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes flash-slide-in {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */
@media (max-width: 1024px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    position: static;
  }
  header > .nav-logo  { order: 1; grid-row: unset; grid-column: unset; align-self: unset; }
  .header-center      { order: 2; width: 100%; gap: 12px; align-items: center; }
  .header-actions     { order: 3; width: 100%; flex-direction: row; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; }
  header > #main-nav  { order: 4; width: 100%; justify-content: center; grid-row: unset; grid-column: unset; }
  .header-btn { font-size: 0.82rem; padding: 10px 16px; min-height: 44px; text-align: center; justify-content: center; }
}

@media (max-width: 900px) {
  .matrix-scroll {
    overflow-x: visible;
  }

  #content {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .category {
    width: 100%;
  }
  
  #site-title {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  }

  .nav-link {
    font-size: 0.72rem;
    padding: 5px 8px;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  #industry-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 499px) {
  #industry-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  #objectives-content { grid-template-columns: 1fr; }
}

@media (min-width: 500px) and (max-width: 1199px) {
  #objectives-content { max-width: 460px; }
}

@media (max-width: 640px) {
  header > .nav-logo  { height: clamp(18px, 4vw, 22px); }
  #controls { padding: 10px 16px; }
  #graph-controls { padding: 10px 16px; }
  #graph-results-panel { padding: 6px 16px 12px; }
  main { padding: 16px; }
  .card-header { padding: 12px 14px; }
  .category { min-width: 220px; }
  .category-header { height: auto; min-height: 48px; }
  #modal-overlay { padding: 12px; }
  #modal { max-height: 92vh; }
  #modal-body { padding: 14px 14px; }
  #modal-title { font-size: 1.1rem; }
  #modal-detail { font-size: 0.85rem; }
  .modal-examples-list li { font-size: 0.85rem; }
  .modal-examples-label { font-size: 0.8rem; }
  .modal-example-code code { font-size: 0.85rem; }
  
  .node-label-tactic { font-size: 10px; }
  #site-title { font-size: 1.1rem; }
  .section-label { font-size: 1.75rem; }
  .category-name, .industry-name { font-size: 1rem; }
}

@media (max-width: 400px) {
  .header-btn { font-size: 0.75rem; padding: 7px 10px; }
  .nav-link { padding: 6px 12px; }
}

@media (min-width: 1025px) {
  main { padding: 32px 24px; }
}

@media (max-width: 1100px) {
  .detail-headline {
    grid-template-columns: 1fr;
  }

  .detail-meta {
    position: static;
  }
}

@media (max-width: 920px) {
  .detail-app {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(92vw, 360px);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 300;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
  }

  .detail-sidebar.open {
    transform: translateX(0);
  }

  .detail-mobile-topbar {
    display: flex;
  }
}

@media (max-width: 640px) {
  .detail-main {
    padding: 16px;
  }

  .detail-hero,
  .detail-meta,
  .detail-panel {
    padding: 16px;
  }

  .detail-hero h1 {
    font-size: 1.5rem;
  }
}

@media (min-width: 900px) and (max-height: 1000px) {
  #graph-controls {
    padding: 10px 24px 12px;
    gap: 8px;
  }

  #graph-controls .search-wrap {
    max-width: 960px;
  }

  .graph-action-buttons {
    gap: 8px;
  }

  #graph-reset-btn,
  #graph-expand-all-btn {
    padding: 7px 12px;
  }

  .graph-page #graph-main {
    height: calc(100vh - 235px);
  }
}

@media (min-width: 900px) and (max-height: 820px) {
  #graph-controls {
    padding: 8px 24px 10px;
    gap: 7px;
  }

  .graph-page #graph-main {
    height: calc(100vh - 215px);
  }
}

@media (max-width: 900px) {
  #content.objectives-matrix {
    grid-template-columns: 1fr;
  }

  .objective-category {
    width: 100%;
    min-width: 0;
  }

  .matrix-scroll .objective-category .category-header {
    height: auto;
    min-height: 72px;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .contribute-panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .about-panel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .matrix-scroll,
  .matrix-scroll-wrap,
  #content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #content {
    grid-template-columns: minmax(0, 1fr);
  }

  .category,
  .card,
  .card-header {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  main {
    padding: 16px;
  }

  .category {
    min-width: 0; 
    width: 100%;
  }

  .nav-link {
    padding: 6px 10px;
  }

  header > #main-nav {
    flex-wrap: wrap;
  }
}

@media (min-width: 500px) and (max-width: 900px) {
  #tactics-section .matrix-scroll {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    overflow-x: visible;
  }

  #tactics-section #content {
    grid-template-columns: 1fr;
    width: 100%;
  }

  #tactics-section .category {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 1200px) {
  #content.objectives-matrix {
    grid-template-columns: 1fr;
    max-width: 680px;
    gap: 26px;
  }
}

@media (max-width: 640px) {
  #content.objectives-matrix {
    min-width: 0;
  }

  .objective-heading-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 1.25rem;
  }

  .integrity-domain {
    padding: 16px 14px 12px 16px;
  }
}

/* ============================================================
   Footer & Floating Actions
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background var(--transition), color var(--transition);
  box-shadow: var(--shadow-card);
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  background: var(--accent);
  color: var(--bg);
}

.site-footer {
  text-align: center;
  padding: 20px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;

}

/* ============================================================
   Miscellaneous
   ============================================================ */
a { color: var(--accent); text-decoration: none; }


.detail-modal[hidden] {
  display: none;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.detail-modal-content {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 32px));
  background: #111;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 24px;
}

.detail-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  cursor: pointer;
}
