/* ===============================================================
   LVRD — Connections (Integrations dashboard)
   A live workspace view: per-agent scoped tool connections, plus a
   glimpse of model usage (provider · model · cost at-cost). Rides
   the same browser .frame the other product mocks use. Brand logos
   sit in uniform light tiles so multicolor marks read on the dark
   field. All static DOM, LVRD tokens.
   =============================================================== */

.cx {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  background: var(--bg);
  color: var(--fg);
  text-align: left;
}

/* shared section heads inside the surface */
.cx-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px 14px; border-bottom: 1px solid var(--border);
}
.cx-head h5, .cx-head .mock-label { font-size: 14px; font-weight: 600; color: var(--fg-strong); margin: 0; }
.cx-head .meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-faint); }
.cx-head .grow { flex: 1; }

/* ---------- left: per-agent connections ---------- */
.cx-main { min-width: 0; display: flex; flex-direction: column; }
.cx-agents { padding: 8px 22px 20px; display: flex; flex-direction: column; }
.cx-agent { padding: 18px 0; border-top: 1px solid var(--border); }
.cx-agent:first-child { border-top: 0; }

.cx-agent-head { display: flex; align-items: center; gap: 11px; }
.cx-agent-head .od-glyph { width: 28px; height: 28px; }
.cx-agent-id { min-width: 0; flex: 1; }
.cx-agent-id .nm { display: block; font-weight: 600; color: var(--fg-strong); font-size: 13.5px; letter-spacing: -0.005em; }
.cx-agent-id .rl { display: block; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-faint); margin-top: 3px; }

/* tool chips */
.cx-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.cx-tool {
  display: grid; grid-template-columns: 30px 1fr; gap: 11px; align-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: 9px 11px;
}
[data-theme="dark"] .cx-tool { background: var(--surface-2); border-color: var(--border-strong); }
.cx-logo {
  width: 30px; height: 30px; border-radius: 8px; background: #fff;
  box-shadow: inset 0 0 0 1px rgba(22,22,24,0.06);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.cx-logo img { width: 21px; height: 21px; display: block; }
.cx-tool .tx { min-width: 0; }
.cx-tool .tn { display: block; font-size: 12.5px; font-weight: 600; color: var(--fg-strong); line-height: 1.2; }
.cx-tool .ts {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint);
}
.cx-tool .ts .scope { color: var(--fg-subtle); }
.cx-tool .ts .d { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px color-mix(in oklab, var(--accent) 75%, transparent); flex: 0 0 auto; }

/* a faint "add a tool" affordance to round out the surface */
.cx-add {
  display: flex; align-items: center; gap: 9px; margin-top: 13px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--fg-faint);
}
.cx-add .plus { width: 18px; height: 18px; border-radius: 6px; border: 1px dashed var(--border-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--fg-subtle); }

/* ---------- right rail: model usage ---------- */
.cx-rail { border-left: 1px solid var(--border); background: var(--surface); min-width: 0; display: flex; flex-direction: column; }
[data-theme="dark"] .cx-rail { background: color-mix(in oklab, var(--surface) 60%, var(--bg)); }
.cx-rail .cx-head { background: transparent; }
.cx-usage { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }

.cx-model { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); padding: 14px 15px; }
[data-theme="dark"] .cx-model { background: var(--bg); border-color: var(--border-strong); }
.cx-model-head { display: flex; align-items: center; gap: 10px; }
.cx-model-head .cx-logo { width: 32px; height: 32px; }
.cx-model-head .cx-logo img { width: 23px; height: 23px; }
.cx-model-id { min-width: 0; flex: 1; }
.cx-model-id .pv { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-faint); }
.cx-model-id .md { display: block; font-size: 13px; font-weight: 600; color: var(--fg-strong); margin-top: 2px; letter-spacing: -0.005em; }
.cx-model .powers { margin: 12px 0 0; font-family: var(--font-mono); font-size: 10px; line-height: 1.5; color: var(--fg-subtle); }
.cx-model .powers b { color: var(--fg-muted); font-weight: 500; }

.cx-meter { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 12px; }
.cx-meter .v { display: block; height: 100%; border-radius: 3px; background: var(--accent); width: 0; transition: width var(--duration-breath) var(--easing-breath); }
.reveal .cx-meter .v { width: 0; }
.reveal.in .cx-meter .v { width: var(--p, 0%); }
.cx-model.alt .cx-meter .v { background: var(--smoke-500); }

.cx-model-foot { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; }
.cx-model-foot .tok { font-family: var(--font-mono); font-size: 10px; color: var(--fg-faint); }
.cx-model-foot .cost { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--fg-strong); }

/* at-cost total strip */
.cx-total { margin-top: auto; border-top: 1px solid var(--border); padding: 15px 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cx-total .lb { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
.cx-total .lb em { color: var(--fg-subtle); font-style: normal; }
.cx-total .amt { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--fg-strong); }

@media (max-width: 820px) {
  .cx { grid-template-columns: 1fr; }
  .cx-rail { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 480px) {
  .cx-tools { grid-template-columns: 1fr; }
}

/* ===============================================================
   Team rail — agent mini-cards in the "Your team" bento card.
   Horizontal scroll-snap row; each card carries a role, a one-line
   description, and the tools it's wired to. Reuses .cx-logo tiles.
   =============================================================== */
.team-rail {
  flex: 1 1 auto; min-height: 0;
  display: flex; gap: 12px; align-items: stretch;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  margin: 6px -28px -28px; padding: 6px 28px 28px;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.team-rail::-webkit-scrollbar { height: 7px; }
.team-rail::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.team-rail::-webkit-scrollbar-track { background: transparent; }

.team-card {
  flex: 0 0 206px; scroll-snap-align: start;
  border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2);
  padding: 15px 15px 14px; display: flex; flex-direction: column; gap: 11px;
  transition: border-color var(--duration-default) var(--easing-default);
}
[data-theme="dark"] .team-card { background: var(--bg); border-color: var(--border-strong); }
.team-card:hover { border-color: color-mix(in oklab, var(--accent) 38%, var(--border-strong)); }
.team-card .tc-head { display: flex; align-items: center; gap: 9px; }
.team-card .tc-head .od-glyph { width: 28px; height: 28px; }
.team-card .tc-id { min-width: 0; }
.team-card .nm { display: block; font-weight: 600; color: var(--fg-strong); font-size: 13px; letter-spacing: -0.005em; line-height: 1.2; }
.team-card .rl { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-faint); margin-top: 3px; }
.team-card .ds { font-size: 12.5px; line-height: 1.45; color: var(--fg-muted); margin: 0; flex: 1; }
.team-card .tc-tools { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
[data-theme="dark"] .team-card .tc-tools { border-top-color: var(--border-strong); }
.team-card .tc-tools .cx-logo { width: 26px; height: 26px; border-radius: 7px; }
.team-card .tc-tools .cx-logo img { width: 17px; height: 17px; }
.team-card .tc-tools .tcl { margin-left: auto; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-faint); }
