#itkb-framework-explorer-root, #itkb-framework-explorer-root *, #itkb-framework-explorer-root *::before, #itkb-framework-explorer-root *::after { box-sizing: border-box; }

#itkb-framework-explorer-root {
  --bg:         #0a0e17;
  --surface:    #151d2e;
  --surface2:   #1c2840;
  --surface3:   #212f47;
  --border:     #1e2d45;
  --border2:    #263550;
  --primary:    #3b82f6;
  --primary-dim: rgba(59,130,246,.12);
  --cyan:       #06b6d4;
  --cyan-dim:   rgba(6,182,212,.12);
  --green:      #10b981;
  --amber:      #f59e0b;
  --text:       #e2e8f0;
  --text2:      #94a3b8;
  --text3:      #64748b;
  --warn-bg:    #1a1200;
  --warn-border:#7c5b00;
  --warn-text:  #fbbf24;
}

#itkb-framework-explorer-root {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
#itkb-framework-explorer-root .header {
  padding: 28px 28px 22px;
  border-bottom: 1px solid var(--border);
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
#itkb-framework-explorer-root .header-left {}
#itkb-framework-explorer-root .header-eyebrow {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
#itkb-framework-explorer-root .header h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
#itkb-framework-explorer-root .header h1 span { color: var(--primary); }
#itkb-framework-explorer-root .header-sub {
  color: var(--text3);
  font-size: 12.5px;
  margin-top: 5px;
  max-width: 560px;
}
#itkb-framework-explorer-root .mode-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  margin-top: 4px;
}
#itkb-framework-explorer-root .mode-label {
  font-size: 11px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--text3);
  margin-right: 2px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
#itkb-framework-explorer-root .mode-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text3);
  font-size: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 6px 14px;
  cursor: pointer;
  transition: all .15s;
}
#itkb-framework-explorer-root .mode-btn:hover { border-color: var(--primary); color: var(--text); }
#itkb-framework-explorer-root .mode-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ── Caveat ── */
#itkb-framework-explorer-root .caveat {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  padding: 9px 28px;
  font-size: 11.5px;
  color: var(--warn-text);
  display: flex;
  gap: 9px;
  align-items: flex-start;
  max-width: 100%;
}
#itkb-framework-explorer-root .caveat-inner { max-width: 1280px; margin: 0 auto; display: flex; gap: 9px; width: 100%; }
#itkb-framework-explorer-root .caveat a { color: var(--warn-text); opacity: .8; }

/* ── Instruction strip ── */
#itkb-framework-explorer-root .instruction {
  max-width: 1280px;
  margin: 18px auto 0;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text3);
}
#itkb-framework-explorer-root .instruction-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--primary);
}

/* ── Workspace ── */
#itkb-framework-explorer-root .workspace {
  max-width: 1280px;
  margin: 16px auto 0;
  padding: 0 28px 40px;
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 0;
  align-items: start;
}

/* ── Column header ── */
#itkb-framework-explorer-root .col-wrap {}
#itkb-framework-explorer-root .col-header {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#itkb-framework-explorer-root .col-badge {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: .08em;
  flex-shrink: 0;
}
#itkb-framework-explorer-root .badge-cobit { background: var(--primary-dim); color: var(--primary); border: 1px solid rgba(59,130,246,.3); }
#itkb-framework-explorer-root .badge-nist { background: var(--cyan-dim);    color: var(--cyan);    border: 1px solid rgba(6,182,212,.3); }
#itkb-framework-explorer-root .col-title { font-size: 13px; font-weight: 600; }
#itkb-framework-explorer-root .col-subtitle { font-size: 11px; color: var(--text3); margin-left: auto; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

/* ── Cards panel ── */
#itkb-framework-explorer-root .cards-panel {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

/* ── Framework card ── */
#itkb-framework-explorer-root .fw-card {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
#itkb-framework-explorer-root .fw-card:last-child { border-bottom: none; }
#itkb-framework-explorer-root .fw-card:hover .card-inner { background: var(--surface2); }

#itkb-framework-explorer-root .fw-card.sel-cobit { border-left: 3px solid var(--primary); }
#itkb-framework-explorer-root .fw-card.sel-cobit .card-inner { background: rgba(59,130,246,.08); }
#itkb-framework-explorer-root .fw-card.sel-nist { border-right: 3px solid var(--cyan); }
#itkb-framework-explorer-root .fw-card.sel-nist  .card-inner { background: rgba(6,182,212,.08); }
#itkb-framework-explorer-root .fw-card.lit .card-inner { background: rgba(255,255,255,.03); }
#itkb-framework-explorer-root .fw-card.dim { opacity: .28; }

#itkb-framework-explorer-root .card-inner { padding: 0; transition: background .12s; }

/* Card header row */
#itkb-framework-explorer-root .card-head {
  padding: 13px 16px 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
#itkb-framework-explorer-root .card-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
#itkb-framework-explorer-root .card-head-text { flex: 1; min-width: 0; }
#itkb-framework-explorer-root .card-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  margin-bottom: 3px;
}
#itkb-framework-explorer-root .card-code.cc { color: var(--primary); }
#itkb-framework-explorer-root .card-code.nc { color: var(--cyan); }
#itkb-framework-explorer-root .card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}
#itkb-framework-explorer-root .card-plain {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.5;
}
/* Owner tag */
#itkb-framework-explorer-root .card-owner {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  flex-shrink: 0;
  margin-top: 2px;
  white-space: nowrap;
}
#itkb-framework-explorer-root .owner-board { background: rgba(245,158,11,.1);  color: var(--amber); border: 1px solid rgba(245,158,11,.25); }
#itkb-framework-explorer-root .owner-mgmt { background: rgba(59,130,246,.1);  color: var(--primary); border: 1px solid rgba(59,130,246,.25); }
#itkb-framework-explorer-root .owner-ops { background: rgba(16,185,129,.1);  color: var(--green); border: 1px solid rgba(16,185,129,.25); }

/* Expand area */
#itkb-framework-explorer-root .card-expand {
  display: none;
  padding: 0 16px 14px 48px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
#itkb-framework-explorer-root .card-expand.open { display: block; }

#itkb-framework-explorer-root .expand-section { margin-top: 12px; }
#itkb-framework-explorer-root .expand-label {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 6px;
}
#itkb-framework-explorer-root .expand-q {
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.55;
  font-style: italic;
}
#itkb-framework-explorer-root .expand-example {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
  padding: 8px 12px;
  background: var(--surface3);
  border-left: 2px solid var(--border2);
  border-radius: 0 4px 4px 0;
  margin-top: 6px;
}
#itkb-framework-explorer-root .expand-example strong { color: var(--text2); font-weight: 500; }

#itkb-framework-explorer-root .obj-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
#itkb-framework-explorer-root .obj-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 11.5px;
}
#itkb-framework-explorer-root .obj-code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--primary);
  flex-shrink: 0;
  padding-top: 1px;
}
#itkb-framework-explorer-root .obj-code.nc { color: var(--cyan); }
#itkb-framework-explorer-root .obj-name { color: var(--text2); line-height: 1.4; }
#itkb-framework-explorer-root .obj-plain { color: var(--text3); font-size: 11px; }

#itkb-framework-explorer-root .card-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text3);
  padding: 6px 16px 10px 48px;
  user-select: none;
}
#itkb-framework-explorer-root .toggle-arrow { font-size: 9px; transition: transform .2s; display: inline-block; }
#itkb-framework-explorer-root .fw-card.expanded .toggle-arrow { transform: rotate(180deg); }

/* ── SVG connector ── */
#itkb-framework-explorer-root .connector-col {
  position: relative;
  align-self: stretch;
}
#itkb-framework-explorer-root #connector-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* ── Detail panel ── */
#itkb-framework-explorer-root .detail-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 32px;
  display: none;
}
#itkb-framework-explorer-root .detail-panel.visible { display: block; }
#itkb-framework-explorer-root .detail-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
#itkb-framework-explorer-root .detail-top {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#itkb-framework-explorer-root .detail-top-label {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .1em;
}
#itkb-framework-explorer-root .detail-close {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text3);
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
}
#itkb-framework-explorer-root .detail-close:hover { border-color: var(--primary); color: var(--text); }
#itkb-framework-explorer-root .detail-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 20px;
}
#itkb-framework-explorer-root .detail-col {}
#itkb-framework-explorer-root .detail-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
#itkb-framework-explorer-root .detail-col-head h3 { font-size: 13px; font-weight: 600; }
#itkb-framework-explorer-root .detail-col p { font-size: 12.5px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; }
#itkb-framework-explorer-root .detail-col p:last-child { margin-bottom: 0; }
#itkb-framework-explorer-root .detail-col p strong { color: var(--text); font-weight: 500; }
#itkb-framework-explorer-root .detail-divider { background: var(--border); }
#itkb-framework-explorer-root .detail-note {
  margin: 0 20px 20px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.6;
}
#itkb-framework-explorer-root .detail-note strong { color: var(--text2); }

/* ── Selector mode ── */
#itkb-framework-explorer-root .selector-wrap {
  max-width: 780px;
  margin: 20px auto 40px;
  padding: 0 28px;
  display: none;
}
#itkb-framework-explorer-root .selector-wrap.visible { display: block; }

#itkb-framework-explorer-root .q-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: opacity .2s;
}
#itkb-framework-explorer-root .q-block.locked { opacity: .35; pointer-events: none; }
#itkb-framework-explorer-root .q-step {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 5px;
}
#itkb-framework-explorer-root .q-text { font-size: 14px; font-weight: 500; margin-bottom: 14px; }
#itkb-framework-explorer-root .q-opts { display: flex; flex-direction: column; gap: 7px; }
#itkb-framework-explorer-root .q-opt {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: all .15s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
#itkb-framework-explorer-root .q-opt:hover { border-color: var(--primary); color: var(--text); }
#itkb-framework-explorer-root .q-opt.selected { background: var(--primary-dim); border-color: var(--primary); color: var(--text); }
#itkb-framework-explorer-root .q-key { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 10px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }

#itkb-framework-explorer-root .sel-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  display: none;
}
#itkb-framework-explorer-root .sel-result.visible { display: block; }
#itkb-framework-explorer-root .result-eyebrow {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
#itkb-framework-explorer-root .result-rec { font-size: 16px; font-weight: 600; margin-bottom: 16px; line-height: 1.4; }
#itkb-framework-explorer-root .result-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
#itkb-framework-explorer-root .r-step { display: flex; gap: 12px; font-size: 13px; color: var(--text2); }
#itkb-framework-explorer-root .r-n {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 10px;
  color: var(--primary);
  background: var(--primary-dim);
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 3px;
  padding: 2px 7px;
  flex-shrink: 0;
  margin-top: 1px;
  height: fit-content;
}
#itkb-framework-explorer-root .result-caveat {
  font-size: 11.5px;
  color: var(--text3);
  padding-top: 14px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}
#itkb-framework-explorer-root .reset-btn {
  margin-top: 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text3);
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
}
#itkb-framework-explorer-root .reset-btn:hover { border-color: var(--primary); color: var(--text); }


/* ── Framework overview / learn-more panel ── */
#itkb-framework-explorer-root .framework-overview-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 5px;
  color: var(--text2);
  font-size: 11px;
  padding: 5px 9px;
  cursor: pointer;
  white-space: nowrap;
}
#itkb-framework-explorer-root .framework-overview-btn:hover, #itkb-framework-explorer-root .framework-overview-btn:focus-visible {
  border-color: var(--primary);
  color: var(--text);
  outline: none;
}
#itkb-framework-explorer-root .learn-panel {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px 32px;
  display: none;
}
#itkb-framework-explorer-root .learn-panel.visible { display: block; }
#itkb-framework-explorer-root .learn-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
#itkb-framework-explorer-root .learn-top {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
#itkb-framework-explorer-root .learn-title {
  font-size: 15px;
  font-weight: 600;
}
#itkb-framework-explorer-root .learn-close {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text3);
  padding: 4px 10px;
  cursor: pointer;
}
#itkb-framework-explorer-root .learn-close:hover, #itkb-framework-explorer-root .learn-close:focus-visible {
  border-color: var(--primary);
  color: var(--text);
  outline: none;
}
#itkb-framework-explorer-root .learn-body {
  padding: 20px;
}
#itkb-framework-explorer-root .learn-summary {
  color: var(--text2);
  margin-bottom: 16px;
  max-width: 920px;
}
#itkb-framework-explorer-root .learn-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
#itkb-framework-explorer-root .learn-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 15px;
}
#itkb-framework-explorer-root .learn-section h3 {
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text);
}
#itkb-framework-explorer-root .learn-section p, #itkb-framework-explorer-root .learn-section li {
  color: var(--text2);
  font-size: 12.5px;
  line-height: 1.6;
}
#itkb-framework-explorer-root .learn-section ul {
  margin: 0;
  padding-left: 18px;
}
#itkb-framework-explorer-root .reference-list {
  display: grid;
  gap: 8px;
}
#itkb-framework-explorer-root .reference-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 11px;
  color: var(--text2);
  text-decoration: none;
  background: var(--surface3);
}
#itkb-framework-explorer-root .reference-link:hover, #itkb-framework-explorer-root .reference-link:focus-visible {
  border-color: var(--primary);
  color: var(--text);
  outline: none;
}
#itkb-framework-explorer-root .reference-type {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: var(--text3);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 2px;
}
#itkb-framework-explorer-root .learn-disclaimer {
  margin-top: 14px;
  padding: 11px 13px;
  border-left: 3px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 11.5px;
  line-height: 1.55;
}
@media (max-width: 820px) {
  #itkb-framework-explorer-root .learn-grid { grid-template-columns: 1fr; }
  #itkb-framework-explorer-root .framework-overview-btn { width: 100%; margin-left: 0; }
  #itkb-framework-explorer-root .col-header { flex-wrap: wrap; }
}

/* ── Footer ── */
#itkb-framework-explorer-root .footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px 32px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text3);
  align-items: center;
}
#itkb-framework-explorer-root .footer a { color: var(--text3); text-decoration: none; }
#itkb-framework-explorer-root .footer a:hover { color: var(--primary); }
#itkb-framework-explorer-root .footer-sep { color: var(--border2); }

@media (max-width: 820px) {
  #itkb-framework-explorer-root .workspace { grid-template-columns: 1fr; }
  #itkb-framework-explorer-root .connector-col { display: none; }
  #itkb-framework-explorer-root .detail-body { grid-template-columns: 1fr; }
  #itkb-framework-explorer-root .detail-divider { display: none; height: 1px; width: 100%; }
  #itkb-framework-explorer-root .header { flex-direction: column; gap: 12px; }
}


/* =========================================================
   Layout refinement — WordPress page integration
   ========================================================= */

#itkb-framework-explorer-root {
  width: 100%;
  max-width: none;
  overflow-x: clip;
}

#itkb-framework-explorer-root .header, #itkb-framework-explorer-root .instruction, #itkb-framework-explorer-root .workspace, #itkb-framework-explorer-root .detail-panel, #itkb-framework-explorer-root .learn-panel, #itkb-framework-explorer-root .footer {
  width: 100%;
  max-width: 1280px;
}

#itkb-framework-explorer-root .header {
  padding-top: 30px;
  padding-bottom: 24px;
}

#itkb-framework-explorer-root .header-left {
  min-width: 0;
  flex: 1 1 560px;
}

#itkb-framework-explorer-root .header h1 {
  line-height: 1.25;
}

#itkb-framework-explorer-root .mode-bar {
  align-self: center;
}

/* Give the connector real breathing room */
#itkb-framework-explorer-root .workspace {
  grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
  column-gap: 0;
}

/* Column header becomes a predictable grid instead of a crowded flex row */
#itkb-framework-explorer-root .col-header, #itkb-framework-explorer-root .col-header[style] {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "badge title action"
    "badge stats action";
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  min-height: 92px;
  padding: 16px 18px;
  flex-direction: initial !important;
}

#itkb-framework-explorer-root .col-header .col-badge {
  grid-area: badge;
  align-self: center;
}

#itkb-framework-explorer-root .col-header .col-title {
  grid-area: title;
  margin: 0 !important;
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
}

#itkb-framework-explorer-root .col-header .col-subtitle {
  grid-area: stats;
  margin: 0 !important;
  font-size: 10.5px;
  line-height: 1.35;
  white-space: normal;
}

#itkb-framework-explorer-root .col-header .framework-overview-btn {
  grid-area: action;
  align-self: center;
  margin: 0;
  min-width: 132px;
  text-align: center;
}

/* Prevent theme button rules from stretching or recoloring controls */
#itkb-framework-explorer-root button {
  width: auto;
  min-height: 0;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

/* Better internal card spacing */
#itkb-framework-explorer-root .card-head {
  gap: 14px;
  padding: 16px 18px 12px;
}

#itkb-framework-explorer-root .card-icon {
  width: 28px;
  text-align: center;
}

#itkb-framework-explorer-root .card-head-text {
  min-width: 0;
}

#itkb-framework-explorer-root .card-name {
  font-size: 14px;
}

#itkb-framework-explorer-root .card-plain {
  font-size: 12px;
}

#itkb-framework-explorer-root .card-owner {
  max-width: 126px;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
}

/* Keep mode selector compact and aligned */
#itkb-framework-explorer-root .mode-btn {
  min-width: 0;
  white-space: nowrap;
}

/* Tablet */
@media (max-width: 1050px) {
  #itkb-framework-explorer-root .workspace {
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
  }

  #itkb-framework-explorer-root .col-header, #itkb-framework-explorer-root .col-header[style] {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "badge title"
      "stats stats"
      "action action";
    min-height: 0;
  }

  #itkb-framework-explorer-root .col-header .framework-overview-btn {
    width: 100%;
    min-width: 0;
    margin-top: 8px;
  }

  #itkb-framework-explorer-root .card-head {
    flex-wrap: wrap;
  }

  #itkb-framework-explorer-root .card-owner {
    margin-left: 42px;
  }
}

/* Mobile */
@media (max-width: 820px) {
  #itkb-framework-explorer-root .header, #itkb-framework-explorer-root .instruction, #itkb-framework-explorer-root .workspace, #itkb-framework-explorer-root .detail-panel, #itkb-framework-explorer-root .learn-panel, #itkb-framework-explorer-root .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  #itkb-framework-explorer-root .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #itkb-framework-explorer-root .col-header, #itkb-framework-explorer-root .col-header[style] {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "badge title"
      "stats stats"
      "action action";
  }

  #itkb-framework-explorer-root .mode-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  #itkb-framework-explorer-root .mode-btn {
    flex: 1 1 auto;
  }

  #itkb-framework-explorer-root .card-owner {
    margin-left: 42px;
  }
}

@media (max-width: 520px) {
  #itkb-framework-explorer-root .header {
    padding-top: 22px;
  }

  #itkb-framework-explorer-root .header h1 {
    font-size: 18px;
  }

  #itkb-framework-explorer-root .col-header, #itkb-framework-explorer-root .col-header[style] {
    grid-template-columns: 1fr;
    grid-template-areas:
      "badge"
      "title"
      "stats"
      "action";
  }

  #itkb-framework-explorer-root .col-header .col-badge {
    justify-self: start;
  }

  #itkb-framework-explorer-root .card-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  #itkb-framework-explorer-root .card-owner {
    grid-column: 2;
    margin-left: 0;
    justify-self: start;
    max-width: 100%;
  }

  #itkb-framework-explorer-root .card-toggle, #itkb-framework-explorer-root .card-expand {
    padding-left: 18px;
  }
}


/* =========================================================
   Container-width fix for WordPress content columns
   ========================================================= */

#itkb-framework-explorer-root {
  container-type: inline-size;
  container-name: framework-explorer;
}

#itkb-framework-explorer-root .workspace,
#itkb-framework-explorer-root .workspace > *,
#itkb-framework-explorer-root .col-wrap,
#itkb-framework-explorer-root .cards-panel,
#itkb-framework-explorer-root .fw-card,
#itkb-framework-explorer-root .card-inner,
#itkb-framework-explorer-root .card-head,
#itkb-framework-explorer-root .card-head-text {
  min-width: 0;
}

#itkb-framework-explorer-root .workspace {
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
}

#itkb-framework-explorer-root .col-header,
#itkb-framework-explorer-root .col-header[style] {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "badge title"
    "stats stats"
    "action action";
  min-height: 0;
}

#itkb-framework-explorer-root .col-header .framework-overview-btn {
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}

#itkb-framework-explorer-root .col-title,
#itkb-framework-explorer-root .col-subtitle,
#itkb-framework-explorer-root .framework-overview-btn,
#itkb-framework-explorer-root .card-name,
#itkb-framework-explorer-root .card-plain {
  overflow-wrap: anywhere;
}

@container framework-explorer (max-width: 1050px) {
  #itkb-framework-explorer-root .workspace {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #itkb-framework-explorer-root .connector-col {
    display: none;
  }

  #itkb-framework-explorer-root .col-header,
  #itkb-framework-explorer-root .col-header[style] {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "badge title"
      "stats stats"
      "action action";
  }

  #itkb-framework-explorer-root .card-head {
    flex-wrap: wrap;
  }

  #itkb-framework-explorer-root .card-owner {
    margin-left: 42px;
  }
}

@container framework-explorer (max-width: 620px) {
  #itkb-framework-explorer-root .header,
  #itkb-framework-explorer-root .instruction,
  #itkb-framework-explorer-root .workspace,
  #itkb-framework-explorer-root .detail-panel,
  #itkb-framework-explorer-root .learn-panel,
  #itkb-framework-explorer-root .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  #itkb-framework-explorer-root .mode-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  #itkb-framework-explorer-root .mode-btn {
    flex: 1 1 auto;
  }

  #itkb-framework-explorer-root .col-header,
  #itkb-framework-explorer-root .col-header[style] {
    grid-template-columns: 1fr;
    grid-template-areas:
      "badge"
      "title"
      "stats"
      "action";
  }

  #itkb-framework-explorer-root .col-header .col-badge {
    justify-self: start;
  }

  #itkb-framework-explorer-root .card-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
  }

  #itkb-framework-explorer-root .card-owner {
    grid-column: 2;
    margin-left: 0;
    justify-self: start;
    max-width: 100%;
  }

  #itkb-framework-explorer-root .card-toggle,
  #itkb-framework-explorer-root .card-expand {
    padding-left: 18px;
  }
}
