/* CoreBridge University Intelligence — shared enhancement layer (enhance.css)
   Companion to enhance.js. Uses only canonical tokens already defined in each hub's styles.css
   (--accent, --ink, --ink-3, --paper-bright, --success, --danger, --chart-gold, --rule, radii,
   shadows). No new colour values are introduced here: the canonical is the sole authority and a
   hex code in this file would be a second source of truth.

   Motion respects prefers-reduced-motion and pauses when the tab is hidden, so a pulse never
   burns a laptop battery in a background tab. */

/* ---------------------------------------------------------------- pulse marks */
.cbx-pulse { display: inline-flex; width: 8px; height: 8px; position: relative; vertical-align: baseline; }
.cbx-pulse i {
  position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: .85;
}
.cbx-pulse i::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid currentColor; opacity: 0;
  animation: cbx-ping 2.4s cubic-bezier(0, 0, .2, 1) infinite;
}
.cbx-pulse--up    { color: var(--success); }
.cbx-pulse--down  { color: var(--danger); }
.cbx-pulse--flat  { color: var(--ink-3, #6B6557); }
.cbx-pulse--live  { color: var(--accent); }
@keyframes cbx-ping {
  0%   { transform: scale(.6); opacity: .75; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------------------------------------------------------------- pulsing sparkline */
.cbx-spark { display: block; margin-top: 6px; overflow: visible; }
.cbx-spark__now { animation: cbx-breathe 2.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.cbx-spark__peak   { fill: var(--success); opacity: .9; }
.cbx-spark__trough { fill: var(--danger);  opacity: .9; }
@keyframes cbx-breathe {
  0%, 100% { r: 2.4; opacity: 1; }
  50%      { r: 3.4; opacity: .55; }
}

/* ---------------------------------------------------------------- bullet row */
.cbx-bullet { margin-top: 9px; }
.cbx-bullet__track {
  position: relative; height: 9px; border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  overflow: visible;
}
.cbx-bullet__band {
  position: absolute; top: 0; bottom: 0; border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 17%, transparent);
}
.cbx-bullet__bar {
  position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 2px;
  background: var(--accent);
}
.cbx-bullet__bar.is-below { background: color-mix(in srgb, var(--ink) 42%, transparent); }
.cbx-bullet__mark {
  position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px;
  background: var(--ink); transform: translateX(-1px);
}
.cbx-bullet__legend {
  display: flex; gap: 7px; align-items: baseline; margin-top: 6px;
  font-size: 11.5px; color: var(--ink-3, #6B6557);
}
.cbx-bullet__legend b { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 12.5px; }

/* ---------------------------------------------------------------- distribution strip */
.cbx-dist { margin-top: 10px; }
.cbx-dist__axis {
  position: relative; height: 22px; border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.cbx-dist__t {
  position: absolute; top: 6px; height: 10px; width: 1px;
  background: color-mix(in srgb, var(--ink) 26%, transparent);
}
.cbx-dist__med {
  position: absolute; top: 2px; bottom: 2px; width: 1.5px;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
}
.cbx-dist__me {
  position: absolute; top: 0; bottom: 0; width: 3px; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}
.cbx-dist__legend {
  display: flex; justify-content: space-between; gap: 10px; margin-top: 6px;
  font-size: 11px; color: var(--ink-3, #6B6557); font-variant-numeric: tabular-nums;
}
.cbx-dist__legend b { color: var(--ink); font-weight: 600; text-align: center; }

/* ---------------------------------------------------------------- tick flash */
@keyframes cbx-flash-up   { from { background: color-mix(in srgb, var(--success) 26%, transparent); } to { background: transparent; } }
@keyframes cbx-flash-down { from { background: color-mix(in srgb, var(--danger)  26%, transparent); } to { background: transparent; } }
.cbx-flash-up   { animation: cbx-flash-up   .85s ease-out 1; }
.cbx-flash-down { animation: cbx-flash-down .85s ease-out 1; }

/* ---------------------------------------------------------------- story cards */
.cbx-stories {
  display: grid; gap: var(--gap, 16px); margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
}
.cbx-story {
  background: var(--paper-bright, #FEFCF7); border: 1px solid var(--rule, rgba(3,22,2,.10));
  border-radius: var(--r-card, 10px); padding: var(--pad-card, 17px 19px);
  box-shadow: var(--shadow-tile);
  border-left: 3px solid var(--accent);
}
.cbx-story--watch { border-left-color: var(--danger); }
.cbx-story--good  { border-left-color: var(--success); }
.cbx-story--note  { border-left-color: var(--chart-gold); }
.cbx-story__eyebrow {
  margin: 0 0 5px; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3, #6B6557); font-weight: 600;
}
.cbx-story__h { margin: 0 0 7px; font-size: 15px; line-height: 1.32; font-weight: 600; }
.cbx-story__b { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-2, var(--ink)); }
.cbx-story__b b { font-variant-numeric: tabular-nums; }
.cbx-story__src { margin: 9px 0 0; font-size: 10.5px; color: var(--ink-3, #6B6557); }

/* ---------------------------------------------------------------- global position band */
.cbx-gb__wrap { overflow-x: auto; margin-top: 14px; }
.cbx-gb__t { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.cbx-gb__t th, .cbx-gb__t td { padding: 9px 12px; text-align: left; vertical-align: top; }
.cbx-gb__t thead th {
  border-bottom: 1.5px solid var(--rule, rgba(3,22,2,.14)); font-weight: 600; font-size: 13px;
  line-height: 1.3;
}
.cbx-gb__t thead th.is-me { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cbx-gb__t tbody th {
  font-weight: 500; color: var(--ink-2, var(--ink)); width: 34%;
  border-bottom: 1px solid var(--rule, rgba(3,22,2,.08));
}
.cbx-gb__t tbody td {
  border-bottom: 1px solid var(--rule, rgba(3,22,2,.08)); font-variant-numeric: tabular-nums;
}
.cbx-gb__c.is-me { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.cbx-gb__v { display: block; font-size: 15px; font-weight: 600; }
.cbx-gb__y { display: block; font-size: 10.5px; color: var(--ink-3, #6B6557); margin-top: 1px; }
.cbx-gb__n { display: block; font-size: 10.5px; font-weight: 400; color: var(--ink-3, #6B6557); }
.cbx-gb__here {
  display: block; font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 2px;
}
.cbx-gb__note {
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3, #6B6557);
  border: 1px solid var(--rule, rgba(3,22,2,.14)); border-radius: 3px; padding: 0 4px; cursor: help;
}
.cbx-gb__demand {
  margin-top: 20px; padding: 16px 18px; border-radius: var(--r-card, 10px);
  background: color-mix(in srgb, var(--accent) 5%, var(--paper-bright, #FEFCF7));
  border: 1px solid var(--rule, rgba(3,22,2,.10));
}
.cbx-gb__demand h4 { margin: 0 0 6px; font-size: 14.5px; line-height: 1.34; font-weight: 600; }
.cbx-gb__demandnote { margin: 0 0 10px; font-size: 12.5px; color: var(--ink-2, var(--ink)); }
.cbx-gb__top { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.cbx-gb__top li {
  display: flex; justify-content: space-between; gap: 12px; font-size: 13px;
  padding: 5px 0; border-bottom: 1px solid var(--rule, rgba(3,22,2,.07));
}
.cbx-gb__top li span { font-variant-numeric: tabular-nums; color: var(--ink-2, var(--ink)); }
.cbx-gb__top li i { font-style: normal; color: var(--ink-3, #6B6557); font-size: 11px; }
.cbx-gb__basis { margin: 10px 0 0; font-size: 11px; line-height: 1.5; color: var(--ink-3, #6B6557); }

/* ---------------------------------------------------------------- student tiles */
.cbx-stu__hint { margin-top: 7px; font-size: 11px; line-height: 1.45; color: var(--ink-3, #6B6557); }

/* ---------------------------------------------------------------- motion + density */
@media (prefers-reduced-motion: reduce) {
  .cbx-pulse i::after, .cbx-spark__now { animation: none; }
  .cbx-flash-up, .cbx-flash-down { animation: none; }
}
@media (max-width: 640px) {
  .cbx-gb__t { font-size: 12px; }
  .cbx-gb__t th, .cbx-gb__t td { padding: 7px 9px; }
  .cbx-stories { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- global band, tier two */
.cbx-gb__why {
  font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3, #6B6557);
  border-bottom: 1px dotted var(--ink-3, #6B6557); cursor: help; margin-left: 5px; white-space: nowrap;
}
.cbx-gb__h3 { margin: 26px 0 6px; font-size: 16px; line-height: 1.3; font-weight: 600; }
.cbx-gb__owns {
  display: grid; gap: var(--gap, 16px); margin-top: 13px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.cbx-gb__own {
  background: var(--paper-bright, #FEFCF7); border: 1px solid var(--rule, rgba(3,22,2,.10));
  border-radius: var(--r-card, 10px); padding: 14px 16px; box-shadow: var(--shadow-tile);
}
.cbx-gb__own.is-me { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.cbx-gb__own h5 { margin: 0 0 9px; font-size: 13.5px; font-weight: 600; }
.cbx-gb__own ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.cbx-gb__own li { display: block; }
.cbx-gb__ol { display: block; font-size: 11.5px; color: var(--ink-3, #6B6557); }
.cbx-gb__own b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cbx-gb__own i { font-style: normal; font-size: 11px; color: var(--ink-3, #6B6557); margin-left: 4px; }
.cbx-gb__ob { display: block; font-size: 10.5px; line-height: 1.45; color: var(--ink-3, #6B6557); margin-top: 3px; }

/* ---------------------------------------------------------------- student lens pairs */
.cbx-stu__pairs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 7px; }
.cbx-stu__pair { font-size: 11.5px; color: var(--ink-3, #6B6557); }
.cbx-stu__pair b { font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cbx-stu__pair i { font-style: normal; opacity: .75; }
.cbx-stugrid { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.cbx-stu__pair.is-stale b { color: var(--ink-3, #6B6557); }
.cbx-stu__pair.is-stale i { font-weight: 600; }
.cbx-gb__breadth {
  margin: 12px 0 0; padding: 10px 12px; font-size: 12.5px; line-height: 1.5;
  border-left: 3px solid var(--chart-gold); border-radius: 0 var(--r-chip, 7px) var(--r-chip, 7px) 0;
  background: color-mix(in srgb, var(--chart-gold) 7%, transparent);
}
