/* Adtran brand tokens (Adtran Colors 2026 / "Adtran 2026 PPT template") --
   primary blue, teal accents, and status colors are Adtran's own values,
   not invented here; see the adtran-revealjs skill's adtran-theme.css for
   the same palette applied to slide decks. */
:root {
  color-scheme: light;

  --adtran-lt1: #ffffff;
  --adtran-dk2: #535353;
  --adtran-lt2: #a7a7a7;
  --adtran-accent1: #00c8e6; /* cyan */
  --adtran-accent3: #02434f; /* darkest teal */
  --adtran-accent5: #3264f0; /* blue -- primary brand */
  --adtran-accent5-deep: #103b9e; /* rgb(16, 59, 158) -- top bar surface */
  --adtran-body-text: #262626;
  --adtran-footer-text: #808080;
  --adtran-status-done: #2faa4a; /* active */
  --adtran-status-warn: #d98a00; /* expired / in progress */
  --adtran-status-blocked: #d83b3b; /* revoked / destructive */

  --border: #e0e0e0;
  --surface: #ffffff;
  --page-bg: #f5f6f8;
}

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--adtran-body-text);
  background: var(--page-bg);
  margin: 0;
}

h1, h2, h3 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 2rem;
  background: var(--adtran-accent5-deep);
  color: var(--adtran-lt1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.topbar .brand-logo {
  height: 26px;
  width: auto;
}

.topbar h1 {
  font-size: 1.15rem;
  margin: 0;
  color: var(--adtran-lt1);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.auth-status {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.auth-status button {
  background: transparent;
  color: var(--adtran-lt1);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-status button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--adtran-lt1);
}

/* ============================================================
   Layout
   ============================================================ */
main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 2rem 2rem;
}

.login-gate {
  max-width: 28rem;
  margin: 6rem auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.login-gate p {
  color: var(--adtran-dk2);
  line-height: 1.5;
}

/* ============================================================
   Tabs -- underline style, brand blue active indicator
   ============================================================ */
.tabs {
  display: flex;
  gap: 1.75rem;
  margin: 1.75rem 0 0;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  padding: 0.7rem 0.1rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--adtran-dk2);
  cursor: pointer;
  margin-bottom: -1px;
}

.tab-button:hover {
  color: var(--adtran-body-text);
}

.tab-button.active {
  color: var(--adtran-accent5);
  border-bottom-color: var(--adtran-accent5);
}

.tab-view {
  display: none;
  padding-top: 1.5rem;
}

.tab-view.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.section-header h2 {
  font-size: 1.05rem;
  color: var(--adtran-body-text);
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================
   Filter bar (Keys tab)
   ============================================================ */
.filters-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.filters-bar input[type="search"] {
  flex: 1;
  max-width: 22rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
}

.filters-bar select {
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--surface);
  color: var(--adtran-body-text);
}

.filters-bar input[type="search"]:focus-visible,
.filters-bar select:focus-visible {
  outline: none;
  border-color: var(--adtran-accent5);
  box-shadow: 0 0 0 3px rgba(50, 100, 240, 0.15);
}

.results-count {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--adtran-dk2);
}

/* ============================================================
   Buttons
   ============================================================ */
button {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--adtran-body-text);
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}

button:hover {
  background: #f2f3f5;
}

button:focus-visible {
  outline: 2px solid var(--adtran-accent5);
  outline-offset: 1px;
}

button.busy {
  cursor: progress;
  opacity: 0.75;
}

/* ============================================================
   Busy spinner (buttons, session check) -- see js/ui-utils.js
   ============================================================ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.4em;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Primary/destructive buttons are classes, not IDs. aks-admin-portal styles these by
   ID (#show-create-key, #refresh-expiring, ...), which silently stops applying the
   moment the markup is cloned with different IDs. */
.btn-primary {
  background: var(--adtran-accent5);
  color: var(--adtran-lt1);
  border-color: var(--adtran-accent5);
}

.btn-primary:hover {
  background: #2851c9;
  border-color: #2851c9;
}

/* Every action that writes to a production secret or invokes a production Lambda. It
   must not look like the benign primary. */
.btn-danger {
  background: var(--adtran-status-blocked);
  color: var(--adtran-lt1);
  border-color: var(--adtran-status-blocked);
}

.btn-danger:hover {
  background: #b83030;
  border-color: #b83030;
}

/* ============================================================
   Kebab actions menu (Keys table row actions)
   ============================================================ */
.actions-menu {
  position: relative;
  display: inline-block;
}

.kebab-button {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.3rem 0.6rem;
  color: var(--adtran-dk2);
  background: transparent;
  border-color: transparent;
}

.kebab-button:hover {
  background: #f2f3f5;
  border-color: var(--border);
}

.actions-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 8rem;
  margin-top: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.actions-dropdown button {
  border: none;
  border-radius: 0;
  text-align: left;
  padding: 0.55rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--adtran-body-text);
  background: var(--surface);
}

.actions-dropdown button:hover {
  background: #f2f3f5;
}

.actions-dropdown button.destructive {
  color: var(--adtran-status-blocked);
}

.actions-dropdown button.destructive:hover {
  background: rgba(216, 59, 59, 0.08);
}

/* ============================================================
   Modal dialogs (create/edit key) -- native <dialog>, styled as a
   plain positioning/backdrop shell; the visible box is still .card.
   ============================================================ */
dialog.modal {
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  max-width: none;
  overflow: visible;
}

dialog.modal::backdrop {
  background: rgba(20, 20, 30, 0.45);
}

dialog.modal .card {
  margin: 0;
  border: none;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  max-height: min(85vh, 640px);
  overflow-y: auto;
}

/* The one-time-key banner keeps its own left accent border even inside a modal --
   restated here since it's more specific than the generic border reset above. */
dialog.modal .card.banner {
  border: none;
}

/* ============================================================
   Form card (create key)
   ============================================================ */
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  max-width: 32rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.card h3 {
  font-size: 1rem;
  margin: 0 0 1rem;
  color: var(--adtran-body-text);
}

.card label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--adtran-dk2);
}

.card input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.9rem;
  font-family: Arial, Helvetica, sans-serif;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  box-sizing: border-box;
}

/* The rule above is written for text inputs: `display: block; width: 100%`. On a checkbox
   or a radio that stretches the control itself across the whole card and pushes its label
   to the far side of the row, so the two read as unrelated -- worst in .cred-mode, where
   you then cannot tell which radio selects which credential form. `.checkbox-field input`
   and `.wizard-ack input` each set only `margin-top`, and `.wizard-ack` escapes it at all
   only because the wizard steps are not inside a `.card`. Reset it once, here.
   `flex` matters as much as `width`: every container involved (.cred-mode label,
   .checkbox-field, .json-unwrap) is a flex row, so `width: auto` alone would leave the
   item free to be resized by the flex algorithm. */
.card input[type="checkbox"],
.card input[type="radio"] {
  width: auto;
  flex: 0 0 auto;
}

.card input:focus-visible {
  outline: none;
  border-color: var(--adtran-accent5);
  box-shadow: 0 0 0 3px rgba(50, 100, 240, 0.15);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
}

/* ============================================================
   Tenant-ID hints (create/edit key forms)
   ============================================================ */
.tenant-hint {
  margin: 0.4rem 0 0.9rem;
  font-size: 0.82rem;
  color: var(--adtran-dk2);
}

.tenant-hint .tenant-hint-label {
  display: block;
  margin-bottom: 0.35rem;
}

.tenant-chip {
  display: inline-block;
  margin: 0 0.35rem 0.35rem 0;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 400;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f2f3f5;
  color: var(--adtran-body-text);
}

.tenant-chip:hover {
  border-color: var(--adtran-accent5);
  background: rgba(50, 100, 240, 0.1);
}

/* Selected tenants (rendered above the "type to add" input) -- same chip shape,
   brand-blue tinted to read as "already added" vs. the neutral available-tenant
   chips, with a small round remove button baked into each chip. */
.tenant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.3rem 0 0.6rem;
}

.tenant-chip.tenant-chip-selected {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-color: var(--adtran-accent5);
  background: rgba(50, 100, 240, 0.1);
  color: var(--adtran-accent5-deep);
}

.tenant-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.tenant-chip-remove:hover {
  background: rgba(216, 59, 59, 0.15);
  color: var(--adtran-status-blocked);
}

/* ============================================================
   One-time key banner -- brand highlight-box treatment
   ============================================================ */
/* Shell only -- the accent colour comes from a .banner-* modifier, so one element never
   has two rules disagreeing about its colour. */
.banner {
  border: none;
  border-left: 6px solid var(--border);
  background: var(--surface);
  max-width: 40rem;
}

.banner-warn {
  border-left-color: var(--adtran-status-warn);
}

.banner-done {
  border-left-color: var(--adtran-status-done);
}

.banner-blocked {
  border-left-color: var(--adtran-status-blocked);
}

.banner-info {
  border-left-color: var(--adtran-accent1);
}

.one-time-key-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: rgba(217, 138, 0, 0.12);
  border: 1px solid var(--adtran-status-warn);
  border-radius: 0.375rem;
}

.one-time-key-warning h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  color: var(--adtran-status-warn);
}

.one-time-key-warning-icon {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--adtran-status-warn);
}

.one-time-key-warning-text {
  margin: 0;
  font-weight: 700;
  color: var(--adtran-body-text);
}

.one-time-key-created-by {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--adtran-dk2);
}

.one-time-key-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.one-time-key-row code {
  flex: 1;
  padding: 0.6rem 0.7rem;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 0.25rem;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

/* ============================================================
   Tables
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  /* No overflow:hidden here (unlike a plain rounded table) -- the actions dropdown
     needs to be able to overhang the table's edge. Corners are rounded explicitly
     on the header/footer cells below instead. */
}

.data-table thead tr:first-child th:first-child {
  border-top-left-radius: 0.5rem;
}

.data-table thead tr:first-child th:last-child {
  border-top-right-radius: 0.5rem;
}

.data-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 0.5rem;
}

.data-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 0.5rem;
}

.data-table th {
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--adtran-dk2);
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #fafbfc;
}

.loading-row td {
  text-align: center;
  padding: 1.5rem 0.9rem;
  color: var(--adtran-dk2);
  font-size: 0.88rem;
}

.loading-row:hover td {
  background: var(--surface);
}

/* Status pill -- dot + label, brand functional colors (traffic-light semantics) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* The four checklist statuses the backend emits, plus two for verify checks and polls.
   `missing` is red rather than amber deliberately: a missing registry key is a *silent*
   customer outage-drop, not a to-do item. `unknown` is grey because the portal genuinely
   cannot tell, and painting that green or red would be a lie either way. */
.status-pill.status-done {
  color: var(--adtran-status-done);
}
.status-pill.status-done::before {
  background: var(--adtran-status-done);
}

.status-pill.status-missing {
  color: var(--adtran-status-blocked);
}
.status-pill.status-missing::before {
  background: var(--adtran-status-blocked);
}

.status-pill.status-manual {
  color: var(--adtran-status-warn);
}
.status-pill.status-manual::before {
  background: var(--adtran-status-warn);
}

.status-pill.status-unknown {
  color: var(--adtran-lt2);
}
.status-pill.status-unknown::before {
  background: var(--adtran-lt2);
}

.status-pill.status-failed {
  color: var(--adtran-status-blocked);
}
.status-pill.status-failed::before {
  background: var(--adtran-status-blocked);
}

.status-pill.status-pending {
  color: var(--adtran-lt2);
}
.status-pill.status-pending::before {
  background: var(--adtran-lt2);
}

.status-pill.status-acknowledged {
  color: var(--adtran-accent1);
}
.status-pill.status-acknowledged::before {
  background: var(--adtran-accent1);
}

/* ============================================================
   Misc
   ============================================================ */
.error {
  color: var(--adtran-status-blocked);
  background: rgba(216, 59, 59, 0.08);
  border-radius: 0.375rem;
  padding: 0.6rem 0.85rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--adtran-dk2);
}

.inline-field input {
  width: 5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-family: Arial, Helvetica, sans-serif;
}

/* ============================================================
   Onboarding wizard
   ============================================================ */
.wizard-progress {
  font-size: 0.9rem;
  color: var(--adtran-dk2);
  margin: 0.75rem 0;
}

.wizard-steps {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.wizard-step {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
}

.wizard-step-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.wizard-step-number {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--adtran-accent5);
  color: var(--adtran-lt1);
}

.wizard-step-done .wizard-step-number {
  background: var(--adtran-status-done);
}
.wizard-step-missing .wizard-step-number {
  background: var(--adtran-status-blocked);
}
.wizard-step-manual .wizard-step-number {
  background: var(--adtran-status-warn);
}
.wizard-step-unknown .wizard-step-number {
  background: var(--adtran-lt2);
}
.wizard-step-acknowledged .wizard-step-number {
  background: var(--adtran-accent1);
}

.wizard-step-title {
  flex: 1;
}

/* Holds the status pill at the right of the step's header row. */
.wizard-step-status {
  flex-shrink: 0;
  margin-left: auto;
  padding-top: 0.15rem;
}

.wizard-step-title h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.wizard-step-detail {
  margin: 0;
  font-size: 0.85rem;
  color: var(--adtran-dk2);
}

.wizard-step-body {
  margin-top: 0.85rem;
  padding-left: 2.45rem;
}

.wizard-ack {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--adtran-body-text);
  margin-top: 0.75rem;
}

.wizard-ack input {
  margin-top: 0.15rem;
}

.manual-steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--adtran-dk2);
}

.manual-steps li {
  margin-bottom: 0.4rem;
}

.kv-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}

.kv-list dt {
  color: var(--adtran-dk2);
  font-weight: 700;
}

.kv-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* `.card` is capped at 32rem for the reference's narrow key forms; the wizard's panels
   and the diff need the full column. */
.card-wide {
  max-width: none;
}

/* ============================================================
   Verify checks
   ============================================================ */
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.check-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.check-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.check-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* The backend's own check name, shown verbatim -- it is what an operator greps for and
   what a ticket should quote. */
.check-name {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: var(--adtran-accent3);
}

.check-detail {
  font-size: 0.85rem;
  color: var(--adtran-dk2);
}

/* ============================================================
   Secret diff (dry-run preview)
   ============================================================ */
.diff-list {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 0.75rem 0;
}

.diff-secret-name {
  margin: 0;
  padding: 0.55rem 0.85rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--adtran-accent3);
}

.diff-group + .diff-group .diff-secret-name {
  border-top: 1px solid var(--border);
}

.diff-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(8rem, max-content) 1fr;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  font-size: 0.85rem;
}

.diff-group:last-child .diff-row:last-child {
  border-bottom: none;
}

.diff-create {
  border-left-color: var(--adtran-status-done);
}
.diff-update {
  border-left-color: var(--adtran-status-warn);
}
.diff-delete {
  border-left-color: var(--adtran-status-blocked);
}
.diff-unchanged {
  border-left-color: var(--border);
  color: var(--adtran-footer-text);
}

.diff-action {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid currentcolor;
}

.diff-create .diff-action {
  color: var(--adtran-status-done);
}
.diff-update .diff-action {
  color: var(--adtran-status-warn);
}
.diff-delete .diff-action {
  color: var(--adtran-status-blocked);
}
.diff-unchanged .diff-action {
  color: var(--adtran-lt2);
}

.diff-key {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.diff-values {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.diff-before {
  color: var(--adtran-footer-text);
}

.diff-after {
  color: var(--adtran-body-text);
  /* Reset the UA's underline on <ins>. */
  text-decoration: none;
}

.diff-absent {
  font-style: italic;
  color: var(--adtran-footer-text);
  text-decoration: none;
}

.confirm-summary {
  font-size: 0.9rem;
  color: var(--adtran-dk2);
  margin: 0 0 0.5rem;
}

/* ============================================================
   Redacted credentials
   ============================================================ */
.fingerprint {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
  color: var(--adtran-dk2);
}

.redacted {
  font-style: italic;
  color: var(--adtran-status-warn);
}

/* ============================================================
   Delivery verdicts (pipeline test)
   ============================================================ */
.verdict {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
  border-radius: 0.375rem;
  border-left: 4px solid currentcolor;
  background: var(--surface);
}

.verdict-accepted {
  color: var(--adtran-status-done);
}
.verdict-rejected {
  color: var(--adtran-status-blocked);
}
.verdict-unresolved {
  color: var(--adtran-dk2);
  border-left-color: var(--adtran-lt2);
}
.verdict-dry-run {
  color: var(--adtran-accent3);
  border-left-color: var(--adtran-accent1);
}

.phase-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.phase-row:last-child {
  border-bottom: none;
}

.phase-name {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  min-width: 3.5rem;
}

.phase-function-error {
  color: var(--adtran-status-blocked);
  font-weight: 700;
}

.code-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.code-chip {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid currentcolor;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.code-chip-ok {
  color: var(--adtran-status-done);
}

.code-chip-bad {
  color: var(--adtran-status-blocked);
}

/* A result that was rendered against a configuration since changed. */
.stale {
  opacity: 0.6;
  border-left: 4px solid var(--adtran-lt2);
  padding-left: 0.75rem;
}

/* ============================================================
   Metric cards (webhook delivery)
   ============================================================ */
.metric-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0;
}

.metric-card {
  flex: 1 1 10rem;
  min-width: 10rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--adtran-lt2);
  background: var(--surface);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
}

.metric-card-success {
  border-left-color: var(--adtran-status-done);
}
.metric-card-failure {
  border-left-color: var(--adtran-status-blocked);
}
.metric-card-error {
  border-left-color: var(--adtran-status-warn);
}

.metric-card-total {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.metric-card-name {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.75rem;
  color: var(--adtran-dk2);
  overflow-wrap: anywhere;
}

.metric-caption {
  font-size: 0.8rem;
  color: var(--adtran-footer-text);
  margin: 0.3rem 0;
}

/* A CSS bar strip, not a chart library: it answers the only question the endpoint can
   answer -- when did failures cluster. Bar heights are set from a computed number via
   `style.height`, never via innerHTML. */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 2.5rem;
  margin-top: 0.5rem;
}

.sparkline-bar {
  flex: 1;
  min-height: 1px;
  background: var(--adtran-accent1);
  border-radius: 1px 1px 0 0;
}

.sparkline-empty {
  font-size: 0.75rem;
  color: var(--adtran-footer-text);
  margin-top: 0.5rem;
}

/* ============================================================
   JSON and log viewers
   ============================================================ */
.json-details {
  margin: 0.5rem 0;
}

.json-details > summary {
  cursor: pointer;
  color: var(--adtran-accent5);
  font-size: 0.85rem;
  font-weight: 700;
}

.json-block,
.log-block {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin: 0.5rem 0 0;
  max-height: 22rem;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.json-unwrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--adtran-dk2);
  margin-top: 0.5rem;
}

/* ============================================================
   Empty states, notices, forms
   ============================================================ */
.empty-row td {
  text-align: center;
  padding: 1.5rem;
  color: var(--adtran-dk2);
  font-size: 0.9rem;
}

.empty-row:hover td {
  background: var(--surface);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--adtran-dk2);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: 0.5rem;
}

/* Counts are only comparable when they line up. */
.data-table td.numeric,
.data-table th.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* A `queue_url` is long and there are no media queries in this stylesheet, so wide
   content scrolls in its own container rather than widening the page. */
.table-scroll {
  overflow-x: auto;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--adtran-dk2);
  margin: 0.15rem 0 0.75rem;
}

.muted {
  color: var(--adtran-footer-text);
  font-weight: 400;
}

.issue-list {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
  color: var(--adtran-status-blocked);
  font-size: 0.8rem;
}

/* Credential mode: two radio-selected panes. The inactive pane's inputs are `disabled`
   as well as hidden, and FormData omits disabled controls -- which is what makes
   submitting both credential forms (a 422) not a code path that exists. */
.cred-form {
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0 0.75rem;
}

.cred-form legend {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--adtran-dk2);
  padding: 0 0.35rem;
}

.cred-mode {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.cred-mode label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 400;
  font-size: 0.85rem;
}

.cred-pane label {
  display: block;
}

.reveal-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.checkbox-field input {
  margin-top: 0.15rem;
}

/* Persistent, non-dismissible: the numbers on screen are invented. Driven by
   GET /v1/health's `fixture_mode`, not by sniffing the data -- two responses (an empty
   DLQ, and the metrics, whose fields are all real backend constants) cannot carry a
   marker at all. */
.fixture-banner {
  background: rgba(217, 138, 0, 0.12);
  border: 1px solid var(--adtran-status-warn);
  border-radius: 0.375rem;
  color: #8a5800;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.6rem 0.85rem;
  margin: 1rem 2rem 0;
}
