:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #f1f4f1;
  --ink: #162019;
  --muted: #68736b;
  --line: #dde3de;
  --brand: #12613f;
  --brand-dark: #0e4c32;
  --brand-soft: #e4f0e9;
  --danger: #a53a3a;
  --danger-soft: #fbe5e3;
  --warning: #8a5a12;
  --warning-soft: #fff0cc;
  --shadow: 0 8px 24px rgba(20, 38, 27, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --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,
.field textarea {
  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,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 107, 74, 0.12);
}

.field textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.parser-profile-form {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.parser-profile-form .form-section:last-of-type {
  border-bottom: 0;
}

.parser-profile-secondary-fields {
  margin-top: 16px;
}

.parser-section-lead {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.parser-source-grid {
  max-width: 780px;
}

.parser-korter-settings {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.parser-korter-settings[hidden] {
  display: none;
}

.parser-advanced {
  margin-top: 18px;
}

.parser-advanced summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 750;
}

.parser-advanced .field-grid {
  margin-top: 16px;
}

.parser-location-footer {
  display: block;
  margin-top: 12px;
}

.parser-district-toolbar {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.parser-owner-toggle {
  align-content: start;
}

.toggle-line {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font-weight: 650;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.parser-profile-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.parser-profile-submit p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.parser-actions input,
.parser-actions select {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.parser-config-preview,
.parser-actions small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.profile-status-stack { display: grid; gap: 5px; justify-items: start; }
.parser-profile-actions { min-width: 210px; }
.parser-actions-menu { position: relative; display: inline-block !important; }
.parser-actions-menu > summary { padding: 7px 10px; border: 1px solid #cfd8d1; border-radius: 7px; color: #465149; cursor: pointer; font-size: .76rem; font-weight: 700; list-style: none; }
.parser-actions-menu > summary::-webkit-details-marker { display: none; }
.parser-actions-menu > summary::after { content: '⌄'; margin-left: 7px; color: var(--brand); }
.parser-actions-menu-body { position: absolute; z-index: 20; top: calc(100% + 7px); right: 0; display: grid; gap: 8px; min-width: 245px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 10px 26px rgba(25, 43, 31, .12); }
.parser-actions-menu-body form, .parser-actions-menu-body details { display: flex; align-items: center; gap: 7px; }

@media (min-width: 801px) {
  .parser-profiles-table { overflow: visible; }
}

.parser-admin-actions-modal { width: min(680px, calc(100vw - 32px)); }
.parser-admin-actions-body { display: grid; gap: 12px; padding: 20px 24px 24px; }
.parser-admin-actions-body section { display: grid; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfa; }
.parser-admin-actions-body h3 { margin: 0; }
.parser-admin-actions-body form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.parser-admin-actions-body input, .parser-admin-actions-body select { min-height: 38px; flex: 1 1 180px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }

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

/* Product section navigation */
.page-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: -10px 0 24px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.page-tabs a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.page-tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .65); }
.page-tabs a[aria-current="page"] { color: var(--brand-dark); background: var(--surface); box-shadow: 0 1px 3px rgba(20, 38, 27, .08); }
.page-tabs a span { min-width: 21px; padding: 2px 6px; border-radius: 999px; color: var(--muted); background: #e8ece8; font-size: .68rem; text-align: center; }
.page-tabs a[aria-current="page"] span { color: var(--brand-dark); background: var(--brand-soft); }
.requests-page-panel .section-title { align-items: flex-start; }
.billing-explainer { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.billing-explainer h2 { margin: 0; }
.billing-explainer .muted { max-width: 720px; margin: 6px 0 0; }
.billing-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.account-grid-security { grid-template-columns: minmax(0, 620px); }

@media (max-width: 760px) {
  .page-tabs { width: 100%; margin-top: -4px; }
  .billing-explainer { align-items: stretch; flex-direction: column; }
  .billing-actions { justify-content: flex-start; }
}

@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-with-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(23, 107, 74, 0.12);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

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

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

.card-actions.sidebar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.sidebar-actions form {
  min-width: 0;
  margin: 0;
}

.sidebar-language {
  display: flex;
  justify-content: flex-end;
}

.language-select {
  min-height: 40px;
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--brand-dark);
  background-color: rgba(255, 255, 255, 0.88);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.language-select:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 74, 0.11);
}

.sidebar-user-chip {
  min-width: 0;
  margin-top: auto;
  margin-bottom: 8px;
}

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

.district-grid-nested {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.district-with-subdistricts {
  min-width: 0;
}

.district-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.district-toggle {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  color: var(--brand);
  background: #fff;
  cursor: pointer;
}

.district-toggle:hover {
  background: var(--brand-soft);
}

.district-toggle i {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.district-toggle[aria-expanded="true"] i {
  transform: rotate(225deg);
}

.subdistrict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.58);
}

.subdistrict-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);
}

/* Tbilisi district selector: override the general card style deliberately,
   so the parent name and the independent menu control form one clean unit. */
.district-header .district-parent span {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  font-size: 0.92rem;
}

.district-header:has(.district-parent input:checked) {
  border-color: #9cc5af;
  background: var(--brand-soft);
}

.district-header:has(.district-parent input:checked) .district-toggle {
  background: transparent;
}

.subdistrict-grid .subdistrict-card span {
  min-height: 35px;
  padding: 6px 7px;
  border-radius: 8px;
  font-size: 0.72rem;
}

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

.two-column-options h4 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.92rem;
}

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

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

.selection-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
}

.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);
  position: relative;
  z-index: 0;
  transform-origin: center;
  will-change: transform;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 340ms ease;
}

.listing-card:hover {
  z-index: 1;
  transform: scale(1.025);
  box-shadow: 0 16px 36px rgba(25, 48, 34, 0.13);
}

.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 {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 130ms ease;
}

.listing-image img.is-active {
  opacity: 1;
}

.photo-count {
  position: absolute;
  right: 10px;
  bottom: 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);
}

.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 {
  display: flex;
  flex-direction: column;
  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-phones {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 7px;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 0.78rem;
}

.listing-phones > span:first-child {
  font-weight: 700;
}

.listing-phones a {
  color: var(--brand-dark);
  font-weight: 750;
  text-decoration: none;
}

.listing-phones a:hover,
.listing-phones a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.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);
}

.scan-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -8px 0 24px;
  padding: 15px 18px;
  border: 1px solid #b9dac8;
  border-radius: var(--radius-sm);
  background: #f5fbf7;
}

.scan-progress p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.radar-small {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  margin: 0;
}

.results-pagination {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

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

.section-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-client-search,
.client-limits-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.admin-client-search input {
  width: 176px;
}

.admin-client-link {
  color: inherit;
  text-decoration: none;
}

.admin-client-link:hover strong {
  color: var(--accent);
}

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

.profile-info-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.profile-info-card > span,
.profile-info-card small {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-info-card strong {
  overflow-wrap: anywhere;
}

.client-profile-limits {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.client-limits-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.client-limits-form input {
  width: 74px;
  min-height: 34px;
  padding: 6px 8px;
}

.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-shell {
  display: grid;
  width: min(100%, 520px);
  gap: 10px;
}

.auth-language-switcher {
  display: flex;
  justify-content: flex-end;
}

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

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

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

.auth-login-method {
  display: grid;
  gap: 15px;
}

.auth-login-method h2 {
  margin: 0 0 5px;
  font-size: 1.04rem;
}

.auth-login-method p {
  margin: 0;
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.48;
}

.auth-login-method-telegram {
  padding: 18px;
  border: 1px solid #b9d8ca;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff9f3, #f9fcfa);
}

.auth-login-method-telegram h2 {
  color: var(--brand-dark);
}

.auth-login-method-telegram .button {
  min-height: 52px;
}

.auth-login-method-telegram .auth-legal-notice {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: center;
}

.auth-login-method-telegram .auth-legal-notice a {
  color: var(--brand-dark);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.auth-login-method-email {
  gap: 14px;
}

.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,
  .profile-info-grid,
  .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%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: var(--shadow);
    transition: transform 160ms ease, visibility 0s linear 160ms;
  }

  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .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,
  .profile-info-grid,
  .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,
  .parser-profile-submit,
  .results-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-actions .button,
  .parser-profile-submit .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;
  }
}

/* --------------------------------------------------------------------------
   SaaS refinement

   The application intentionally uses one quiet layout system across the
   customer and administrator areas.  Keeping this at the end of the file
   lets legacy page-specific rules remain functional while these shared
   measurements set the final visual language.
   -------------------------------------------------------------------------- */

body {
  background: #f4f6f4;
  font-size: 15px;
}

h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: -0.028em;
}

h1 {
  max-width: 900px;
  margin-bottom: 8px;
  font-size: clamp(1.9rem, 3.2vw, 2.55rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.28rem, 2vw, 1.55rem);
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.lead {
  max-width: 700px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  padding: 24px 16px 16px;
  border-right-color: var(--line);
  background: #fff;
  backdrop-filter: none;
}

.sidebar .brand {
  margin: 2px 8px 30px;
}

.brand {
  gap: 10px;
  font-size: 1.1rem;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 0.88rem;
}

.brand small {
  display: none;
}

.sidebar nav {
  gap: 4px;
}

.nav-section-label {
  margin: 20px 12px 5px;
  color: #778279;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section-label:first-of-type {
  margin-top: 18px;
}

.nav-item {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 7px;
  color: #465149;
  font-size: 0.88rem;
  font-weight: 650;
}

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

.nav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: var(--brand-dark);
  background: #d5e8dc;
  font-size: 0.7rem;
}

.sidebar-user-chip {
  margin-bottom: 10px;
}

.user-chip {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.user-chip > span {
  width: 32px;
  height: 32px;
  font-size: 0.78rem;
}

.user-chip strong {
  font-size: 0.84rem;
}

.sidebar-actions {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.link-button {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 650;
}

.language-select {
  min-height: 36px;
  border-radius: 7px;
  font-size: 0.72rem;
}

.main {
  width: min(100%, 1440px);
  margin: 0;
  padding: 30px clamp(24px, 3.5vw, 52px) 56px;
  background: #fff;
}

.page-head {
  align-items: center;
  gap: 20px;
  min-height: 54px;
  margin: -30px calc(-1 * clamp(24px, 3.5vw, 52px)) 28px;
  padding: 30px clamp(24px, 3.5vw, 52px) 24px;
  border-bottom: 1px solid var(--line);
}

.page-head.compact-head {
  margin-bottom: 22px;
}

.button,
button.button {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover,
button.button:hover {
  box-shadow: none;
  transform: none;
}

.button--small {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 6px;
}

.button-large {
  min-height: 44px;
  padding-inline: 17px;
}

.flash {
  margin-bottom: 18px;
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 0.88rem;
}

.live-badge,
.step-badge,
.badge,
.status {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.live-badge {
  border: 1px solid #cde2d5;
  background: #f2f8f4;
}

.metric-grid {
  gap: 0;
  margin: -16px 0 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.metric {
  min-height: 92px;
  padding: 14px 16px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.metric strong {
  margin: 3px 0;
  font-size: 1.55rem;
}

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

.metric.accent {
  border-color: transparent;
  color: var(--brand-dark);
  background: #eef7f1;
  box-shadow: none;
}

.metric.accent > span,
.metric.accent small {
  color: #567065;
}

.search-panel,
.panel,
.card,
.subscription-card,
.account-card,
.profile-info-card,
.client-profile-limits {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: none;
}

.parser-profile-form {
  border-radius: 10px;
}

.parser-profile-submit {
  padding: 18px 24px;
}

.search-panel {
  margin-bottom: 20px;
}

.search-panel-head {
  padding: 18px 22px;
}

.form-section {
  padding: 20px 22px;
}

.form-section h3 {
  gap: 8px;
  margin-bottom: 14px;
}

.segment-control {
  gap: 2px;
  margin-bottom: 14px;
  padding: 3px;
  border-radius: 8px;
}

.segment-control span {
  padding: 8px 13px;
  border-radius: 6px;
  font-size: 0.88rem;
}

.segment-control input:checked + span {
  box-shadow: 0 1px 2px rgba(20, 38, 27, 0.08);
}

.district-grid {
  gap: 8px;
}

.district-grid-nested {
  gap: 12px;
}

.district-header,
.subdistrict-grid {
  border-radius: 8px;
}

.district-header {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.district-toggle,
.district-header .district-parent span {
  min-height: 44px;
}

.subdistrict-grid {
  gap: 6px;
  margin-top: 7px;
  padding: 7px;
}

.check-card span,
.pill span {
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 650;
}

.subdistrict-grid .subdistrict-card span {
  min-height: 34px;
  border-radius: 6px;
}

.field-grid {
  gap: 12px;
}

.field-grid label,
.form-stack label {
  gap: 6px;
  font-size: 0.78rem;
}

.field-grid input,
.field-grid select,
.form-stack input,
.subscribe-inline input,
.admin-client-search input,
.client-limits-form input {
  min-height: 40px;
  border-radius: 7px;
  font-size: 0.9rem;
}

.two-column-options {
  gap: 24px;
}

.pill-grid {
  gap: 7px;
}

.search-actions {
  gap: 16px;
  padding: 18px 24px;
}

.panel {
  padding: 18px;
}

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

.results,
.listing-grid,
.subscription-grid {
  gap: 14px;
}

.listing {
  border-radius: 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.listing:hover {
  border-color: #bfd6c6;
  box-shadow: 0 8px 20px rgba(20, 38, 27, 0.08);
}

.listing__body {
  min-height: 158px;
  padding: 14px;
}

.listing__price {
  margin-bottom: 5px;
  font-size: 1.12rem;
}

.listing__meta {
  margin-bottom: 12px;
}

.subscription-card {
  padding: 18px;
}

.subscription-top {
  margin-bottom: 14px;
}

.subscription-card dl {
  gap: 8px;
  margin: 16px 0;
}

.subscription-card dl div {
  padding: 8px;
  border-radius: 6px;
}

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

.section-title {
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.section-tools,
.admin-client-search,
.client-limits-form {
  gap: 8px;
}

.table-wrap {
  border-radius: 10px;
  box-shadow: none;
}

table {
  font-size: 0.84rem;
}

th,
td {
  padding: 11px 12px;
  vertical-align: middle;
}

th {
  color: #59655d;
  background: #f7f9f7;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.055em;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #f7faf8;
}

.table-wrap .button,
.table-wrap button.button {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.76rem;
}

.admin-table-actions {
  white-space: nowrap;
}

.admin-table-actions form {
  display: inline;
  margin-left: 4px;
}

.admin-table-actions .button-secondary {
  border-color: #cfd8d1;
  color: #34423a;
  background: #fff;
}

.admin-table-actions .button-danger-ghost {
  padding-inline: 7px;
  color: #9a3b3b;
  background: transparent;
}

.admin-table-actions .button-danger-ghost:hover {
  color: #7f2929;
  background: #fceeed;
}

.admin-client-search input {
  width: 240px;
}

.client-limits-form label {
  gap: 3px;
  font-size: 0.68rem;
}

.client-limits-form input {
  width: 62px;
  min-height: 32px;
  padding: 5px 7px;
}

.profile-info-grid {
  gap: 12px;
}

.profile-info-card {
  min-height: 108px;
  padding: 16px;
}

.empty {
  padding: 26px 18px;
  border-radius: 10px;
  background: #fafcf9;
}

.auth-body {
  background: var(--bg);
}

.auth-card {
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(20, 38, 27, 0.07);
}

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

.auth-login-method-telegram {
  padding: 16px;
  border-radius: 9px;
  background: #f2f8f4;
}

.auth-note {
  margin: 18px 0;
  padding: 13px;
  border-radius: 8px;
}

.form-stack {
  gap: 13px;
  margin: 20px 0 16px;
}

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

  .metric-grid.five .metric:nth-child(3) {
    border-right: 0;
  }
}

@media (max-width: 820px) {
  .main {
    padding: 24px 18px 40px;
    background: var(--bg);
  }

  .page-head {
    align-items: flex-start;
    min-height: 0;
    margin: 0 0 24px;
    padding: 0;
    border-bottom: 0;
  }

  .section-title,
  .search-panel-head,
  .search-actions {
    align-items: flex-start;
  }
}

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

  .main {
    padding: 20px 14px 32px;
  }

  .form-section,
  .search-panel-head,
  .search-actions,
  .panel,
  .auth-card {
    padding: 16px;
  }

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

  .metric {
    border-bottom: 1px solid var(--line);
  }
}

/* Account and security */
.user-chip {
  color: inherit;
  text-decoration: none;
}

.user-chip:hover {
  border-color: #b9cbbf;
  background: #fff;
}

.auth-form,
.account-action-form {
  display: grid;
  gap: 14px;
}

.auth-form {
  margin: 24px 0 18px;
}

.auth-login-method-email .auth-form {
  margin: 0;
}

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

.auth-form input,
.account-action-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cfd8d0;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

.auth-form input:focus,
.account-action-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(23, 107, 74, 0.11);
}

.auth-form input:disabled,
.account-action-form input:disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-secondary-link {
  justify-self: start;
  color: var(--brand);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

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

.terms-acceptance-form .terms-acceptance-choice {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: #435047;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.55;
}

.terms-acceptance-form .terms-acceptance-choice input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--brand);
}

.terms-acceptance-choice a {
  color: var(--brand);
  font-weight: 750;
  text-underline-offset: 3px;
}

.auth-form-note {
  margin: -3px 0 2px;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

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

.account-card {
  display: flex;
  min-width: 0;
  min-height: 280px;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.account-card-head,
.account-section-head,
.session-row,
.session-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.account-card-head h2,
.account-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.account-card .account-action-form {
  margin-top: auto;
}

.account-value {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--brand-dark);
  font-size: 1.08rem;
  font-weight: 800;
}

.account-requirement {
  margin: auto 0 0;
  padding: 12px 14px;
  border-radius: 11px;
  color: #536158;
  background: var(--surface-soft);
  font-size: 0.82rem;
}

.security-status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.security-status.is-ok {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.account-sessions {
  margin-top: 24px;
}

.account-section-head {
  margin-bottom: 18px;
}

.session-list {
  display: grid;
}

.session-row {
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.session-row > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

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

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

.session-actions {
  align-items: center;
}

.session-actions form {
  margin: 0;
}

.session-actions .link-button {
  width: auto;
  color: var(--danger);
  white-space: nowrap;
}

.compact-page-head,
.account-confirm {
  width: min(100%, 700px);
}

.account-confirm {
  display: grid;
  gap: 20px;
}

.account-confirm h2 {
  margin-bottom: 0;
}

.code-input {
  max-width: 180px;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.38em;
  text-align: center;
}

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

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

  .account-card {
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .account-card,
  .account-confirm {
    padding: 20px;
  }

  .account-card-head,
  .account-section-head,
  .session-row {
    align-items: stretch;
    flex-direction: column;
  }

  .account-section-head .button,
  .account-action-form .button,
  .account-confirm .button {
    width: 100%;
  }

  .session-actions {
    width: 100%;
  }

  .session-actions form {
    margin-left: auto;
  }
}

/* Final action hierarchy. Templates consistently use these semantic class
   names; declaring them together prevents secondary and destructive actions
   from accidentally inheriting the primary green treatment. */
.button-secondary,
.button--secondary {
  border-color: #cfd8d1;
  color: #34423a;
  background: #fff;
}

.button-secondary:hover,
.button--secondary:hover {
  border-color: #b7c6bb;
  color: #1e3025;
  background: #f5f8f5;
}

.button-danger {
  border-color: #f0cfcb;
  color: #9a3b3b;
  background: #fff5f4;
}

.button-danger:hover {
  border-color: #eab4ae;
  color: #842d2d;
  background: #fde9e7;
}

.button-danger-ghost {
  border-color: transparent;
  color: #9a3b3b;
  background: transparent;
}

.button-danger-ghost:hover {
  color: #842d2d;
  background: #fceeed;
}

.admin-section .client-limits-form {
  align-items: flex-end;
}

.admin-table-actions {
  padding-bottom: 12px;
  vertical-align: bottom;
}

.admin-table-actions > a,
.admin-table-actions > form {
  vertical-align: bottom;
}

.admin-table-actions form {
  display: inline-block;
  margin: 0 0 0 4px;
}

/* Client product home: make product state explicit without pretending an
   unfinished self-service or payment flow is already available. */
.client-home-head { align-items: flex-start; }

.access-summary, .billing-current, .prepared-feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.access-summary h2, .billing-current h2, .prepared-feature h2,
.product-card h2, .plan-card h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.access-summary p:not(.eyebrow), .billing-current p:not(.eyebrow),
.prepared-feature p:not(.eyebrow), .product-card > p {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.access-summary-actions, .prepared-feature-side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

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

.product-card, .plan-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.product-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.product-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 1.15rem;
  font-weight: 700;
}

.product-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.product-stats > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 12px;
}

.product-stats > div + div { border-left: 1px solid var(--line); }

.product-stats strong, .feature-number {
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.1;
}

.product-stats span, .prepared-feature-side small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.product-card .card-actions { margin-top: auto; }
.overview-history { margin-top: 18px; }

.text-action {
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}
.text-action:hover { text-decoration: underline; }

.prepared-feature { align-items: stretch; }
.prepared-feature-copy { min-width: 0; }

.prepared-feature-copy ul, .plan-card ul {
  display: grid;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.86rem;
}

.prepared-feature-copy li::before, .plan-card li::before {
  content: "✓";
  margin-right: 8px;
  color: var(--brand);
  font-weight: 800;
}

.prepared-feature-side {
  display: grid;
  grid-template-columns: auto;
  align-content: center;
  min-width: 190px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.prepared-feature-side .button { margin-top: 8px; justify-self: start; }
.billing-current { margin-bottom: 16px; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.plan-card { display: flex; min-height: 220px; flex-direction: column; }
.plan-card h2 { margin-top: 8px; color: var(--brand-dark); font-size: 1.6rem; }
.plan-card h2 + p { margin: 3px 0 0; color: var(--muted); font-size: 0.82rem; }
.plan-card form { margin-top: auto; padding-top: 18px; }
.plan-card form .button { width: 100%; }

.parser-channel-list { display: grid; gap: 8px; margin-top: 14px; }
.parser-channel-list .muted { margin: 0; }
.parser-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}
.parser-channel-row > span { min-width: 0; overflow-wrap: anywhere; }
.parser-channel-row form { flex: 0 0 auto; }
.parser-channel-row .button { padding: 7px 10px; font-size: 0.8rem; }

.billing-addon {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 0.84rem;
}

.account-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.account-plan h2 { margin: 0; font-size: 1.1rem; }
.account-plan .muted { margin: 6px 0 0; }

.plan-application-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  border-color: #c9ded0;
  background: #f7fbf8;
}
.plan-application-summary h2 { margin: 0; font-size: 1.1rem; }
.plan-application-summary .muted { max-width: 720px; margin: 6px 0 0; }
.plan-application-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }

.account-language {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.account-language h2 { margin: 0; font-size: 1.1rem; }
.account-language .muted { margin: 6px 0 0; }
.account-language-form { display: flex; align-items: end; gap: 10px; flex: 0 0 auto; }
.account-language-form label { display: grid; gap: 5px; color: var(--muted); font-size: 0.78rem; }
.account-language-form select { min-width: 148px; }

.plan-modal {
  width: min(980px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(20, 38, 27, 0.18);
}

.plan-modal::backdrop { background: rgba(19, 30, 23, 0.34); }

.plan-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.plan-modal-head h2 { margin: 0; font-size: 1.25rem; }

.modal-close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 1.3rem;
  line-height: 1;
}

.plan-modal .plan-grid { padding: 20px 24px 0; }
.plan-modal .billing-addon, .modal-note { margin: 0 24px 20px; }
.modal-note { color: var(--muted); font-size: 0.84rem; line-height: 1.5; }

.parser-help-modal { width: min(1080px, calc(100vw - 32px)); }
.parser-help-flow { display: flex; align-items: stretch; gap: 10px; padding: 26px 24px 20px; }
.parser-help-step { display: grid; min-width: 0; flex: 1; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.parser-help-step > span { color: var(--brand); font-size: .72rem; font-weight: 850; letter-spacing: .08em; }
.parser-help-step strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: .92rem; }
.parser-help-step p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.parser-help-arrow { display: grid; flex: 0 0 18px; place-items: center; color: var(--brand); font-size: 1.3rem; font-weight: 750; }
.parser-help-note { margin: 0 24px 24px; padding: 13px 15px; border-left: 3px solid var(--brand); border-radius: 0 7px 7px 0; color: #466052; background: var(--brand-soft); font-size: .84rem; line-height: 1.5; }
.parser-request-modal { width: min(680px, calc(100vw - 32px)); }
.parser-request-body { display: grid; gap: 22px; padding: 24px; }
.parser-request-body > p { max-width: 580px; margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.6; }
.parser-request-form { display: grid; gap: 12px; }
.parser-request-form label { display: grid; gap: 9px; color: #34423a; font-size: .9rem; font-weight: 750; }
.parser-request-form textarea { width: 100%; min-height: 210px; padding: 14px 15px; resize: vertical; border: 1px solid #cfd8d0; border-radius: 10px; outline: none; color: var(--ink); background: #fff; font: inherit; line-height: 1.55; }
.parser-request-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(23, 107, 74, 0.12); }
.parser-request-form .muted { margin: 0; font-size: .84rem; }
.catalog-request { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 20px; padding: 16px 18px; border: 1px solid #cfe0d4; border-radius: 10px; background: #f4f9f5; }
.catalog-request strong { font-size: .94rem; }
.catalog-request p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.request-list { display: grid; gap: 10px; }
.request-list-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.request-list-item p { max-width: 780px; margin: 5px 0 8px; color: var(--muted); white-space: pre-wrap; }
.request-list-item small { color: var(--muted); }

/* Agency workspace: deliberately follows the same flat SaaS language as the
   rest of the account—consistent rhythm, restrained borders and no effects. */
.surface {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.surface.table-wrap { padding: 0; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 14px;
}
.section-heading h2 { margin: 0; }
.section-heading p:not(.eyebrow) { max-width: 720px; margin: 6px 0 0; color: var(--muted); }
.status-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #46534b;
  background: #f5f7f5;
  font-size: .74rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}
.status-chip-success { border-color: #cde2d5; color: var(--brand-dark); background: #eff8f2; }
.status-chip-warning { border-color: #ead9ad; color: #75591b; background: #fff8e7; }
.status-chip-danger { border-color: #ecc7c3; color: #913b3b; background: #fff3f2; }
.agency-head { align-items: center; }
.agency-head .status-chip { flex: 0 0 auto; }
.agency-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  margin: 0 0 20px;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f5f7f5;
}
.agency-tabs a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.agency-tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .58); }
.agency-tabs a.active { color: var(--brand-dark); background: var(--surface); box-shadow: 0 1px 2px rgba(20, 38, 27, .08); }
.agency-onboarding { max-width: 760px; padding: 28px; }
.agency-compact-form { display: flex; align-items: end; gap: 12px; margin-top: 22px; }
.agency-compact-form label { flex: 1; }
.agency-compact-form input { width: 100%; }
.agency-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 18px; }
.agency-metrics .agency-metric:last-child { border-right: 0; }
.agency-metric { min-width: 0; }
.agency-metric strong { font-variant-numeric: tabular-nums; }
.agency-overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); align-items: stretch; gap: 16px; }
.agency-overview-card { min-width: 0; }
.agency-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.agency-card-heading h2 { margin: 0; font-size: 1.1rem; }
.agency-overview-card .agency-limit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agency-limit-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.agency-limit-grid div { display: grid; gap: 6px; padding: 18px; background: var(--surface); }
.agency-limit-grid span, .agency-details dt, .agency-channel-card small { color: var(--muted); }
.agency-limit-grid strong { font-size: 20px; }
.agency-limit-grid strong small { color: var(--muted); font-size: .78rem; font-weight: 650; }
.agency-billing-details { display: grid; gap: 0; margin: 20px 0 0; }
.agency-billing-details > div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 13px 0; border-top: 1px solid var(--line); }
.agency-billing-details dt { color: var(--muted); font-size: .78rem; }
.agency-billing-details dd { margin: 0; font-size: .9rem; font-weight: 750; text-align: right; }
.agency-create-panel { margin-bottom: 18px; padding: 0; }
.agency-create-panel summary { padding: 18px 20px; cursor: pointer; font-weight: 800; }
.agency-create-panel[open] summary { border-bottom: 1px solid var(--line); }
.agency-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.agency-form-grid label, .agency-inline-form label { display: grid; gap: 7px; font-weight: 700; }
.agency-form-grid input, .agency-form-grid select, .agency-form-grid textarea, .agency-inline-form input, .agency-inline-form select, .agency-invite-link input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.agency-form-grid textarea { min-height: 110px; resize: vertical; }
.agency-wide { grid-column: 1 / -1; }
.agency-inline-form { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; align-items: end; gap: 12px; }
.agency-invite-link { display: grid; gap: 6px; margin-top: 18px; }
.agency-card-list { display: grid; gap: 12px; }
.agency-channel-card { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(320px, 1.3fr); align-items: center; gap: 20px; }
.agency-channel-card > div:first-child { display: grid; gap: 5px; }
.agency-channel-card form { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.agency-check-list { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.agency-check-list label { white-space: nowrap; }
.agency-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.agency-details { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; margin: 20px 0 0; }
.agency-details dt, .agency-details dd { margin: 0; }
.agency-list-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.agency-list-row:last-child { border-bottom: 0; }
.agency-invitation-card { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 24px; }
.agency-invitation-card > div { display: grid; gap: 6px; }
.role-form { display: flex; align-items: center; gap: 8px; }
.role-form select { min-height: 36px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.admin-agency-card { padding: 0; }
.admin-agency-card summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; cursor: pointer; }
.admin-agency-card summary > span:first-child { display: grid; gap: 4px; }
.admin-agency-card summary small { color: var(--muted); }
.admin-agency-card[open] summary { border-bottom: 1px solid var(--line); }
.admin-agency-card form { display: grid; gap: 16px; padding: 20px; }
.admin-agency-card textarea { min-height: 80px; }
.admin-agency-limits { padding: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-agency-create { margin-top: 24px; }
.admin-agency-summary { margin: 20px; }
.admin-agency-members { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 20px 20px; }
.admin-agency-members h3 { flex-basis: 100%; margin: 0 0 4px; }
.admin-agency-audit { margin: 0 20px 20px; padding-block: 12px; border-block: 1px solid var(--line); }
.danger-text { color: var(--danger); }
.muted { color: var(--muted); }
.table-wrap td small { display: block; margin-top: 4px; color: var(--muted); }
.parser-request-message { min-width: 280px; max-width: 520px; white-space: pre-wrap; }
.parser-request-update { display: grid; min-width: 260px; gap: 8px; }
.parser-request-actions { display: grid; gap: 8px; }
.parser-request-update select, .parser-request-update input { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; }
.plan-application-filters { display: grid; grid-template-columns: minmax(150px, 210px) minmax(150px, 210px) minmax(220px, 1fr) auto; align-items: end; gap: 12px; margin-bottom: 18px; }
.plan-application-filters label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.plan-application-filters input, .plan-application-filters select, .plan-application-update input, .plan-application-update select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; }
.plan-application-update { display: grid; min-width: 280px; gap: 8px; }

@media (max-width: 1120px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agency-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agency-metrics .agency-metric:nth-child(3) { border-right: 0; }
  .agency-metrics .agency-metric:nth-child(n+4) { border-top: 1px solid var(--line); }
  .agency-overview-grid { grid-template-columns: 1fr; }
  .agency-limit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .client-home-head, .access-summary, .billing-current, .prepared-feature {
    align-items: flex-start;
    flex-direction: column;
  }
  .access-summary-actions { align-items: center; }
  .product-grid, .plan-grid { grid-template-columns: 1fr; }
  .prepared-feature-side {
    width: 100%;
    min-width: 0;
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .account-plan { align-items: flex-start; flex-direction: column; }
  .plan-application-summary, .plan-application-actions { align-items: flex-start; flex-direction: column; }
  .plan-application-filters { grid-template-columns: 1fr; }
  .account-language { align-items: flex-start; flex-direction: column; }
  .account-language-form { width: 100%; align-items: end; }
  .plan-modal-head { padding: 18px 20px 16px; }
  .plan-modal .plan-grid { padding: 16px 20px 0; }
  .plan-modal .billing-addon, .modal-note { margin-right: 20px; margin-left: 20px; }
  .parser-help-flow { flex-direction: column; padding: 16px 20px; }
  .parser-help-arrow { width: 100%; min-height: 16px; transform: rotate(90deg); }
  .parser-help-note { margin: 0 20px 20px; }
  .parser-request-body { gap: 18px; padding: 20px; }
  .parser-request-form textarea { min-height: 180px; }
  .catalog-request { align-items: flex-start; flex-direction: column; gap: 12px; }
  .request-list-item { align-items: flex-start; flex-direction: column; gap: 10px; }
  .agency-compact-form, .agency-channel-card, .agency-channel-card form, .agency-invitation-card { display: flex; align-items: stretch; flex-direction: column; }
  .agency-tabs { width: 100%; }
  .agency-metrics, .agency-limit-grid, .agency-overview-card .agency-limit-grid, .agency-form-grid, .agency-detail-grid { grid-template-columns: 1fr; }
  .agency-metrics .agency-metric { border-right: 0; border-top: 1px solid var(--line); }
  .agency-metrics .agency-metric:first-child { border-top: 0; }
  .agency-inline-form { grid-template-columns: 1fr; }
  .agency-wide { grid-column: auto; }
}
