/* =========================================================
   CT Dashboards — Modal
   Full-viewport overlay + centered panel. Shared between
   Financial Analysis and Strategic Insights drills.
   ========================================================= */
.ct-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 16, 0.58);
  backdrop-filter: saturate(1.1) blur(4px);
  -webkit-backdrop-filter: saturate(1.1) blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  padding: 32px 20px;
}
.ct-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

[data-theme="light"] .ct-modal-overlay {
  background: rgba(15, 23, 42, 0.32);
}

.ct-modal {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42),
              0 4px 16px rgba(0, 0, 0, 0.28);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.985);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1);
  outline: none;
}
.ct-modal-overlay.open .ct-modal {
  transform: translateY(0) scale(1);
}
.ct-modal-overlay.wide .ct-modal {
  max-width: 860px;
}

.ct-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ct-modal-heading {
  min-width: 0;
  flex: 1;
}
.ct-modal-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-4);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.ct-modal-sub:empty { display: none; }
.ct-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  line-height: 1.3;
  word-break: break-word;
}
.ct-modal-close {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all .12s;
}
.ct-modal-close:hover {
  color: var(--text);
  background: var(--surface-3, var(--surface-2));
  border-color: var(--border-2);
}

.ct-modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
}
.ct-modal-body h1,
.ct-modal-body h2,
.ct-modal-body h3 {
  color: var(--text);
  font-weight: 700;
  margin: 18px 0 8px;
  line-height: 1.3;
}
.ct-modal-body h1 { font-size: 15px; }
.ct-modal-body h2 { font-size: 13.5px; }
.ct-modal-body h3 {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ct-modal-body p { margin: 0 0 10px; }
.ct-modal-body strong { color: var(--text); }
.ct-modal-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}
.ct-modal-body ul,
.ct-modal-body ol {
  margin: 6px 0 12px;
  padding-left: 20px;
}
.ct-modal-body li { margin-bottom: 4px; }
