/* Settings: Alert Controls flyouts. Rows keep the settings layout (label column, then value column), with the
   labels at the top of their row. Inputs take the whole width of the value column. */
.ac-flyout .setting-grid {
  align-items: start;
}
.ac-flyout .setting-control .setting-input {
  max-width: none;
  width: 100%;
  /* Inputs in the column controls keep their own height instead of stretching to fill the row */
  flex: 0 0 auto;
}

/* The keys list fills the value column, the same width as the inputs above it */
.ac-flyout .ac-keys {
  width: 100%;
}

/* Save on the left, Cancel on the right */
.ac-flyout .ac-actions {
  display: flex;
  justify-content: space-between;
}

/* Icon-only button in a table row */
.ac-icon-btn {
  padding: 0.25rem 0.45rem;
  margin: 0 0 0 0.35rem;
  line-height: 0;
}

/* Condition rows in the blacklist flyout. Pico gives form controls a bottom margin, which would add space
   under the row, so the controls have no margin and the row has equal space above and below. */
.ac-flyout .ac-condition {
  padding: 0.5rem 0;
}
.ac-flyout .ac-condition input,
.ac-flyout .ac-condition select {
  margin: 0;
}
.ac-flyout .ac-condition-remove {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  height: auto;
  margin: 0;
  padding: 0 0.7rem;
}

/* The forward flyout's footer: the buttons stay in view while the form scrolls above them */
.ac-flyout .flyout-footer {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--ev-rule);
  background: var(--bg-surface, #0b0b0b);
}

/* The condition button of the forward flyout shows the blocks as text, which can be long */
.ac-flyout .cond-summary {
  text-align: left;
  white-space: normal;
  width: 100%;
  margin: 0;
}

/* The condition flyout opens over the forward flyout, so its backdrop and panel sit above both */
.sub-backdrop {
  z-index: 55;
}
.sub-flyout {
  z-index: 60;
}

/* The forward form: a label column and a control column. Every row has the same two columns, and every control
   fills the control column, so the rows line up. The flyout buttons show a summary of what they edit. */
.ac-flyout .fw-form {
  display: flex;
  flex-direction: column;
}
.ac-flyout .fw-row {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1rem;
  /* Labels sit at the top of the row, level with the first line of the control */
  align-items: start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--ev-rule);
}
.ac-flyout .fw-row > .setting-title {
  margin: 0;
  /* Centres the label's line on the 2.25rem control: half the control height, less half a line */
  padding-top: 0.5rem;
  line-height: 1.2;
}
.ac-flyout .fw-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.ac-flyout .fw-control > input,
.ac-flyout .fw-control > select,
.ac-flyout .fw-control > textarea {
  width: 100%;
  max-width: none;
  margin: 0;
}
.ac-flyout .fw-control > label {
  margin: 0;
}
.ac-flyout .fw-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ac-flyout .fw-inline input {
  margin: 0;
}
.ac-flyout .fw-note {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted, #7a7a7a);
}
.ac-flyout .fw-footnote {
  margin-top: 0.9rem;
}
.ac-flyout .fw-code {
  font-family: var(--ev-mono);
  font-size: 0.8rem;
}

/* A row's flyout button: the summary on the left, "Edit" on the right, in the same box as the inputs */
.ac-flyout .fw-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 400;
  color: var(--text-main, #e5e5e5);
  background: var(--bg-input, #0b0b0b);
  border: 1px solid var(--ev-rule-strong, #333);
}
.ac-flyout .fw-button:hover,
.ac-flyout .fw-button:focus-visible {
  background: var(--bg-input, #0b0b0b);
  border-color: var(--text-muted, #7a7a7a);
  color: var(--text-main, #e5e5e5);
}
.ac-flyout .fw-button-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ac-flyout .fw-edit {
  flex: none;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #7a7a7a);
}

/* One height for the flyout buttons and the inputs of the forward form, so the rows match */
.ac-flyout .fw-control > input:not([type="checkbox"]):not([type="radio"]),
.ac-flyout .fw-control > select,
.ac-flyout .fw-button,
.ac-flyout .fw-inline input {
  box-sizing: border-box;
  height: 2.25rem;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.875rem;
  line-height: 1.2;
}
.ac-flyout .fw-control > input:not([type="checkbox"]):not([type="radio"]),
.ac-flyout .fw-control > select {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.ac-flyout .fw-control > textarea {
  font-size: 0.875rem;
}

/* The Enabled switch: the events page's switch, its label on the left and the switch on the right of the column */
.ac-flyout .fw-switch {
  width: 100% !important;
  padding: 0;
}

/* Directory table: the row number is muted, and the kind and criticality read in title case, not the badges' capitals */
.asset-index {
  color: var(--text-muted, #7a7a7a);
  font-variant-numeric: tabular-nums;
}
.asset-badge {
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Directory table headers that sort. The button takes the header's look (the buttons' own styles would make the row
   taller and drop the uppercase). The arrows are small and muted; a rank shows the order of several sort keys. */
.ac-flyout .asset-sort,
.asset-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  /* Pico gives buttons their own padding and height, so the reset is forced */
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: inherit !important;
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.asset-sort .sort-mark,
.asset-sort .sort-rank {
  margin: 0;
  line-height: 1;
  color: var(--text-muted, #7a7a7a);
}
.asset-sort .sort-mark {
  font-size: 0.65rem;
}
/* The rank sits on the arrow's line; a raised one would make the header row taller */
.asset-sort .sort-rank {
  font-size: 0.5rem;
  vertical-align: baseline;
}

/* Headers of an Apprise forward: a name, a value and a remove icon per row, with a plus icon above the list */
.ap-headers-note {
  margin: 0 0 1rem;
  line-height: 1.5;
}
.ap-headers-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ap-headers-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ap-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.ap-header-row input {
  margin: 0;
}
.ap-header-labels {
  padding: 0.5rem 0 0.2rem;
  border-bottom: 0;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.ap-headers-empty {
  margin: 1rem 0 0;
}
.ap-header-row .ac-icon-btn {
  margin: 0;
}

/* The info button next to Test connection: a small round button, showing the Apprise URL */
.ap-info-btn {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
}
