/* Connectors page (ticket 708), route #/stations: the fleet table, plus ticket 713's Add
   Connector panel above it. The table reuses table.data, .section and .table-scroll from
   console.css; the panel reuses .login-label/.login-input/.login-error and .btn there. A row
   opens its detail page through the Name link (ticket 757), so the pointer cursor table.data
   gives the whole row is undone. */

table.connectors-table tbody tr {
  cursor: default;
}

/* Status chips (ticket 720): the entities.css pill shape, scoped to this table, tinted per
   status with the page's own variables. */
.connectors-table .chip,
.connector-detail .chip {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  white-space: nowrap;
}

.connectors-table .chip--online,
.connector-detail .chip--online {
  color: var(--st-2xx);
  border-color: var(--st-2xx);
}

.connectors-table .chip--offline,
.connector-detail .chip--offline {
  color: var(--st-5xx, var(--ink-muted));
  border-color: var(--st-5xx, var(--border-strong));
}

.connectors-table .chip--never,
.connectors-table .chip--removed,
.connector-detail .chip--never,
.connector-detail .chip--removed {
  color: var(--ink-muted);
  border-color: var(--border-strong);
}

/* Paused (ticket 866) sits beside the status chip: the Connector is up but answers nothing. */
.connectors-table .chip--paused,
.connector-detail .chip--paused {
  margin-left: 0.35rem;
  color: var(--st-4xx, var(--ink-muted));
  border-color: var(--st-4xx, var(--border-strong));
}

.connector-pause {
  margin: 0.8rem 0;
}

/* The version and clock warning lines under a Version cell (ticket 720). */
.connectors-warning {
  margin-top: 0.15rem;
  font-size: var(--fs-2xs);
  color: var(--st-4xx, var(--ink-muted));
}

.connectors-add {
  margin: 0 0 1.2rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md, 0.7rem);
  background: var(--panel-deep);
  color: var(--ink);
}

.connectors-add__title {
  margin: 0 0 0.6rem;
  font-size: var(--fs-sm);
}

.connectors-add__form,
.connectors-add__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
}

.connectors-add__command,
.connectors-add__install {
  flex: 1 1 24rem;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  padding: 0.3rem 0.55rem;
  background: var(--panel-deep);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}

.connectors-add__title--later {
  margin-top: 0.9rem;
}

/* `.login-label { display: flex }` (console.css) beats the browser's `[hidden] { display: none }`,
   so the address field would stay on screen when the server fixes the address. */
.connectors-add .login-label[hidden] {
  display: none;
}

/* The Deploy to AWS block's parameter table (ticket 1009). */
.connectors-add__params {
  width: 100%;
  margin-top: 0.6rem;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.connectors-add__params th,
.connectors-add__params td {
  padding: 0.25rem 0.5rem 0.25rem 0;
  text-align: left;
  vertical-align: top;
}

.connectors-add__param {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.connectors-add__steps {
  margin: 0.6rem 0 0;
  padding-left: 1.2rem;
  font-size: var(--fs-sm);
}

.connectors-add__hint {
  margin: 0.5rem 0 0;
  font-size: var(--fs-2xs);
  color: var(--ink-muted);
}

/* The Done button's row follows the last notice: without a margin of its own the button touched the text
   above it (the browser proof of ticket 001113 measures 14 px with this rule, at 1280 and 390 px). */
.connectors-add__hint + .connectors-add__row {
  margin-top: 0.9rem;
}

.connectors-add .login-error {
  margin-bottom: 0.6rem;
}

.connectors-actions {
  white-space: nowrap;
}

/* What an Actions cell says when its row has no action (ticket 001086): "Built in" on the Station that
   runs inside this console. */
.connectors-actions__none {
  color: var(--ink-muted);
  font-size: var(--fs-xs);
}

.connectors-next {
  margin: 0.9rem 0 0;
}

.connector-detail__section,
.connector-remove {
  margin-top: 1.5rem;
}

.connector-detail__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* The Home Station's zone when the start command set it: the fields read as not editable, like a
   disabled select. (While a save runs the fields are disabled for a moment too.) */
.connector-dns .login-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.connector-detail p,
.connector-detail td {
  overflow-wrap: anywhere;
}

.connector-remove__confirm {
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md, 0.7rem);
}

.connector-checks__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 0.75rem;
}

.connector-checks__row .login-input {
  width: 8rem;
}

.connector-checks__row .login-error {
  flex-basis: 100%;
}

.connector-checks__stranded {
  overflow-wrap: anywhere;
}

/* Add Connector's "Where it stands" row (docs/design/console-towers.md): provider, region and site
   side by side under one label, so the form keeps its single row on a wide screen. */
.connectors-add__location {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.4rem;
}

.connectors-add__location > span {
  flex-basis: 100%;
}

.connectors-add__location > select,
.connectors-add__location > input {
  width: auto;
  min-width: 9rem;
  flex: 1 1 9rem;
}

/* Many Stations at once (views/connectors.js, views/stations_bulk.js). With nothing ticked the list is the
   plain table with a filter box above it and each Station's tags under its name. */
.connectors-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0 0 0.75rem;
}

.connectors-filter__input {
  flex: 0 1 22rem;
  min-width: 0;
}

.connectors-filter__count {
  color: var(--ink-muted);
  font-size: var(--fs-xs);
}

/* A Station's tags: the page's chip, quieter than a status chip. */
.connectors-tags,
.connector-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.3rem 0 0;
}

.connectors-table .chip--tag,
.connector-detail .chip--tag {
  color: var(--ink-body, var(--ink));
  background: var(--panel-deep);
  font-weight: 500;
}

/* The checkbox column, as the Case Files queue has it (intrusion-groups.css), and a ticked row. */
.connectors-table .connectors-select {
  width: 2.25rem;
  text-align: center;
}

.connectors-select input {
  cursor: pointer;
}

.connectors-table tbody tr.is-selected {
  background: var(--gold-soft);
}

.connectors-nomatch {
  color: var(--ink-muted);
}

/* The bar under the table reuses .ig-bulk (sticky at the bottom of the window, intrusion-groups.css).
   Its count and buttons share one line; an open form and the last outcome each take a line below. */
.stations-bulk__actions,
.stations-bulk__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.stations-bulk__form,
.stations-bulk__status {
  flex-basis: 100%;
}

.stations-bulk__form:empty,
.stations-bulk__status:empty {
  display: none;
}

.stations-bulk__form p,
.stations-bulk__headline {
  margin: 0 0 0.5rem;
  font-size: var(--fs-sm);
}

.stations-bulk__headline {
  margin: 0;
}

.stations-bulk__row .login-input {
  width: 14rem;
  max-width: 100%;
}

.stations-bulk__failures {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

/* The "Change a setting" drawer: the exchange detail's side panel (.detail-overlay, .detail-panel in
   console.css), narrower because it holds one short form. */
.stations-drawer {
  width: min(30rem, 100%);
}

.stations-drawer__sub {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: var(--fs-xs);
}

.stations-drawer__form,
.stations-drawer__value {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.stations-drawer__value:empty {
  display: none;
}

/* The On / Off pair keeps its own width in the column. */
.stations-drawer__value > .toggle-group {
  align-self: flex-start;
}

.stations-drawer select {
  width: 100%;
}

.stations-drawer p {
  margin: 0;
}

/* "Keep evidence on each Station for [ ] days": the words and the box on one line, as on the Station's
   page. */
.stations-drawer__inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.stations-drawer__inline .login-input {
  width: 7rem;
}

/* "Keep everything": a tick and its words on one line, in the ink of a choice. */
.stations-drawer__check {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
}

/* How many of the Stations about to change the list's filter hides, with the button that names them. */
.stations-drawer__hidden {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
}

.stations-drawer__modes {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0.6rem 0.8rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.6rem;
}

.stations-drawer__modes .login-label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
}

.stations-drawer__count,
.stations-drawer__headline {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.stations-drawer__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

/* Apply is off until the Chief has made a choice, and a control is off while a request runs: an off
   button must look off (the console's .btn has no disabled look of its own). */
.stations-drawer .btn:disabled,
.stations-bulk .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stations-drawer__result {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

/* A Station's Tags section on its own page. */
.connector-tags__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.connector-tags__form .login-input {
  width: 14rem;
  max-width: 100%;
}

.connector-tags__remove {
  margin-left: 0.3rem;
  padding: 0 0.15rem;
  border: none;
  background: none;
  color: var(--ink-muted);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.connector-tags__remove:hover,
.connector-tags__remove:focus-visible {
  color: var(--ink);
}

/* What a slot's site template choice needs said: it shows an older version of one of the Chief's own
   templates, or a template cannot run on this Station (views/connector_scenarios.js). */
.connector-scenarios__note {
  max-width: 44rem;
  margin: var(--space-2) 0 0;
  font-size: var(--fs-xs);
  color: var(--ink-dim);
}

/* A remote Station's page (views/connector_ops.js): the health line under the head, Pause and Restart
   side by side, and the settings as a list of folds, each closed with its current value. */
.connector-health {
  margin: 0.35rem 0 0;
  color: var(--ink-dim);
  font-size: var(--fs-xs);
}

.connector-health__warn {
  color: var(--st-4xx);
  font-weight: 600;
}

.connector-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.8rem 1.2rem;
  margin: 1.2rem 0 0;
}

.connector-actions .connector-pause {
  margin: 0;
}

.connector-restart .section__hint,
.connector-restart .login-error,
.connector-upgrade .section__hint,
.connector-upgrade .connectors-warning,
.connector-upgrade .login-error {
  margin: 0.4rem 0 0;
}

.connector-upgrade {
  max-width: 44rem;
}

.connector-upgrade .section__hint:first-child {
  margin: 0 0 0.4rem;
}

.connector-upgrade__command {
  margin: 0.4rem 0 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.connector-release-gap {
  margin-top: 1rem;
  font-size: var(--fs-xs);
}

.connector-controls__title {
  margin: 1.6rem 0 0.5rem;
}

.connector-fold {
  border-top: 1px solid var(--border);
}

.connector-fold:last-of-type {
  border-bottom: 1px solid var(--border);
}

.connector-fold__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.8rem;
  padding: 0.6rem 0.2rem;
  cursor: pointer;
  list-style: none;
}

.connector-fold__summary::-webkit-details-marker {
  display: none;
}

/* The fold's own marker: a flex summary drops the browser's triangle. */
.connector-fold__summary::before {
  content: "\25B8";
  width: 0.7rem;
  color: var(--ink-muted);
}

.connector-fold[open] > .connector-fold__summary::before {
  content: "\25BE";
}

.connector-fold__summary:hover .connector-fold__title,
.connector-fold__summary:focus-visible .connector-fold__title {
  color: var(--gold);
}

.connector-fold__title {
  font-weight: 600;
  color: var(--ink);
}

.connector-fold__value {
  color: var(--ink-muted);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

.connector-fold__body {
  padding: 0.2rem 0.2rem 1.2rem 1.1rem;
}

/* The fold's summary already names the card, so the card's own first heading is not repeated. */
.connector-fold__body > .connector-detail__section {
  margin-top: 0;
}

.connector-fold__body > .connector-detail__section > h3:first-child {
  display: none;
}

.connector-fold__body .configure-section {
  margin: 0;
}

/* The Station's own log lines: plain text, scrolled in place, never wrapped into the page's width. */
.connector-log__lines {
  max-height: 24rem;
  margin: 0.6rem 0 0;
  padding: 0.6rem 0.75rem;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md, 0.7rem);
  background: var(--panel-deep);
  color: var(--ink-body);
  font: 400 var(--fs-2xs) / 1.45 var(--font-mono);
  white-space: pre;
}

/* "Run drill" on a remote Station's page: under Pause and Restart, the drill's checklist under it. */
.connector-drill {
  margin: 0.8rem 0 0;
}

.connector-drill .home-drill__drawer {
  margin-top: 0.6rem;
}

.connector-drill .section__hint,
.connector-drill .login-error {
  margin: 0.4rem 0 0;
}

.connector-drill__address-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.4rem 0.8rem;
  margin: 0.8rem 0 0;
  max-width: 44rem;
}

.connector-drill__address-form .login-label {
  flex: 1 1 18rem;
  min-width: 0;
}

.connector-drill__address-form .section__hint {
  flex: 1 1 100%;
  margin: 0;
}

/* A remote Station's Meeting Sites (views/station_sites.js): one row per site, its state as a chip,
   its ports and the Station's own words when it did not start; "Add a Meeting Site" under them. */
.station-sites__sites {
  list-style: none;
  margin: 0;
  padding: 0;
}
.station-sites__site {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.station-sites__site:last-child {
  border-bottom: 0;
}
.station-sites__line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.station-sites__site p {
  margin: 0.3rem 0 0;
}
.station-sites__state--running {
  color: var(--health-ok);
}
.station-sites__state--waiting,
.station-sites__state--removing {
  color: var(--st-4xx);
}
.station-sites__state--failed {
  color: #fca5a5;
}
.station-sites__remove,
.station-sites__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.station-sites__remove p {
  flex-basis: 100%;
}
.station-sites__status:empty {
  display: none;
}
.station-sites__add {
  margin-top: 0.9rem;
}
.station-sites__add h4 {
  margin: 0.9rem 0 0.4rem;
}
.station-sites__held {
  margin-top: 0.9rem;
}
