/*
 * The list of servers and the dialog that adds a server and shows its install line. Everything here is layout
 * around the components of js/ui and uses the tokens of css/design only; a class starts with sv-.
 */

/* What a role may not do here, said once and quietly */

.sv-role {
  display: flex;
  align-items: flex-start;
  gap: var(--ui-space-2);
  margin: 0;
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
}

.sv-role .ui-icon {
  margin-top: 3px;
}

.sv-role--center {
  justify-content: center;
}

.sv-reasons {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}

/* No servers yet: the three steps that bring the first one in */

.sv-first-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ui-space-5);
  width: 100%;
}

.sv-first {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-3);
  width: 100%;
  max-width: 34rem;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.sv-first__step {
  display: flex;
  align-items: flex-start;
  gap: var(--ui-space-3);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
  padding: var(--ui-space-3) var(--ui-space-4);
  background: var(--ui-surface-sunken);
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}

.sv-first__step strong {
  color: var(--ui-text);
  font-weight: var(--ui-weight-semibold);
}

.sv-first__number {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--ui-radius-full);
  background: var(--ui-primary-tint);
  color: var(--ui-primary);
  font-size: var(--ui-text-xs);
  font-weight: var(--ui-weight-semibold);
  font-variant-numeric: tabular-nums;
}

/* The list */

.sv-toolbar {
  padding: var(--ui-space-4) var(--ui-space-5) 0;
}

.sv-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sv-stack--cell {
  align-items: flex-start;
}

.sv-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ui-space-1) var(--ui-space-2);
}

.sv-name__link {
  color: var(--ui-text);
  font-weight: var(--ui-weight-semibold);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.sv-name__link:hover {
  color: var(--ui-link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.sv-sub {
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}

/* Wraps between words only: a cell that may wrap must not cut a version or an address in two. */
.sv-sub--words {
  overflow-wrap: normal;
}

.sv-sub--clip {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sv-packages {
  display: inline-flex;
  align-items: center;
  gap: var(--ui-space-2);
}

.sv-packages__link {
  color: var(--ui-text);
  text-decoration: none;
}

.sv-packages__link:hover {
  color: var(--ui-link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.sv-chip-link {
  display: inline-flex;
  border-radius: var(--ui-radius-full);
  text-decoration: none;
}

.sv-chip-link:hover .ui-chip__label {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Between a phone and a wide window the list keeps its columns and drops what the server itself also says. */
@container (min-width: 34.01rem) and (max-width: 62rem) {
  .sv-extra {
    display: none;
  }
}

/* And where even that does not fit, the list scrolls inside its card instead of pushing the page sideways. */
@media (max-width: 1279px) {
  .sv-table {
    overflow-x: auto;
  }
}

/* Folded to cards on a phone, a cell reads from the right: its lines follow. */
@container (max-width: 34rem) {
  .sv-stack--cell {
    align-items: flex-end;
  }

  .sv-sub--clip {
    max-width: 13rem;
    white-space: normal;
    text-align: right;
  }
}

/* The install line */

.sv-install {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-5);
}

.sv-install__line,
.sv-install__start,
.sv-install__steps {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-3);
}

.sv-install__lead {
  margin: 0;
  color: var(--ui-text);
  font-weight: var(--ui-weight-medium);
}

.sv-install__once,
.sv-install__watch {
  display: flex;
  align-items: flex-start;
  gap: var(--ui-space-2);
  margin: 0;
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}

.sv-install__once .ui-icon,
.sv-install__watch .ui-icon {
  margin-top: 3px;
}

.sv-install__what {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
}

.sv-install__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ui-space-2);
  border-top: 1px solid var(--ui-border);
  padding-top: var(--ui-space-4);
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}

/* "Update all agents": the two groups of a round, and why a press cannot be taken */

.sv-round {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
}

.sv-round__lead {
  margin: 0;
  color: var(--ui-text);
  font-weight: var(--ui-weight-medium);
}

.sv-round__group {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-2);
}

.sv-round__text {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
  line-height: var(--ui-leading);
}

.sv-round__why {
  display: flex;
  align-items: flex-start;
  gap: var(--ui-space-2);
  flex: 1 1 14rem;
  min-width: 0;
  color: var(--ui-text-muted);
  font-size: var(--ui-text-sm);
}

.sv-round__why .ui-icon {
  flex: none;
  margin-top: 3px;
}
