:root {
  color-scheme: light;
  --ink: #14231f;
  --muted: #66756f;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --line: #dce5e1;
  --brand: #0a6b50;
  --brand-dark: #084c3b;
  --brand-soft: #e4f4ed;
  --up: #07865f;
  --up-soft: #e3f7ef;
  --down: #c13d45;
  --down-soft: #fcebed;
  --flat: #8b958f;
  --shadow: 0 20px 50px rgb(19 48 39 / 9%);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, rgb(34 156 116 / 12%), transparent 34rem),
    linear-gradient(180deg, #f7faf8 0%, #eef4f1 100%);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--brand-dark);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0.85rem max(1.25rem, calc((100vw - 1280px) / 2));
  background: rgb(247 250 248 / 88%);
  border-bottom: 1px solid rgb(220 229 225 / 80%);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(145deg, var(--brand), #13a576);
  border-radius: 13px;
  box-shadow: 0 8px 18px rgb(10 107 80 / 23%);
  place-items: center;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.status-chip {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #d4a72c;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(212 167 44 / 13%);
}

.status-chip.is-online .status-dot {
  background: var(--up);
  box-shadow: 0 0 0 4px rgb(7 134 95 / 13%);
}

.status-chip.is-offline .status-dot {
  background: var(--down);
  box-shadow: 0 0 0 4px rgb(193 61 69 / 13%);
}

main {
  width: min(1280px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 3.5rem 0 2.5rem;
}

.hero {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.6rem;
  font-size: clamp(2.15rem, 5vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  letter-spacing: -0.035em;
}

.snapshot-meta {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.snapshot-meta a {
  color: var(--brand);
  font-weight: 650;
  text-underline-offset: 3px;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
}

.primary-button {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.05rem;
  color: white;
  font-size: 0.88rem;
  font-weight: 750;
  background: var(--brand);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgb(10 107 80 / 22%);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-button.is-loading .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error-banner {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  color: #7f242b;
  font-size: 0.88rem;
  background: var(--down-soft);
  border: 1px solid #f4cbd0;
  border-radius: var(--radius-sm);
}

.error-banner[hidden] {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.summary-card {
  position: relative;
  min-height: 142px;
  padding: 1.2rem;
  overflow: hidden;
  background: rgb(255 255 255 / 88%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgb(23 55 44 / 5%);
}

.summary-card::after {
  position: absolute;
  right: -28px;
  bottom: -48px;
  width: 110px;
  height: 110px;
  content: "";
  background: var(--brand-soft);
  border-radius: 50%;
  opacity: 0.55;
}

.summary-card > * {
  position: relative;
  z-index: 1;
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.summary-card strong {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.gain-card strong {
  color: var(--up);
}

.gain-card::after {
  background: var(--up-soft);
}

.loss-card strong {
  color: var(--down);
}

.loss-card::after {
  background: var(--down-soft);
}

.breadth-panel,
.market-panel {
  background: rgb(255 255 255 / 91%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.breadth-panel {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(260px, 1.5fr) auto;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius-md);
}

.breadth-visual {
  display: flex;
  height: 12px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 999px;
}

.breadth-segment {
  min-width: 0;
  transition: width 350ms ease;
}

.breadth-up {
  background: var(--up);
}

.breadth-flat {
  background: #abb4af;
}

.breadth-down {
  background: var(--down);
}

.breadth-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.breadth-legend span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.up {
  background: var(--up);
}

.legend-dot.flat {
  background: #abb4af;
}

.legend-dot.down {
  background: var(--down);
}

.market-panel {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1.15rem;
}

.result-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 0 1.5rem 1.2rem;
  border-bottom: 1px solid var(--line);
}

.toolbar label:not(.search-field) {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.search-field {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  height: 44px;
  padding: 0 0.85rem;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 11px;
}

.search-field:focus-within {
  background: white;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(10 107 80 / 10%);
}

.search-field input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

select,
.secondary-button {
  height: 44px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 11px;
}

select {
  min-width: 180px;
  padding: 0 2.2rem 0 0.8rem;
}

.secondary-button {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
}

select:hover,
.secondary-button:hover {
  border-color: var(--line);
}

.table-shell,
.history-table-shell {
  position: relative;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.95rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid #e9efec;
}

th:first-child,
td:first-child {
  padding-left: 1.5rem;
}

th:last-child,
td:last-child {
  padding-right: 1.5rem;
}

th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: #fafcfb;
}

td {
  color: #31423c;
  font-size: 0.82rem;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #f7faf8;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.numeric {
  text-align: right;
}

.symbol-button {
  padding: 0;
  color: var(--ink);
  font-weight: 800;
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.symbol-button:hover,
.symbol-button:focus-visible {
  color: var(--brand);
  text-decoration-color: currentcolor;
}

.positive {
  color: var(--up);
  font-weight: 750;
}

.negative {
  color: var(--down);
  font-weight: 750;
}

.neutral {
  color: var(--flat);
}

.table-state {
  margin: 0;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.table-state[hidden] {
  display: none;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1280px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 0.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

footer a {
  color: var(--brand);
  font-weight: 700;
  text-underline-offset: 3px;
}

.history-dialog {
  width: min(720px, calc(100% - 2rem));
  max-height: min(680px, calc(100vh - 2rem));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 90px rgb(9 35 27 / 28%);
}

.history-dialog::backdrop {
  background: rgb(11 29 23 / 46%);
  backdrop-filter: blur(4px);
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  color: var(--muted);
  font-size: 1.4rem;
  background: var(--surface-soft);
  border-radius: 50%;
  place-items: center;
}

.icon-button:hover {
  color: var(--ink);
}

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

:focus-visible {
  outline: 3px solid rgb(10 107 80 / 28%);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .breadth-panel {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 68px;
  }

  .brand small {
    display: none;
  }

  .status-chip {
    padding: 0.5rem;
    font-size: 0;
  }

  main {
    width: min(100% - 1.25rem, 1280px);
    padding-top: 2rem;
  }

  .hero {
    display: grid;
    gap: 1.25rem;
  }

  .primary-button {
    width: 100%;
  }

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

  .summary-card {
    min-height: 125px;
    padding: 1rem;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
    padding-inline: 1rem;
  }

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

  select {
    width: 100%;
    min-width: 0;
  }

  .panel-heading {
    padding-inline: 1rem;
  }

  footer {
    width: calc(100% - 1.25rem);
  }
}

@media (max-width: 430px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 112px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

[hidden] {
  display: none !important;
}

.header-actions,
.footer-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.header-link {
  padding: 0.5rem 0.75rem;
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 750;
  text-decoration: none;
  border-radius: 9px;
}

.header-link:hover {
  background: var(--brand-soft);
}

.market-disabled .summary-grid,
.market-disabled .breadth-panel,
.market-disabled .market-panel {
  display: none;
}

.history-dialog {
  width: min(980px, calc(100% - 2rem));
}

.admin-body {
  background:
    radial-gradient(circle at 85% -15%, rgb(10 107 80 / 14%), transparent 36rem),
    #f1f5f3;
}

.admin-main {
  width: min(1400px, calc(100% - 2.5rem));
  padding-top: 2.5rem;
}

.quiet-button {
  padding: 0.55rem 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.quiet-button:hover {
  color: var(--ink);
  border-color: #bdcac4;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 3rem;
  align-items: center;
  width: min(920px, 100%);
  min-height: 520px;
  margin: 4vh auto;
  padding: clamp(2rem, 5vw, 4rem);
  background: rgb(255 255 255 / 94%);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.login-copy h1,
.admin-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.login-copy > p:last-child {
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.7;
}

.login-form,
.backfill-form {
  display: grid;
  gap: 1rem;
}

.login-form label,
.backfill-form label,
.compact-select {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 750;
}

.login-form input,
.backfill-form input,
.mini-search input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

.login-form input:focus,
.backfill-form input:focus,
.mini-search input:focus {
  background: white;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(10 107 80 / 10%);
}

.form-error {
  margin: 0;
  color: var(--down);
  font-size: 0.8rem;
}

.admin-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.admin-hero h1 {
  margin-bottom: 0.5rem;
}

.notice-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-weight: 700;
  background: var(--brand-soft);
  border: 1px solid #c4e5d8;
  border-radius: var(--radius-sm);
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.summary-date {
  font-size: clamp(1.2rem, 2vw, 1.65rem) !important;
  line-height: 1.15 !important;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-panel {
  overflow: hidden;
  background: rgb(255 255 255 / 94%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 32px rgb(23 55 44 / 5%);
}

.admin-panel h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.admin-panel p {
  margin-bottom: 0;
}

.operation-block {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
}

.operation-block p,
.operation-copy p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.backfill-form {
  grid-template-columns: 1.3fr repeat(3, minmax(125px, 0.65fr)) auto;
  align-items: end;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid var(--line);
}

.backfill-form .secondary-button {
  white-space: nowrap;
}

.feature-list {
  border-top: 1px solid var(--line);
}

.feature-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  min-height: 78px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.feature-switch:last-child {
  border-bottom: 0;
}

.feature-switch strong,
.feature-switch small {
  display: block;
}

.feature-switch strong {
  margin-bottom: 0.25rem;
  font-size: 0.86rem;
}

.feature-switch small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.feature-switch input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  background: #c8d1cd;
  border-radius: 999px;
  transition: background 150ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  content: "";
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
  transition: transform 150ms ease;
}

.feature-switch input:checked + .switch-track {
  background: var(--brand);
}

.feature-switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.feature-switch input:focus-visible + .switch-track {
  outline: 3px solid rgb(10 107 80 / 28%);
  outline-offset: 2px;
}

.jobs-panel,
.traffic-panel {
  margin-bottom: 1rem;
}

.jobs-panel table {
  min-width: 1180px;
}

.job-requested strong,
.job-requested small,
.job-operation strong,
.job-operation small,
.job-stage-cell small,
.job-records strong,
.job-records small,
.job-progress-cell small {
  display: block;
}

.job-requested strong,
.job-operation strong,
.job-records strong {
  margin-bottom: 0.28rem;
  font-size: 0.78rem;
}

.job-requested small,
.job-operation small,
.job-stage-cell small,
.job-records small,
.job-progress-cell small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.job-stage-cell small {
  margin-top: 0.42rem;
}

.job-progress-cell {
  width: 300px;
  white-space: normal;
}

.job-progress-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.42rem;
  font-size: 0.7rem;
}

.job-progress-heading span {
  color: var(--muted);
}

.job-progress-track {
  display: block;
  width: 100%;
  height: 7px;
  margin-bottom: 0.42rem;
  overflow: hidden;
  background: #e4ebe8;
  border-radius: 999px;
}

.job-progress-track i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: inherit;
  transition: width 220ms ease;
}

.job-row-failed .job-progress-track i {
  background: var(--down);
}

.job-details {
  width: min(360px, 32vw);
  white-space: normal;
}

.job-details summary {
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.job-details[open] summary {
  margin-bottom: 0.85rem;
}

.job-detail-content {
  display: grid;
  gap: 0.85rem;
}

.job-failure {
  padding: 0.75rem;
  color: #7a2028;
  background: var(--down-soft);
  border: 1px solid #f0c7cb;
  border-radius: 10px;
}

.job-failure strong,
.job-failure code {
  display: block;
}

.job-failure strong {
  margin-bottom: 0.3rem;
  font-size: 0.74rem;
}

.job-failure code {
  width: fit-content;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.35rem;
  color: #7a2028;
  font-size: 0.63rem;
  background: rgb(255 255 255 / 65%);
  border-radius: 4px;
}

.job-failure p {
  margin: 0;
  color: #7a2028;
  font-size: 0.68rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.job-metadata {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 0.35rem 0.65rem;
  margin: 0;
  font-size: 0.66rem;
}

.job-metadata dt {
  color: var(--muted);
  font-weight: 750;
}

.job-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.retry-job {
  justify-self: start;
  height: 36px;
  color: #7a2028;
  background: var(--down-soft);
  border-color: #f0c7cb;
}

.job-status {
  display: inline-flex;
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: capitalize;
  border-radius: 999px;
}

.status-queued {
  color: #745900;
  background: #fff4c7;
}

.status-running {
  color: #075e83;
  background: #e1f5fc;
}

.status-succeeded {
  color: var(--up);
  background: var(--up-soft);
}

.status-failed {
  color: var(--down);
  background: var(--down-soft);
}

.traffic-heading {
  align-items: center;
}

.compact-select {
  grid-template-columns: auto auto;
  align-items: center;
}

.compact-select select {
  min-width: 110px;
}

.traffic-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.traffic-metrics > div {
  padding: 1.1rem 1.5rem;
  border-right: 1px solid var(--line);
}

.traffic-metrics > div:last-child {
  border-right: 0;
}

.traffic-metrics span,
.traffic-metrics strong {
  display: block;
}

.traffic-metrics span {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.traffic-metrics strong {
  font-size: 1.4rem;
}

.traffic-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(250px, 0.7fr);
  gap: 2rem;
  padding: 1.5rem;
}

.traffic-chart {
  display: flex;
  gap: clamp(0.2rem, 1vw, 0.75rem);
  align-items: flex-end;
  height: 190px;
  padding-top: 0.75rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.traffic-day {
  display: grid;
  flex: 1 0 22px;
  grid-template-rows: 1fr auto;
  gap: 0.4rem;
  min-width: 20px;
  height: 100%;
  text-align: center;
}

.traffic-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.traffic-bars i {
  display: block;
  width: min(7px, 35%);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.views-bar {
  background: var(--brand);
}

.visitors-bar {
  background: #7dbca7;
}

.traffic-day small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-list,
.audit-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.route-list li {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.6rem 0;
  color: var(--muted);
  font-size: 0.76rem;
  border-bottom: 1px solid var(--line);
}

.route-list li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-list li strong {
  color: var(--ink);
}

.lower-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
}

.mini-search {
  width: min(220px, 45vw);
}

.user-identity strong,
.user-identity small {
  display: block;
}

.user-identity small {
  margin-top: 0.2rem;
  color: var(--muted);
}

.audit-list {
  border-top: 1px solid var(--line);
}

.audit-list li {
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.audit-list li:last-child {
  border-bottom: 0;
}

.audit-list li div {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.audit-list strong {
  font-size: 0.78rem;
  text-transform: capitalize;
}

.audit-list time,
.audit-list p {
  color: var(--muted);
  font-size: 0.68rem;
}

.audit-list p {
  margin-top: 0.3rem;
  overflow-wrap: anywhere;
}

.empty-list {
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 1100px) {
  .admin-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .backfill-form {
    grid-template-columns: repeat(3, 1fr);
  }

  .operation-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .admin-summary-grid,
  .traffic-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .traffic-metrics > div {
    border-bottom: 1px solid var(--line);
  }

  .traffic-layout,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .login-panel {
    gap: 1.5rem;
    min-height: 0;
    margin-top: 1rem;
  }
}

@media (max-width: 600px) {
  .admin-main {
    width: min(100% - 1rem, 1400px);
    padding-top: 1.5rem;
  }

  .admin-hero,
  .operation-block {
    display: grid;
  }

  .admin-hero .secondary-button,
  .operation-block .primary-button {
    width: 100%;
  }

  .admin-summary-grid,
  .traffic-metrics,
  .backfill-form {
    grid-template-columns: 1fr;
  }

  .traffic-layout {
    padding: 1rem;
  }

  .header-link {
    display: none;
  }
}
