:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #edf1ec;
  --ink: #18211a;
  --muted: #667168;
  --line: #dce3dc;
  --brand: #176b4a;
  --brand-dark: #0f5037;
  --brand-soft: #dcefe6;
  --danger: #a53a3a;
  --danger-soft: #fbe5e3;
  --warning: #8a5a12;
  --warning-soft: #fff0cc;
  --shadow: 0 18px 48px rgba(25, 48, 34, 0.08);
  --radius: 20px;
  --radius-sm: 12px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(169, 210, 187, 0.32), transparent 30rem),
    radial-gradient(circle at 100% 28%, rgba(236, 211, 156, 0.2), transparent 27rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
.button {
  min-height: 42px;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(calc(100% - 40px), var(--content));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(220, 227, 220, 0.86);
  background: rgba(245, 247, 244, 0.9);
  backdrop-filter: blur(16px);
}

.topbar__inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(23, 107, 74, 0.22);
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a,
.nav button {
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.nav a:hover,
.nav a[aria-current="page"],
.nav button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.nav__logout {
  display: inline;
  margin: 0;
}

.menu-toggle {
  display: none;
  width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: var(--ink);
  content: "";
}

main.shell {
  padding-top: 42px;
  padding-bottom: 72px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  line-height: 1.14;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 780px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

h3 {
  margin-bottom: 9px;
  font-size: 1.12rem;
}

.lead,
.muted {
  color: var(--muted);
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  font-size: 1.05rem;
}

.grid {
  display: grid;
  gap: 22px;
}

.grid--dashboard {
  grid-template-columns: minmax(0, 1.45fr) minmax(285px, 0.55fr);
}

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

.card {
  padding: 26px;
  border: 1px solid rgba(220, 227, 220, 0.92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.card--flat {
  box-shadow: none;
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 19px;
}

.card__head h2,
.card__head h3,
.card__head p {
  margin-bottom: 0;
}

.stat {
  padding: 21px;
}

.stat__value {
  display: block;
  margin-bottom: 3px;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.stat__label {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.field {
  display: grid;
  gap: 8px;
}

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

.field label,
.field__label {
  color: #34423a;
  font-size: 0.88rem;
  font-weight: 750;
}

.field input,
.field select {
  width: 100%;
  min-height: 47px;
  padding: 10px 13px;
  border: 1px solid #cfd8d0;
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 107, 74, 0.12);
}

.field__hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.choice {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
}

.choice:hover {
  border-color: #abc3b5;
  background: #f8fbf9;
}

.choice input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand);
}

.choice[hidden] {
  display: none;
}

.form-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-actions {
  grid-column: 1 / -1;
  margin-top: 5px;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: white;
  background: var(--brand);
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.button:hover,
button.button:hover {
  background: var(--brand-dark);
  box-shadow: 0 8px 22px rgba(23, 107, 74, 0.2);
  transform: translateY(-1px);
}

.button--secondary {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button--secondary:hover {
  background: var(--surface-soft);
  box-shadow: none;
}

.button--danger {
  border-color: #ecc7c3;
  color: var(--danger);
  background: var(--danger-soft);
}

.button--danger:hover {
  color: white;
  background: var(--danger);
}

.button--small {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 0.84rem;
}

.link {
  color: var(--brand);
  font-weight: 750;
  text-decoration: none;
}

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

.flash {
  margin-bottom: 22px;
  padding: 13px 16px;
  border: 1px solid #b7d8c6;
  border-radius: 12px;
  color: #174a34;
  background: var(--brand-soft);
}

.flash--error,
.flash-error {
  border-color: #ecc7c3;
  color: #7e2828;
  background: var(--danger-soft);
}

.flash-warning {
  border-color: #ead39e;
  color: var(--warning);
  background: var(--warning-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #355145;
  background: var(--surface-soft);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge--active,
.badge--succeeded {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.badge--queued,
.badge--running {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge--failed,
.badge--paused {
  color: var(--danger);
  background: var(--danger-soft);
}

.list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.list__item:first-child {
  padding-top: 0;
}

.list__item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.list__title {
  display: block;
  margin-bottom: 3px;
  font-weight: 750;
  text-decoration: none;
}

.list__meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.empty {
  padding: 32px 20px;
  border: 1px dashed #cbd6ce;
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  background: rgba(247, 250, 247, 0.7);
}

.results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.listing {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.listing__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-soft);
}

.listing__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing__placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #718078;
  font-weight: 700;
}

.listing__body {
  display: flex;
  min-height: 178px;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.listing__title {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 7px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-weight: 780;
}

.listing__price {
  margin-bottom: 7px;
  color: var(--brand-dark);
  font-size: 1.22rem;
  font-weight: 850;
}

.listing__meta {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.listing__body .link {
  margin-top: auto;
}

.status-panel {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 3px solid #dbe8e0;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f7f9f7;
  font-size: 0.76rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

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

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 34px 20px;
}

.auth-card {
  width: min(100%, 440px);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.auth-card .brand {
  margin-bottom: 34px;
}

.auth-card h1 {
  margin-bottom: 12px;
  font-size: 2rem;
}

.auth-card .form-grid {
  grid-template-columns: 1fr;
  margin-top: 26px;
}

.auth-card .form-actions {
  margin-top: 4px;
}

.auth-card .button {
  width: 100%;
}

.footer {
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

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

  .grid--dashboard > :first-child {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  .shell {
    width: min(calc(100% - 28px), var(--content));
  }

  .topbar__inner {
    min-height: 64px;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 63px;
    right: 14px;
    left: 14px;
    display: none;
    align-items: stretch;
    flex-direction: column;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .nav[data-open="true"] {
    display: flex;
  }

  .nav a,
  .nav button {
    display: block;
    width: 100%;
    text-align: left;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .choice-grid,
  .grid--dashboard,
  .grid--stats,
  .results {
    grid-template-columns: 1fr;
  }

  .grid--dashboard > :first-child {
    grid-column: auto;
  }

  .card {
    padding: 20px;
    border-radius: 16px;
  }

  main.shell {
    padding-top: 30px;
  }
}

@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;
  }
}

/* Application shell */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 20px;
  border-right: 1px solid rgba(220, 227, 220, 0.9);
  background: rgba(250, 252, 249, 0.88);
  backdrop-filter: blur(18px);
}

.sidebar .brand {
  margin: 0 8px 34px;
}

.brand-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(23, 107, 74, 0.22);
  font-weight: 850;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.sidebar nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.sidebar-logout {
  margin-top: auto;
}

.link-button {
  width: 100%;
  padding: 10px 13px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.link-button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.main {
  width: min(100%, 1300px);
  min-width: 0;
  margin: 0 auto;
  padding: 48px clamp(26px, 4vw, 64px) 80px;
}

.mobile-header {
  display: none;
}

.user-chip {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.user-chip > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 850;
}

.user-chip > div {
  display: grid;
}

.user-chip small {
  color: var(--muted);
  font-size: 0.72rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric {
  display: grid;
  min-height: 148px;
  align-content: space-between;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.9);
}

.metric > span,
.metric small {
  color: var(--muted);
}

.metric > span {
  font-size: 0.84rem;
  font-weight: 750;
}

.metric strong {
  margin: 8px 0;
  font-size: 2.2rem;
  letter-spacing: -0.06em;
}

.metric small {
  font-size: 0.76rem;
}

.metric.accent {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 16px 35px rgba(23, 107, 74, 0.2);
}

.metric.accent > span,
.metric.accent small {
  color: rgba(255, 255, 255, 0.74);
}

.danger-metric {
  border-color: #ecc7c3;
  background: var(--danger-soft);
}

.search-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.search-panel {
  margin-bottom: 24px;
  overflow: hidden;
}

.search-panel-head,
.panel-head,
.section-title,
.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.search-panel-head {
  padding: 25px 28px;
  border-bottom: 1px solid var(--line);
}

.search-panel-head h2,
.panel-head h2,
.section-title h2,
.results-head h2 {
  margin-bottom: 0;
}

.step-badge,
.live-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2a9a68;
  box-shadow: 0 0 0 4px rgba(42, 154, 104, 0.14);
}

.form-section {
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
}

.form-section h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}

.form-section h3 > span {
  color: var(--brand);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.segment-control {
  display: inline-flex;
  gap: 5px;
  margin-bottom: 17px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.segment-control label,
.check-card,
.pill {
  cursor: pointer;
}

.segment-control input,
.check-card input,
.pill input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.segment-control span {
  display: block;
  padding: 8px 15px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 750;
}

.segment-control input:checked + span {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 48, 34, 0.09);
}

.district-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.district-grid[hidden] {
  display: none;
}

.check-card span,
.pill span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #4f5d54;
  background: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
}

.check-card input:checked + span,
.pill input:checked + span {
  border-color: #9cc5af;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

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

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-grid label,
.form-stack label {
  display: grid;
  gap: 7px;
  color: #435047;
  font-size: 0.82rem;
  font-weight: 750;
}

.field-grid input,
.field-grid select,
.form-stack input,
.subscribe-inline input {
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd8d0;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

.field-grid input:focus,
.field-grid select:focus,
.form-stack input:focus,
.subscribe-inline input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 107, 74, 0.11);
}

.two-column-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill span {
  min-width: 58px;
}

.search-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding: 22px 28px;
}

.search-actions p {
  max-width: 420px;
  margin: 0 auto 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.button-primary {
  color: #fff;
  background: var(--brand);
}

.button-large {
  min-height: 50px;
  padding-inline: 22px;
}

.button-wide {
  width: 100%;
}

.button-danger-ghost {
  border-color: transparent;
  color: var(--danger);
  background: transparent;
}

.button-danger-ghost:hover {
  color: #fff;
  background: var(--danger);
}

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

.panel {
  padding: 25px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head a,
.section-title > span {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

.row-list {
  display: grid;
}

.compact-row {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.compact-row:last-child {
  border-bottom: 0;
}

.compact-row > div {
  display: grid;
  min-width: 0;
}

.compact-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row small {
  color: var(--muted);
}

.source-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 0.76rem;
  font-weight: 850;
}

.status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  color: #59665e;
  background: var(--surface-soft);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-active,
.status-succeeded {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.status-queued,
.status-running,
.status-degraded {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-failed,
.status-paused {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-large {
  padding: 8px 13px;
  font-size: 0.82rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8a9790;
}

.status-dot.active {
  background: #2a9a68;
  box-shadow: 0 0 0 5px rgba(42, 154, 104, 0.12);
}

.status-dot.paused {
  background: #c46555;
}

.compact-head {
  align-items: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.results-head {
  align-items: flex-end;
  margin: 34px 0 20px;
}

.subscribe-inline {
  display: flex;
  gap: 9px;
}

.subscribe-inline input {
  width: min(300px, 42vw);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.listing-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(25, 48, 34, 0.06);
}

.listing-image {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 10;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: var(--surface-soft);
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-label {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(24, 33, 26, 0.76);
  font-size: 0.68rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.listing-body {
  padding: 16px;
}

.listing-body h3 {
  margin-bottom: 5px;
  color: var(--brand-dark);
  font-size: 1.28rem;
}

.listing-body > p {
  min-height: 42px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.listing-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}

.listing-facts span {
  padding: 4px 7px;
  border-radius: 7px;
  color: #506057;
  background: var(--surface-soft);
  font-size: 0.72rem;
}

.listing-link {
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.loading-state {
  display: grid;
  min-height: 380px;
  place-items: center;
  align-content: center;
  padding: 45px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.loading-state p {
  max-width: 520px;
  color: var(--muted);
}

.radar {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 25px;
  overflow: hidden;
  border: 1px solid #a9cdb9;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 5px, transparent 6px), repeating-radial-gradient(circle, transparent 0 18px, rgba(23, 107, 74, 0.13) 19px 20px);
}

.radar span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 1px;
  transform-origin: left;
  background: linear-gradient(90deg, var(--brand), transparent);
  animation: radar 1.4s linear infinite;
}

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

.subscription-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.subscription-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--shadow);
}

.subscription-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.subscription-card h2 {
  margin-bottom: 8px;
}

.subscription-card > p {
  min-height: 48px;
  color: var(--muted);
  font-size: 0.86rem;
}

.subscription-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.subscription-card dl div {
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.subscription-card dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.subscription-card dd {
  margin: 2px 0 0;
  font-size: 0.82rem;
  font-weight: 750;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty.compact {
  padding: 25px 15px;
}

.error-panel {
  border-color: #ecc7c3;
}

.admin-section {
  margin-top: 34px;
}

.section-title {
  align-items: flex-end;
  margin-bottom: 14px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
}

.error-text {
  display: block;
  max-width: 360px;
  margin-top: 6px;
  color: var(--danger);
}

/* Authentication */
.auth-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 30px 18px;
}

.auth-body .auth-card {
  width: min(100%, 520px);
}

.auth-brand {
  margin-bottom: 34px;
}

.auth-card .lead {
  margin-bottom: 23px;
}

.auth-card code {
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.auth-note {
  display: grid;
  gap: 4px;
  margin: 22px 0;
  padding: 15px;
  border-radius: 12px;
  color: #3e4c43;
  background: var(--surface-soft);
  font-size: 0.86rem;
}

.auth-note span {
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 16px;
  margin: 25px 0 20px;
}

@media (max-width: 1120px) {
  .metric-grid.five,
  .metric-grid.four,
  .district-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(290px, 86vw);
    height: 100vh;
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    transition: transform 160ms ease;
  }

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

  .main {
    padding: 20px 18px 60px;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -4px 0 30px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-header .brand {
    margin: 0;
  }

  .menu-button {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
    font-weight: 750;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-chip {
    min-width: 0;
  }

  .metric-grid,
  .metric-grid.four,
  .metric-grid.five,
  .split-grid,
  .two-column-options,
  .field-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 2.05rem;
  }

  .metric-grid,
  .metric-grid.four,
  .metric-grid.five,
  .split-grid,
  .two-column-options,
  .field-grid,
  .field-grid.three,
  .district-grid,
  .listing-grid,
  .subscription-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 126px;
  }

  .search-panel-head,
  .form-section,
  .search-actions,
  .panel {
    padding: 20px;
  }

  .search-panel-head,
  .search-actions,
  .results-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-actions .button,
  .subscribe-inline,
  .subscribe-inline input,
  .subscribe-inline .button {
    width: 100%;
  }

  .subscribe-inline {
    flex-direction: column;
  }

  .compact-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .compact-row > .status {
    grid-column: 2;
  }

  .segment-control {
    width: 100%;
  }

  .segment-control label {
    flex: 1;
  }

  .segment-control span {
    text-align: center;
  }
}
