/* AUTO-SYNCED from ui/components.css — edit there, run make ui-sync */
/* ============================================================
   Gantry shared component classes
   ------------------------------------------------------------
   Canonical home of the cross-surface component CSS (.cg-*).
   Lifted verbatim from web/theme.css (2026-07-05); web/theme.css
   keeps only web-specific styles. Extension and landing consume
   bundled copies via `make ui-sync`.
   Depends on tokens.css being loaded first.
   ============================================================ */

.cg-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: var(--r-pill);
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  font-family: var(--font-mono); font-weight: 500;
  border: 1px solid var(--line);
  color: var(--fg-2);
  background: var(--bg-2);
}
.cg-pill.good { color: var(--good); border-color: color-mix(in oklab, var(--good) 35%, var(--line)); background: color-mix(in oklab, var(--good) 8%, var(--bg-2)); }
.cg-pill.warn { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 35%, var(--line)); background: color-mix(in oklab, var(--warn) 8%, var(--bg-2)); }
.cg-pill.bad  { color: var(--bad);  border-color: color-mix(in oklab, var(--bad)  35%, var(--line)); background: color-mix(in oklab, var(--bad)  8%, var(--bg-2)); }

.cg-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cg-dot.good { background: var(--good); box-shadow: 0 0 0 3px var(--good-glow); }
.cg-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-glow); }
.cg-dot.bad  { background: var(--bad);  box-shadow: 0 0 0 3px var(--bad-glow); }

.cg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.cg-btn:hover { background: var(--bg-hover); border-color: var(--line-2); }
.cg-btn:active { transform: translateY(1px); }
.cg-btn.primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.cg-btn.primary:hover { background: var(--fg-2); border-color: var(--fg-2); }
.cg-btn.brand {
  background: var(--brand);
  color: var(--on-brand);
  border-color: var(--brand);
}
.cg-btn.brand:hover { background: var(--brand-text); border-color: var(--brand-text); }
.cg-btn.ghost { background: transparent; }
.cg-btn.ghost:hover { background: var(--bg-hover); }
.cg-btn:disabled { opacity: .5; cursor: not-allowed; }
/* <Button as="a"> renders an anchor; keep it reading as a button */
a.cg-btn { text-decoration: none; }

.cg-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--fg);
  font-size: 14px;
  outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.cg-input:focus { border-color: var(--line-strong); background: var(--bg-2); }
.cg-input::placeholder { color: var(--fg-4); }

.cg-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.cg-divider { height: 1px; background: var(--line); border: 0; }

/* Section title — small, monospace, uppercase, like a fintech caption */
.cg-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Numeric stat block */
.cg-stat-num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-feature-settings: "tnum" on;
  letter-spacing: -0.01em;
}

/* Grid background utility */
.cg-grid-bg {
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Smooth fade on screen transitions */
@keyframes cg-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cg-fade { animation: cg-fade-in .25s var(--ease); }

/* Skeleton/placeholder image stripes */
.cg-placeholder {
  background:
    repeating-linear-gradient(45deg, var(--bg-3) 0 8px, var(--bg-2) 8px 16px);
  border: 1px dashed var(--line-2);
  color: var(--fg-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
}

/* Avatar (initials) */
.cg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-2);
  flex: 0 0 auto;
}

/* Org "logo" tile — text-based, monogram-style */
.cg-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600;
  font-size: 13px;
  color: var(--fg);
  border: 1px solid var(--line);
  background: var(--bg-2);
  letter-spacing: 0;
  flex: 0 0 auto;
}

/* Tabs */
.cg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.cg-tab {
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--fg-3);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.cg-tab:hover { color: var(--fg-2); }
.cg-tab[data-active="true"] {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

/* "ticker" small label */
.cg-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

/* Modal (lifted verbatim from web/connect.css, 2026-07-05 — the wizard
   step indicator stayed in connect.css) */
.cg-modal-wrap {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.cg-modal-scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
}
.cg-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md, 12px);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cg-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.cg-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.cg-modal-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
