/* Connections: the PE dashboard's own screen, on this terminal's palette.
 *
 * The class names, the markup and the layout rules are the dashboard's —
 * `conn`, `conn-top`, `conn-av`, `conn-name`, `conn-why`, `conn-cfg`,
 * `conn-cat`, `conn-grid`, `conn-spacer` — so the two screens are the same
 * structure rather than two designs that resemble each other. Only the values
 * differ, and every one of them is a token from styles.css: that stylesheet's
 * contrast checker reads the tokens and fails the build on a pair below WCAG,
 * and a literal hex written at the point of use is a value it cannot see.
 *
 * The exception is a vendor's brand colour, which arrives inline from the
 * catalogue. It colours a GLYPH on a neutral chip, never a background behind
 * text — the dashboard makes the same choice, and it is what stops half the
 * catalogue failing contrast on its own brand.
 */

.conn-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin: -6px 0 18px;
}

.conn-error {
  font-size: 12.5px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 16px;
}

/* A group is collapsible, and opens itself when it holds anything actionable
   — the dashboard's rule, kept because a nine-group catalogue read as one
   endless wall otherwise, and the groups worth opening are the ones you can
   actually connect. */
.conn-cat { border-top: 1px solid var(--line); }
.conn-cat > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 2px;
  cursor: pointer;
  list-style: none;
}
.conn-cat > summary::-webkit-details-marker { display: none; }
/* A disclosure triangle drawn rather than inherited, so it can rotate and so
   its colour is a token. */
.conn-cat > summary::before {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: none;
}
.conn-cat[open] > summary::before { transform: rotate(45deg); }
.conn-cat > summary:focus-visible { outline: 2px solid var(--nav-focus); outline-offset: 2px; }

.conn-cat-n { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--ink); }
.conn-cat-c {
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 1px 8px;
  background: var(--surface-subtle);
  color: var(--muted);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.conn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 4px 0 18px;
}
@media (max-width: 1100px) { .conn-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .conn-grid { grid-template-columns: 1fr; } }

.conn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 17px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.conn-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.conn-av {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex: none;
}
.conn-av svg { width: 18px; height: 18px; }
.conn-name { font-weight: 600; font-size: 14px; flex: 1; line-height: 1.3; color: var(--ink); }
.conn-why { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 0; }
.conn-cfg { font-size: 12px; color: var(--faint); margin-top: 8px; overflow-wrap: anywhere; }
/* Pins the buttons to the bottom so a three-line card and a one-line card in
   the same row still have their actions on the same baseline. */
.conn-spacer { margin-top: auto; }
.conn .button { margin-top: 12px; margin-right: 8px; }

.conn-foot {
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* Slack's workspace dropdown and conversation picker.
 *
 * The only tile with controls of its own, because it is the only vendor where
 * "connected" leaves a question open: WHICH workspace, and which conversations
 * inside it. Everything here is a token from styles.css for the same reason
 * the rest of this file is — the contrast checker reads tokens and cannot see
 * a literal hex written at the point of use. */
.conn-slack {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.conn-ws { display: block; margin-bottom: 8px; }
.conn-ws select {
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
}
.conn-ws select:focus-visible { outline: 2px solid var(--nav-focus); outline-offset: 2px; }
.conn-ws select:disabled { color: var(--faint); }

.conn-pick {
  margin: 10px 0 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface-subtle);
}
.conn-pick-head { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.conn-pick-group { border: 0; margin: 0 0 10px; padding: 0; }
.conn-pick-group legend {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 0;
  margin-bottom: 4px;
}
/* Capped and scrollable: a workspace with two hundred channels must not push
   every other integration off the page. */
.conn-pick-group > label { display: flex; }
.conn-pick-group { max-height: 210px; overflow-y: auto; }
.conn-pick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink);
  padding: 3px 2px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.conn-pick-row input { flex: none; accent-color: var(--nav-focus); }
.conn-pick-foot { display: flex; gap: 8px; margin-top: 6px; }
.conn-pick-foot .button { margin: 0; }
.conn-slack .button { margin-top: 8px; margin-right: 8px; }
