/* CBT Engine page-only enhancements (theme keeps primary styling in style.css) */

.apt-cbt-tags{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px;}
.apt-cbt-tag{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: rgba(241,245,249,.88);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.apt-cbt-two{display:grid; grid-template-columns: 1fr 1fr; gap:12px;}
@media (max-width: 820px){.apt-cbt-two{grid-template-columns:1fr;}}

.apt-cbt-micro{font-size:12px; color: rgba(154,164,178,.92); line-height:1.55; font-family:'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;}

/* Progress dashboard */
.apt-cbt-metrics{display:grid; grid-template-columns: repeat(4, 1fr); gap:12px; margin-top:14px;}
@media (max-width: 980px){.apt-cbt-metrics{grid-template-columns: repeat(2, 1fr);}}
@media (max-width: 520px){.apt-cbt-metrics{grid-template-columns: 1fr;}}

.apt-cbt-metric{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 14px 14px 12px;
}
.apt-cbt-metric .label{
  font-family:'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(154,164,178,.92);
}
.apt-cbt-metric .value{font-size: 28px; font-weight: 700; margin-top: 10px; letter-spacing: -.01em;}
.apt-cbt-metric .sub{margin-top: 6px; font-size: 12px; color: rgba(154,164,178,.92);}

.apt-cbt-charts{display:grid; grid-template-columns: 1fr 1fr; gap:12px; margin-top:12px;}
@media (max-width: 980px){.apt-cbt-charts{grid-template-columns: 1fr;}}

.apt-cbt-chart{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 16px;
}

.apt-cbt-spark{width:100%; height:110px; margin-top: 10px; display:block;}
.apt-cbt-spark .gridline{stroke: rgba(255,255,255,.06); stroke-width: 1;}
.apt-cbt-spark .line-start{stroke: rgba(154,164,178,.85); fill:none; stroke-width: 2; stroke-dasharray: 4 4;}
.apt-cbt-spark .line-end{stroke: rgba(47,107,255,.92); fill:none; stroke-width: 2;}
.apt-cbt-spark .dot-end{fill: rgba(47,107,255,.95);}

.apt-cbt-legend{display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-top: 10px;}
.apt-cbt-legend span{display:inline-flex; align-items:center; gap:8px; font-size:12px; color: rgba(154,164,178,.92); font-family:'IBM Plex Mono', monospace;}
.apt-cbt-swatch{width:16px; height:2px; border-radius: 2px; display:inline-block; background: rgba(154,164,178,.85);}
.apt-cbt-swatch.end{background: rgba(47,107,255,.92);}

/* Insight block (end of session) */
.apt-cbt-insight{padding:18px;}
.apt-cbt-insight-head{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.apt-cbt-insight-title{font-size:20px; font-weight:800; letter-spacing:-.01em; margin-top:10px; color: rgba(241,245,249,.92);}

.apt-cbt-highlight{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 14px;
}
.apt-cbt-highlight-text{
  margin-top: 10px;
  color: rgba(241,245,249,.86);
  line-height: 1.6;
  font-size: 13px;
  font-family:'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.apt-cbt-cta-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
@media (max-width: 980px){
  .apt-cbt-cta-grid{grid-template-columns: 1fr;}
}

.apt-cbt-cta{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 14px;
}
.apt-cbt-cta-title{font-weight:800; letter-spacing:-.01em; margin-top:10px; color: rgba(241,245,249,.92);}

/* Details accordion */
.apt-cbt-details{
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(9,12,18,.35);
  overflow:hidden;
}
.apt-cbt-details summary{
  cursor:pointer;
  padding: 12px 14px;
  color: rgba(154,164,178,.92);
  font-family:'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  list-style:none;
}
.apt-cbt-details summary::-webkit-details-marker{display:none;}
.apt-cbt-details[open] summary{border-bottom:1px solid rgba(255,255,255,.08);}
.apt-cbt-details .output{
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}


/* V1.7.1 — Saved CBT sessions readability and responsive table repair */
body.apt-original-core-tool-active #apt-history > div[style*="overflow"]{
  margin-top:18px;
  overflow-x:auto!important;
  border:1px solid #d7e3ef;
  border-radius:18px;
  background:#fff;
  box-shadow:0 14px 36px rgba(28,73,116,.08);
  -webkit-overflow-scrolling:touch;
}
body.apt-original-core-tool-active #apt-history table.widefat{
  width:100%;
  min-width:720px;
  margin:0;
  border:0!important;
  border-collapse:separate;
  border-spacing:0;
  background:#fff!important;
  color:#173b60!important;
  font-size:15px;
  line-height:1.5;
}
body.apt-original-core-tool-active #apt-history table.widefat thead th{
  padding:14px 16px;
  border:0;
  border-bottom:1px solid #cddcea;
  background:#edf5fc!important;
  color:#173b60!important;
  font-size:12px;
  font-weight:850;
  letter-spacing:.08em;
  line-height:1.35;
  text-transform:uppercase;
  white-space:nowrap;
}
body.apt-original-core-tool-active #apt-history table.widefat tbody td{
  padding:15px 16px;
  border:0;
  border-bottom:1px solid #e2ebf3;
  background:#fff!important;
  color:#284f73!important;
  vertical-align:top;
}
body.apt-original-core-tool-active #apt-history table.widefat tbody tr:nth-child(even) td{
  background:#f7faff!important;
}
body.apt-original-core-tool-active #apt-history table.widefat tbody tr:last-child td{
  border-bottom:0;
}
body.apt-original-core-tool-active #apt-history table.widefat tbody tr:hover td{
  background:#eef7ff!important;
}
body.apt-original-core-tool-active #apt-history table.widefat th:first-child,
body.apt-original-core-tool-active #apt-history table.widefat td:first-child{
  width:190px;
}
body.apt-original-core-tool-active #apt-history table.widefat th:nth-child(2),
body.apt-original-core-tool-active #apt-history table.widefat td:nth-child(2){
  width:130px;
}
body.apt-original-core-tool-active #apt-history table.widefat th:nth-child(3),
body.apt-original-core-tool-active #apt-history table.widefat td:nth-child(3){
  width:110px;
}
@media (max-width:760px){
  body.apt-original-core-tool-active #apt-history{
    padding:22px 18px!important;
  }
  body.apt-original-core-tool-active #apt-history > div[style*="overflow"]{
    margin-right:-2px;
    border-radius:14px;
  }
  body.apt-original-core-tool-active #apt-history table.widefat{
    min-width:680px;
    font-size:14px;
  }
  body.apt-original-core-tool-active #apt-history table.widefat thead th,
  body.apt-original-core-tool-active #apt-history table.widefat tbody td{
    padding:13px 14px;
  }
}
