/* ═══════════════════════════════════════════════════════
   COMPONENTS — Reusable UI building blocks
   ═══════════════════════════════════════════════════════ */

/* ── Tool Frame ── */
.tool-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.03), 0 1px 2px rgba(0,0,0,.02);
  overflow: hidden;
  margin-bottom: 1.75rem;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  position: relative;
}
.tool-frame:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.07);
  border-color: var(--primary-bd);
}
.tool-frame + .tool-frame {
  margin-top: 1.5rem;
}

/* Tool frame top accent line */
.tool-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  opacity: .3;
  z-index: 1;
  transition: opacity .3s;
}
.tool-frame:hover::before { opacity: .8; }

/* ── Tool Bar ── */
.tool-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1.25rem;
  background: linear-gradient(180deg, var(--surface-2), rgba(248,247,244,.95));
  border-bottom: 1px solid var(--border);
  gap: .75rem;
  flex-wrap: wrap;
}
.tool-bar-left {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.tool-bar-title {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-2);
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── Tool Dots ── */
.tool-dots {
  display: flex;
  gap: 5px;
}
.tool-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-2);
  transition: background .3s;
}
.tool-frame:hover .tool-dots span:nth-child(1) { background: #EF4444; }
.tool-frame:hover .tool-dots span:nth-child(2) { background: #F59E0B; }
.tool-frame:hover .tool-dots span:nth-child(3) { background: #22C55E; }

/* ── Tool Label ── */
.tool-label {
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 4px;
}
.tool-label::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: .3rem;
  vertical-align: middle;
}
.tl-green { background: var(--primary-light); color: var(--primary); }
.tl-green::before { background: var(--primary); }
.tl-blue { background: var(--blue-light); color: var(--blue); }
.tl-amber { background: var(--amber-light); color: var(--amber); }
.tl-purple { background: var(--purple-light); color: var(--purple); }
.tl-purple::before { background: var(--purple); }
.tl-red { background: var(--red-light); color: var(--red); }
.tl-red::before { background: var(--red); }
.tl-teal { background: var(--teal-light); color: var(--teal); }

/* ── Tool Body ── */
.tool-body {
  padding: clamp(1.25rem, 3vw, 2rem);
  font-size: var(--fs-base);
  line-height: 1.75;
}
.tool-body strong {
  color: var(--text);
}

/* ── Tool Hint ── */
.tool-hint {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 500;
  color: var(--text-3);
  padding: .25rem .6rem;
  border-radius: 100px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  margin-left: auto;
  cursor: default;
  transition: all .2s;
  opacity: .8;
}
.tool-hint::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.tool-frame:hover .tool-hint {
  opacity: 1;
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary-bd);
}

/* ── Status Indicators ── */
.s-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.s-ok { background: #22C55E; box-shadow: 0 0 6px rgba(34,197,94,.3); }
.s-warn { background: #F59E0B; box-shadow: 0 0 6px rgba(245,158,11,.3); }
.s-err { background: #EF4444; box-shadow: 0 0 6px rgba(239,68,68,.3); }
.s-info { flex: 1; min-width: 0; }
.s-name { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-detail { font-size: .72rem; color: var(--text-3); font-family: var(--mono); }
.s-badge { font-family: var(--mono); font-size: .62rem; font-weight: 700; padding: .15rem .45rem; border-radius: 100px; flex-shrink: 0; letter-spacing: .02em; }
.sb-ok { background: #DCFCE7; color: #15803D; }
.sb-warn { background: #FEF3C7; color: #92400E; }
.sb-err { background: #FEE2E2; color: #B91C1C; }
.s-expand-icon { font-size: .6rem; color: var(--text-3); transition: transform .2s; flex-shrink: 0; opacity: .4; transition: opacity .15s, color .15s; }

/* ── Status Panel ── */
.status-panel {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sp-header {
  padding: .75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid rgba(0,0,0,.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sp-title { font-weight: 600; font-size: .88rem; color: var(--text); }
.sp-count { font-family: var(--mono); font-size: .65rem; color: var(--text-3); }
.sp-body {
  padding: .65rem;
  max-height: 280px;
  overflow-y: auto;
  position: relative;
}
.sp-body::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
  display: block;
  margin-top: -24px;
  flex-shrink: 0;
}

/* ── Status Row ── */
.status-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .8rem;
  border-radius: 8px;
  transition: all .2s cubic-bezier(.16,1,.3,1), border-left-color .15s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
  margin: 2px 0;
}
.status-row:hover {
  background: rgba(26,107,80,.04);
  border-left-color: var(--primary);
}
.status-row:active {
  transform: scale(.995);
  transition-duration: .08s;
}
.status-row:hover .s-expand-icon { color: var(--primary); opacity: 1; }
.status-row .s-expand-icon { opacity: .4; }
.status-row.expanded {
  border-left-color: var(--primary);
  background: var(--primary-light);
  border-radius: var(--r) var(--r) 0 0;
}
.status-row.expanded .s-expand-icon { transform: rotate(180deg); color: var(--primary); }
.status-row .sr-chevron { display: inline-block; transition: transform .25s; font-size: .6rem; margin-left: auto; }
.status-row.expanded .sr-chevron { transform: rotate(90deg); }

/* ── Row Detail ── */
.row-detail {
  display: none;
  padding: .6rem .85rem .75rem;
  margin: 0 .35rem .35rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r) var(--r);
  background: var(--surface);
}
.row-detail.show { display: block; }
.rd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-bottom: .5rem;
}
.rd-item { padding: .55rem .7rem; background: var(--bg-2); border-radius: 4px; }
.rd-label { font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: .1rem; font-weight: 600; }
.rd-value { font-size: .78rem; font-weight: 600; color: var(--text); }
.rd-history { font-family: var(--mono); font-size: .6rem; color: var(--text-3); line-height: 1.7; }
.rd-history span { display: block; }

/* ── Refresh Indicator ── */
.refresh-indicator { font-family: var(--mono); font-size: .55rem; color: var(--text-3); display: flex; align-items: center; gap: .35rem; }
.refresh-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* ── Cards — Universal base ── */
.b-card, .ai-card, .counsel-card, .esc-card, .insight-card, .lookup-card, .eq-card {
  transition: all .25s cubic-bezier(.16,1,.3,1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.b-card:hover, .ai-card:hover, .counsel-card:hover, .esc-card:hover,
.insight-card:hover, .lookup-card:hover, .eq-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* Active press feedback */
.b-card:active, .ai-card:active, .counsel-card:active,
.esc-card:active, .msg-preview:active, .lookup-card:active {
  transform: translateY(0) scale(.995);
  transition-duration: .1s;
}

/* Button click pop feedback */
.td-btn:active, .deploy-fix-btn:active, .jt-btn:active,
.lookup-filter:active, .iv-ftab:active, .outreach-tab:active,
.ai-tab:active, .filter-tab:active, .footer-cta:active {
  animation: btnPop .2s ease;
}

/* Expanded card state */
.b-card.expanded, .ai-card.ai-expanded, .counsel-card.cc-open {
  border-color: var(--primary-bd);
  box-shadow: 0 8px 32px rgba(26,107,80,.08), 0 0 0 1px var(--primary-bd);
  transform: scale(1.005);
  background: var(--surface);
}

/* ── Barrier Cards ── */
.b-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.b-card {
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow);
}
.b-card[class*="sev-high"] { border-left: 3px solid var(--red); }
.b-card[class*="sev-med"] { border-left: 3px solid var(--amber); }
.b-card[class*="sev-low"] { border-left: 3px solid var(--blue); }
.b-card:hover { border-left-color: var(--primary); }
.b-head {
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface);
}
.b-num { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: .8rem; font-weight: 600; flex-shrink: 0; transition: all .2s; }
.b-card:hover .b-num { transform: scale(1.15); }
.b-sev-high .b-num { background: var(--red-light); color: var(--red); }
.b-sev-med .b-num { background: var(--amber-light); color: var(--amber); }
.b-sev-low .b-num { background: var(--blue-light); color: var(--blue); }
.b-title { font-weight: 700; font-size: .85rem; color: var(--text); flex: 1; }
.b-cat { font-family: var(--mono); font-size: .58rem; letter-spacing: .05em; padding: .12rem .4rem; border-radius: 100px; border: 1px solid var(--border); color: var(--text-3); white-space: nowrap; font-weight: 500; }
.b-sev-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.b-sev-high .b-sev-dot { background: var(--red); }
.b-sev-med .b-sev-dot { background: var(--amber); }
.b-sev-low .b-sev-dot { background: var(--blue); }
.b-detail {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .4s cubic-bezier(.16,1,.3,1), opacity .3s ease;
  padding: 0 1.1rem;
  background: var(--surface);
}
.b-card.expanded .b-detail {
  max-height: 600px;
  opacity: 1;
  padding-bottom: 1.1rem;
}
.b-detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-top: .35rem; }
.b-d-box { padding: .55rem .65rem; border-radius: var(--r); border: 1px solid var(--border); }
.b-d-label { font-family: var(--mono); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .2rem; font-weight: 700; }
.b-d-text { font-size: .78rem; color: var(--text); line-height: 1.65; }
.lbl-red { color: var(--red); }
.lbl-grey { color: var(--text-3); }
.lbl-green { color: var(--primary); }

/* Chevron affordance on barrier cards */
.b-card .b-head::after {
  content: '+';
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-3);
  margin-left: auto;
  transition: all .25s cubic-bezier(.16,1,.3,1);
  flex-shrink: 0;
  opacity: .5;
}
.b-card:hover .b-head::after { opacity: 1; color: var(--primary); }
.b-card.expanded .b-head::after { content: '\2212'; color: var(--red); transform: scale(1.1); opacity: 1; }

/* Click hint — disabled, using +/− icon in .b-head instead */
.b-card::after {
  display: none;
}
.b-card:hover::after { opacity: .6; }
.b-card.expanded::after { display: none; }

/* Barrier ticket % badge */
.b-card .b-head span[style*="border-radius:100px"] { font-weight: 600; }

/* ── AI Cards ── */
.ai-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ai-card {
  padding: 1.1rem 1.25rem;
  transition: all .25s cubic-bezier(.16,1,.3,1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ai-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.ai-card:hover { border-left: 3px solid var(--purple); background: rgba(139,92,246,.02); }
.ai-card-icon { font-size: 1.1rem; margin-bottom: .4rem; }
.ai-card-title { font-weight: 700; font-size: .88rem; color: var(--text); margin-bottom: .25rem; line-height: 1.3; }
.ai-card-desc { font-size: .8rem; color: var(--text-2); line-height: 1.75; }
.ai-card-signal {
  margin-top: .4rem;
  padding-top: .35rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: .3rem;
}
.ai-card-signal::before { content: ''; width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }

.aic-predict::before { background: var(--primary); }
.aic-predict { border-left: 0; }
.aic-predict::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.aic-equity::before { background: var(--teal); }
.aic-equity { border-left: 0; }
.aic-equity::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--teal); }
.aic-govern::before { background: var(--red); }
.aic-govern { border-left: 0; }
.aic-govern::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }
.aic-role::before { background: var(--blue); }
.aic-role { border-left: 0; }
.aic-role::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }

/* AI Card expand state */
.ai-card-expand {
  display: block;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .4s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.ai-card.ai-expanded .ai-card-expand { max-height: 800px; opacity: 1; }
.ai-card.ai-expanded { border-color: var(--teal-bd); background: var(--surface-2); }

/* AI Card hover chevron */
.ai-card::after {
  content: '\25BE';
  position: absolute;
  top: .75rem;
  right: .75rem;
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .15s;
}
.ai-card:hover::after { opacity: .6; }
.ai-card.ai-expanded::after { content: '\25B4'; opacity: .6; color: var(--primary); }

/* ── Insight Cards ── */
.insights-panel { display: flex; flex-direction: column; gap: .75rem; }
.insight-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  transition: all .2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.insight-card:hover { filter: brightness(.98); border-left: 3px solid var(--primary); }
.insight-card.insight-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light), 0 4px 16px rgba(0,0,0,.06);
}
.ic-severity { font-family: var(--mono); font-size: .5rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: .15rem .4rem; border-radius: 4px; display: inline-block; margin-bottom: .35rem; }
.ic-high { background: var(--red-light); color: var(--red); }
.ic-med { background: var(--amber-light); color: var(--amber); }
.ic-low { background: var(--blue-light); color: var(--blue); }
.ic-title { font-weight: 700; font-size: .85rem; color: var(--text); margin-bottom: .2rem; line-height: 1.35; }
.ic-desc { font-size: .78rem; color: var(--text-2); line-height: 1.65; }
.ic-meta { display: flex; gap: .6rem; margin-top: .5rem; font-family: var(--mono); font-size: .55rem; color: var(--text-3); }
.ic-cat-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: .3rem; vertical-align: middle; flex-shrink: 0; }
.ic-action {
  font-family: var(--mono);
  font-size: .55rem;
  color: var(--text-3);
  margin-top: .4rem;
  padding-top: .35rem;
  border-top: 1px solid var(--border);
  transition: all .15s;
  opacity: .5;
}
.insight-card:hover .ic-action { opacity: 1; color: var(--primary); }
.insight-card.insight-active .ic-action { opacity: 1; color: var(--primary); font-weight: 600; }

/* ── Info Panels ── */
.info-panel {
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.info-panel-header {
  padding: .5rem .75rem;
  background: var(--surface-2);
  border-bottom: 1px solid rgba(0,0,0,.04);
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.info-panel-body { padding: .75rem; }
.info-stat-row { display: flex; gap: .5rem; margin-top: .75rem; }
.info-stat { flex: 1; text-align: center; padding: .5rem; border: 1px solid var(--border); border-radius: var(--r); }
.info-stat-num { font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.info-stat-label { font-size: .55rem; color: var(--text-3); margin-top: .1rem; }
.info-source { font-family: var(--mono); font-size: .52rem; color: var(--text-3); margin-top: .75rem; padding-top: .5rem; border-top: 1px solid var(--border); line-height: 1.5; }

/* ── Growth Bars ── */
.growth-row { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.growth-row:last-child { border-bottom: none; }
.growth-year { font-family: var(--mono); font-size: .6rem; color: var(--text-3); width: 55px; flex-shrink: 0; }
.growth-bar-wrap { flex: 1; height: 28px; background: var(--bg-3); border-radius: 4px; position: relative; display: flex; align-items: center; }
.growth-bar {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: .4rem;
  flex-shrink: 0;
  width: 0;
  transition: width 1.2s cubic-bezier(.16,1,.3,1);
}
.growth-bar.bar-visible { width: var(--bar-w); }
.growth-num { font-family: var(--mono); font-size: .62rem; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* ── Course Bars ── */
.course-bar-row { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; }
.course-name { font-size: .72rem; color: var(--text); width: 130px; flex-shrink: 0; font-weight: 500; }
.course-bar-wrap { flex: 1; height: 18px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.course-bar { height: 100%; border-radius: 3px; display: flex; align-items: center; padding-left: .4rem; width: 0; transition: width 1s cubic-bezier(.16,1,.3,1) .2s; }
.course-bar.bar-visible { width: var(--bar-w); }
.course-pct { font-family: var(--mono); font-size: .5rem; font-weight: 600; color: #fff; }

/* ── Copy Button ── */
.msg-copy {
  position: absolute;
  top: .4rem;
  right: .4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .2rem .45rem;
  font-family: var(--mono);
  font-size: .52rem;
  color: var(--text-3);
  cursor: pointer;
  opacity: .6;
  transition: all .15s;
  z-index: 5;
}
.msg-preview:hover .msg-copy { opacity: 1; }
.msg-copy:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.msg-copy.copied { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,107,80,.15); }

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,.03);
  border-radius: var(--r);
  padding: 2px;
}
.filter-tab {
  padding: .35rem .7rem;
  border-radius: 100px;
  border: none;
  background: transparent;
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--text-3);
  cursor: pointer;
  transition: all .2s cubic-bezier(.16,1,.3,1);
  white-space: nowrap;
}
.filter-tab:hover { color: var(--text); background: rgba(0,0,0,.03); }
.filter-tab:active { transform: scale(.96); }
.filter-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15,118,110,.2);
  border-radius: 8px;
  font-weight: 700;
}

/* ── Legend Items ── */
.legend-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .65rem;
  color: var(--text-2);
  cursor: pointer;
  padding: .15rem .4rem;
  border-radius: 4px;
  transition: all .15s;
  user-select: none;
}
.legend-item:hover { background: var(--bg-2); color: var(--text); }
.legend-item:hover .legend-dot { transform: scale(1.3); }
.legend-item.disabled { opacity: .35; text-decoration: line-through; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; transition: all .15s; }

/* ── Tooltip ── */
.tip {
  position: fixed;
  z-index: 300;
  background: var(--text);
  color: var(--bg-2);
  font-size: .75rem;
  padding: .4rem .65rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  max-width: 240px;
  line-height: 1.5;
  white-space: nowrap;
}
.tip.show { opacity: 1; }
.tip strong { color: #fff; font-weight: 600; }

/* ── Toast ── */
.kb-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  padding: .6rem 1.2rem .6rem 1rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(26,107,80,.25);
  z-index: 9999;
  opacity: 0;
  transition: all .3s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.kb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Keyboard Overlay ── */
.kb-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kb-overlay.kb-show { opacity: 1; pointer-events: auto; }
.kb-help { background: var(--bg); border-radius: 12px; padding: 1.5rem; max-width: 360px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.kb-help-title { font-family: var(--display); font-size: 1.1rem; font-weight: 700; margin-bottom: .75rem; color: var(--text); }
.kb-help-row { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--border); gap: 1rem; }
.kb-help-row:last-child { border: none; }
.kb-help-row .kb-help-desc { flex: 1; display: flex; align-items: center; gap: .3rem; }
.kb-help-desc { font-size: .75rem; color: var(--text-2); }
.kb-help-key { font-family: var(--mono); font-size: .6rem; padding: .15rem .4rem; border-radius: 4px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.kb-help-close { margin-top: .75rem; text-align: center; font-size: .65rem; color: var(--text-3); }

/* ── Universal clickable affordances ── */
.b-card .b-head,
.ai-card,
.counsel-card,
.esc-card,
.insight-card,
.lookup-card,
.status-row,
.trigger-card {
  position: relative;
}

/* Hover: left-border accent on clickable cards */
.counsel-card:hover { border-left: 3px solid var(--teal); }
.esc-card:hover { border-left: 3px solid var(--amber); }
.trigger-card:hover { border-left: 3px solid var(--teal); }

/* Counsel card hover chevron */
.counsel-card::after {
  content: '\25BE';
  position: absolute;
  top: .75rem;
  right: .75rem;
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--text-3);
  opacity: 0;
  transition: opacity .15s;
}
.counsel-card:hover::after { opacity: .6; }
.counsel-card.cc-open::after { content: '\25B4'; opacity: .6; color: var(--primary); }

/* ── Ripple Effect ── */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(26,107,80,.12);
  transform: scale(0);
  pointer-events: none;
}

/* ── Delight: Confetti particles ── */
.confetti-particle {
  position: absolute;
  animation: confettiFall ease-out forwards;
  --spin: 720deg;
  will-change: transform, opacity;
}

/* ── Delight: Achievement toast variant ── */
.achievement-toast {
  background: linear-gradient(135deg, #0F766E, #0D9488) !important;
  box-shadow: 0 8px 32px rgba(15,118,110,.35) !important;
}

/* ── Delight: Card tilt ── */
.tilt-enabled {
  transform-style: preserve-3d;
  perspective: 800px;
}
.tilt-enabled:hover {
  transform: perspective(800px) rotateX(calc(var(--my, 0) * -3deg)) rotateY(calc(var(--mx, 0) * 3deg)) translateY(-4px);
}

/* ── Delight: Matrix rain columns ── */
.matrix-column {
  position: absolute;
  top: 0;
  font-family: var(--mono);
  font-size: .7rem;
  color: #22C55E;
  white-space: pre;
  line-height: 1.6;
  opacity: .7;
  text-shadow: 0 0 8px rgba(34,197,94,.5);
  animation: matrixFall linear forwards;
}

/* ── Delight: Logo animation states ── */
.logo-bounce { animation: logoBounce .5s cubic-bezier(.16,1,.3,1); }
.logo-wiggle { animation: logoWiggle .6s ease; }
.logo-flip { animation: logoFlip .6s ease; }

/* ═══════════════════════════════════════════════════════
   TICKET LOG — Personal queue (localStorage)
   ═══════════════════════════════════════════════════════ */
.tl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}
.tl-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .65rem .8rem;
  text-align: center;
}
.tl-stat-num {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}
.tl-stat-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-top: .25rem;
}
.tl-controls {
  display: flex;
  gap: .65rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.tl-filters {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.tl-filter {
  font-family: var(--mono);
  font-size: .7rem;
  padding: .4rem .75rem;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}
.tl-filter:hover { border-color: var(--primary); color: var(--primary); }
.tl-filter.tl-f-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tl-search {
  flex: 1;
  min-width: 200px;
  padding: .55rem .85rem;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-family: var(--body);
  font-size: .82rem;
  background: var(--surface);
  color: var(--text);
}
.tl-search:focus { outline: none; border-color: var(--primary); }
.tl-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tl-btn {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  padding: .5rem .9rem;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.tl-btn:hover { border-color: var(--primary); color: var(--primary); }
.tl-btn-new {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tl-btn-new:hover {
  background: #0d6660;
  color: #fff;
}
.tl-btn-del {
  color: var(--red);
  border-color: var(--red-bd);
}
.tl-btn-del:hover { background: var(--red-light); color: var(--red); }
.tl-btn-import { position: relative; }

.tl-templates-wrap {
  position: relative;
  display: inline-block;
}
.tl-templates-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: .3rem;
  min-width: 260px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: .35rem;
}
.tl-templates-menu.tl-templates-open { display: block; }
.tl-tpl-item {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem;
}
.tl-tpl-use {
  flex: 1;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: .5rem .65rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.tl-tpl-use:hover {
  background: var(--primary-light);
  border-color: var(--primary-bd);
}
.tl-tpl-name {
  font-family: var(--body);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
}
.tl-tpl-meta {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-tpl-del {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: .9rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.tl-tpl-del:hover { color: var(--red); background: var(--red-light); }
.tl-tpl-empty {
  padding: .9rem 1rem;
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════
   ACTIVITY LOG
   ═══════════════════════════════════════════════════════ */
#activity {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, transparent, rgba(29,78,216,.02));
  border-bottom: 1px solid var(--border);
}
.act-filters {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.act-filter {
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
  text-transform: capitalize;
}
.act-filter:hover { border-color: var(--primary); color: var(--primary); }
.act-filter.act-f-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.act-f-count {
  opacity: .65;
  font-weight: 400;
  margin-left: .2rem;
}

.act-stream {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.act-day-label {
  padding: .65rem 1rem .55rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 700;
}
.act-stream .act-day-label:first-child { border-top: none; }

.act-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: .85rem;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.act-item:last-child { border-bottom: none; }
.act-item:hover { background: var(--bg-2); }

.act-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 700;
}
.act-kind-ticket .act-icon { background: var(--blue-light); color: var(--blue); }
.act-kind-kb .act-icon { background: var(--amber-light); color: var(--amber); }
.act-kind-college .act-icon { background: var(--primary-light); color: var(--primary); }
.act-kind-outreach .act-icon { background: var(--teal-light); color: var(--teal); }
.act-kind-onboarding .act-icon { background: #dcfce7; color: #166534; }
.act-kind-barrier .act-icon { background: var(--red-light); color: var(--red); }

.act-item.act-focused {
  background: var(--primary-light);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.kb-list-item.kb-focused {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.ob-item.ob-focused {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.act-main { min-width: 0; }
.act-title {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
  margin-bottom: .12rem;
}
.act-sub {
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.act-time {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  flex-shrink: 0;
}
.act-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-3);
  font-family: var(--body);
  font-size: .85rem;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.act-truncated {
  padding: .7rem 1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  background: var(--surface-2);
  border-radius: var(--r);
  margin-top: .5rem;
}
@media (max-width: 560px) {
  .act-item { grid-template-columns: 26px 1fr; gap: .5rem; padding: .6rem .75rem; }
  .act-time { grid-column: 2; font-size: .58rem; margin-top: .15rem; }
}
.tl-body {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.tl-row {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.tl-row:hover { border-color: var(--border-2); }
.tl-row.tl-focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.tl-row.tl-expanded { border-color: var(--primary-bd); box-shadow: var(--shadow-md); }
.tl-row.tl-selected {
  border-color: var(--primary);
  background: var(--primary-light);
}
.tl-row.tl-selected .tl-select-box { accent-color: var(--primary); }

.tl-select-box {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.tl-bulk-bar {
  display: none;
  position: sticky;
  top: 60px;
  z-index: 40;
  background: var(--dark-bg);
  color: var(--dark-text);
  padding: .65rem 1rem;
  border-radius: var(--r);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  margin-bottom: .85rem;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  animation: bulkSlide .2s cubic-bezier(.16,1,.3,1);
}
.tl-bulk-bar.tl-bulk-show { display: flex; }
@keyframes bulkSlide {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.tl-bulk-count {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--dark-text-2);
  margin-right: .5rem;
}
.tl-bulk-count strong {
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  margin-right: .15rem;
}
.tl-bulk-bar .tl-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  color: var(--dark-text);
  font-size: .68rem;
}
.tl-bulk-bar .tl-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.4);
  color: #fff;
}
.tl-bulk-bar .tl-btn-del {
  border-color: rgba(248,113,113,.4);
  color: #fca5a5;
}
.tl-bulk-bar .tl-btn-del:hover {
  background: rgba(248,113,113,.15);
  color: #fff;
}
.tl-summary {
  display: grid;
  grid-template-columns: 22px 48px minmax(120px, 1.2fr) 110px 2fr 110px;
  align-items: center;
  gap: .65rem;
  padding: .65rem .85rem;
  cursor: pointer;
  font-size: .8rem;
}
.tl-age {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 700;
  text-align: center;
  padding: .2rem .4rem;
  border-radius: 4px;
}
.tl-age-ok { background: var(--primary-light); color: var(--primary); }
.tl-age-amber { background: var(--amber-light); color: var(--amber); }
.tl-age-red { background: var(--red-light); color: var(--red); }
.tl-age-resolved { background: var(--bg-3); color: var(--text-3); }
.tl-college { font-weight: 600; color: var(--text); }
.tl-sys {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
  background: var(--bg-2);
  padding: .18rem .45rem;
  border-radius: 4px;
  justify-self: start;
}
.tl-symptom {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tl-status {
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .22rem .5rem;
  border-radius: 4px;
  text-align: center;
  justify-self: end;
}
.tl-st-open { background: var(--blue-light); color: var(--blue); }
.tl-st-waiting-vendor { background: var(--purple-light); color: var(--purple); }
.tl-st-waiting-college { background: var(--amber-light); color: var(--amber); }
.tl-st-waiting-student { background: var(--bg-3); color: var(--text-2); }
.tl-st-resolved { background: var(--primary-light); color: var(--primary); }
.tl-detail {
  display: none;
  padding: .95rem 1rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.tl-row.tl-expanded .tl-detail { display: block; }
.tl-field-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem;
  margin-bottom: .75rem;
}
.tl-field { display: flex; flex-direction: column; gap: .25rem; }
.tl-field-full { margin-bottom: .75rem; }
.tl-field label {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 600;
}
.tl-field input,
.tl-field select,
.tl-field textarea {
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--body);
  font-size: .8rem;
  background: var(--surface);
  color: var(--text);
}
.tl-field textarea { font-family: var(--mono); font-size: .74rem; resize: vertical; }
.tl-field input:focus,
.tl-field select:focus,
.tl-field textarea:focus { outline: none; border-color: var(--primary); }
.tl-row-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .5rem;
  border-top: 1px dashed var(--border);
  margin-top: .5rem;
  gap: .75rem;
  flex-wrap: wrap;
}
.tl-row-footer-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.tl-kb-suggest {
  margin: .75rem 0;
  padding: .75rem .9rem;
  background: var(--amber-light);
  border: 1px solid var(--amber-bd);
  border-radius: var(--r);
}
.tl-kb-suggest-label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--amber);
  font-weight: 700;
  margin-bottom: .45rem;
}
.tl-kb-suggest-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .4rem .55rem;
  margin: .2rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all .12s;
}
.tl-kb-suggest-item:hover {
  border-color: var(--amber);
  background: var(--surface-2);
}
.tl-kb-sug-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.tl-kb-sug-meta {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text-3);
}

.tl-dupe-warn {
  margin: .75rem 0;
  padding: .75rem .9rem;
  background: var(--red-light);
  border: 1px solid var(--red-bd);
  border-radius: var(--r);
}
.tl-dupe-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
  font-weight: 700;
  margin-bottom: .45rem;
}
.tl-dupe-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .45rem .6rem;
  margin: .25rem 0;
  background: var(--surface);
  border: 1px solid var(--red-bd);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s;
}
.tl-dupe-item:hover { border-color: var(--red); background: var(--red-light); }
.tl-dupe-symptom {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
}
.tl-dupe-meta {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
}

/* Sub-tasks inside a ticket */
.tl-subtasks {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.tl-subtask {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.tl-subtask:hover { border-color: var(--border-2); }
.tl-subtask input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.tl-subtask-text {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--body);
  font-size: .8rem;
  color: var(--text);
  padding: .15rem .2rem;
  border-bottom: 1px solid transparent;
}
.tl-subtask-text:focus {
  outline: none;
  border-bottom-color: var(--primary);
}
.tl-st-done .tl-subtask-text {
  text-decoration: line-through;
  color: var(--text-3);
}
.tl-subtask-del {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity .12s;
}
.tl-subtask:hover .tl-subtask-del { opacity: 1; }
.tl-subtask-del:hover { color: var(--red); background: var(--red-light); }
.tl-subtask-add {
  padding: .45rem .7rem;
  border: 1.5px dashed var(--border-2);
  background: transparent;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
  margin-top: .2rem;
}
.tl-subtask-add:hover { border-color: var(--primary); color: var(--primary); }

.tl-subtask-count {
  display: inline-block;
  font-family: var(--mono);
  font-size: .56rem;
  font-weight: 700;
  padding: .13rem .4rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 3px;
  margin-left: .45rem;
  vertical-align: middle;
}

/* Ticket links ("see also") */
.tl-links {
  margin: .75rem 0;
  padding: .75rem .9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.tl-links-label {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: .5rem;
}
.tl-link-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .25rem 0;
}
.tl-link-link {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .55rem;
  align-items: center;
  padding: .45rem .6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: border-color .12s;
}
.tl-link-link:hover { border-color: var(--primary); }
.tl-link-status {
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: .14rem .4rem;
  border-radius: 3px;
}
.tl-link-text {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tl-link-meta {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  white-space: nowrap;
}
.tl-link-rm {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}
.tl-link-rm:hover { border-color: var(--red); color: var(--red); background: var(--red-light); }

/* Storage health */
.sh-bar {
  font-family: var(--body);
}
.sh-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--text-3);
  margin-bottom: .4rem;
}
.sh-bar-pct strong { color: var(--text); font-size: .78rem; font-weight: 700; }
.sh-bar-track {
  height: 10px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
}
.sh-bar-fill {
  height: 100%;
  transition: width .3s;
}
.sh-bar-warn {
  margin-top: .5rem;
  padding: .5rem .7rem;
  background: var(--amber-light);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  font-size: .72rem;
  color: var(--text-2);
}
.sh-rows {
  margin-top: .75rem;
  font-family: var(--mono);
  font-size: .66rem;
}
.sh-row {
  display: flex;
  justify-content: space-between;
  padding: .2rem 0;
  color: var(--text-3);
  border-bottom: 1px dashed var(--border);
}
.sh-row:last-child { border-bottom: none; }
.sh-row-name { color: var(--text-2); }
.sh-row-size { color: var(--text); font-weight: 600; }

.sh-warn-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10005;
  padding: .65rem 1rem;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: .72rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.sh-warn-banner strong { color: #fff; }
.sh-warn-banner button {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
}

/* Timer controls in ticket detail */
.tl-timer-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.tl-timer-display {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  padding: 0 .65rem 0 .25rem;
  border-right: 1px solid var(--border);
  margin-right: .5rem;
  min-width: 80px;
}
.tl-timer-btn {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}
.tl-timer-btn:hover { border-color: var(--primary); color: var(--primary); }
.tl-timer-start {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tl-timer-start:hover { background: #0d6660; color: #fff; }
.tl-timer-stop {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.tl-timer-stop:hover { background: #a11717; color: #fff; }
.tl-timer-reset { font-size: .6rem; margin-left: auto; }

.tl-timer-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .56rem;
  font-weight: 700;
  padding: .13rem .4rem;
  background: var(--bg-3);
  color: var(--text-2);
  border-radius: 3px;
  margin-left: .45rem;
  vertical-align: middle;
}
.tl-timer-badge.tl-timer-running {
  background: var(--primary);
  color: #fff;
  animation: fuPulse 2s infinite;
}

/* Pattern alerts on Today */
.today-patterns {
  margin-bottom: 1.25rem;
  padding: .85rem 1rem;
  background: var(--amber-light);
  border: 1px solid var(--amber-bd);
  border-left: 4px solid var(--amber);
  border-radius: var(--r);
}
.today-patterns-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--amber);
  font-weight: 700;
  margin-bottom: .65rem;
}
.today-patterns-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.today-pattern {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: .75rem;
  align-items: start;
  padding: .5rem .7rem;
  background: var(--surface);
  border: 1px solid var(--amber-bd);
  border-radius: 4px;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  color: inherit;
}
.today-pattern:hover { border-color: var(--amber); background: var(--amber-light); }
.today-pat-high { border-left: 3px solid var(--red); }
.today-pat-kind {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  padding-top: .2rem;
}
.today-pat-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .15rem;
}
.today-pat-hint {
  display: block;
  font-size: .7rem;
  color: var(--text-3);
  font-family: var(--body);
}

/* Filter presets bar */
.tl-presets-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  padding: .55rem .85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: .75rem;
}
.tl-preset-save {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 600;
  padding: .32rem .65rem;
  border: 1px dashed var(--border-2);
  border-radius: 100px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.tl-preset-save:hover { border-color: var(--primary); color: var(--primary); border-style: solid; }
.tl-preset-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.tl-preset-apply {
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  padding: .32rem .75rem;
  background: transparent;
  border: none;
  color: var(--blue);
  cursor: pointer;
}
.tl-preset-apply:hover { background: var(--blue-light); }
.tl-preset-del {
  font-size: .8rem;
  padding: .2rem .45rem;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  line-height: 1;
}
.tl-preset-del:hover { color: var(--red); background: var(--red-light); }

/* Quick capture modal */
.qc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10003;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.qc-overlay.qc-show { display: flex; animation: searchFadeIn .15s ease; }
.qc-modal {
  width: min(520px, 94vw);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
  overflow: hidden;
  animation: searchSlideIn .2s cubic-bezier(.16,1,.3,1);
}
.qc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1.1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.qc-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.qc-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}
.qc-close:hover { background: var(--bg-2); color: var(--text); }
.qc-form {
  padding: 1.1rem 1.25rem .25rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: .75rem;
}
.qc-field { display: flex; flex-direction: column; gap: .3rem; }
.qc-field-full { grid-column: 1 / -1; }
.qc-field label {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
}
.qc-field input,
.qc-field select {
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--body);
  font-size: .88rem;
  background: var(--surface);
  color: var(--text);
}
.qc-field input:focus,
.qc-field select:focus { outline: none; border-color: var(--primary); }
.qc-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.25rem 1.15rem;
}
.qc-hint {
  flex: 1;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
}
.qc-hint kbd {
  display: inline-block;
  padding: .08rem .4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .62rem;
}
@media (max-width: 560px) {
  .qc-form { grid-template-columns: 1fr; }
  .qc-overlay { padding-top: 10vh; }
}

/* KB starter template items */
.kb-starter-item {
  display: block;
  width: 100%;
  padding: .85rem 1rem;
  margin-bottom: .55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.kb-starter-item:hover {
  border-color: var(--amber);
  background: var(--amber-light);
}
.kb-starter-title {
  font-family: var(--body);
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .2rem;
}
.kb-starter-meta {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  margin-bottom: .35rem;
}
.kb-starter-preview {
  font-family: var(--body);
  font-size: .74rem;
  color: var(--text-2);
  line-height: 1.5;
}

/* Focus mode */
body.focus-on #nav,
body.focus-on .sec-group-divider,
body.focus-on footer,
body.focus-on .hub-header,
body.focus-on #toc,
body.focus-on .search-fab,
body.focus-on .cvc-fab {
  display: none !important;
}
body.focus-on main > section.sec,
body.focus-on main > section {
  display: none !important;
}
/* Sections in focus-on mode are hidden; the JS adds a .focus-target class to the chosen one */
body.focus-on main > .focus-target {
  display: block !important;
}

.focus-exit-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  padding: .55rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all .15s;
}
.focus-exit-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Archive view styling */
.tl-blocked-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .56rem;
  font-weight: 700;
  padding: .13rem .4rem;
  background: var(--red);
  color: #fff;
  border-radius: 3px;
  margin-left: .45rem;
  vertical-align: middle;
}

.tl-blocks {
  margin: .75rem 0;
  padding: .75rem .9rem;
  background: var(--red-light);
  border: 1px solid var(--red-bd);
  border-radius: var(--r);
}
.tl-blocks-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
  font-weight: 700;
  margin-bottom: .45rem;
}
.tl-block-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .25rem 0;
}
.tl-block-item.tl-block-ok {
  opacity: .65;
}
.tl-block-link {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .55rem;
  align-items: center;
  padding: .45rem .6rem;
  background: var(--surface);
  border: 1px solid var(--red-bd);
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.tl-block-link:hover { border-color: var(--red); }
.tl-block-status {
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: .14rem .4rem;
  border-radius: 3px;
}
.tl-block-text {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-bottom: .85rem;
  padding: .6rem .85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.tl-tag-chips-label {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  margin-right: .3rem;
}
.tl-tag-chip {
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}
.tl-tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tl-tag-chip-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.tl-tag-chip-count {
  opacity: .7;
  font-weight: 400;
  margin-left: .15rem;
}

.tl-row-tags {
  display: inline-flex;
  gap: .25rem;
  margin-left: .5rem;
  vertical-align: middle;
}
.tl-row-tag {
  font-family: var(--mono);
  font-size: .56rem;
  font-weight: 600;
  padding: .12rem .4rem;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 3px;
  text-transform: lowercase;
}
.tl-row-tag-more {
  font-family: var(--mono);
  font-size: .56rem;
  color: var(--text-3);
  padding: .12rem .35rem;
}

.tl-fu-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .14rem .45rem;
  border-radius: 3px;
  margin-left: .5rem;
  vertical-align: middle;
}
.tl-fu-overdue { background: var(--red); color: #fff; animation: fuPulse 2s infinite; }
.tl-fu-due-today { background: var(--amber); color: #fff; }
.tl-fu-due-soon { background: var(--amber-light); color: var(--amber); border: 1px solid var(--amber-bd); }
.tl-fu-scheduled { background: var(--bg-2); color: var(--text-3); }
@keyframes fuPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.tl-field-row-2col { grid-template-columns: 1fr 1fr; }
.tl-followup-quick {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
}
.tl-fu-btn {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 600;
  padding: .4rem .55rem;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .12s;
}
.tl-fu-btn:hover { border-color: var(--primary); color: var(--primary); }

.today-card-followup {
  border-color: var(--amber-bd);
  background: linear-gradient(180deg, var(--amber-light), var(--surface) 60%);
}
.today-card-followup .today-card-title { color: var(--amber); }
.today-followup-count {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: var(--amber);
  padding: .2rem .55rem;
  border-radius: 100px;
}
.today-fu-marker {
  font-family: var(--mono);
  font-size: .6rem;
  font-weight: 700;
  padding: .25rem .5rem;
  border-radius: 3px;
  min-width: 52px;
  text-align: center;
}
.today-fu-over { background: var(--red); color: #fff; }
.today-fu-now { background: var(--amber); color: #fff; }
.today-fu-soon { background: var(--amber-light); color: var(--amber); border: 1px solid var(--amber-bd); }

/* ═══════════════════════════════════════════════════════
   ONBOARDING role switcher
   ═══════════════════════════════════════════════════════ */
.ob-role-switch {
  padding: .5rem .65rem;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  cursor: pointer;
}
.ob-role-switch:focus { outline: none; border-color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   FOR STUDENTS — self-help guide
   ═══════════════════════════════════════════════════════ */
#forStudents {
  background: linear-gradient(180deg, rgba(14,165,233,.05), transparent 60%);
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--border);
}

.stu-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}
.stu-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.stu-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0EA5E9;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}
.stu-step-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .5rem;
  line-height: 1.3;
}
.stu-step-body {
  font-size: .88rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: .75rem;
}
.stu-step-body a { color: #0EA5E9; font-weight: 600; }
.stu-step-body strong { color: var(--text); }
.stu-step-body code { font-family: var(--mono); background: var(--bg-2); padding: .1rem .35rem; border-radius: 3px; font-size: .85em; }
.stu-step-check {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-3);
  padding-top: .5rem;
  border-top: 1px dashed var(--border);
}
.stu-check-box { font-size: .9rem; margin-right: .3rem; color: #0EA5E9; }

.stu-troubles {
  margin: 2rem 0;
}
.stu-troubles-title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
}
.stu-trouble {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  background: var(--amber-light);
  border: 1px solid var(--amber-bd);
  border-radius: var(--r);
}
.stu-trouble-symptom {
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 600;
  color: var(--amber);
  margin-bottom: .65rem;
  font-style: italic;
}
.stu-trouble-symptom::before { content: '"'; margin-right: .15rem; }
.stu-trouble-symptom::after { content: '"'; margin-left: .15rem; }
.stu-trouble-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .65rem;
  padding: .4rem 0;
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.55;
}
.stu-trouble-row strong { color: var(--text); }
.stu-trouble-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  font-weight: 700;
}
.stu-trouble-action { background: var(--surface); border-radius: 4px; padding: .55rem .65rem; margin-top: .3rem; }

.stu-contacts { margin-top: 2rem; }
.stu-contacts-title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
}
.stu-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .85rem;
}
.stu-contact-card {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #0EA5E9;
  border-radius: var(--r);
}
.stu-contact-role {
  font-family: var(--mono);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #0EA5E9;
  font-weight: 700;
  margin-bottom: .4rem;
}
.stu-contact-body {
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.55;
}
.stu-contact-body strong { color: var(--text); }

.stu-lang-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1.25rem;
  padding: .5rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.stu-lang-btn {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  padding: .4rem .85rem;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all .15s;
}
.stu-lang-btn:hover { border-color: #0EA5E9; color: #0EA5E9; }
.stu-lang-active {
  background: #0EA5E9;
  border-color: #0EA5E9;
  color: #fff;
}
.stu-lang-note {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  font-style: italic;
  margin-left: .4rem;
}

/* ═══════════════════════════════════════════════════════
   GLOSSARY
   ═══════════════════════════════════════════════════════ */
.gloss-search-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0 1.25rem;
}
.gloss-search {
  flex: 1;
  padding: .7rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-family: var(--body);
  font-size: .88rem;
  background: var(--surface);
  color: var(--text);
}
.gloss-search:focus { outline: none; border-color: var(--primary); }
.gloss-count {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  flex-shrink: 0;
}
.gloss-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .78rem;
}
.gloss-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
.gloss-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.2rem;
  transition: border-color .15s;
}
.gloss-item:hover { border-color: var(--border-2); }
.gloss-term-row {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.gloss-term {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .02em;
}
.gloss-long {
  font-family: var(--body);
  font-size: .78rem;
  color: var(--text-3);
  font-style: italic;
}
.gloss-tags {
  display: inline-flex;
  gap: .25rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.gloss-tag {
  font-family: var(--mono);
  font-size: .55rem;
  padding: .12rem .4rem;
  background: var(--bg-2);
  color: var(--text-3);
  border-radius: 3px;
  font-weight: 600;
}
.gloss-body {
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.65;
}
.gloss-body strong { color: var(--text); }
.gloss-body a { color: var(--primary); }
.gloss-item.gloss-highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  animation: glossFlash 1.8s ease;
}
@keyframes glossFlash {
  0%, 100% { background: var(--surface); }
  30% { background: var(--primary-light); }
}
@media (max-width: 560px) {
  .gloss-term-row { flex-direction: column; gap: .25rem; align-items: flex-start; }
  .gloss-tags { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════
   EXTERNAL TOOLS HUB
   ═══════════════════════════════════════════════════════ */
.ext-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}
.ext-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.15rem 1.1rem;
}
.ext-group-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding-bottom: .55rem;
  margin-bottom: .65rem;
  border-bottom: 1px dashed var(--border);
}
.ext-group-icon {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--primary);
  width: 22px;
  text-align: center;
}
.ext-group-label {
  font-family: var(--display);
  font-size: .98rem;
  font-weight: 600;
  color: var(--text);
}
.ext-links { display: flex; flex-direction: column; gap: .35rem; }
.ext-link {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  transition: all .12s;
}
.ext-link:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(2px);
}
.ext-link-main { flex: 1; min-width: 0; }
.ext-link-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .1rem;
}
.ext-link-arrow { font-size: .72rem; color: var(--text-3); }
.ext-link-desc {
  font-family: var(--body);
  font-size: .7rem;
  color: var(--text-3);
  line-height: 1.45;
}
.ext-link-url {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: .15rem;
}
@media (max-width: 720px) {
  .ext-grid { grid-template-columns: 1fr; }
  .ext-link-url { display: none; }
}

/* ═══════════════════════════════════════════════════════
   INLINE GLOSSARY TOOLTIPS
   ═══════════════════════════════════════════════════════ */
.gloss-tooltip-wrap {
  position: relative;
  border-bottom: 1px dotted var(--text-3);
  cursor: help;
  outline: none;
}
.gloss-tooltip-wrap:hover,
.gloss-tooltip-wrap:focus {
  border-bottom-color: var(--primary);
  color: var(--primary);
}
.gloss-tooltip-bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 240px;
  max-width: 360px;
  padding: .65rem .85rem;
  background: var(--dark-bg);
  color: var(--dark-text);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  font-size: .74rem;
  line-height: 1.55;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s, transform .18s cubic-bezier(.16,1,.3,1);
  z-index: 50;
  white-space: normal;
  font-weight: 400;
}
.gloss-tooltip-bubble strong { color: #fff; font-weight: 700; }
.gloss-tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--dark-bg);
}
.gloss-tooltip-body {
  display: block;
  margin-top: .3rem;
  color: var(--dark-text-2);
  font-size: .68rem;
  line-height: 1.5;
}
.gloss-tooltip-wrap:hover .gloss-tooltip-bubble,
.gloss-tooltip-wrap:focus .gloss-tooltip-bubble {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 560px) {
  .gloss-tooltip-bubble { min-width: 200px; max-width: 280px; }
}

/* ═══════════════════════════════════════════════════════
   PWA — offline banner + install button
   ═══════════════════════════════════════════════════════ */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10004;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .45rem .75rem;
  background: var(--amber);
  color: #fff;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.offline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-dot 1.5s infinite;
}

.today-btn-pwa {
  border-color: var(--primary-bd) !important;
  background: var(--primary-light) !important;
  color: var(--primary) !important;
}
.today-btn-pwa:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════════════════════
   MANAGER DASHBOARD
   ═══════════════════════════════════════════════════════ */
#manager {
  display: none;
  background: linear-gradient(180deg, rgba(202,138,4,.04), transparent 60%);
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--border);
}
html[data-role="manager"] #manager,
html[data-role="analyst"] #manager {
  display: block;
}
html[data-role="manager"] #manager {
  /* Give it visual prominence */
  background: linear-gradient(180deg, rgba(202,138,4,.08), transparent 80%);
}

/* Manager mode: dim most operational tools (they can still click through) */
html[data-role="manager"] #reconcile,
html[data-role="manager"] #tracer,
html[data-role="manager"] #kb,
html[data-role="manager"] #lookup,
html[data-role="manager"] #escHelper,
html[data-role="manager"] #forAR,
html[data-role="manager"] #forFA,
html[data-role="manager"] #forDSPS,
html[data-role="manager"] #forCounselors,
html[data-role="manager"] #forStudents {
  opacity: .55;
}

.mgr-kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .65rem;
  margin: 1.25rem 0 1.5rem;
}
.mgr-kpi {
  padding: .9rem .7rem .8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-align: center;
}
.mgr-kpi-label {
  font-family: var(--mono);
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: .5rem;
}
.mgr-kpi-num {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: .35rem;
}
.mgr-kpi-delta {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text-3);
}
.mgr-delta-up { color: var(--primary); font-weight: 700; }
.mgr-delta-down { color: var(--red); font-weight: 700; }
.mgr-delta-flat { color: var(--text-3); }

.mgr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.mgr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.25rem;
}
.mgr-card-head {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .85rem;
  padding-bottom: .55rem;
  border-bottom: 1px dashed var(--border);
}
.mgr-card-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .72rem;
}

.mgr-bars { display: flex; flex-direction: column; gap: .5rem; }
.mgr-bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 40px;
  align-items: center;
  gap: .65rem;
}
.mgr-bar-label {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mgr-bar-track {
  height: 18px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
}
.mgr-bar-fill {
  height: 100%;
  transition: width .4s cubic-bezier(.16,1,.3,1);
}
.mgr-bar-count {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.mgr-progress-num {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-2);
  margin-bottom: .4rem;
}
.mgr-progress-num strong { color: var(--text); font-weight: 700; font-size: 1rem; }
.mgr-progress-bar {
  height: 10px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: .4rem;
}
.mgr-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #CA8A04, var(--primary));
  transition: width .3s cubic-bezier(.16,1,.3,1);
}
.mgr-progress-pct {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
  text-align: right;
}

.mgr-kb-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-bottom: .75rem;
}
.mgr-kb-stat {
  padding: .65rem .4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.mgr-kb-num {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}
.mgr-kb-lbl {
  font-family: var(--mono);
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-top: .25rem;
}
.mgr-kb-warn {
  padding: .6rem .85rem;
  background: var(--amber-light);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  font-size: .75rem;
  color: var(--text-2);
  line-height: 1.5;
}

.mgr-talking {
  background: linear-gradient(180deg, rgba(202,138,4,.08), var(--surface) 50%);
  border: 1px solid var(--amber-bd);
  border-left: 4px solid #CA8A04;
  border-radius: var(--r-lg);
  padding: 1.15rem 1.35rem 1.25rem;
}
.mgr-talking-head {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #CA8A04;
  margin-bottom: .65rem;
}
.mgr-talking-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.7;
}
.mgr-talking-list li { margin-bottom: .3rem; }
.mgr-talking-list strong { color: var(--text); font-weight: 700; }

.mgr-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.mgr-empty h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--text);
  margin: 0 0 .6rem;
}
.mgr-empty p {
  font-size: .85rem;
  color: var(--text-3);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .mgr-kpi-strip { grid-template-columns: repeat(3, 1fr); }
  .mgr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .mgr-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .mgr-bar-row { grid-template-columns: 100px 1fr 36px; }
}

/* ═══════════════════════════════════════════════════════
   FOR COUNSELORS — triage workflows
   ═══════════════════════════════════════════════════════ */
#forCounselors {
  background: linear-gradient(180deg, rgba(109,40,217,.04), transparent 60%);
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--border);
}
.cnl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.cnl-group { }
.cnl-group-title {
  font-family: var(--mono);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--purple);
  font-weight: 700;
  margin-bottom: .55rem;
  padding-left: .5rem;
  border-left: 3px solid var(--purple);
}
.cnl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: .6rem;
  cursor: pointer;
  transition: all .2s;
  overflow: hidden;
}
.cnl-card:hover { border-color: var(--purple-bd); box-shadow: var(--shadow-md); }
.cnl-trigger {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.15rem;
}
.cnl-quote {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--purple);
  line-height: .8;
  flex-shrink: 0;
}
.cnl-trigger-text {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  font-style: italic;
}
.cnl-detail {
  display: none;
  padding: 0 1.15rem 1.15rem;
  border-top: 1px dashed var(--border);
  padding-top: 1rem;
}
.cnl-card.cnl-expanded .cnl-detail { display: block; }
.cnl-first {
  padding: .6rem .85rem;
  background: var(--purple-light);
  border-radius: 4px;
  margin-bottom: .85rem;
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.5;
}
.cnl-first strong { color: var(--purple); font-weight: 700; }
.cnl-label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  margin-right: .35rem;
}
.cnl-say-box {
  padding: .85rem 1rem;
  background: var(--amber-light);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  margin-bottom: .85rem;
}
.cnl-say {
  font-family: var(--display);
  font-size: .95rem;
  font-style: italic;
  color: var(--text);
  margin-top: .4rem;
  line-height: 1.55;
}
.cnl-steps-box { margin-bottom: .85rem; }
.cnl-steps {
  margin: .35rem 0 0;
  padding-left: 1.2rem;
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.6;
}
.cnl-steps li { margin-bottom: .2rem; }
.cnl-steps a { color: var(--purple); }
.cnl-escalate {
  font-size: .75rem;
  color: var(--text-3);
  padding-top: .5rem;
  border-top: 1px dashed var(--border);
  line-height: 1.5;
}

.cnl-quickref {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--primary-light);
  border: 1px solid var(--primary-bd);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-lg);
}
.cnl-quickref h3 {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 .85rem;
}
.cnl-quickref ul {
  margin: 0;
  padding-left: 1.35rem;
  font-size: .85rem;
  color: var(--text-2);
  line-height: 1.7;
}
.cnl-quickref li { margin-bottom: .4rem; }
.cnl-quickref strong { color: var(--text); font-weight: 700; }

/* ═══════════════════════════════════════════════════════
   PACKET MODAL — partner one-pager generator
   ═══════════════════════════════════════════════════════ */
.packet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10002;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 3vh 1rem;
  overflow-y: auto;
}
.packet-overlay.packet-show { display: flex; animation: searchFadeIn .2s ease; }
.packet-modal {
  width: min(860px, 100%);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
  animation: searchSlideIn .25s cubic-bezier(.16,1,.3,1);
  margin-bottom: 3rem;
}
.packet-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.packet-modal-title {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.packet-modal-sub {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
  margin-top: .2rem;
}
.packet-modal-body { padding: 1.25rem 1.5rem 1.5rem; }

.packet-picker { text-align: left; }
.packet-picker-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: .5rem;
}
.packet-picker-input {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  font-family: var(--body);
  font-size: .9rem;
  margin-bottom: .75rem;
  background: var(--surface);
  color: var(--text);
}
.packet-picker-input:focus { outline: none; border-color: var(--primary); }
.packet-picker-list {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  max-height: 400px;
  overflow-y: auto;
}
.packet-picker-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .65rem .9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: all .12s;
}
.packet-picker-item:hover { border-color: var(--primary); background: var(--primary-light); }
.packet-pi-name { font-size: .88rem; font-weight: 600; color: var(--text); }
.packet-pi-sub { font-family: var(--mono); font-size: .64rem; color: var(--text-3); }
.packet-picker-empty, .packet-error {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: .75rem;
}

.packet-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.packet-doc {
  padding: 2rem 2.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-family: var(--body);
  color: var(--text);
}
.packet-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 1rem;
}
.packet-doc-brand {
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  font-weight: 700;
}
.packet-doc-date { font-family: var(--mono); font-size: .68rem; color: var(--text-3); }
.packet-doc-title {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 .3rem;
  line-height: 1.2;
}
.packet-doc-sub {
  font-size: .85rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}

.packet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin: 1.25rem 0 1.5rem;
}
.packet-box {
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.packet-box-label {
  font-family: var(--mono);
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
}
.packet-box-val {
  font-family: var(--body);
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin: .25rem 0 .3rem;
}
.packet-box-val a { color: var(--primary); text-decoration: none; }
.packet-box-note {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  line-height: 1.4;
}

.packet-h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 .65rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.packet-contacts { margin-bottom: 1rem; }
.packet-contact-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: .82rem;
}
.packet-contact-role {
  font-family: var(--mono);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-3);
  font-weight: 700;
}
.packet-contact-value { color: var(--text); }
.packet-contact-empty {
  padding: .75rem;
  background: var(--bg-2);
  border-radius: 4px;
  font-size: .75rem;
  color: var(--text-3);
  font-style: italic;
}
.packet-notes {
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.55;
  white-space: pre-wrap;
}
.packet-kb-item {
  padding: .5rem 0;
  border-bottom: 1px dashed var(--border);
}
.packet-kb-item:last-child { border-bottom: none; }
.packet-kb-title { font-size: .88rem; font-weight: 600; color: var(--text); }
.packet-kb-meta { font-family: var(--mono); font-size: .64rem; color: var(--text-3); margin-top: .1rem; }
.packet-barriers {
  padding: .75rem 1rem;
  background: var(--red-light);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  font-size: .82rem;
  color: var(--text-2);
}
.packet-escalation { font-size: .82rem; color: var(--text-2); line-height: 1.8; }
.packet-esc-row { padding: .2rem 0; }
.packet-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .68rem;
  color: var(--text-3);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .packet-grid { grid-template-columns: 1fr; }
  .packet-doc { padding: 1.5rem 1.25rem; }
  .packet-contact-row { grid-template-columns: 1fr; gap: .1rem; }
  .stu-step { grid-template-columns: 36px 1fr; }
  .stu-step-num { width: 32px; height: 32px; font-size: 1rem; }
  .stu-trouble-row { grid-template-columns: 1fr; gap: .2rem; }
}

/* ═══════════════════════════════════════════════════════
   BARRIERS — personal state layer
   ═══════════════════════════════════════════════════════ */
.b-personal {
  padding: .75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 4px;
  font-family: var(--body);
  font-size: .82rem;
  color: var(--text-2);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.b-personal strong { color: var(--red); font-weight: 700; }

.b-card.b-active {
  border-left: 4px solid var(--red) !important;
  background: linear-gradient(90deg, var(--red-light) 0%, var(--surface) 15%);
}
.b-card.b-active .b-num { background: var(--red); color: #fff; }

.b-actions {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--border);
}
.b-active-btn {
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  padding: .35rem .75rem;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.b-active-btn:hover { border-color: var(--red); color: var(--red); }
.b-active .b-active-btn {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════
   UNDO TOAST — bottom center, slide-up
   ═══════════════════════════════════════════════════════ */
.undo-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 10003;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem .75rem 1.15rem;
  background: var(--dark-bg);
  color: var(--dark-text);
  border-radius: var(--r);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  font-family: var(--body);
  font-size: .82rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.16,1,.3,1);
}
.undo-toast.undo-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.undo-toast-msg strong { color: #fff; font-weight: 600; }
.undo-toast-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--primary);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  padding: .35rem .85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.undo-toast-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
@media (max-width: 560px) {
  .undo-toast { left: .75rem; right: .75rem; transform: translateY(10px); bottom: 1rem; }
  .undo-toast.undo-show { transform: translateY(0); }
}
.tl-meta {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
}
.tl-empty {
  padding: 2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-3);
  border: 1px dashed var(--border-2);
  border-radius: var(--r);
}
.tl-window-footer {
  padding: .65rem .85rem;
  margin: 0 0 .6rem 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
}
.tl-window-footer strong { color: var(--text-1); font-weight: 600; }
.tl-window-more {
  background: var(--surface);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .25rem .6rem;
  font-family: var(--mono);
  font-size: .7rem;
  cursor: pointer;
}
.tl-window-more:hover { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.tl-window-hint { color: var(--text-3); font-size: .68rem; }
.tl-privacy {
  margin-top: 1rem;
  padding: .6rem .85rem;
  background: var(--bg-2);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: .72rem;
  color: var(--text-3);
}
.tl-privacy code {
  font-family: var(--mono);
  background: var(--surface);
  padding: .1rem .35rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}
@media (max-width: 720px) {
  .tl-stats { grid-template-columns: repeat(2, 1fr); }
  .tl-summary { grid-template-columns: 20px 44px 1fr 90px; gap: .5rem; }
  .tl-sys, .tl-status { display: none; }
  .tl-field-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   ROLE MODE — section visibility hints per role
   Sections marked data-role-hide="..." are hidden when
   the matching role is active.
   ═══════════════════════════════════════════════════════ */

/* Student mode: hide analyst-only tools, show student guide */
html[data-role="student"] #ticketLog,
html[data-role="student"] #reconcile,
html[data-role="student"] #escHelper,
html[data-role="student"] #activity,
html[data-role="student"] #monitor,
html[data-role="student"] #tracer,
html[data-role="student"] #patterns,
html[data-role="student"] #escalation,
html[data-role="student"] #comms,
html[data-role="student"] #cvcData,
html[data-role="student"] #aiVision {
  display: none;
}
/* Student mode: surface the student section prominently */
html[data-role="student"] #forStudents { display: block; }

/* Default: student section only visible in student mode */
#forStudents { display: none; }
html[data-role="student"] #forStudents,
html[data-role="counselor"] #forStudents {
  display: block;
}

/* Counselor mode: surface counselor section, dim heavy analyst tools */
#forCounselors { display: none; }
html[data-role="counselor"] #forCounselors,
html[data-role="analyst"] #forCounselors,
html[data-role="ar"] #forCounselors,
html[data-role="fa"] #forCounselors,
html[data-role="dsps"] #forCounselors {
  display: block;
}
html[data-role="counselor"] #reconcile,
html[data-role="counselor"] #activity,
html[data-role="counselor"] #ticketLog {
  opacity: .55;
}
html[data-role="counselor"] #reconcile:hover,
html[data-role="counselor"] #activity:hover,
html[data-role="counselor"] #ticketLog:hover {
  opacity: 1;
}

/* Role-specific workflow sections — show only to their own role
   (and analyst as a reference) by default */
#forAR, #forFA, #forDSPS { display: none; }

html[data-role="ar"] #forAR,
html[data-role="analyst"] #forAR {
  display: block;
}
html[data-role="fa"] #forFA,
html[data-role="analyst"] #forFA {
  display: block;
}
html[data-role="dsps"] #forDSPS,
html[data-role="analyst"] #forDSPS {
  display: block;
}

/* Analyst sees them but slightly dimmed so they don't crowd the main tools */
html[data-role="analyst"] #forAR,
html[data-role="analyst"] #forFA,
html[data-role="analyst"] #forDSPS,
html[data-role="analyst"] #forCounselors {
  opacity: .85;
}
html[data-role="analyst"] #forAR:hover,
html[data-role="analyst"] #forFA:hover,
html[data-role="analyst"] #forDSPS:hover,
html[data-role="analyst"] #forCounselors:hover {
  opacity: 1;
}

/* A&R / FA / DSPS modes dim analyst power tools */
html[data-role="ar"] #reconcile,
html[data-role="fa"] #reconcile,
html[data-role="dsps"] #reconcile,
html[data-role="ar"] #activity,
html[data-role="fa"] #activity,
html[data-role="dsps"] #activity {
  opacity: .55;
}
html[data-role="ar"] #reconcile:hover,
html[data-role="fa"] #reconcile:hover,
html[data-role="dsps"] #reconcile:hover,
html[data-role="ar"] #activity:hover,
html[data-role="fa"] #activity:hover,
html[data-role="dsps"] #activity:hover {
  opacity: 1;
}

/* Role-tagged sections get a subtle colored accent */
body.role-student .hub-title em { color: #0EA5E9; -webkit-text-fill-color: #0EA5E9; background: none; }
body.role-counselor .hub-title em { color: var(--purple); -webkit-text-fill-color: var(--purple); background: none; }
body.role-ar .hub-title em { color: var(--blue); -webkit-text-fill-color: var(--blue); background: none; }
body.role-fa .hub-title em { color: var(--amber); -webkit-text-fill-color: var(--amber); background: none; }
body.role-dsps .hub-title em { color: var(--teal); -webkit-text-fill-color: var(--teal); background: none; }

/* ═══════════════════════════════════════════════════════
   TODAY DASHBOARD — personal workbench at top of page
   ═══════════════════════════════════════════════════════ */
.sec-today {
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 10% 0%, rgba(15,118,110,.035) 0%, transparent 60%),
    linear-gradient(180deg, rgba(15,118,110,.02) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.today-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.today-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: .4rem;
}
.today-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 2s infinite;
}
.today-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  margin: 0;
  line-height: 1;
}
.today-head-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.today-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--body);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.today-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.today-btn kbd {
  font-family: var(--mono);
  font-size: .65rem;
  padding: .1rem .4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
}
.today-btn:hover kbd { background: var(--surface); border-color: var(--primary-bd); color: var(--primary); }

.today-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .65rem;
  margin-bottom: 1.25rem;
}
.today-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .9rem .85rem .8rem;
  text-align: center;
  transition: all .15s;
}
.today-stat:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.today-alert { border-color: var(--amber-bd); background: var(--amber-light); }
.today-urgent { border-color: var(--red-bd); background: var(--red-light); }
.today-stat-num {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  margin-bottom: .35rem;
}
.today-stat-label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}

.today-rollup {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.today-rollup-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 700;
  flex-shrink: 0;
}
.today-rollup-items {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--body);
  font-size: .78rem;
  color: var(--text-2);
}
.today-rollup-item strong {
  color: var(--text);
  font-weight: 700;
  font-size: .95rem;
  margin-right: .15rem;
}

.today-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
}

.today-card-outreach .today-card-title { color: var(--teal); }
.today-outreach-stats {
  display: flex;
  gap: .75rem;
  padding-bottom: .5rem;
  margin-bottom: .55rem;
  border-bottom: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--text-3);
}
.today-or-stat strong { color: var(--text); font-weight: 700; font-size: .82rem; margin-right: .15rem; }
.today-or-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
  margin-top: .35rem;
}
.today-or-planned { background: var(--text-3); }
.today-or-in-progress { background: var(--blue); }
.today-or-done { background: var(--primary); }
.today-or-skipped { background: var(--bg-3); border: 1px solid var(--border-2); }
.today-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  transition: all .15s;
}
.today-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); }
.today-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .85rem;
  padding-bottom: .65rem;
  border-bottom: 1px dashed var(--border);
}
.today-card-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.today-card-action {
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 600;
  padding: .3rem .6rem;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.today-card-action:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.today-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.today-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem;
  align-items: flex-start;
  padding: .5rem .55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  color: inherit;
}
.today-item:hover { background: var(--bg-2); }
.today-age {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 700;
  padding: .18rem .4rem;
  border-radius: 3px;
  text-align: center;
  min-width: 32px;
}
.today-age-ok { background: var(--primary-light); color: var(--primary); }
.today-age-amber { background: var(--amber-light); color: var(--amber); }
.today-age-red { background: var(--red-light); color: var(--red); }
.today-kb-tag {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 600;
  padding: .2rem .45rem;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 3px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-college-mark {
  color: var(--primary);
  font-size: .8rem;
  line-height: 1;
  padding-top: .15rem;
}
.today-item-main {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.today-item-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.today-item-sub {
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-empty {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-3);
  text-align: center;
  padding: 1.5rem .5rem;
  line-height: 1.5;
}
.today-empty kbd {
  display: inline-block;
  padding: .1rem .4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .62rem;
  color: var(--text-2);
}
.today-hint {
  margin-top: 1rem;
  padding: .6rem .9rem;
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--text-3);
  text-align: center;
  border-top: 1px dashed var(--border);
}
@media (max-width: 1100px) {
  .today-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .today-grid { grid-template-columns: 1fr; }
  .today-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .today-strip { grid-template-columns: repeat(2, 1fr); }
  .today-head { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════════
   GLOBAL SEARCH OVERLAY — ⌘K
   ═══════════════════════════════════════════════════════ */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.search-overlay.search-show { display: flex; animation: searchFadeIn .15s ease; }
@keyframes searchFadeIn { from { opacity: 0; } to { opacity: 1; } }

.search-modal {
  width: min(640px, 94vw);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 72vh;
  animation: searchSlideIn .2s cubic-bezier(.16,1,.3,1);
}
@keyframes searchSlideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.search-input-icon {
  font-size: 1.1rem;
  opacity: .5;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-3); }
.search-input-hint {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  flex-shrink: 0;
}
.search-input-hint kbd {
  display: inline-block;
  padding: .08rem .35rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: .58rem;
  color: var(--text-2);
}

.search-results {
  overflow-y: auto;
  flex: 1;
  padding: .4rem;
}
.search-result {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .65rem .8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s;
}
.search-result.search-selected {
  background: var(--primary-light);
}
.search-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 700;
}
.search-icon-section { background: var(--bg-2); color: var(--text-2); }
.search-icon-ticket { background: var(--blue-light); color: var(--blue); }
.search-icon-kb { background: var(--amber-light); color: var(--amber); }
.search-icon-college { background: var(--primary-light); color: var(--primary); }
.search-icon-glossary { background: var(--bg-2); color: var(--text-2); }
.search-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .12rem;
}
.search-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.search-desc {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-kind {
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.search-empty {
  padding: 2rem 1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-3);
}
.search-footer {
  padding: .6rem 1.1rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text-3);
}
.search-footer kbd {
  display: inline-block;
  padding: .08rem .35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: .58rem;
  color: var(--text-2);
  margin-right: .25rem;
}

/* ═══════════════════════════════════════════════════════
   RECONCILIATION HELPER
   ═══════════════════════════════════════════════════════ */
.rc-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: .85rem;
}
.rc-input { display: flex; flex-direction: column; gap: .3rem; }
.rc-input label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
  font-weight: 600;
}
.rc-input textarea {
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: .72rem;
  line-height: 1.5;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  min-height: 140px;
}
.rc-input textarea:focus { outline: none; border-color: var(--primary); }
.rc-actions {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
}
.rc-mapping {
  padding: .75rem .9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: .85rem;
}
.rc-mapping-title {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: .5rem;
}
.rc-mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .4rem;
}
.rc-mapping-grid > div {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.rc-m-label {
  font-family: var(--mono);
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}
.rc-m-val {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text);
  font-weight: 600;
}
.rc-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .55rem;
  margin-bottom: 1rem;
}
.rc-sum-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .7rem .5rem;
  text-align: center;
}
.rc-sum-num {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
}
.rc-sum-label {
  font-family: var(--mono);
  font-size: .54rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-top: .3rem;
}
.rc-section {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.rc-section-red { border-color: var(--red-bd); }
.rc-section-red .rc-section-head { background: var(--red-light); }
.rc-section-red .rc-section-title { color: var(--red); }
.rc-section-amber { border-color: var(--amber-bd); }
.rc-section-amber .rc-section-head { background: var(--amber-light); }
.rc-section-amber .rc-section-title { color: var(--amber); }
.rc-section-head {
  padding: .75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.rc-section-title {
  font-family: var(--body);
  font-size: .88rem;
  font-weight: 600;
}
.rc-section-help {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--text-3);
  line-height: 1.4;
}
.rc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .74rem;
  font-family: var(--mono);
}
.rc-table th, .rc-table td {
  padding: .45rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.rc-table th {
  background: var(--surface-2);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  font-weight: 600;
}
.rc-table tbody tr:hover { background: var(--bg-2); }
.rc-diff-l { color: var(--blue); font-weight: 600; }
.rc-diff-r { color: var(--red); font-weight: 600; }
.rc-more {
  padding: .55rem 1rem;
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--text-3);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.rc-hint {
  padding: 1.25rem 1rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--text-3);
  background: var(--bg-2);
  border-radius: var(--r);
  border: 1px dashed var(--border-2);
  line-height: 1.55;
}
.rc-error {
  padding: 1rem 1.15rem;
  background: var(--red-light);
  border: 1px solid var(--red-bd);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--red);
  line-height: 1.5;
}
.rc-error code {
  background: var(--surface);
  padding: .08rem .35rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.rc-clean {
  padding: 1.5rem;
  text-align: center;
  background: var(--primary-light);
  border: 1px solid var(--primary-bd);
  border-radius: var(--r);
  color: var(--primary);
  font-weight: 600;
  font-size: .95rem;
}
.rc-privacy {
  margin-top: 1rem;
  padding: .6rem .85rem;
  background: var(--bg-2);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: .7rem;
  color: var(--text-3);
  line-height: 1.5;
}
@media (max-width: 820px) {
  .rc-input-grid { grid-template-columns: 1fr; }
  .rc-summary { grid-template-columns: repeat(3, 1fr); }
}

.rc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: .6rem .85rem;
  background: var(--surface-2);
  border-radius: var(--r);
  min-height: 36px;
}
.rc-presets-label {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  margin-right: .3rem;
}
.rc-presets-empty {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
}
.rc-preset-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
}
.rc-preset-name {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  padding: .3rem .7rem;
  background: transparent;
  border: none;
  color: var(--blue);
  cursor: pointer;
}
.rc-preset-name:hover { background: var(--blue-light); }
.rc-preset-x {
  font-size: .8rem;
  padding: .2rem .45rem;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  line-height: 1;
}
.rc-preset-x:hover { color: var(--red); background: var(--red-light); }

/* ═══════════════════════════════════════════════════════
   SEARCH FLOATING ACTION BUTTON
   ═══════════════════════════════════════════════════════ */
.search-fab {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 100px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all .2s cubic-bezier(.16,1,.3,1);
  font-family: var(--body);
  color: var(--text-2);
}
.search-fab:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}
.search-fab-icon {
  font-size: 1rem;
  line-height: 1;
}
.search-fab-key {
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 600;
  padding: .15rem .45rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-3);
}
.search-fab:hover .search-fab-key {
  background: var(--primary-light);
  border-color: var(--primary-bd);
  color: var(--primary);
}
@media (max-width: 640px) {
  .search-fab {
    bottom: 1rem;
    left: 1rem;
    padding: .65rem .85rem;
  }
  .search-fab-key { display: none; }
}

/* ═══════════════════════════════════════════════════════
   WELCOME TOUR MODAL
   ═══════════════════════════════════════════════════════ */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.welcome-overlay.welcome-show { display: flex; animation: searchFadeIn .2s ease; }
.welcome-modal {
  position: relative;
  width: min(580px, 100%);
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 2.25rem 2.25rem 1.75rem;
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
  animation: searchSlideIn .25s cubic-bezier(.16,1,.3,1);
}
.welcome-close {
  position: absolute;
  top: .75rem;
  right: .85rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}
.welcome-close:hover { background: var(--bg-2); color: var(--text); }

.welcome-progress {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.5rem;
}
.welcome-dot {
  flex: 1;
  height: 4px;
  background: var(--bg-3);
  border-radius: 100px;
  transition: background .3s;
}
.welcome-dot-done { background: var(--primary-bd); }
.welcome-dot-active { background: var(--primary); }

.welcome-title {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.25;
}
.welcome-content {
  font-family: var(--body);
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 1.25rem;
}
.welcome-content strong { color: var(--text); }
.welcome-content kbd {
  display: inline-block;
  padding: .1rem .4rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-2);
}
.welcome-foot-note {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-3);
  padding: .75rem .9rem;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}
.welcome-foot-note kbd {
  display: inline-block;
  padding: .08rem .35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-2);
}
.welcome-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.welcome-step-count {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
}

/* ═══════════════════════════════════════════════════════
   REAL OUTREACH — Personal calendar
   ═══════════════════════════════════════════════════════ */
.ro-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin-bottom: 1rem;
}
.ro-sum-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .8rem .6rem;
  text-align: center;
}
.ro-sum-num {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  margin-bottom: .3rem;
}
.ro-sum-label {
  font-family: var(--mono);
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}

.ro-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .8rem;
}
.ro-month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: .85rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-height: 120px;
}
.ro-month-current {
  border-color: var(--primary-bd);
  background: linear-gradient(180deg, var(--primary-light), var(--surface) 60%);
}
.ro-month-has { box-shadow: var(--shadow); }
.ro-month-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed var(--border);
}
.ro-month-name {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.ro-month-count {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  padding: .15rem .45rem;
  background: var(--bg-2);
  border-radius: 100px;
}
.ro-month-add {
  width: 22px;
  height: 22px;
  border: 1px dashed var(--border-2);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.ro-month-add:hover { border-color: var(--primary); color: var(--primary); border-style: solid; }
.ro-month-empty {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
  text-align: center;
  padding: .5rem;
}

.ro-events { display: flex; flex-direction: column; gap: .45rem; }
.ro-event {
  display: grid;
  grid-template-columns: 80px 1fr 60px 22px;
  gap: .4rem;
  align-items: center;
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}
.ro-event textarea {
  grid-column: 1 / -1;
  padding: .35rem .5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .7rem;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  margin-top: .35rem;
}
.ro-event textarea:focus { outline: none; border-color: var(--primary); }
.ro-event.ro-status-done { background: var(--primary-light); border-color: var(--primary-bd); }
.ro-event.ro-status-done .ro-title-input { text-decoration: line-through; color: var(--text-3); }
.ro-event.ro-status-skipped { opacity: .55; }
.ro-event.ro-status-in-progress { border-left: 3px solid var(--blue); }

.ro-status-pill {
  padding: .25rem .35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
}
.ro-title-input {
  padding: .3rem .45rem;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--body);
  font-size: .78rem;
  color: var(--text);
  border-radius: 4px;
}
.ro-title-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}
.ro-month-select {
  padding: .25rem .3rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  cursor: pointer;
}
.ro-del {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}
.ro-del:hover { color: var(--red); background: var(--red-light); }

.ro-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.ro-empty h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 .5rem;
}
.ro-empty p {
  font-size: .82rem;
  color: var(--text-3);
  max-width: 500px;
  margin: 0 auto 1rem;
  line-height: 1.55;
}
@media (max-width: 980px) {
  .ro-month-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .ro-month-grid { grid-template-columns: 1fr; }
  .ro-summary { grid-template-columns: repeat(2, 1fr); }
  .ro-event { grid-template-columns: 70px 1fr 22px; }
  .ro-event .ro-month-select { display: none; }
}

/* ═══════════════════════════════════════════════════════
   DEMO DATA BADGE — marks sections with simulated content
   ═══════════════════════════════════════════════════════ */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .22rem .55rem;
  border-radius: 100px;
  background: var(--bg-3);
  color: var(--text-3);
  border: 1px solid var(--border-2);
  margin-left: .5rem;
  vertical-align: middle;
  cursor: help;
}
.demo-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
}

/* ═══════════════════════════════════════════════════════
   ONBOARDING CHECKLIST — First 30 Days
   ═══════════════════════════════════════════════════════ */
#onboarding {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
  background: linear-gradient(180deg, transparent 0%, rgba(161,98,7,.025) 100%);
  border-bottom: 1px solid var(--border);
}
.ob-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.ob-sub {
  font-family: var(--body);
  font-size: .82rem;
  color: var(--text-3);
  margin: .35rem 0 0;
  max-width: 560px;
  line-height: 1.55;
}
.ob-head-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 280px;
  justify-content: flex-end;
}
.ob-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 200px;
}
.ob-progress-label {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-2);
}
.ob-progress-label strong { color: var(--text); font-size: .9rem; }
.ob-pct {
  float: right;
  color: var(--amber);
  font-weight: 700;
}
.ob-progress-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
}
.ob-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--primary));
  transition: width .3s cubic-bezier(.16,1,.3,1);
}
.ob-head-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

.ob-group {
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ob-group-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.ob-group-title {
  flex: 1;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.ob-group-count {
  font-family: var(--mono);
  font-size: .68rem;
  color: var(--text-3);
  padding: .18rem .5rem;
  background: var(--bg-2);
  border-radius: 100px;
}
.ob-group-add {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px dashed var(--border-2);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all .15s;
}
.ob-group-add:hover { border-color: var(--primary); color: var(--primary); border-style: solid; }

.ob-items { display: flex; flex-direction: column; }
.ob-item {
  display: grid;
  grid-template-columns: 24px 80px 1fr 24px;
  align-items: center;
  gap: .65rem;
  padding: .55rem .9rem;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.ob-item:last-child { border-bottom: none; }
.ob-item:hover { background: var(--bg-2); }
.ob-item.ob-done .ob-text-input { text-decoration: line-through; color: var(--text-3); }
.ob-item.ob-done { background: var(--primary-light); }
.ob-item.ob-done:hover { background: var(--primary-light); }

.ob-check {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ob-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.ob-checkmark {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-2);
  border-radius: 5px;
  transition: all .15s;
  background: var(--surface);
}
.ob-check:hover .ob-checkmark { border-color: var(--primary); }
.ob-check input:checked + .ob-checkmark {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: contain;
}

.ob-cat {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .2rem .45rem;
  border-radius: 3px;
  text-align: center;
}
.ob-cat-access { background: var(--blue-light); color: var(--blue); }
.ob-cat-people { background: var(--primary-light); color: var(--primary); }
.ob-cat-learn { background: var(--amber-light); color: var(--amber); }
.ob-cat-tool { background: var(--purple-light); color: var(--purple); }
.ob-cat-produce { background: #dcfce7; color: #166534; }
.ob-cat-plan { background: #fce7f3; color: #9d174d; }
.ob-cat-habit { background: var(--bg-3); color: var(--text-2); }
.ob-cat-custom { background: var(--bg-2); color: var(--text-3); }

.ob-text-input {
  border: none;
  background: transparent;
  font-family: var(--body);
  font-size: .86rem;
  color: var(--text);
  outline: none;
  padding: .25rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color .15s;
}
.ob-text-input:focus { border-bottom-color: var(--primary); }

.ob-del {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0;
  transition: all .15s;
}
.ob-item:hover .ob-del { opacity: 1; }
.ob-del:hover { color: var(--red); background: var(--red-light); }

@media (max-width: 720px) {
  .ob-header { flex-direction: column; }
  .ob-head-right { min-width: 0; width: 100%; justify-content: flex-start; }
  .ob-item { grid-template-columns: 24px 1fr 24px; }
  .ob-cat { display: none; }
}

/* ═══════════════════════════════════════════════════════
   BACKUP / RESTORE MODAL
   ═══════════════════════════════════════════════════════ */
.backup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 21, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.backup-overlay.backup-show { display: flex; animation: searchFadeIn .15s ease; }
.backup-modal {
  width: min(520px, 100%);
  max-height: 85vh;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: searchSlideIn .2s cubic-bezier(.16,1,.3,1);
}
.backup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.backup-title {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.backup-sub {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-3);
  margin-top: .2rem;
}
.backup-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}
.backup-close:hover { background: var(--bg-2); color: var(--text); }
.backup-body {
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.backup-section {
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}
.backup-section:last-child { border-bottom: none; padding-bottom: 0; }
.backup-section-title {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: .5rem;
}
.backup-help {
  font-family: var(--body);
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0 0 .75rem;
}
.backup-stats {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .6rem .85rem;
  font-family: var(--mono);
  font-size: .74rem;
}
.backup-stat-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .75rem;
  padding: .25rem 0;
  color: var(--text-2);
}
.backup-stat-name { color: var(--text); font-weight: 600; }
.backup-stat-count { color: var(--text-3); }
.backup-stat-size { color: var(--text-3); min-width: 50px; text-align: right; }
.backup-stat-total {
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  text-align: right;
}
.backup-danger { background: var(--red-light); padding: 1rem 1.15rem; border-radius: var(--r); border: 1px solid var(--red-bd); }
.backup-danger .backup-section-title { color: var(--red); }

/* ═══════════════════════════════════════════════════════
   ESCALATION HELPER — fill-in form + drafts
   ═══════════════════════════════════════════════════════ */
.esc-helper-grid {
  display: grid;
  grid-template-columns: minmax(0, 440px) 1fr;
  gap: 1.25rem;
}
.esc-helper-form { display: flex; flex-direction: column; gap: 1rem; }
.esc-helper-output {
  max-height: 720px;
  overflow-y: auto;
  padding-right: .5rem;
}

.esc-sev-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}
.esc-sev-btn {
  padding: .75rem .65rem;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .3rem;
  text-align: left;
  transition: all .15s;
}
.esc-sev-btn:hover { border-color: var(--text-3); }
.esc-sev-label {
  font-family: var(--mono);
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}
.esc-sev-text {
  font-family: var(--body);
  font-size: .65rem;
  color: var(--text-3);
  line-height: 1.35;
}
.esc-sev-p1.esc-sev-active { border-color: var(--red); background: var(--red-light); }
.esc-sev-p1.esc-sev-active .esc-sev-label { color: var(--red); }
.esc-sev-p2.esc-sev-active { border-color: var(--amber); background: var(--amber-light); }
.esc-sev-p2.esc-sev-active .esc-sev-label { color: var(--amber); }
.esc-sev-p3.esc-sev-active { border-color: var(--blue); background: var(--blue-light); }
.esc-sev-p3.esc-sev-active .esc-sev-label { color: var(--blue); }

.esc-meta {
  padding: .75rem .9rem;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .76rem;
  line-height: 1.55;
  color: var(--text-2);
}
.esc-meta-p1 { background: var(--red-light); border-color: var(--red-bd); }
.esc-meta-p2 { background: var(--amber-light); border-color: var(--amber-bd); }
.esc-meta-p3 { background: var(--blue-light); border-color: var(--blue-bd); }
.esc-meta-row { display: flex; gap: .75rem; padding: .15rem 0; }
.esc-meta-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  min-width: 110px;
  flex-shrink: 0;
}

.esc-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.esc-field { display: flex; flex-direction: column; gap: .25rem; }
.esc-field-full { grid-column: 1 / -1; }
.esc-field label {
  font-family: var(--mono);
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 600;
}
.esc-field input,
.esc-field select {
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--body);
  font-size: .82rem;
  background: var(--surface);
  color: var(--text);
}
.esc-field input:focus,
.esc-field select:focus { outline: none; border-color: var(--primary); }
.esc-form-actions { display: flex; gap: .5rem; }

.esc-output-title {
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: .75rem;
}
.esc-checklist {
  padding: .85rem 1rem;
  background: var(--primary-light);
  border: 1px solid var(--primary-bd);
  border-radius: var(--r);
  margin-bottom: 1rem;
}
.esc-checklist-title {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: .5rem;
}
.esc-checklist ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.65;
}
.esc-checklist li { margin-bottom: .25rem; }

.esc-draft {
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: .7rem;
  overflow: hidden;
}
.esc-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .85rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.esc-draft-label {
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  font-weight: 600;
}
.esc-draft-copy {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.esc-draft-copy:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.esc-draft-body {
  margin: 0;
  padding: .85rem 1rem;
  background: var(--surface);
  font-family: var(--mono);
  font-size: .74rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 980px) {
  .esc-helper-grid { grid-template-columns: 1fr; }
  .esc-helper-output { max-height: none; padding-right: 0; }
}
@media (max-width: 560px) {
  .esc-form-grid { grid-template-columns: 1fr; }
  .esc-sev-picker { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   REAL MONITOR — Active colleges from ticket log
   ═══════════════════════════════════════════════════════ */
.rm-view-toggle {
  display: flex;
  gap: .35rem;
  margin: 0 auto 0 0;
}
.rm-view-btn {
  font-family: var(--mono);
  font-size: .62rem;
  font-weight: 600;
  padding: .35rem .65rem;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  transition: all .15s;
}
.rm-view-btn:hover { color: var(--text); }
.rm-view-btn.rm-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.demo-view-banner {
  padding: .65rem .9rem;
  background: var(--bg-2);
  border-left: 3px solid var(--text-3);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-3);
  margin-bottom: 1rem;
}
.rm-pulse {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .6rem;
  margin-bottom: 1.25rem;
}
.rm-pulse-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .85rem .6rem;
  text-align: center;
}
.rm-pulse-num {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  margin-bottom: .35rem;
}
.rm-pulse-label {
  font-family: var(--mono);
  font-size: .55rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}
.rm-list-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .75rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.rm-list-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.rm-list-hint {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-3);
  line-height: 1.5;
}
.rm-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.rm-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: .85rem;
  align-items: center;
  padding: .75rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: all .15s;
}
.rm-row:hover {
  border-color: var(--primary-bd);
  background: var(--primary-light);
  transform: translateX(2px);
}
.rm-info { min-width: 0; }
.rm-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rm-sub {
  font-family: var(--mono);
  font-size: .66rem;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.rm-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.rm-empty h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 .5rem;
}
.rm-empty p {
  font-size: .82rem;
  color: var(--text-3);
  max-width: 420px;
  margin: 0 auto 1rem;
  line-height: 1.55;
}
@media (max-width: 820px) {
  .rm-pulse { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .rm-pulse { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════
   REAL PATTERNS — Chart from real tickets
   ═══════════════════════════════════════════════════════ */
.rp-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
  margin-bottom: 1rem;
}
.rp-sum-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: .85rem .6rem;
  text-align: center;
}
.rp-sum-num {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  margin-bottom: .3rem;
}
.rp-sum-label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}

.rp-group-picker {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.rp-group-label {
  font-family: var(--mono);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 600;
}
.rp-group-btn {
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  padding: .35rem .8rem;
  border: 1px solid var(--border-2);
  border-radius: 100px;
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  text-transform: capitalize;
  transition: all .15s;
}
.rp-group-btn:hover { color: var(--text); border-color: var(--text-3); }
.rp-group-btn.rp-active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.rp-chart {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  margin-bottom: 1rem;
}
.rp-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: .75rem;
  min-height: 28px;
}
.rp-bar-label {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-2);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-bar-track {
  height: 22px;
  background: var(--purple-light);
  border-radius: 4px;
  position: relative;
  min-width: 4px;
  transition: width .4s cubic-bezier(.16,1,.3,1);
}
.rp-bar-open {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: var(--purple);
  border-radius: 4px;
  transition: width .4s cubic-bezier(.16,1,.3,1);
}
.rp-bar-count {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
  white-space: nowrap;
}
.rp-bar-open-badge {
  font-size: .58rem;
  padding: .1rem .35rem;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 3px;
  font-weight: 600;
}
.rp-legend {
  display: flex;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--text-3);
  padding-top: .85rem;
  border-top: 1px dashed var(--border);
}
.rp-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.rp-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.rp-swatch-open { background: var(--purple); }
.rp-swatch-all { background: var(--purple-light); }

.rp-resolution {
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.rp-resolution-head {
  margin-bottom: .9rem;
  padding-bottom: .75rem;
  border-bottom: 1px dashed var(--border);
}
.rp-resolution-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.rp-resolution-help {
  display: block;
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--text-3);
  margin-top: .2rem;
  line-height: 1.5;
}
.rp-resolution-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-bottom: 1rem;
}
.rp-res-stat {
  padding: .75rem .6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-align: center;
}
.rp-res-num {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.rp-res-label {
  font-family: var(--mono);
  font-size: .56rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-top: .3rem;
}
.rp-res-sys-label {
  font-family: var(--mono);
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: .5rem;
}
.rp-res-sys-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: .74rem;
}
.rp-res-sys-row:last-child { border-bottom: none; }
.rp-res-sys-name { color: var(--text); font-weight: 600; }
.rp-res-sys-count { color: var(--text-3); min-width: 30px; text-align: right; }
.rp-res-sys-time { color: var(--purple); font-weight: 700; min-width: 60px; text-align: right; }

.rp-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.rp-empty h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--text);
  margin: 0 0 .5rem;
}
.rp-empty p {
  font-size: .82rem;
  color: var(--text-3);
  max-width: 420px;
  margin: 0 auto 1rem;
  line-height: 1.55;
}
@media (max-width: 720px) {
  .rp-summary { grid-template-columns: repeat(2, 1fr); }
  .rp-bar-row { grid-template-columns: 110px 1fr auto; }
  .rp-bar-label { font-size: .66rem; }
}

/* ═══════════════════════════════════════════════════════
   REAL TRACER — Interactive 5-stage diagnostic checklist
   ═══════════════════════════════════════════════════════ */
.rt-header {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.rt-form-row {
  display: grid;
  grid-template-columns: 2fr 3fr 90px;
  gap: .75rem;
  margin-bottom: .85rem;
}
.rt-field { display: flex; flex-direction: column; gap: .25rem; }
.rt-field label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
}
.rt-field input,
.rt-field select {
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--body);
  font-size: .82rem;
  background: var(--surface);
  color: var(--text);
}
.rt-field input:focus,
.rt-field select:focus { outline: none; border-color: var(--primary); }

.rt-prog-wrap { margin-bottom: .85rem; }
.rt-prog-label {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text-2);
  margin-bottom: .35rem;
}
.rt-prog-label strong { color: var(--text); font-size: .9rem; }
.rt-prog-pct {
  float: right;
  color: var(--primary);
  font-weight: 700;
}
.rt-prog-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
}
.rt-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, #be185d, var(--primary));
  transition: width .3s cubic-bezier(.16,1,.3,1);
}
.rt-header-actions { display: flex; gap: .5rem; }

.rt-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .55rem;
  margin-bottom: 1rem;
}
.rt-stage {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .75rem .85rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  min-width: 0;
}
.rt-stage:hover { border-color: var(--border-2); }
.rt-stage-active {
  border-color: #be185d;
  background: rgba(190, 24, 93, .05);
  box-shadow: 0 2px 8px rgba(190, 24, 93, .1);
}
.rt-stage-complete {
  border-color: var(--primary-bd);
  background: var(--primary-light);
}
.rt-stage-complete .rt-stage-icon {
  background: var(--primary);
  color: #fff;
}
.rt-stage-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.rt-stage-active .rt-stage-icon {
  background: #be185d;
  color: #fff;
}
.rt-stage-info {
  flex: 1;
  min-width: 0;
}
.rt-stage-label {
  font-family: var(--body);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rt-stage-progress {
  height: 3px;
  background: var(--bg-3);
  border-radius: 100px;
  overflow: hidden;
  margin: .35rem 0 .2rem;
}
.rt-stage-progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width .3s;
}
.rt-stage-count {
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-3);
}

.rt-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem;
}
.rt-detail-head {
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px dashed var(--border);
}
.rt-detail-label {
  font-family: var(--mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #be185d;
  font-weight: 700;
  margin-bottom: .3rem;
}
.rt-detail-prompt {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.45;
}

.rt-questions { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.rt-question {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  cursor: pointer;
  transition: all .12s;
}
.rt-question:hover { border-color: var(--border-2); background: var(--bg-2); }
.rt-question input { display: none; }
.rt-q-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-2);
  border-radius: 4px;
  background: var(--surface);
  margin-top: 1px;
  transition: all .15s;
}
.rt-question:hover .rt-q-check { border-color: #be185d; }
.rt-question input:checked + .rt-q-check {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: contain;
}
.rt-q-text {
  flex: 1;
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.55;
}
.rt-q-done .rt-q-text { color: var(--text-3); text-decoration: line-through; }

.rt-note-wrap { display: flex; flex-direction: column; gap: .3rem; }
.rt-note-wrap label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
}
.rt-note-wrap textarea {
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: .74rem;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.rt-note-wrap textarea:focus { outline: none; border-color: var(--primary); }

@media (max-width: 780px) {
  .rt-form-row { grid-template-columns: 1fr; }
  .rt-stages { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .rt-stages { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════
   REAL COMMS — Routine fill-in templates
   ═══════════════════════════════════════════════════════ */
.rcc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  min-height: 520px;
}
.rcc-sidebar {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.rcc-sidebar-label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 700;
  padding: .4rem .6rem;
  margin-bottom: .2rem;
}
.rcc-tab {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  color: var(--text-2);
}
.rcc-tab:hover { background: var(--bg-2); color: var(--text); }
.rcc-tab-active {
  background: var(--surface);
  border-color: #4338ca;
  color: #4338ca;
  font-weight: 600;
}
.rcc-tab-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}
.rcc-tab-label {
  font-size: .78rem;
  line-height: 1.3;
}

.rcc-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.rcc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.rcc-form-head { padding-bottom: .5rem; border-bottom: 1px dashed var(--border); }
.rcc-form-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.rcc-field { display: flex; flex-direction: column; gap: .25rem; }
.rcc-field label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
}
.rcc-field input {
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--body);
  font-size: .82rem;
  background: var(--surface-2);
  color: var(--text);
}
.rcc-field input:focus { outline: none; border-color: #4338ca; }
.rcc-form-actions { display: flex; gap: .5rem; margin-top: .3rem; }

.rcc-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
}
.rcc-preview-label {
  font-family: var(--mono);
  font-size: .58rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 700;
  margin-bottom: .65rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed var(--border);
}
.rcc-preview-body {
  flex: 1;
  margin: 0;
  font-family: var(--mono);
  font-size: .76rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border-radius: var(--r);
  padding: .85rem 1rem;
  overflow-y: auto;
  max-height: 520px;
}

@media (max-width: 900px) {
  .rcc-layout { grid-template-columns: 1fr; }
  .rcc-sidebar { flex-direction: row; flex-wrap: wrap; padding: .6rem; gap: .4rem; }
  .rcc-sidebar-label { display: none; }
  .rcc-tab { flex: 1; min-width: 120px; }
  .rcc-right { grid-template-columns: 1fr; }
}

/* ── Insights (narrative analytics) ──────────────────────────── */
.rp-insights-mount { margin: 1rem 0 1.5rem; }
.ins-head {
  display: flex; align-items: baseline; gap: .75rem;
  margin-bottom: .75rem; padding-bottom: .5rem;
  border-bottom: 1px dashed var(--border);
}
.ins-head-title {
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-2);
}
.ins-head-sub { font-family: var(--mono); font-size: .62rem; color: var(--text-3); }
.ins-empty {
  padding: 1rem; border: 1px dashed var(--border); border-radius: 8px;
  font-size: .78rem; color: var(--text-2); line-height: 1.55;
}
.ins-empty strong { color: var(--text-1); }
.ins-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .75rem;
}
.ins-card {
  border: 1px solid var(--border); border-radius: 8px;
  padding: .8rem .9rem; background: var(--bg-1);
  display: flex; flex-direction: column; gap: .5rem;
}
.ins-card-head {
  display: flex; align-items: flex-start; gap: .55rem;
}
.ins-card-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: .32rem; flex-shrink: 0; background: var(--text-3);
}
.ins-card-title {
  font-size: .82rem; font-weight: 600; color: var(--text-1); line-height: 1.35;
}
.ins-card-detail {
  font-size: .68rem; color: var(--text-3); line-height: 1.55;
  padding-left: 1rem; border-left: 2px solid var(--border);
}
.ins-card-body { font-family: var(--mono); font-size: .66rem; color: var(--text-2); }
.ins-sev-info .ins-card-dot { background: var(--blue); }
.ins-sev-notice .ins-card-dot { background: var(--amber); }
.ins-sev-warn {
  border-color: var(--red-bd, var(--border));
  background: var(--red-light, var(--bg-1));
}
.ins-sev-warn .ins-card-dot { background: var(--red); }
.ins-sev-warn .ins-card-title { color: var(--text-1); }
.ins-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: .5rem; padding: .2rem 0;
  border-bottom: 1px dotted var(--border);
}
.ins-row:last-child { border-bottom: none; }
.ins-row-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2); font-size: .66rem;
}
.ins-row-val { color: var(--text-1); font-weight: 600; font-size: .66rem; white-space: nowrap; }
.ins-row-bar-wrap {
  grid-column: 1 / 2; grid-row: 2 / 3;
  height: 4px; background: var(--bg-2); border-radius: 2px; overflow: hidden;
}
.ins-row-bar { display: block; height: 100%; background: var(--primary); }
.ins-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.ins-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 100px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: .62rem; color: var(--text-2);
}
.ins-chip-n {
  background: var(--primary-light, var(--bg-1));
  color: var(--primary); font-weight: 700; padding: 0 .35rem; border-radius: 100px;
}
.ins-velocity {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
  padding: .35rem 0;
}
.ins-vel-big {
  font-size: 1.4rem; font-weight: 700; color: var(--text-1); font-family: var(--mono);
}
.ins-vel-label { font-size: .6rem; color: var(--text-3); }
.ins-vel-sep { color: var(--text-3); font-size: .7rem; padding: 0 .25rem; }
.ins-dist {
  display: grid; gap: .15rem;
}
.ins-dist-head,
.ins-dist-row {
  display: grid; grid-template-columns: 1.6fr .6fr 1fr 1fr;
  gap: .4rem; padding: .25rem 0; font-size: .64rem;
}
.ins-dist-head {
  color: var(--text-3); text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border); font-weight: 600;
}
.ins-dist-row { color: var(--text-2); border-bottom: 1px dotted var(--border); }
.ins-dist-row:last-child { border-bottom: none; }
@media (max-width: 600px) {
  .ins-grid { grid-template-columns: 1fr; }
}
