/* Skylund console styles.
 * Sections: reset, shared building blocks, app shell, auth pages, then one block per page.
 * State classes toggled by app.js: .is-open, .is-active, .is-on.
 */

/* ---------- Reset ---------- */

*,
::before,
::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  -webkit-tap-highlight-color: transparent;
  /* Background glows hang off the edges; on phones body's overflow: hidden doesn't stop them widening the page. */
  overflow-x: clip;
}

body {
  margin: 0;
  line-height: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b, strong {
  font-weight: bolder;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1em;
}

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button, select {
  text-transform: none;
}

button, input:where([type=button]), input:where([type=reset]), input:where([type=submit]) {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
}

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

h1, h2, h3, h4, h5, h6, p, pre {
  margin: 0;
}

ol, ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: #9ca3af;
}

button, [role=button] {
  cursor: pointer;
}

:disabled {
  cursor: default;
}

img, svg, video, canvas {
  display: block;
  vertical-align: middle;
}

img, video {
  max-width: 100%;
  height: auto;
}

/* !important so component display rules (.fields { display: grid }) can't unhide it. */
[hidden]:where(:not([hidden=until-found])) {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* ---------- Animations ---------- */

@keyframes pulse {
  50% { opacity: .5; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes menu-appear {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes nebula-slow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.1); }
}

@keyframes nebula-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ---------- Building blocks ---------- */

/* Alert. Variants match the colors handlers pass in: purple, red, green. */
.alert {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border-width: 1px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: shake 0.2s ease-in-out 0s 2;
}

.alert__icon {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.alert__message {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  white-space: pre-wrap;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.625;
}

.alert--purple { background-color: rgb(168 85 247 / 0.1); border-color: rgb(168 85 247 / 0.2); }
.alert--purple .alert__icon { color: #a855f7; }
.alert--purple .alert__message { color: #e9d5ff; }

.alert--red { background-color: rgb(239 68 68 / 0.1); border-color: rgb(239 68 68 / 0.2); }
.alert--red .alert__icon { color: #ef4444; }
.alert--red .alert__message { color: #fecaca; }

.alert--green { background-color: rgb(34 197 94 / 0.1); border-color: rgb(34 197 94 / 0.2); }
.alert--green .alert__icon { color: #22c55e; }
.alert--green .alert__message { color: #bbf7d0; }

/* Primary call to action (auth forms). */
.btn-primary {
  display: block;
  width: 100%;
  background-image: linear-gradient(to right, #9333ea, #2563eb);
  color: #fff;
  font-weight: 700;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgb(168 85 247 / 0.2), 0 4px 6px -4px rgb(168 85 247 / 0.2);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background-image: linear-gradient(to right, #a855f7, #3b82f6);
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

/* Quiet full-width button (auth pages). */
.btn-secondary {
  display: block;
  width: 100%;
  background-color: rgb(255 255 255 / 0.05);
  color: #fff;
  font-weight: 500;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-radius: 0.75rem;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  background-color: rgb(255 255 255 / 0.1);
}

/* White pill button ("Create New ..."). */
.btn-light {
  background-color: #fff;
  color: #000;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-light:hover {
  background-color: #9333ea;
  color: #fff;
}

.btn-light--sm {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 10px;
  line-height: inherit;
}

/* Uppercase action buttons (zone + billing forms). */
.btn-action {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-action:hover {
  background-color: rgb(255 255 255 / 0.05);
}

.btn-action--solid {
  padding-left: 2rem;
  padding-right: 2rem;
  border-width: 0;
  background-color: #9333ea;
  color: #fff;
  box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

.btn-action--solid:hover {
  background-color: #a855f7;
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-action--solid:disabled:hover {
  background-color: #9333ea;
}

.btn-action--danger {
  border-color: rgb(239 68 68 / 0.2);
  color: #ef4444;
}

.btn-action--danger:hover {
  background-color: #ef4444;
  color: #fff;
}

.btn-action--xs {
  font-size: 10px;
  line-height: inherit;
}

.btn-action--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

/* Text inputs on the dark auth cards. */
.input {
  width: 100%;
  background-color: rgb(0 0 0 / 0.4);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgb(168 85 247 / 0.5);
}

.input--icon {
  padding-left: 2.75rem;
}

.input-wrap {
  position: relative;
}

.input-wrap__icon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding-left: 1rem;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* Text inputs inside app panels. */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field--wide {
  grid-column: 1 / -1;
}

.field__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-left: 0.25rem;
}

.field__input {
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.field__input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: rgb(168 85 247 / 0.5);
}

.field__input--sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

textarea.field__input {
  resize: none;
}

.field__hint {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #64748b;
}

/* Read-only value shown in place of an input. */
.field__value {
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  min-height: 46px;
  display: flex;
  align-items: center;
}

.field__value--multiline {
  display: block;
  min-height: 74px;
  white-space: pre-wrap;
}

.field__value--key {
  display: block;
  min-height: 0;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 400;
  overflow-wrap: break-word;
  word-break: break-all;
}

.field__empty {
  color: #475569;
}

.fields {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2rem;
}

.fields--tight {
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .fields--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Native select (dropdown component). */
.dropdown {
  position: relative;
  width: 100%;
}

.dropdown__select {
  appearance: none;
  width: 100%;
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown__select:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: rgb(168 85 247 / 0.5);
}

.dropdown__option,
select.field__input option {
  background-color: #0f0f18;
  color: #fff;
}

/* The browser draws the option list of a native select; without these it gets white text on its
   own light or grey list. */
select.field__input option:checked {
  background-color: #3b0764;
}

.dropdown__option--placeholder {
  color: #64748b;
}

.dropdown__chevron {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding-right: 1rem;
  pointer-events: none;
}

.dropdown__chevron svg {
  width: 1rem;
  height: 1rem;
  color: #64748b;
}

/* Button + list select (zone settings). */
.custom-select {
  position: relative;
}

.custom-select__button {
  width: 100%;
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select__button:focus {
  border-color: rgb(168 85 247 / 0.5);
}

.custom-select__button i {
  font-size: 10px;
  color: #64748b;
}

.custom-select__menu {
  display: none;
  position: absolute;
  z-index: 50;
  width: 100%;
  margin-top: 0.5rem;
  background-color: #12121a;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  backdrop-filter: blur(24px);
}

.custom-select.is-open .custom-select__menu {
  display: block;
}

.custom-select__option {
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select__option:hover {
  background-color: #9333ea;
}

/* On/off switch. */
.toggle {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
  background-color: rgb(255 255 255 / 0.1);
  cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle.is-on {
  background-color: #9333ea;
}

.toggle__thumb {
  position: absolute;
  top: 0.25rem;
  left: 0;
  width: 1rem;
  height: 1rem;
  background-color: #fff;
  border-radius: 9999px;
  transform: translateX(0.25rem);
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle.is-on .toggle__thumb {
  transform: translateX(1.75rem);
}

/* Label + big number + unit. */
.metric__label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.25rem;
}

.metric__value {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 300;
  color: #fff;
}

.metric__unit {
  font-size: 0.75rem;
  line-height: 1rem;
  margin-left: 0.25rem;
  color: #64748b;
}

.stat-card {
  position: relative; /* Anchors the info tooltip */
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  padding: 1.5rem;
  border-radius: 2rem;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  border-color: rgb(168 85 247 / 0.5);
}

.stat-card__label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* Info icon by the label; the tooltip opens on hover, and on click or focus for touch and keyboards. */
.stat-card__info {
  display: inline-block;
  margin-left: 0.25rem;
  letter-spacing: 0;
}

.stat-card__info-btn {
  background: none;
  border: 0;
  padding: 0 0.125rem;
  font: inherit;
  font-size: 0.75rem;
  color: #64748b;
  cursor: help;
}

.stat-card__info:hover .stat-card__info-btn,
.stat-card__info:focus-within .stat-card__info-btn {
  color: #c084fc;
}

.stat-card__info-btn:focus-visible {
  outline: 2px solid rgb(192 132 252 / 0.6);
  outline-offset: 2px;
  border-radius: 9999px;
}

.stat-card__tip {
  display: none;
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 2.75rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: #11111a;
  border: 1px solid rgb(255 255 255 / 0.1);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.5);
  color: #cbd5e1;
  font-size: 0.75rem;
  line-height: 1.125rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.stat-card__info:hover .stat-card__tip,
.stat-card__info:focus-within .stat-card__tip {
  display: block;
}

@media (min-width: 640px) {
  .stat-card__tip {
    width: 20rem;
    right: auto;
  }

  /* The right-most cards open theirs to the left so it stays on screen */
  .stat-card:nth-last-child(-n+2) .stat-card__tip {
    left: auto;
    right: 1rem;
  }
}

.stat-card__value {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 300;
}

.stat-card__unit {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #c084fc;
  font-weight: 700;
}

/* Status pill with a glowing dot (Verified / Review Pending). */
.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border-width: 1px;
}

.status-pill__dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 9999px;
}

.status-pill__text {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-pill--ok { background-color: rgb(16 185 129 / 0.1); border-color: rgb(16 185 129 / 0.2); }
.status-pill--ok .status-pill__dot { background-color: #10b981; box-shadow: 0 0 8px #10b981; }
.status-pill--ok .status-pill__text { color: #34d399; }

.status-pill--pending { background-color: rgb(245 158 11 / 0.1); border-color: rgb(245 158 11 / 0.2); }
.status-pill--pending .status-pill__dot { background-color: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.status-pill--pending .status-pill__text { color: #fbbf24; }

.status-pill--bad { background-color: rgb(239 68 68 / 0.1); border-color: rgb(239 68 68 / 0.2); }
.status-pill--bad .status-pill__dot { background-color: #ef4444; box-shadow: 0 0 8px #ef4444; }
.status-pill--bad .status-pill__text { color: #f87171; }

.status-pill--sm {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
}

/* Invoice status. Variants match invoiceStatus(). */
.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  border-width: 1px;
}

.badge-paid {
  background-color: rgb(16 185 129 / 0.1);
  color: #10b981;
  border-color: rgb(16 185 129 / 0.2);
}

.badge-unpaid {
  background-color: rgb(245 158 11 / 0.1);
  color: #f59e0b;
  border-color: rgb(245 158 11 / 0.2);
}

.badge-overdue {
  background-color: rgb(239 68 68 / 0.1);
  color: #ef4444;
  border-color: rgb(239 68 68 / 0.2);
}

.badge-void {
  background-color: rgb(100 116 139 / 0.1);
  color: #94a3b8;
  border-color: rgb(100 116 139 / 0.2);
}

/* Section card with a 1px gradient border. */
.panel {
  position: relative;
  z-index: 20;
  scroll-margin-top: 6rem;
  padding: 1px;
  border-radius: 2.5rem;
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.1), transparent);
}

.panel:focus-within {
  z-index: 50;
}

.panel__body {
  background-color: rgb(10 10 16 / 0.8);
  backdrop-filter: blur(24px);
  padding: 2.5rem;
  border-radius: 2.5rem;
}

.panel__body--compact {
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .panel__body--compact {
    padding: 2.5rem;
  }
}

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.panel__head--loose {
  margin-bottom: 2.5rem;
}

.panel__title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.panel__head .panel__title {
  margin-bottom: 0;
}

.panel__title--spaced {
  margin-bottom: 1.5rem;
}

.panel__title--list {
  margin-bottom: 2rem;
}

.panel__title--lg {
  font-size: 1.5rem;
  line-height: 2rem;
  letter-spacing: -0.025em;
}

.panel__desc {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1rem;
  margin-bottom: 2rem;
}

.panel__head .panel__desc {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.panel__desc--lg {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.panel__actions {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Settings pages: section nav on the left, panels on the right. */
.page {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
}

.page__header {
  margin-bottom: 2.5rem;
}

.page__header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
}

.page__heading {
  min-width: 0;
}

.page__header--flush {
  margin-bottom: 0;
}

.page__title {
  overflow-wrap: anywhere;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.025em;
}

.page__subtitle {
  color: #94a3b8;
  margin-top: 0.5rem;
}

.page__subtitle--sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.page__notice {
  color: #c084fc;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.page__actions {
  display: flex;
  gap: 1rem;
}

/* Stacks with flexbox below lg: as a 12-column grid, the gaps alone are wider than a phone. */
.split {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.split__nav,
.split__main {
  min-width: 0;
}

.split__main > :not([hidden]) ~ :not([hidden]) {
  margin-top: 3rem;
  margin-bottom: 0;
}

@media (min-width: 1024px) {
  .split {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .split__nav {
    grid-column: span 3 / span 3;
  }

  .split__main {
    grid-column: span 9 / span 9;
  }
}

/* A row of chips that scrolls sideways on phones, a sticky column from lg up. */
.section-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1023px) {
  .section-nav .section-nav__link {
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    border-color: rgb(255 255 255 / 0.1);
  }
}

@media (min-width: 640px) {
  .section-nav {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (min-width: 1024px) {
  .section-nav {
    flex-direction: column;
    overflow: visible;
    position: sticky;
    top: 6rem;
  }
}

.section-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  border-width: 1px;
  border-color: transparent;
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.section-nav__link:hover,
.section-nav__link.is-active {
  background-color: rgb(255 255 255 / 0.05);
}

.section-nav__link.is-active {
  border-color: rgb(255 255 255 / 0.1);
  color: #fff;
}

.section-nav__link.is-active i {
  color: #c084fc;
}

/* Small inset box inside a panel (setting row, CNAME, ...). */
.inset {
  background-color: rgb(255 255 255 / 0.05);
  border-radius: 1rem;
  padding: 1.5rem;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-row__title {
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.setting-row__desc {
  color: #64748b;
  font-size: 10px;
}

.stack > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.stack--sm > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1rem;
}

/* ---------- App shell ---------- */

.app {
  background-color: #020205;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
}

.app__nebula {
  position: fixed;
  inset: 0;
  z-index: -1;
  filter: blur(100px);
  background: radial-gradient(circle at 50% 0%, #2e1065 0%, transparent 50%);
}

.app__frame {
  flex: 1 1 0%;
}

.app__row {
  display: flex;
}

.app__main {
  flex: 1 1 0%;
  /* Otherwise wide content (tables, long URLs) stretches the page past the viewport. */
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app__content {
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .app__content {
    padding: 2rem;
  }
}

.app__content > :not([hidden]) ~ :not([hidden]) {
  margin-top: 2rem;
  margin-bottom: 0;
}

/* Sidebar: off-canvas below lg, sticky column from lg up. */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  z-index: 140;
  display: none;
  opacity: 0;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-backdrop.is-shown {
  display: block;
}

.sidebar-backdrop.is-open {
  opacity: 1;
}

.sidebar {
  width: 16rem;
  background-color: #050508;
  border-right-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 150;
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.is-open {
  transform: translateX(0);
}

.sidebar__close-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem;
  border-bottom-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
}

.sidebar__close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: #94a3b8;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar__close:hover {
  background-color: rgb(255 255 255 / 0.05);
  color: #fff;
}

.sidebar__brand {
  padding: 2rem;
  display: flex;
  align-items: center;
}

.sidebar__brand img {
  height: 2.5rem;
}

.sidebar__nav {
  flex: 1 1 0%;
  padding-left: 1rem;
  padding-right: 1rem;
}

.sidebar__nav > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.sidebar__section {
  padding: 0 1rem 0.5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #c084fc;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #94a3b8;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar__link:not(.is-active):hover {
  background-color: rgb(255 255 255 / 0.05);
}

.sidebar__link.is-active {
  background-color: rgb(147 51 234 / 0.1);
  color: #c084fc;
  border-left-width: 2px;
  border-color: #a855f7;
}

.sidebar__link i {
  width: 1.25rem;
}

@media (min-width: 1024px) {
  .sidebar-backdrop,
  .sidebar-backdrop.is-shown,
  .sidebar__close-bar {
    display: none;
  }

  .sidebar {
    position: sticky;
    z-index: 40;
    transform: translateX(0);
  }
}

/* Header */
.topbar {
  height: 5rem;
  border-bottom-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 2rem;
  padding-right: 2rem;
  background-color: rgb(0 0 0 / 0.2);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar__menu-btn {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  color: #94a3b8;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar__menu-btn i {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.topbar__menu-btn:hover {
  color: #fff;
}

.topbar__menu-btn:active {
  transform: scale(0.95);
}

.topbar__title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  view-transition-name: header-title;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.topbar__health {
  display: none;
  font-size: 10px;
  background-color: rgb(16 185 129 / 0.1);
  color: #34d399;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border-width: 1px;
  border-color: rgb(16 185 129 / 0.2);
  text-transform: uppercase;
  font-weight: 700;
  view-transition-name: nodes-online;
}

.topbar__health--warn {
  background-color: rgb(245 158 11 / 0.1);
  color: #fbbf24;
  border-color: rgb(245 158 11 / 0.2);
}

.topbar__health--down {
  background-color: rgb(239 68 68 / 0.1);
  color: #f87171;
  border-color: rgb(239 68 68 / 0.2);
}

@media (min-width: 768px) {
  .topbar__health {
    display: block;
  }
}

@media (min-width: 1024px) {
  .topbar__menu-btn {
    display: none;
  }
}

.user-menu {
  position: relative;
  view-transition-name: profile-dropdown;
}

.user-menu__button {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background-color: #1e293b;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  view-transition-name: profile-button;
}

.user-menu__button:hover {
  border-color: rgb(168 85 247 / 0.5);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.user-menu__button:active {
  transform: scale(0.9);
}

.user-menu__panel {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 0.75rem;
  width: 16rem;
  background-color: rgb(10 10 16 / 0.95);
  backdrop-filter: blur(40px);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  overflow: hidden;
  z-index: 110;
  transform-origin: top right;
}

.user-menu.is-open .user-menu__panel {
  display: block;
  animation: menu-appear 0.2s ease-out;
}

.user-menu__head {
  padding: 1.25rem 1.5rem;
  border-bottom-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  background-color: rgb(255 255 255 / 0.02);
}

.user-menu__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.user-menu__account {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__email {
  font-size: 11px;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.125rem;
}

.user-menu__group {
  padding: 0.5rem;
}

.user-menu__group--danger {
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  background-color: rgb(239 68 68 / 0.02);
}

.user-menu__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.user-menu__item:hover {
  background-color: rgb(255 255 255 / 0.05);
  color: #fff;
}

.user-menu__item i {
  width: 1rem;
  color: #c084fc;
}

.user-menu__item--danger {
  width: 100%;
  color: #f87171;
  text-align: left;
}

.user-menu__item--danger:hover {
  background-color: rgb(239 68 68 / 0.1);
  color: #f87171;
}

.user-menu__item--danger i {
  color: inherit;
}

/* Footer */
.site-footer {
  padding: 5rem 2rem;
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  background-color: rgb(0 0 0 / 0.4);
  margin-top: auto;
}

.site-footer__inner {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.site-footer__logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.site-footer__logo img {
  height: 2rem;
}

.site-footer__copy {
  color: #475569;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 700;
}

/* ---------- Auth pages (login, signup, reset, verify) ---------- */

.auth {
  background-color: #050510;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.glow {
  position: absolute;
  width: 40%;
  height: 40%;
  border-radius: 9999px;
  filter: blur(120px);
}

.glow--top-left {
  top: -10%;
  left: -10%;
  background-color: rgb(88 28 135 / 0.2);
}

.glow--bottom-right {
  bottom: -10%;
  right: -10%;
  background-color: rgb(30 58 138 / 0.2);
}

.auth__container {
  width: 100%;
  max-width: 28rem;
  padding: 2rem;
  position: relative;
  z-index: 10;
}

.brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.brand__logo {
  height: 2.75rem;
}

.brand__tagline {
  color: #94a3b8;
  margin-top: 0.5rem;
}

.card {
  background-color: rgb(255 255 255 / 0.05);
  backdrop-filter: blur(24px);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.card--center {
  text-align: center;
}

.card__title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.5rem;
}

.card__title--tight {
  margin-bottom: 0.5rem;
}

.card__lead {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.25rem;
  margin-bottom: 1.5rem;
}

.card__lead--relaxed {
  line-height: 1.625;
}

.card__lead--loose {
  margin-bottom: 2rem;
}

.card__lead strong {
  color: #d8b4fe;
  font-weight: 500;
}

.card__icon {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  border-width: 1px;
}

.card__icon--mail {
  background-image: linear-gradient(to top right, rgb(168 85 247 / 0.2), rgb(59 130 246 / 0.2));
  border-color: rgb(168 85 247 / 0.3);
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgb(168 85 247 / 0.05), 0 8px 10px -6px rgb(168 85 247 / 0.05);
}

.card__icon--mail i {
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  background-image: linear-gradient(to right, #c084fc, #60a5fa);
  font-size: 1.5rem;
  line-height: 2rem;
}

.card__icon--locked {
  background-color: rgb(239 68 68 / 0.1);
  border-color: rgb(239 68 68 / 0.2);
  border-radius: 9999px;
}

.card__icon--locked i {
  color: #ef4444;
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.card__note {
  background-color: rgb(0 0 0 / 0.2);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  border-radius: 0.75rem;
  padding: 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #64748b;
  text-align: left;
  margin-bottom: 1.5rem;
}

.card__note > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

.card__note strong {
  color: #94a3b8;
}

.card__footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1rem;
}

.card__footer button {
  color: #fff;
  font-weight: 500;
  margin-left: 0.25rem;
}

.card__footer button:hover {
  text-decoration-line: underline;
}

.form > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.form__label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.form__hint {
  font-size: 10px;
  color: #64748b;
  margin-top: 0.5rem;
  margin-left: 0.25rem;
  font-style: italic;
}

.form__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  line-height: 1rem;
}

.form__check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #94a3b8;
}

.form__check input {
  border-radius: 0.25rem;
  border-color: rgb(255 255 255 / 0.1);
  background-color: rgb(0 0 0 / 0.4);
  color: #9333ea;
}

.form__terms {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.form__terms label {
  font-size: 0.75rem;
  line-height: 1.5;
  color: #94a3b8;
}

.form__terms a {
  text-decoration-line: underline;
}

.link {
  color: #c084fc;
}

.link:hover {
  color: #d8b4fe;
}

.auth__footer {
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.25rem;
  margin-top: 2rem;
}

.auth__footer a {
  color: #fff;
}

.auth__footer a:hover {
  text-decoration-line: underline;
}

/* Dev mode only: seeded users under the sign in card. */
.dev-logins {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.dev-logins code {
  color: #e2e8f0;
}

.dev-logins__user {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: #cbd5e1;
  text-align: left;
}

.dev-logins__user:hover {
  color: #fff;
}

.dev-logins__role {
  color: #64748b;
}

/* Square checkbox drawn in CSS for the dark theme. */
.checkbox {
  appearance: none;
  background-color: rgba(0, 0, 0, 0.4);
  margin: 0;
  margin-top: 0.125rem;
  font: inherit;
  color: currentColor;
  width: 1.25em;
  height: 1.25em;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.375rem;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #a855f7;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox:checked::before {
  transform: scale(1);
}

.checkbox:checked {
  border-color: rgba(168, 85, 247, 0.5);
}

.checkbox:focus {
  outline: 2px solid rgba(168, 85, 247, 0.3);
}

/* One-time code boxes (verify device). */
.otp {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.otp__input {
  width: 3rem;
  height: 3.5rem;
  background-color: rgb(0 0 0 / 0.4);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: #fff;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.otp__input:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgb(168 85 247 / 0.5);
}

.otp__input::-webkit-outer-spin-button,
.otp__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.locked {
  text-align: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.locked__retry {
  display: inline-block;
  width: 100%;
  background-color: rgb(255 255 255 / 0.1);
  color: #fff;
  font-weight: 700;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-radius: 0.75rem;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.locked__retry:hover {
  background-color: rgb(255 255 255 / 0.2);
}

/* Background glows on standalone pages. */
.glow--wide {
  width: 70%;
  height: 70%;
}

.glow--purple-15 { background-color: rgb(88 28 135 / 0.15); }
.glow--blue-15 { background-color: rgb(30 58 138 / 0.15); }
.glow--blue-10 { background-color: rgb(30 58 138 / 0.1); }

.glow--animated-fast {
  animation: nebula-pulse 10s infinite ease-in-out;
}

.glow--animated-slow {
  animation: nebula-slow 15s infinite ease-in-out;
}

/* ---------- Error page ---------- */

.error-page {
  background-color: #050510;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: #cbd5e1;
}

.error-page *::selection,
.error-page::selection,
.home *::selection,
.home::selection {
  background-color: rgb(168 85 247 / 0.3);
}

.error-page__container {
  width: 100%;
  max-width: 36rem;
  padding: 1.5rem;
  position: relative;
  z-index: 10;
}

.error-page__status-row {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.error-page__status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  backdrop-filter: blur(24px);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.error-page__dots {
  display: flex;
  gap: 0.25rem;
}

.error-page__dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 9999px;
  background-color: #ef4444;
}

.error-page__dot--orange {
  background-color: #f97316;
}

.error-page__code {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgb(255 255 255 / 0.8);
}

.error-page__dash {
  color: #a855f7;
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.error-page__frame {
  padding: 1px;
  border-radius: 2.5rem;
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.1), transparent);
}

.error-page__card {
  background-color: rgb(10 10 16 / 0.9);
  backdrop-filter: blur(64px);
  padding: 2.5rem;
  border-radius: 2.5rem;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.error-page__hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.error-page__icon-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.error-page__icon-glow {
  position: absolute;
  inset: 0;
  background-color: rgb(147 51 234 / 0.2);
  filter: blur(40px);
  border-radius: 9999px;
}

.error-page__icon {
  position: relative;
  width: 5rem;
  height: 5rem;
  background-image: linear-gradient(to bottom right, rgb(147 51 234 / 0.2), transparent);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
}

.error-page__icon i {
  font-size: 1.875rem;
  line-height: 2.25rem;
  color: #c084fc;
}

.error-page__title {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.error-page__lead {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.625;
  max-width: 24rem;
  margin-left: auto;
  margin-right: auto;
}

.error-page__log {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 1rem;
  background-color: rgb(0 0 0 / 0.4);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  position: relative;
}

.error-page__log-label {
  position: absolute;
  top: -0.625rem;
  left: 1.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  background-color: #0a0a10;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.error-page__message {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 0.875rem;
  line-height: 1.625;
  color: rgb(233 213 255 / 0.6);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.error-page__message::selection {
  background-color: rgb(168 85 247 / 0.4);
}

.error-page__ref {
  margin-top: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #64748b;
}

.error-page__actions {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px) {
  .error-page__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.error-page__back,
.error-page__home {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.error-page__back {
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  color: #94a3b8;
}

.error-page__back:hover {
  background-color: rgb(255 255 255 / 0.05);
  color: #fff;
}

.error-page__back i {
  margin-right: 0.5rem;
  font-size: 8px;
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.error-page__back:hover i {
  transform: translateX(-0.25rem);
}

.error-page__home {
  background-color: #9333ea;
  color: #fff;
  box-shadow: 0 0 25px rgba(147, 51, 234, 0.4);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-page__home:hover {
  background-color: #a855f7;
}

.error-page__home i {
  margin-left: 0.5rem;
  font-size: 8px;
}

.error-page__footer {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  opacity: 0.4;
}

.error-page__rule {
  height: 1px;
  width: 3rem;
  background-image: linear-gradient(to right, transparent, #64748b, transparent);
}

.error-page__brand {
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5em;
}

.error-page__brand span {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

/* ---------- Home (account picker) ---------- */

.home {
  background-color: #050510;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: #cbd5e1;
}

.home__nav {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2rem;
  z-index: 50;
}

.home__logout {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.home__logout span {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #64748b;
}

.home__logout i {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #475569;
  /* Glyph width, reserved so the nav doesn't shift when the icon font arrives. */
  width: 1em;
}

.home__logout:hover span,
.home__logout:hover i {
  color: #f87171;
}

.home__admin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #c084fc;
}

.home__admin i {
  font-size: 0.75rem;
  width: 1em;
}

.home__admin:hover {
  color: #e9d5ff;
}

.home__container {
  width: 100%;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  padding: 10rem 1.5rem 5rem;
  position: relative;
  z-index: 10;
}

.home__intro {
  margin-bottom: 3rem;
  border-left-width: 2px;
  border-color: rgb(168 85 247 / 0.5);
  padding-left: 1.5rem;
}

.home__title {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.025em;
}

.home__lead {
  color: #64748b;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.625;
}

.home__accounts > :not([hidden]) ~ :not([hidden]) {
  margin-top: 1rem;
  margin-bottom: 0;
}

.home__divider {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0.3;
}

.home__divider span {
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5em;
  color: #fff;
  white-space: nowrap;
}

.home__divider-line {
  height: 1px;
  flex: 1 1 0%;
  background-image: linear-gradient(to right, #fff, transparent);
}

.home__list {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 1rem;
}

.home__list > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.home__list::-webkit-scrollbar {
  width: 4px;
}

.home__list::-webkit-scrollbar-track {
  background: transparent;
}

.home__list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.home__list::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.3);
}

.account {
  display: block;
  padding: 1px;
  border-radius: 0.75rem;
  background-color: rgb(255 255 255 / 0.05);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.account:hover {
  background-color: rgb(255 255 255 / 0.1);
}

.account__inner {
  background-color: rgb(10 10 16 / 0.6);
  backdrop-filter: blur(12px);
  padding: 1.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.account:hover .account__inner {
  border-color: rgb(168 85 247 / 0.3);
}

.account__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.account__name {
  font-weight: 700;
  color: #fff;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.account:hover .account__name {
  color: #c084fc;
}

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

.account__meta-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  color: #475569;
}

.account__id {
  font-size: 10px;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  opacity: 0.8;
  transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.account:hover .account__id {
  opacity: 1;
}

.account__chevron {
  height: 2rem;
  width: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.account:hover .account__chevron {
  border-color: rgb(168 85 247 / 0.5);
  background-color: rgb(168 85 247 / 0.1);
}

.account__chevron i {
  font-size: 10px;
  color: #334155;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.account:hover .account__chevron i {
  color: #c084fc;
  transform: translateX(0.125rem);
}

.home__empty {
  padding: 4rem;
  text-align: center;
  border-width: 1px;
  border-style: dashed;
  border-color: rgb(255 255 255 / 0.05);
  border-radius: 2.5rem;
  background-color: rgb(255 255 255 / 0.02);
}

.home__empty i {
  color: #1e293b;
  font-size: 1.875rem;
  line-height: 2.25rem;
  margin-bottom: 1rem;
}

.home__empty p {
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-style: italic;
}

.home__footer {
  margin-top: 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0.3;
}

.home__footer p {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4em;
  color: #64748b;
}

.home__footer-line {
  height: 1px;
  width: 6rem;
  background-image: linear-gradient(to left, #64748b, transparent);
}

/* ---------- Analytics ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

/* Two columns on phones instead of one. */
.stat-grid--pairs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* Five cards: three and two on tablets, one row from 1024px with tighter cards until 1280px. */
  .stat-grid--5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-grid--pairs {
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .stat-grid--5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
  }

  .stat-grid--5 .stat-card {
    padding: 1.25rem;
  }

  .stat-grid--5 .stat-card__value {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

@media (min-width: 1280px) {
  .stat-grid--5 {
    gap: 1.5rem;
  }

  .stat-grid--5 .stat-card {
    padding: 1.5rem;
  }

  .stat-grid--5 .stat-card__value {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
}

@media (max-width: 639px) {
  .stat-grid--pairs .stat-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
  }

  .stat-grid--pairs .stat-card__value {
    font-size: 1.5rem;
    line-height: 2rem;
  }
}

.chart-panel {
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  border-radius: 2rem;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .chart-panel {
    border-radius: 2.5rem;
    padding: 2rem;
  }
}

.chart-panel__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.chart-panel__title {
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chart-panel__canvas {
  height: 260px;
}

@media (min-width: 640px) {
  .chart-panel__canvas {
    height: 350px;
  }
}

/* Switch with a sliding highlight. app.js sets --segments (option count) and
   --segment (checked index); set them inline too so the slider starts in place. */
.segmented {
  position: relative;
  /* Equal-width options, so the slider lines up with any of them. */
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  align-items: center;
  background-color: rgb(0 0 0 / 0.4);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  padding: 0.25rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  user-select: none;
}

.segmented__slider {
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: calc((100% - 0.5rem) / var(--segments, 2));
  transform: translateX(calc(var(--segment, 0) * 100%));
  border-radius: 9999px;
  background-color: rgb(139 92 246 / 0.2);
  border-width: 1px;
  border-color: rgb(139 92 246 / 0.3);
  transition: transform 300ms cubic-bezier(0, 0, 0.2, 1);
}

.segmented__option {
  position: relative;
  display: block;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  text-align: center;
  cursor: pointer;
  color: rgb(255 255 255 / 0.5);
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.segmented__option:hover {
  color: #fff;
}

.segmented__option.is-active {
  color: #c4b5fd;
}

/* ---------- Zones ---------- */

.zones-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.zones-header__lead {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.zone-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2rem;
}

@media (min-width: 768px) {
  .zone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .zone-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.zone-card {
  position: relative;
  padding: 1px;
  border-radius: 2.5rem;
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.1), transparent);
  transition: all 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zone-card:hover {
  background-image: linear-gradient(to bottom, rgb(168 85 247 / 0.4), transparent);
}

.zone-card__body {
  height: 100%;
  width: 100%;
  background-color: rgb(10 10 16 / 0.8);
  backdrop-filter: blur(24px);
  padding: 2rem;
  border-radius: 2.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.zone-card__glow {
  position: absolute;
  top: -6rem;
  right: -6rem;
  width: 12rem;
  height: 12rem;
  background-color: rgb(147 51 234 / 0.1);
  filter: blur(80px);
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zone-card:hover .zone-card__glow {
  background-color: rgb(147 51 234 / 0.2);
}

.zone-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.zone-card__name {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: #fff;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zone-card:hover .zone-card__name {
  color: #d8b4fe;
}

.zone-card__origin {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.zone-card__origin-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.origin-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  font-weight: 500;
  color: rgb(16 185 129 / 0.8);
}

.origin-status__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.origin-status.is-degraded {
  color: rgb(245 158 11 / 0.8);
}

.origin-status.is-degraded .origin-status__dot {
  background-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.origin-status.is-down {
  color: rgb(239 68 68 / 0.8);
}

.origin-status.is-down .origin-status__dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.origin-status.is-unknown {
  color: #64748b;
}

.origin-status.is-unknown .origin-status__dot {
  background-color: #64748b;
  box-shadow: none;
}

/* Zone settings: origin status with its latest check. */
.origin-health {
  justify-content: space-between;
  gap: 1rem;
}

.origin-health .origin-status {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.origin-health__detail {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.zone-card__metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-top-width: 1px;
  border-bottom-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  margin-bottom: 1.5rem;
}

.zone-card__cname {
  background-color: rgb(255 255 255 / 0.03);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 2rem;
}

.zone-card__cname-label {
  font-size: 9px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.zone-card__cname-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zone-card__cname-value {
  font-size: 0.75rem;
  line-height: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 1rem;
}

.zone-card__copy {
  color: #64748b;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zone-card__copy:hover {
  color: #fff;
}

.zone-card__copy i {
  font-size: 0.75rem;
  line-height: 1rem;
}

.zone-card__footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.zone-card__badges {
  display: flex;
  gap: 0.5rem;
}

.zone-card__badge {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(255 255 255 / 0.05);
  color: #94a3b8;
  cursor: help;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zone-card__badge:hover {
  color: #c084fc;
}

.zone-card__badge i {
  font-size: 10px;
}

.zone-card__badge--link {
  cursor: pointer;
}

.zone-card__name a:hover {
  color: #fff;
}

.zone-card__configure {
  position: relative;
  padding: 0.5rem 1rem;
  overflow: hidden;
}

.zone-card__configure span {
  position: relative;
  z-index: 10;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #c084fc;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.zone-card__configure:hover span {
  color: #fff;
}

.zone-card__configure i {
  margin-left: 0.25rem;
  font-size: 8px;
}

/* ---------- Zone settings ---------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 1rem;
}

.breadcrumb a {
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.breadcrumb a:hover {
  color: #c084fc;
}

.breadcrumb i {
  font-size: 8px;
  opacity: 0.3;
}

.breadcrumb span {
  color: #cbd5e1;
}

.code-chip {
  color: #c084fc;
  background-color: rgb(192 132 252 / 0.1);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
}

.fields--pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.callout {
  padding: 1rem;
  border-radius: 0.75rem;
  background-color: rgb(59 130 246 / 0.05);
  border-width: 1px;
  border-color: rgb(59 130 246 / 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.callout__text {
  font-size: 0.75rem;
  line-height: 1rem;
  color: rgb(191 219 254 / 0.9);
}

.callout__link {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: rgb(59 130 246 / 0.2);
  color: #dbeafe;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.callout__link:hover {
  background-color: rgb(59 130 246 / 0.3);
}

.danger {
  padding-top: 2.5rem;
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
}

.danger__heading {
  color: rgb(239 68 68 / 0.8);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.danger__box {
  background-color: rgb(239 68 68 / 0.05);
  border-width: 1px;
  border-color: rgb(239 68 68 / 0.1);
  border-radius: 2rem;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.danger__title {
  color: #fff;
  font-weight: 700;
}

.danger__desc {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1rem;
}

/* ---------- Billing ---------- */

.pay-card {
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  border-radius: 1rem;
  background-image: linear-gradient(to bottom right, rgb(147 51 234 / 0.2), transparent);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pay-card__info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.pay-card__brand {
  width: 3.5rem;
  height: 2.5rem;
  background-color: rgb(255 255 255 / 0.05);
  border-radius: 0.5rem;
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1.75rem;
  color: #fff;
}

.pay-card__title {
  color: #fff;
  font-weight: 600;
}

.pay-card__meta {
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

.pay-card__badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background-color: rgb(168 85 247 / 0.2);
  color: #c084fc;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.05em;
}

.pay-terms {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.25rem 2rem;
  margin-top: 1.75rem;
}

@media (min-width: 768px) {
  .pay-terms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pay-terms__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.pay-terms__value {
  margin: 0.375rem 0 0;
  color: #cbd5e1;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  overflow-wrap: break-word;
}

.pay-terms__link {
  color: #c084fc;
}

.pay-terms__link:hover {
  color: #d8b4fe;
}

.invoice-table {
  display: none;
  overflow-x: auto;
}

.invoice-table table {
  width: 100%;
  text-align: left;
}

.invoice-table thead tr {
  border-bottom-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
}

.invoice-table th {
  padding-bottom: 1rem;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.invoice-table td {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.invoice-table tbody > tr ~ tr {
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
}

.invoice-table tbody tr {
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.invoice-table tbody tr:hover {
  background-color: rgb(255 255 255 / 0.02);
}

.invoice-table .invoice-table__right {
  text-align: right;
}

.invoice-table__date,
.invoice-table__no,
.invoice-table__amount {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.invoice-table__date {
  color: #cbd5e1;
}

.invoice-table__no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #c084fc;
}

.invoice-table__no a:hover,
a.invoice-card__no:hover {
  text-decoration-line: underline;
}

.invoice-table__type {
  font-family: inherit;
  font-size: 0.75rem;
  color: #64748b;
}

.invoice-table__empty {
  color: #64748b;
  font-size: 0.875rem;
  padding: 1rem 0;
}

.invoice-table__amount {
  color: #fff;
  font-weight: 500;
}

.invoice-table__download {
  color: #64748b;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.invoice-table__download:hover {
  color: #fff;
}

.invoice-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1024px) {
  .invoice-table {
    display: block;
  }

  .invoice-cards {
    display: none;
  }
}

.invoice-card {
  background-color: rgb(255 255 255 / 0.02);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.invoice-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.invoice-card__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  display: block;
  margin-bottom: 0.25rem;
}

.invoice-card__label--tight {
  margin-bottom: 0.125rem;
}

.invoice-card__no {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #c084fc;
  font-weight: 700;
}

.invoice-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 0.75rem;
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
}

.invoice-card__date {
  font-size: 0.75rem;
  line-height: 1rem;
  color: #cbd5e1;
}

.invoice-card__amount {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: #fff;
}

.invoice-card__actions {
  padding-top: 0.75rem;
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  display: flex;
  justify-content: flex-end;
}

.invoice-card__download {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  background-color: rgb(255 255 255 / 0.05);
  border-width: 1px;
  border-color: rgb(255 255 255 / 0.1);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.invoice-card__download:hover {
  color: #fff;
}

.invoice-card__download:active {
  transform: scale(0.95);
}

.invoice-card__download i {
  color: #c084fc;
}

/* ---------- Zone page ---------- */

.zone-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 0.75rem;
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.zone-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.zone-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1280px) {
  .zone-overview {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }
}

/* Label/value rows; the label sits above the value on phones. */
.detail-list__row {
  display: grid;
  gap: 0.375rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
}

.detail-list__row:first-child {
  border-top-width: 0;
  padding-top: 0;
}

.detail-list__row:last-child {
  padding-bottom: 0;
}

@media (min-width: 640px) {
  .detail-list__row {
    grid-template-columns: 8rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: baseline;
  }
}

.detail-list dt {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  color: #e2e8f0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.detail-list__sub {
  display: block;
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1rem;
}

.detail-list__muted {
  color: #64748b;
}

.copy-value {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.copy-value__btn {
  flex-shrink: 0;
  color: #64748b;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-value__btn:hover {
  color: #fff;
}

.copy-value__btn i {
  font-size: 0.75rem;
  line-height: 1rem;
}

.domain-list > * + * {
  margin-top: 0.75rem;
}

.domain-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.domain-list__name {
  min-width: 0;
}

.cache-total {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 300;
  color: #fff;
  margin-bottom: 1.5rem;
}

.cache-total span {
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  color: #c084fc;
}

.bar-list > * + * {
  margin-top: 1rem;
}

.bar-list__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.bar-list__label {
  color: #e2e8f0;
}

.bar-list__value {
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bar-list__count {
  margin-left: 0.5rem;
  color: #64748b;
  font-size: 0.75rem;
}

.bar-list__track {
  height: 0.375rem;
  border-radius: 9999px;
  background-color: rgb(255 255 255 / 0.05);
  overflow: hidden;
}

.bar-list__fill {
  height: 100%;
  min-width: 2px;
  border-radius: 9999px;
  background-color: rgb(148 163 184 / 0.5);
}

.bar-list__item--accent .bar-list__fill {
  background-image: linear-gradient(to right, #7c3aed, #a78bfa);
  box-shadow: 0 0 12px rgb(167 139 250 / 0.4);
}

.empty-note {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.report-head {
  flex-wrap: wrap;
  gap: 1rem;
}

.report-head__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Scrolls sideways on phones; the date column stays put. */
.report-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.report-table table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.report-table th,
.report-table td {
  padding: 0.75rem 1rem;
  text-align: right;
  white-space: nowrap;
}

.report-table th:first-child,
.report-table td:first-child {
  padding-left: 0;
  text-align: left;
}

@media (max-width: 767px) {
  .report-table th:first-child,
  .report-table td:first-child {
    position: sticky;
    left: 0;
    background-color: #0b0b11;
    box-shadow: 8px 0 8px -8px rgb(0 0 0 / 0.8);
  }
}

.report-table th:last-child,
.report-table td:last-child {
  padding-right: 0;
}

.report-table th {
  padding-top: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.report-table tbody td {
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.05);
  color: #cbd5e1;
}

.report-table tbody td:first-child {
  color: #fff;
}

.report-table tbody tr:hover td {
  background-color: #111118;
}

.report-table tfoot td {
  border-top-width: 1px;
  border-color: rgb(255 255 255 / 0.15);
  color: #fff;
  font-weight: 700;
}

.report-table__tag {
  margin-left: 0.5rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #c084fc;
  background-color: rgb(192 132 252 / 0.1);
}

/* ---------- Admin portal ---------- */

.page--wide {
  max-width: 90rem;
}

.admin-stack > * + *,
.page > .panel + .panel,
.page > .admin-stack + .panel,
.page > form + .panel,
.admin-sums + .panel,
.admin-results + .admin-sums,
.admin-results + .panel {
  margin-top: 1.5rem;
}

.admin-title-badge {
  vertical-align: middle;
  margin-left: 0.5rem;
  font-size: 10px;
}

.admin-panel-head {
  margin-bottom: 1.5rem;
}

/* Summary cards above the list, one per currency */
.admin-sums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-sum {
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  background-color: rgb(255 255 255 / 0.03);
}

.admin-sum__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.admin-sum__rows {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 0.25rem;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.admin-sum__rows dt {
  color: #94a3b8;
}

.admin-sum__rows dd {
  margin: 0;
  text-align: right;
  color: #fff;
  font-weight: 600;
}

.admin-sum__rows dd.admin-sum__overdue {
  color: #f87171;
}

/* Filters */
.admin-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
  align-items: end;
}

.admin-filters .field__input {
  width: 100%;
  padding: 0.5rem 0.75rem;
}

.admin-filters select.field__input,
.admin-inline-form select.field__input,
.admin-stack select.field__input {
  appearance: auto;
  color-scheme: dark;
}

.admin-filters__search,
.admin-filters__range {
  grid-column: span 2;
}

.admin-filters__dates {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
}

.admin-filters__dates .field__input {
  min-width: 0;
  color-scheme: dark;
}

.admin-filters__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  grid-column: -2 / -1;
}

@media (max-width: 767px) {
  .admin-filters__search,
  .admin-filters__range {
    grid-column: auto;
  }
}

/* Invoice list */
.admin-table th,
.admin-table td {
  text-align: left;
  vertical-align: top;
}

.admin-table th a {
  color: inherit;
}

.admin-table th a:hover {
  color: #fff;
}

.admin-table .admin-table__num {
  text-align: right;
}

.admin-table__check {
  width: 1.5rem;
}

.admin-table__no {
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.admin-table__no:hover {
  color: #c084fc;
}

.admin-table__no-series,
.admin-table__no-draft {
  color: #64748b;
  font-weight: 500;
}

.admin-table__no:hover .admin-table__no-series {
  color: rgb(192 132 252 / 0.6);
}

.admin-table__credits {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

.admin-table__credits i {
  font-size: 8px;
  opacity: 0.7;
}

.admin-table__credits:hover {
  color: #fff;
  background-color: rgb(192 132 252 / 0.3);
}

.admin-table__sub {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: #64748b;
}

.admin-table__late {
  color: #f87171;
}

.admin-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

.admin-results__list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  font-size: 0.875rem;
  color: #cbd5e1;
}

.admin-results__list li + li {
  margin-top: 0.5rem;
}

.admin-results__list a {
  color: #c084fc;
}

.admin-results__error {
  white-space: pre-line;
  color: #fca5a5;
}

/* Draft lines */
.admin-lines table {
  min-width: 76rem;
}

.admin-lines td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  vertical-align: middle;
}

.admin-lines .field__input {
  width: 100%;
  padding: 0.5rem 0.625rem;
}

.admin-lines input[type="date"] {
  color-scheme: dark;
  width: 9.5rem;
}

.admin-lines .admin-lines__desc {
  min-width: 16rem;
}

.admin-lines .admin-lines__num {
  min-width: 9rem;
  text-align: right;
}

.admin-lines .admin-lines__unit {
  min-width: 5.5rem;
}

.admin-lines .admin-lines__vat {
  min-width: 4.5rem;
  text-align: right;
}

.admin-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.admin-actions__main {
  display: flex;
  gap: 0.75rem;
}

/* Published invoices */
.admin-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 2rem;
  row-gap: 0.5rem;
  font-size: 0.875rem;
}

.admin-facts dt {
  color: #64748b;
}

.admin-facts dd {
  margin: 0;
  color: #fff;
}

.admin-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.admin-inline-form .field__input {
  padding: 0.5rem 0.75rem;
  color-scheme: dark;
  min-width: 16rem;
}

.admin-preview {
  display: block;
  width: 100%;
  height: 72rem;
  margin-top: 1rem;
  border: 0;
  border-radius: 0.75rem;
  background-color: #e2e8f0;
}

.admin-account-notes + * {
  margin-top: 1.5rem;
}

.admin-notes {
  width: 100%;
  resize: vertical;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.admin-search {
  padding: 0.5rem 0.75rem;
  min-width: 16rem;
}

.admin-table__link {
  color: #fff;
  font-weight: 500;
}

.admin-table__link:hover {
  color: #c084fc;
}

.admin-table__sub.admin-table__inline {
  display: inline;
}

/* Team: invite form and users */
.team-invite {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1.25rem;
}

.team-invite .field__input {
  width: 100%;
  height: 2.375rem;
  padding: 0.5rem 0.75rem;
}

.team-invite select.field__input,
.team-role select.field__input {
  appearance: auto;
  color-scheme: dark;
}

.team-invite__roles {
  margin-top: 1rem;
}

.team-invite__roles b {
  color: #94a3b8;
  font-weight: 600;
}

@media (max-width: 767px) {
  .team-invite {
    grid-template-columns: 1fr;
  }
}

.team-role .field__input {
  padding: 0.375rem 0.625rem;
}

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

.team-actions form {
  display: inline-block;
}

.team-actions form + form {
  margin-left: 0.5rem;
}

/* Admin users: invite form and a user's page */
.admin-invite {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  align-items: end;
  margin-top: 1.25rem;
}

.admin-invite .field__input {
  width: 100%;
  height: 2.375rem;
  padding: 0.5rem 0.75rem;
}

.admin-invite__end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 2.375rem;
}

@media (max-width: 767px) {
  .admin-invite {
    grid-template-columns: 1fr;
  }
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  cursor: pointer;
}

.admin-check .checkbox {
  margin-top: 0;
}

.admin-user-access {
  margin: 1.25rem 0;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.admin-user-link {
  margin-top: 1.5rem;
}

.admin-user-link__hint {
  margin-top: 0.5rem;
}

/* ---------- Admin dashboards (System Health, Customer Health) ---------- */

.admin-dash > * + * {
  margin-top: 1.5rem;
}

.admin-dash > .page__header + *,
.admin-dash > .breadcrumb + * {
  margin-top: 0;
}

.sidebar__badge {
  margin-left: auto;
  min-width: 1.25rem;
  padding: 0 0.375rem;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

.sidebar__badge--warning {
  background-color: rgb(245 158 11 / 0.15);
  color: #fbbf24;
}

.sidebar__badge--critical {
  background-color: rgb(239 68 68 / 0.18);
  color: #f87171;
}

/* Period links, styled like .segmented */
.window-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid rgb(255 255 255 / 0.1);
  background-color: rgb(0 0 0 / 0.4);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
}

.window-switch__option {
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  color: rgb(255 255 255 / 0.5);
  white-space: nowrap;
  transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.window-switch__option:hover {
  color: #fff;
}

.window-switch__option.is-active {
  color: #c4b5fd;
  background-color: rgb(139 92 246 / 0.2);
  border-color: rgb(139 92 246 / 0.3);
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
}

/* KPI tiles */
.admin-stats {
  display: grid;
  /* Two side by side on phones */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
  gap: 1rem;
}

@media (max-width: 639px) {
  .admin-stat {
    padding: 1rem 1.125rem;
  }

  .admin-stat__value {
    font-size: 1.375rem;
  }
}

/* Even rows on wide screens, by the number of tiles */
@media (min-width: 1280px) {
  .admin-stats--n4,
  .admin-stats--n8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-stats--n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-stats--n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.admin-stat {
  padding: 1.25rem 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  background-color: rgb(255 255 255 / 0.03);
}

.admin-stat__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-bottom: 0.5rem;
}

.admin-stat__value {
  font-size: 1.625rem;
  line-height: 2rem;
  font-weight: 300;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.admin-stat__value--ok { color: #34d399; }
.admin-stat__value--warn { color: #fbbf24; }
.admin-stat__value--bad { color: #f87171; }

.admin-stat__unit {
  font-size: 0.75rem;
  font-weight: 700;
  color: #c084fc;
}

.admin-stat__note {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #64748b;
}

/* Anomalies */
.anomaly-box__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.anomaly-box__head .panel__desc {
  margin-bottom: 0;
}

.anomaly-box__counts {
  display: flex;
  gap: 0.5rem;
}

.anomaly-count {
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.anomaly-count--critical {
  background-color: rgb(239 68 68 / 0.15);
  color: #f87171;
}

.anomaly-count--warning {
  background-color: rgb(245 158 11 / 0.12);
  color: #fbbf24;
}

.anomaly-box__clear {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: #34d399;
}

.anomaly-failed {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: rgb(239 68 68 / 0.08);
  border: 1px solid rgb(239 68 68 / 0.2);
  font-size: 0.8125rem;
  color: #fca5a5;
}

.anomaly-failed__error {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.anomaly-list {
  margin-top: 1.25rem;
}

.anomaly {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-top: 1px solid rgb(255 255 255 / 0.05);
}

.anomaly__dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.4375rem;
  border-radius: 9999px;
  background-color: #64748b;
}

.anomaly--critical .anomaly__dot { background-color: #ef4444; box-shadow: 0 0 8px #ef4444; }
.anomaly--warning .anomaly__dot { background-color: #f59e0b; box-shadow: 0 0 8px rgb(245 158 11 / 0.6); }
.anomaly--info .anomaly__dot { background-color: #60a5fa; }

.anomaly--stale {
  opacity: 0.6;
}

.anomaly__main {
  flex: 1;
  min-width: 0;
}

.anomaly__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}

.anomaly__subject {
  margin-left: 0.375rem;
  font-weight: 400;
  color: #94a3b8;
}

.anomaly__detail {
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  overflow-wrap: anywhere;
}

.anomaly__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
}

.anomaly__link {
  color: #c084fc;
}

.anomaly__link:hover {
  text-decoration: underline;
}

@media (max-width: 639px) {
  .anomaly {
    flex-wrap: wrap;
  }

  .anomaly__side {
    flex-direction: row;
    width: 100%;
    padding-left: 1.375rem;
    justify-content: space-between;
  }
}

/* Anomaly titles in table cells */
.anomaly-tag {
  display: inline-block;
  margin: 0.125rem 0.25rem 0 0;
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: help;
}

.anomaly-tag--critical { background-color: rgb(239 68 68 / 0.12); color: #f87171; }
.anomaly-tag--warning { background-color: rgb(245 158 11 / 0.12); color: #fbbf24; }
.anomaly-tag--info { background-color: rgb(96 165 250 / 0.12); color: #93c5fd; }

/* Two panels side by side on wide screens */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

@media (min-width: 1280px) {
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-panel-head--row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.admin-panel-head--row .panel__title {
  margin-bottom: 0;
}

.admin-panel-head--spaced {
  margin-top: 2rem;
}

.admin-link {
  font-size: 0.75rem;
  color: #c084fc;
  white-space: nowrap;
}

.admin-link:hover {
  text-decoration: underline;
}

.admin-chart__head {
  margin-bottom: 1rem;
}

.admin-chart__head .panel__desc {
  margin: 0.25rem 0 0;
}

/* Dashboard tables */
.admin-table__link {
  color: #c084fc;
}

.admin-table__link:hover {
  text-decoration-line: underline;
}

.admin-table__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #c084fc;
  text-transform: uppercase;
}

.admin-table__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-table td.admin-table__bad,
.admin-table .admin-table__bad {
  color: #f87171;
}

.admin-table__warn {
  color: #fbbf24;
}

.admin-table td.admin-table__up {
  color: #34d399;
}

.admin-table td.admin-table__down {
  color: #f87171;
}

.admin-table__muted {
  color: #64748b;
}

.admin-table td.admin-table__status {
  white-space: normal;
  min-width: 10rem;
  max-width: 18rem;
}

/* Utilization of capacity and share of traffic, under the number */
.util,
.share {
  display: block;
  width: 5rem;
  height: 0.25rem;
  margin: 0.375rem 0 0 auto;
  border-radius: 9999px;
  background-color: rgb(255 255 255 / 0.08);
  overflow: hidden;
}

.util__bar,
.share__bar {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background-color: #a78bfa;
}

.util__bar--ok { background-color: #34d399; }
.util__bar--warn { background-color: #fbbf24; }
.util__bar--bad { background-color: #f87171; }

.origin-dot {
  display: inline-block;
  width: 0.4375rem;
  height: 0.4375rem;
  margin-right: 0.375rem;
  border-radius: 9999px;
  background-color: #64748b;
}

.origin-dot--healthy { background-color: #10b981; }
.origin-dot--degraded { background-color: #f59e0b; }
.origin-dot--down { background-color: #ef4444; }

.admin-table__url {
  display: inline-block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.admin-facts__multiline {
  white-space: pre-line;
}

.customer-table table {
  min-width: 72rem;
}

.customer-table__billing {
  margin-left: 0.25rem;
  vertical-align: 1px;
}

/* ---------- Zone caching rules (configure_zone.html) ---------- */

.cache-settings select.field__input {
  appearance: auto;
  color-scheme: dark;
}

.cache-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.cache-row__text {
  min-width: 0;
}

.cache-row__inputs {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

.cache-row__amount {
  width: 9rem; /* A stored u32 of seconds has up to 10 digits */
}

.cache-row__unit {
  width: 12rem;
}

.cache-row__mode {
  width: 18rem;
}

@media (max-width: 768px) {
  .cache-row {
    flex-direction: column;
    align-items: stretch;
  }

  .cache-row__unit,
  .cache-row__mode {
    width: 100%;
  }
}

.cache-params {
  margin-top: 1.25rem;
}

.cache-params__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}

.cache-params__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 28rem;
}

.cache-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.25rem;
  cursor: pointer;
}

.cache-check input {
  margin-top: 0.25rem;
  width: 1rem;
  height: 1rem;
  accent-color: #8b5cf6;
}

.cache-check .setting-row__title,
.cache-check .setting-row__desc {
  display: block;
}

.callout--warn {
  background-color: rgb(245 158 11 / 0.06);
  border-color: rgb(245 158 11 / 0.25);
}

.callout--warn .callout__text {
  color: rgb(253 230 138 / 0.9);
}

.cache-list {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #cbd5e1;
  overflow-wrap: anywhere;
}

.cache-params__warn {
  color: rgb(253 230 138 / 0.9);
}
