:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --line: rgba(20, 28, 38, 0.1);
  --line-strong: rgba(20, 28, 38, 0.16);
  --text: #111827;
  --muted: #697386;
  --soft: #8b95a5;
  --blue: #0a84ff;
  --cyan: #2dd4bf;
  --green: #0f9f6e;
  --amber: #b7791f;
  --red: #d92d20;
  --shadow: 0 24px 70px rgba(28, 39, 60, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 45% 0%, rgba(45, 212, 191, 0.14), transparent 34rem),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

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

.app-shell.locked {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(250, 252, 255, 0.72);
  backdrop-filter: blur(24px);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(140deg, #111827, #0a84ff, #2dd4bf) border-box;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 6px rgba(10, 132, 255, 0.05);
}

.brand-name {
  font-weight: 650;
  line-height: 1.1;
}

.brand-subtitle,
.system-label,
.panel-head p,
.eyebrow,
.metric span,
.task-meta,
td {
  color: var(--muted);
}

.brand-subtitle,
.system-label {
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  cursor: pointer;
}

.nav-item.active {
  color: var(--text);
  background: rgba(17, 24, 39, 0.06);
}

.nav-item:disabled {
  cursor: default;
  opacity: 0.52;
}

.nav-icon {
  color: var(--blue);
  font-size: 11px;
}

.system-card,
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.system-card {
  margin-top: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.account-card,
.balance-card,
.ledger-card {
  display: grid;
  gap: 3px;
}

.account-card strong,
.balance-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.account-card span {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-list {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.ledger-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
  padding: 8px;
}

.ledger-item div,
.ledger-item small {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ledger-item span,
.ledger-item small,
.ledger-empty {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.ledger-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-amount {
  font-size: 12px;
  line-height: 1.3;
}

.ledger-amount.credit {
  color: var(--green);
}

.ledger-amount.debit {
  color: var(--red);
}

.system-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(183, 121, 31, 0.12);
}

.pulse.ok {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(15, 159, 110, 0.12);
}

.workspace {
  padding: 28px;
  min-width: 0;
  overflow-x: hidden;
}

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

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.12;
  font-weight: 680;
}

h2 {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 650;
}

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

.icon-button,
.primary-button,
.secondary-button,
.ghost-link,
.mode-button,
.logout-button,
.auth-switch {
  min-height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;
}

.icon-button {
  width: 38px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.74);
  cursor: pointer;
}

.icon-button svg,
.primary-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ghost-link,
.secondary-button,
.mode-button,
.logout-button,
.auth-switch {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  padding: 0 14px;
  cursor: pointer;
}

.logout-button,
.auth-switch {
  min-height: 34px;
}

.primary-button {
  color: #fff;
  background: #111827;
  padding: 0 16px;
  cursor: pointer;
}

.full-button {
  width: 100%;
  margin-top: 12px;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.ghost-link:hover,
.mode-button:hover,
.logout-button:hover,
.auth-switch:hover {
  transform: translateY(-1px);
}

.secondary-button:disabled,
.primary-button:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none;
}

.view-section {
  display: none;
}

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

.grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.16fr) minmax(320px, 0.84fr);
  gap: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.36fr) minmax(440px, 0.64fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.billing-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(360px, 1.18fr);
  gap: 18px;
}

.companies-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
}

.infrastructure-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
}

.infrastructure-form-panel {
  position: relative;
  overflow: visible;
}

.infrastructure-form-panel:has(.field-help[open]) {
  z-index: 100;
}

.companies-results-panel,
.infrastructure-results-panel {
  grid-column: 1 / -1;
}

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

.field-grid label {
  display: grid;
  gap: 7px;
}

.check-group-field {
  display: grid;
  gap: 7px;
}

.multi-select {
  position: relative;
}

.multi-select summary {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #6b7c95;
  border-bottom: 1.5px solid #6b7c95;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
  flex: 0 0 auto;
}

.multi-select[open] summary {
  border-color: rgba(10, 132, 255, 0.34);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(28, 39, 60, 0.08);
}

.multi-select[open] summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.multi-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  margin-top: 8px;
  padding: 0 12px;
  outline: none;
}

.multi-search:focus {
  border-color: rgba(10, 132, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.08);
}

.check-group {
  max-height: 238px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  padding: 8px;
  margin-top: 8px;
  box-shadow: 0 18px 48px rgba(28, 39, 60, 0.08);
}

.okved-picker {
  max-height: 320px;
}

.check-option,
.tree-option {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  border-radius: 6px;
  padding: 4px 6px;
}

.check-option:hover,
.tree-option:hover,
.tree-node summary:hover {
  background: rgba(17, 24, 39, 0.045);
}

.tree-option.level-0 {
  font-weight: 650;
}

.tree-option.level-2 {
  padding-left: 18px;
}

.tree-option.level-3 {
  padding-left: 30px;
}

.tree-option.level-4 {
  padding-left: 42px;
}

.selected-only {
  background: rgba(10, 132, 255, 0.07);
}

.empty-state.mini {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.check-option input,
.tree-option input,
.tree-node summary input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.tree-node {
  border-radius: 6px;
}

.tree-node summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  border-radius: 6px;
  padding: 4px 6px;
}

.tree-node summary::-webkit-details-marker {
  display: none;
}

.tree-arrow::before {
  content: "›";
  display: inline-flex;
  width: 14px;
  color: #58739a;
  font-size: 22px;
  line-height: 1;
  transform: translateY(-1px);
}

.tree-node[open] > summary .tree-arrow::before {
  transform: rotate(90deg) translateX(-1px);
}

.tree-children {
  margin-left: 22px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-filter {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.check-filter input {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.service-pricing-panel,
.billing-ledger-panel {
  grid-column: 1 / -1;
}

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

.service-pricing-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.1fr) minmax(170px, 0.45fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.service-pricing-row > div {
  display: grid;
  gap: 4px;
}

.service-pricing-row > strong {
  font-size: 15px;
}

.service-pricing-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.balance-hero {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(45, 212, 191, 0.16), transparent 18rem),
    rgba(255, 255, 255, 0.52);
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px;
}

.balance-hero strong {
  font-size: 42px;
  line-height: 1;
  font-weight: 680;
}

.balance-hero span,
.rate-grid span,
.package-card span,
.package-card small,
.billing-ledger-item span {
  color: var(--muted);
}

.rate-grid,
.package-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.rate-grid div,
.package-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  padding: 14px;
}

.rate-grid span,
.package-card span,
.package-card small {
  display: block;
  font-size: 12px;
}

.rate-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
}

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

.package-card {
  min-height: 168px;
  display: grid;
  grid-template-rows: auto auto auto 42px;
  gap: 10px;
}

.package-card strong {
  display: block;
  margin-top: 16px;
  font-size: 30px;
  line-height: 1;
}

.package-card.featured {
  border-color: rgba(10, 132, 255, 0.34);
  background: rgba(10, 132, 255, 0.06);
}

.package-pay-button {
  width: auto;
  min-width: 108px;
  min-height: 32px;
  align-self: end;
  justify-self: start;
  padding: 0 12px;
  font-size: 13px;
}

.custom-token-purchase {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.custom-token-summary,
.custom-token-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.custom-token-summary > div {
  display: grid;
  gap: 4px;
}

.custom-token-summary span {
  color: var(--muted);
  font-size: 11px;
}

.custom-token-summary strong {
  font-size: 14px;
}

.custom-token-price {
  text-align: right;
}

.custom-token-controls input[type="range"] {
  flex: 1;
  min-height: 32px;
  padding: 0;
  accent-color: var(--blue);
}

.custom-token-controls .primary-button {
  width: auto;
  min-width: 108px;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 14px;
  font-size: 13px;
}

.billing-ledger-list {
  display: grid;
  gap: 8px;
}

.billing-ledger-item {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 88px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.billing-ledger-item div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.billing-ledger-item div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-ledger-item > strong {
  text-align: right;
}

.placeholder-panel {
  min-height: 180px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.panel-head p {
  margin-top: 3px;
  font-size: 13px;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 3px;
  background: rgba(17, 24, 39, 0.05);
  border-radius: var(--radius);
}

.mode-button {
  min-height: 32px;
  border: 0;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
}

.mode-button.active {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
}

.form-stack {
  display: grid;
  gap: 10px;
}

.cost-preview {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
}

.cost-preview span,
.cost-preview small {
  color: var(--muted);
  font-size: 12px;
}

.cost-preview strong {
  font-size: 15px;
}

.cost-preview small {
  grid-column: 1 / -1;
}

.cost-preview.warning {
  border-color: rgba(217, 45, 32, 0.24);
  background: rgba(217, 45, 32, 0.04);
}

.cost-preview.warning strong {
  color: var(--red);
}

.purchase-panel {
  display: grid;
  gap: 10px;
}

.hidden {
  display: none !important;
}

.field-label {
  font-size: 13px;
  color: var(--muted);
}

.field-label-with-help {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-help {
  position: relative;
}

.field-help summary {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.field-help summary::-webkit-details-marker {
  display: none;
}

.field-help-popup {
  position: absolute;
  z-index: 1000;
  top: 26px;
  left: -12px;
  display: grid;
  width: min(300px, 75vw);
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.field-help-popup a {
  color: var(--blue);
  font-weight: 600;
}

.infrastructure-token-cost {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  line-height: 1.45;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

textarea:focus,
input:focus,
select:focus,
.upload-zone:focus-within {
  border-color: rgba(10, 132, 255, 0.46);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}

.upload-zone {
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  min-height: 74px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.42);
}

.upload-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-zone strong,
.upload-zone span {
  display: block;
}

.upload-zone span {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-orbit {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(10, 132, 255, 0.32);
  box-shadow: inset 0 0 0 8px rgba(10, 132, 255, 0.06);
}

.status-pill {
  min-width: 78px;
  min-height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  color: var(--muted);
  background: rgba(17, 24, 39, 0.06);
  font-size: 12px;
  text-transform: uppercase;
}

.status-pill.finished {
  color: var(--green);
  background: rgba(15, 159, 110, 0.1);
}

.status-pill.failed {
  color: var(--red);
  background: rgba(217, 45, 32, 0.1);
}

.status-pill.canceled {
  color: var(--muted);
  background: rgba(17, 24, 39, 0.08);
}

.status-pill.running,
.status-pill.queued {
  color: var(--blue);
  background: rgba(10, 132, 255, 0.1);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.07);
  border-radius: 999px;
  margin-bottom: 14px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: inherit;
  transition: width 220ms ease;
}

.task-eta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

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

.metric {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  padding: 12px;
}

.metric span {
  display: block;
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.metric.valid strong {
  color: var(--green);
}

.metric.risky strong {
  color: var(--amber);
}

.metric.invalid strong {
  color: var(--red);
}

.download-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.input-stats {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.download-meta {
  margin-top: 8px;
  color: var(--soft);
  font-size: 12px;
  text-align: right;
}

.task-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 3px;
}

.task-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.task-item.active {
  border-color: rgba(10, 132, 255, 0.42);
  background: rgba(10, 132, 255, 0.06);
}

.task-main {
  min-width: 0;
  padding: 2px 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 590;
}

.task-title span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  margin-top: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mode-pill {
  min-height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  color: var(--blue);
  background: rgba(10, 132, 255, 0.09);
}

.mode-pill.deep {
  color: #4338ca;
  background: rgba(67, 56, 202, 0.09);
}

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

.mini-button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mini-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.mini-button.danger:hover {
  color: var(--red);
}

.table-wrap {
  width: 100%;
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.5);
}

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

th {
  position: sticky;
  top: 0;
  background: rgba(248, 250, 252, 0.94);
  color: #3b4352;
  font-weight: 640;
  z-index: 1;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 620;
}

.badge.valid {
  color: var(--green);
  background: rgba(15, 159, 110, 0.1);
}

.badge.risky,
.badge.catch_all {
  color: var(--amber);
  background: rgba(183, 121, 31, 0.11);
}

.badge.invalid {
  color: var(--red);
  background: rgba(217, 45, 32, 0.1);
}

.empty-state {
  color: var(--soft);
  padding: 18px;
  font-size: 13px;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(45, 212, 191, 0.18), transparent 34rem),
    rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(22px);
}

.auth-screen.hidden {
  display: none;
}

.auth-panel {
  width: min(100%, 420px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  padding: 22px;
}

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

.auth-copy {
  margin-bottom: 18px;
}

.auth-copy h1 {
  font-size: 24px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-submit,
.auth-switch {
  width: 100%;
}

.auth-submit {
  margin-top: 6px;
}

.auth-switch {
  margin-top: 10px;
}

.register-only {
  display: none;
}

.auth-screen.register-mode .register-only {
  display: block;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 44px));
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    overflow: visible;
    z-index: 4;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    align-items: center;
    padding: 14px 18px;
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow: auto;
  }

  .system-card {
    display: none;
  }
}

@media (max-width: 900px) {
  .workspace {
    padding: 18px;
  }

  .grid,
  .content-grid,
  .billing-grid,
  .companies-grid,
  .infrastructure-grid {
    grid-template-columns: 1fr;
  }

  .billing-ledger-panel,
  .service-pricing-panel,
  .companies-results-panel,
  .infrastructure-results-panel {
    grid-column: auto;
  }

  .topbar {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .service-pricing-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

@media (max-width: 620px) {
  .sidebar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 24px;
  }

  .panel-head,
  .upload-zone {
    grid-template-columns: 1fr;
  }

  .upload-zone {
    display: grid;
  }

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

  .rate-grid,
  .package-grid,
  .billing-ledger-item,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .custom-token-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .custom-token-controls .primary-button {
    width: 100%;
  }

  .billing-ledger-item > strong {
    text-align: left;
  }
}

/* Public product site */
body.public-mode {
  background: #ffffff;
}

body.public-mode .app-shell {
  display: none;
}

body.app-mode .public-site {
  display: none;
}

.public-site {
  min-height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 max(24px, calc((100% - 1320px) / 2));
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
}

.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.public-brand .brand-mark {
  width: 30px;
  height: 30px;
}

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

.public-nav a,
.footer-column a,
.footer-column button,
.footer-bottom a {
  color: var(--muted);
  text-decoration: none;
}

.public-nav a {
  font-size: 13px;
}

.public-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.public-text-button,
.public-primary-button,
.public-secondary-button,
.audience-grid a,
.footer-column button {
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
}

.public-text-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
}

.public-primary-button,
.public-secondary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 17px;
  font-size: 16px;
  font-weight: 650;
}

.public-primary-button {
  color: #ffffff;
  background: #111827;
}

.public-secondary-button {
  color: var(--text);
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(255, 255, 255, 0.76);
}

.public-primary-button.large,
.public-secondary-button.large {
  min-height: 54px;
  padding: 0 26px;
  font-size: 17px;
}

.public-primary-button:hover,
.public-secondary-button:hover,
.public-text-button:hover,
.audience-grid a:hover {
  transform: translateY(-1px);
}

.public-hero {
  position: relative;
  height: min(780px, calc(100svh - 96px));
  min-height: 620px;
  overflow: hidden;
  background: #f8fbfd;
}

.public-hero-media,
.public-hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.public-hero-media {
  object-fit: cover;
  object-position: center bottom;
}

.public-hero-shade {
  background: rgba(255, 255, 255, 0.13);
}

.public-hero-copy {
  position: relative;
  z-index: 2;
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 62px;
  text-align: center;
}

.public-kicker,
.public-section-label {
  color: #0879e8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.public-hero h1 {
  margin-top: 10px;
  font-size: 88px;
  line-height: 0.98;
  font-weight: 760;
}

.public-hero-lead {
  max-width: 900px;
  margin: 20px auto 0;
  color: #384152;
  font-size: 25px;
  line-height: 1.36;
}

.public-hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.public-hero-foot {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 20px;
  width: min(860px, calc(100% - 40px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.public-hero-foot span {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 6px;
  color: #4c5668;
  font-size: 14px;
  text-align: center;
  border-right: 1px solid rgba(17, 24, 39, 0.08);
}

.public-hero-foot span:last-child {
  border-right: 0;
}

.public-intro,
.audience-head,
.infrastructure-stage-head {
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.public-intro {
  padding: 118px 24px 70px;
}

.public-intro h2,
.audience-head h2,
.infrastructure-stage h2,
.public-pricing h2,
.public-cta h2 {
  margin-top: 14px;
  font-size: 64px;
  line-height: 1.04;
  font-weight: 720;
}

.public-intro > p:last-child,
.infrastructure-stage-head > p:last-child {
  max-width: 900px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.45;
}

.cycle-rail {
  max-width: 1320px;
  margin: 0 auto 120px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cycle-step {
  min-height: 250px;
  padding: 28px;
  border-right: 1px solid var(--line);
}

.cycle-step:last-child {
  border-right: 0;
}

.cycle-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cycle-step-head svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #0879e8;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cycle-step-head > span,
.audience-index {
  color: #0879e8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.cycle-step h3 {
  margin: 48px 0 10px;
  font-size: 28px;
}

.cycle-step p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.product-band {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto 28px;
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(520px, 1.18fr);
  align-items: center;
  gap: 72px;
  padding: 70px;
  border-radius: 8px;
  overflow: hidden;
}

.product-band-companies {
  background: #f2f6fb;
}

.product-band-validation {
  grid-template-columns: minmax(520px, 1.18fr) minmax(300px, 0.82fr);
  background: #effaf7;
}

.product-band-copy h2 {
  max-width: 560px;
  margin-top: 14px;
  font-size: 56px;
  line-height: 1.04;
}

.product-band-copy > p:not(.public-section-label) {
  margin-top: 22px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.48;
}

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

.feature-list li {
  position: relative;
  padding-left: 22px;
  color: #394355;
  font-size: 17px;
  line-height: 1.45;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.48em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--cyan);
}

.product-surface,
.validation-visual {
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 80px rgba(28, 39, 60, 0.14);
}

.product-surface {
  padding: 22px;
  transform: rotate(1.2deg);
}

.surface-toolbar,
.validation-header,
.validation-export {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.surface-toolbar {
  font-weight: 700;
}

.surface-status {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 10px;
  border-radius: 8px;
  color: #0879e8;
  background: #eaf4ff;
  font-size: 11px;
  text-transform: uppercase;
}

.surface-status.green {
  color: var(--green);
  background: #e9f8f2;
}

.surface-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.surface-fields span {
  min-height: 68px;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.surface-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.surface-checks span,
.validation-modes span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.surface-action {
  min-height: 46px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-radius: 8px;
  color: #ffffff;
  background: #111827;
}

.validation-visual {
  padding: 26px;
  transform: rotate(-1deg);
}

.validation-header > div {
  display: grid;
  gap: 4px;
}

.validation-header span,
.validation-export span {
  color: var(--muted);
  font-size: 12px;
}

.validation-header strong {
  font-size: 20px;
}

.validation-modes {
  display: flex;
  gap: 8px;
  margin-top: 26px;
}

.validation-modes .active {
  color: #0879e8;
  border-color: rgba(10, 132, 255, 0.28);
  background: #edf6ff;
}

.validation-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.validation-columns span {
  min-height: 124px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.validation-columns span:nth-child(1) {
  border-top: 4px solid var(--green);
}

.validation-columns span:nth-child(2) {
  border-top: 4px solid var(--amber);
}

.validation-columns span:nth-child(3) {
  border-top: 4px solid var(--red);
}

.validation-export {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.infrastructure-stage {
  margin-top: 0;
  padding: 110px 24px 122px;
  color: #f8fafc;
  background: #171c24;
}

.infrastructure-stage .public-section-label {
  color: #55dec9;
}

.infrastructure-stage-head > p:last-child {
  color: #aeb7c5;
}

.infrastructure-flow {
  max-width: 1180px;
  margin: 70px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.infrastructure-flow > div {
  min-height: 210px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.infrastructure-flow > div:last-child {
  border-right: 0;
}

.infrastructure-flow span {
  color: #55dec9;
  font-size: 12px;
}

.infrastructure-flow-head {
  min-height: 18px;
  margin-bottom: 26px;
}

.infrastructure-flow strong {
  font-size: 28px;
}

.infrastructure-flow small {
  color: #aeb7c5;
  font-size: 16px;
}

.audience-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 124px 24px;
}

.audience-head {
  max-width: 900px;
}

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

.audience-grid article {
  min-height: 440px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.audience-grid article:last-child {
  background: #f1faf7;
}

.audience-grid h3 {
  max-width: 530px;
  margin: 56px 0 0;
  font-size: 38px;
  line-height: 1.15;
}

.audience-grid p {
  max-width: 540px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.audience-grid a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 0;
  color: #0879e8;
  background: transparent;
  font-weight: 650;
  text-decoration: none;
}

.roadmap-section {
  padding: 118px max(24px, calc((100% - 1320px) / 2)) 126px;
  background: #f3f7fb;
}

.roadmap-head {
  max-width: 900px;
}

.roadmap-head h2 {
  max-width: 820px;
  margin-top: 14px;
  font-size: 64px;
  line-height: 1.04;
  font-weight: 720;
}

.roadmap-head > p:last-child {
  max-width: 720px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.roadmap-grid {
  margin-top: 66px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.roadmap-grid article {
  min-height: 300px;
  padding: 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.roadmap-grid span {
  display: block;
  margin-top: 0;
  color: #0879e8;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.roadmap-grid h3 {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.12;
}

.roadmap-grid p {
  max-width: 500px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.public-pricing {
  max-width: 1320px;
  margin: 0 auto 120px;
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(580px, 1.3fr);
  gap: 72px;
  padding: 70px;
  border-radius: 8px;
  background: #f3f6fa;
}

.public-pricing h2 {
  font-size: 52px;
}

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

.public-price-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(190px, 1fr);
  gap: 5px 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.public-price-list span,
.public-price-list small {
  color: var(--muted);
  font-size: 16px;
}

.public-price-list small {
  grid-column: 2;
}

.public-cta {
  padding: 126px 24px 136px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.public-cta .public-primary-button {
  margin-top: 34px;
}

.public-cta > .public-text-button {
  display: block;
  margin: 12px auto 0;
  color: var(--muted);
}

.public-footer {
  padding: 74px max(24px, calc((100% - 1320px) / 2)) 34px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.7fr 0.75fr 0.75fr 1.1fr;
  gap: 60px;
  min-height: 235px;
}

.footer-brand-block p {
  max-width: 330px;
  margin-top: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.footer-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.footer-column strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.footer-column a,
.footer-column button {
  padding: 0;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.footer-bottom {
  min-height: 66px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-bottom div {
  display: flex;
  gap: 18px;
}

.contacts-main {
  min-height: calc(100vh - 64px);
  background:
    radial-gradient(circle at 16% 4%, rgba(56, 189, 248, 0.12), transparent 34rem),
    radial-gradient(circle at 88% 28%, rgba(45, 212, 191, 0.12), transparent 30rem),
    #ffffff;
}

.contacts-hero,
.contacts-details {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.contacts-hero {
  padding: 112px 0 86px;
  border-bottom: 1px solid var(--line);
}

.contacts-hero h1 {
  max-width: 900px;
  margin: 14px 0 24px;
  font-size: 76px;
  line-height: 0.98;
  letter-spacing: 0;
}

.contacts-hero > p:last-child {
  max-width: 680px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.5;
}

.contacts-details {
  padding: 0 0 110px;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.8fr);
  gap: 48px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.contact-row > span {
  color: var(--muted);
  font-size: 15px;
}

.contact-row a,
.contact-row strong {
  color: var(--text);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.contact-row a:hover {
  color: #087cf0;
}

.contact-legal {
  padding-top: 78px;
}

.contact-legal h2 {
  margin: 12px 0 38px;
  font-size: 48px;
  letter-spacing: 0;
}

.contact-legal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.contact-legal-list > div {
  min-height: 132px;
  padding: 26px 30px 26px 0;
  border-bottom: 1px solid var(--line);
}

.contact-legal-list > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.contact-legal-list > div:nth-child(even) {
  padding-left: 30px;
}

.contact-legal-list dt {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.contact-legal-list dd {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.55;
}

.legal-main {
  min-height: calc(100vh - 64px);
  background: #ffffff;
}

.legal-hero {
  padding: 92px max(24px, calc((100% - 1160px) / 2)) 64px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 14% 0%, rgba(56, 189, 248, 0.11), transparent 30rem),
    radial-gradient(circle at 92% 20%, rgba(45, 212, 191, 0.1), transparent 28rem),
    #fbfcfd;
}

.legal-back {
  display: inline-flex;
  margin-bottom: 38px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.legal-back:hover,
.legal-document a {
  color: #087cf0;
}

.legal-hero h1 {
  max-width: 920px;
  margin: 12px 0 18px;
  font-size: 62px;
  line-height: 1.02;
  letter-spacing: 0;
}

.legal-hero-subtitle {
  max-width: 760px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.legal-shell {
  width: min(1160px, calc(100% - 48px));
  display: grid;
  grid-template-columns: 250px minmax(0, 820px);
  gap: 80px;
  margin: 0 auto;
  padding: 68px 0 110px;
}

.legal-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.legal-toc strong {
  display: block;
  margin-bottom: 18px;
  font-size: 13px;
}

.legal-toc a {
  display: block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

.legal-toc a:hover {
  color: var(--text);
}

.legal-document {
  min-width: 0;
  color: #303746;
  font-size: 17px;
  line-height: 1.72;
}

.legal-document > p {
  margin: 0 0 19px;
}

.legal-document > p:first-child {
  color: var(--muted);
  font-size: 20px;
}

.legal-document h2 {
  scroll-margin-top: 94px;
  margin: 58px 0 22px;
  padding-top: 10px;
  color: var(--text);
  font-size: 31px;
  line-height: 1.2;
  letter-spacing: 0;
}

.legal-document h2:first-of-type {
  margin-top: 42px;
}

.legal-document strong {
  color: var(--text);
}

.legal-related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 70px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.legal-related a {
  min-height: 78px;
  display: flex;
  align-items: center;
  padding: 18px 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.auth-screen {
  background: rgba(244, 247, 250, 0.82) !important;
}

.auth-panel {
  position: relative;
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(17, 24, 39, 0.05);
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .public-header {
    grid-template-columns: 1fr auto;
  }

  .public-nav {
    display: none;
  }

  .product-band,
  .product-band-validation,
  .public-pricing {
    grid-template-columns: 1fr;
  }

  .product-band {
    gap: 50px;
  }

  .product-band-validation .validation-visual {
    order: 2;
  }

  .footer-main {
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 30px;
  }
}

@media (max-width: 820px) {
  .legal-hero h1 {
    font-size: 46px;
  }

  .legal-shell {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .legal-toc {
    position: static;
    max-height: none;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
  }

  .contacts-hero h1 {
    font-size: 54px;
  }

  .contact-legal-list {
    grid-template-columns: 1fr;
  }

  .contact-legal-list > div:nth-child(odd) {
    border-right: 0;
  }

  .contact-legal-list > div:nth-child(even) {
    padding-left: 0;
  }

  .public-hero h1 {
    font-size: 54px;
  }

  .public-hero-lead {
    font-size: 17px;
  }

  .public-intro h2,
  .audience-head h2,
  .infrastructure-stage h2,
  .roadmap-head h2,
  .public-cta h2 {
    font-size: 38px;
  }

  .cycle-rail,
  .infrastructure-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cycle-step:nth-child(2),
  .infrastructure-flow > div:nth-child(2) {
    border-right: 0;
  }

  .cycle-step:nth-child(-n + 2),
  .infrastructure-flow > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .infrastructure-flow > div:nth-child(-n + 2) {
    border-bottom-color: rgba(255, 255, 255, 0.18);
  }

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

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

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

@media (max-width: 620px) {
  .legal-hero {
    padding: 58px 16px 46px;
  }

  .legal-hero h1 {
    font-size: 39px;
  }

  .legal-hero-subtitle {
    font-size: 17px;
  }

  .legal-shell {
    width: calc(100% - 32px);
    padding: 46px 0 76px;
  }

  .legal-document {
    font-size: 16px;
  }

  .legal-document h2 {
    font-size: 27px;
  }

  .legal-related {
    grid-template-columns: 1fr;
  }

  .contacts-hero,
  .contacts-details {
    width: min(100% - 32px, 1320px);
  }

  .contacts-hero {
    padding: 72px 0 56px;
  }

  .contacts-hero h1 {
    font-size: 43px;
  }

  .contacts-hero > p:last-child {
    font-size: 18px;
  }

  .contact-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 26px 0;
  }

  .contact-row a,
  .contact-row strong {
    font-size: 21px;
  }

  .contact-legal {
    padding-top: 56px;
  }

  .contact-legal h2 {
    font-size: 36px;
  }

  .public-header {
    height: 58px;
    padding: 0 16px;
  }

  .public-actions .public-text-button {
    display: none;
  }

  .public-primary-button {
    padding: 0 13px;
    font-size: 13px;
  }

  .public-hero {
    height: calc(100svh - 76px);
    min-height: 560px;
  }

  .public-hero-media {
    object-position: 55% bottom;
  }

  .public-hero-copy {
    padding-top: 42px;
  }

  .public-hero h1 {
    font-size: 42px;
  }

  .public-hero-lead {
    margin-top: 15px;
    font-size: 15px;
  }

  .public-hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: min(320px, 100%);
    margin: 20px auto 0;
  }

  .public-hero-foot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-hero-foot span {
    min-height: 34px;
    font-size: 10px;
  }

  .public-hero-foot span:nth-child(3) {
    border-right: 0;
  }

  .public-hero-foot span:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }

  .public-intro {
    padding: 82px 20px 54px;
  }

  .public-intro h2,
  .audience-head h2,
  .infrastructure-stage h2,
  .roadmap-head h2,
  .public-cta h2 {
    font-size: 32px;
  }

  .cycle-rail,
  .infrastructure-flow {
    grid-template-columns: 1fr;
  }

  .cycle-step,
  .infrastructure-flow > div {
    min-height: 180px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cycle-step:last-child,
  .infrastructure-flow > div:last-child {
    border-bottom: 0;
  }

  .cycle-step h3 {
    margin-top: 36px;
  }

  .product-band {
    width: calc(100% - 24px);
    min-height: 0;
    padding: 42px 20px;
    gap: 36px;
  }

  .product-band-copy h2,
  .public-pricing h2 {
    font-size: 32px;
  }

  .surface-fields {
    grid-template-columns: 1fr;
  }

  .surface-fields span {
    min-height: 52px;
  }

  .validation-columns span {
    min-height: 90px;
    padding: 10px;
    font-size: 12px;
  }

  .infrastructure-stage {
    padding: 82px 20px;
  }

  .infrastructure-flow > div {
    border-bottom-color: rgba(255, 255, 255, 0.18);
  }

  .audience-section {
    padding: 82px 12px;
  }

  .audience-grid article {
    min-height: 400px;
    padding: 28px 22px;
  }

  .audience-grid h3 {
    margin-top: 40px;
    font-size: 25px;
  }

  .roadmap-section {
    padding: 82px 16px;
  }

  .roadmap-head > p:last-child {
    font-size: 17px;
  }

  .roadmap-grid {
    margin-top: 44px;
  }

  .roadmap-grid article {
    min-height: 260px;
    padding: 26px 22px;
  }

  .roadmap-grid span {
    margin-top: 34px;
  }

  .roadmap-grid h3 {
    font-size: 25px;
  }

  .public-pricing {
    margin-bottom: 80px;
    padding: 42px 22px;
    gap: 38px;
  }

  .public-price-list > div {
    grid-template-columns: 1fr;
  }

  .public-price-list small {
    grid-column: auto;
  }

  .public-cta {
    padding: 86px 18px 94px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 38px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}
