/* Ops console: Connections zone (connections.js). Loaded after app.css and
 * built only from its tokens; no inline styles (CSP style-src 'self'). */

/* The card scrolls sideways (app.css .card overflow-x: auto); the table keeps
 * a readable minimum width instead of crushing every column at 390px. */
.conn-card { padding: 0; }
.conn-table { width: 100%; min-width: 960px; border-collapse: collapse; }
.conn-table th, .conn-table td { padding: var(--ad-space-3) var(--ad-space-2); text-align: left; vertical-align: top; }
.conn-table tbody tr + tr td { border-top: 1px solid var(--border); }
.conn-table td { font-variant-numeric: tabular-nums; }
.conn-org { font-weight: 600; }
/* Room for the columns people read most, so a long route reason wraps
 * instead of squeezing the company name to one word per line. */
.conn-table th:first-child, .conn-table td:first-child { padding-left: var(--ad-space-4); }
.conn-table th:last-child, .conn-table td:last-child { padding-right: var(--ad-space-4); }
.conn-table th:nth-child(1) { min-width: 8rem; }
.conn-table th:nth-child(4) { min-width: 10rem; }
.conn-table th:nth-child(8) { width: 9rem; }
.conn-nowrap { white-space: nowrap; }
.conn-host { overflow-wrap: break-word; }
.conn-when { white-space: nowrap; }
.conn-note { margin-top: var(--ad-space-1); max-width: 24ch; overflow-wrap: anywhere; }
.conn-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--ad-space-1); }
.conn-actions .btn { white-space: normal; text-align: center; line-height: 1.25; }

.conn-empty { padding: var(--ad-space-6, 32px) var(--ad-space-4); text-align: center; }
.conn-empty-title { margin: 0 0 var(--ad-space-1); font-weight: 600; color: var(--text); }
.conn-empty p { margin: 0; text-wrap: pretty; }
#zone-connections .zone-header p { text-wrap: pretty; }
/* The whole label is the tap target: at least 44px tall and wide (WCAG 2.5.5,
 * Apple HIG) at every width, so it beats app.css's label:has(> input) 24px
 * desktop minimum. The box itself keeps the app-wide 24px size. */
#zone-connections .conn-toggle {
  display: inline-flex; align-items: center; gap: var(--ad-space-2);
  min-height: 44px; min-width: 44px; padding-inline: var(--ad-space-1); margin-inline-start: calc(-1 * var(--ad-space-1));
  cursor: pointer; user-select: none;
}
#zone-connections .conn-toggle input { margin: 0; cursor: pointer; }

/* Result dialog: two files side by side would not fit a phone; stacked. */
.modal.conn-config-modal { max-width: 760px; }
.conn-secret-warning {
  margin: 0 0 var(--ad-space-3); padding: var(--ad-space-2) var(--ad-space-3); font-size: var(--ad-fs-sm);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--radius-sm); color: var(--text);
}
.conn-config-facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--ad-space-1) var(--ad-space-3); margin: 0 0 var(--ad-space-3); }
.conn-config-facts dt { color: var(--text-dim); }
.conn-config-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.conn-hint { font-family: var(--mono); font-size: var(--ad-fs-xs); user-select: all; }
.conn-file { margin-top: var(--ad-space-3); }
.conn-file-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ad-space-2); margin-bottom: var(--ad-space-1); }
.conn-file-head label { font-size: var(--ad-fs-sm); color: var(--text); }
.conn-file-btns { display: flex; gap: var(--ad-space-2); }
.conn-conf {
  display: block; width: 100%; min-height: 160px; resize: vertical; white-space: pre; overflow: auto;
  padding: var(--ad-space-2) var(--ad-space-3); color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: var(--ad-fs-xs);
  line-height: 1.5; tab-size: 4;
}

@media (max-width: 820px) {
  .conn-table { min-width: 880px; }
  .conn-config-facts { grid-template-columns: 1fr; }
  .conn-config-facts dd + dt { margin-top: var(--ad-space-1); }
}
