:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #f4f6f8;
  color: #182230;
  --background: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #dde5ee;
  --border-strong: #c8d3df;
  --text: #182230;
  --muted: #5c6b7d;
  --accent: #1f6fb2;
  --accent-dark: #175488;
  --success: #1d8a5b;
  --warning: #b7791f;
  --shadow: 0 18px 48px rgb(24 34 48 / 8%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--background);
}

.app-shell {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 22px 22px;
}

.topbar {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: auto;
  min-width: 74px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 10px;
  font-size: 15px;
  letter-spacing: 0;
}

.topbar-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.topbar-nav:not(.is-authenticated) .nav-only {
  display: none;
}

.topbar-nav-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.topbar-nav-button:hover:not(:disabled),
.topbar-status:hover:not(:disabled),
.topbar-nav-button.is-active,
.topbar-status.is-active {
  border-color: var(--border-strong);
  color: var(--text);
}

.topbar-nav-button.is-active,
.topbar-status.is-active {
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgb(31 111 178 / 10%);
}

.topbar-nav-button:focus,
.topbar-status:focus {
  outline: 0;
}

.topbar-primary {
  border-color: rgb(31 111 178 / 35%);
  background: #edf4fb;
  color: var(--accent-dark);
}

.topbar-nav-button:focus-visible,
.topbar-status:focus-visible {
  outline: 0;
  border-color: rgb(31 111 178 / 45%);
  box-shadow: 0 0 0 3px rgb(31 111 178 / 14%);
}

.topbar-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.topbar-status:disabled {
  cursor: default;
  opacity: 1;
}

.access-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.access-primary,
.access-secondary,
.admin-panel,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.access-primary {
  padding: 34px;
}

.access-secondary {
  padding: 22px;
  display: grid;
  grid-auto-rows: min-content;
  gap: 12px;
}

.access-heading {
  max-width: 560px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.access-heading p,
.section-heading p,
.workflow-step p,
.admin-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.access-heading p {
  margin-top: 12px;
  max-width: 520px;
}

.identity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.identity-row strong,
.identity-row span {
  display: block;
}

.identity-row strong {
  font-size: 15px;
}

.identity-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f0fa;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

.primary-action,
.ghost-action,
.danger-action {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.ghost-action {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
}

.danger-action {
  border: 1px solid #e2b8b8;
  background: #fff6f6;
  color: #8b2f2f;
  padding: 0 14px;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.admin-note {
  margin-top: 12px;
  text-align: center;
}

.status-box {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  border: 1px solid #cfe1d8;
  border-radius: 8px;
  padding: 11px 12px;
  color: #24543f;
  background: #f4fbf7;
  font-size: 14px;
  font-weight: 650;
}

.status-box.is-pending {
  border-color: #ead6ab;
  color: #76520f;
  background: #fff9eb;
}

.status-box.is-blocked {
  border-color: #f0c5c5;
  color: #8b2f2f;
  background: #fff6f6;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.workflow-step {
  min-height: 118px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-muted);
}

.workflow-step span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  background: #e9eef4;
  font-size: 13px;
  font-weight: 800;
}

.workflow-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.workflow-step.is-active span {
  color: #ffffff;
  background: var(--accent);
}

.admin-panel {
  margin-top: 18px;
  padding: 18px;
}

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

.admin-tabs {
  display: inline-flex;
  gap: 6px;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: var(--surface-muted);
}

.admin-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.admin-tab.is-active {
  color: var(--accent-dark);
  background: #ffffff;
  box-shadow: 0 1px 4px rgb(24 34 48 / 8%);
}

.admin-tab-badge {
  min-width: 18px;
  min-height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 5px;
  background: #d92d20;
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
}

.admin-role-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid #d5e6f6;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f3f8fd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.admin-role-note strong {
  flex: 0 0 auto;
  color: var(--accent-dark);
}

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

.admin-request-grid .section-heading-secondary {
  margin-top: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
  min-width: 0;
}

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

.account-page,
.history-page,
.instructions-page {
  margin-top: 18px;
}

.account-panel {
  max-width: 860px;
  margin: 0 auto;
}

.instructions-panel {
  max-width: 1120px;
  margin: 0 auto;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.balance-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-muted);
}

.balance-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.balance-card strong {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.balance-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.top-up-form {
  align-content: start;
}

.payment-confirm-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.payment-invoice {
  margin-top: 18px;
  border: 1px solid #b8c8d9;
  border-radius: 8px;
  padding: 16px;
  background: #f9fbfd;
}

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

.payment-invoice-head span,
.payment-field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-invoice-head strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.15;
}

.payment-invoice-head small {
  color: #7a4f08;
  font-size: 13px;
  font-weight: 750;
}

.payment-invoice-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.payment-qr-box {
  width: 220px;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.payment-qr-box img {
  width: 198px;
  height: 198px;
  display: block;
}

.payment-qr-placeholder {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.payment-details {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.payment-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.payment-field span,
.payment-field strong,
.payment-field code {
  grid-column: 1 / 2;
}

.payment-field strong {
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.payment-field code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  font-weight: 750;
}

.copy-action {
  grid-column: 2 / 3;
  grid-row: 1 / 4;
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--accent-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.copy-action-secondary {
  grid-column: auto;
  grid-row: auto;
  width: max-content;
}

.payment-note {
  border: 1px solid #ead6ab;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff9eb;
  color: #68480c;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.payment-status-cell {
  display: grid;
  gap: 6px;
  min-width: 138px;
}

.payment-status-cell strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
}

.payment-status-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.payment-status-cell .row-action {
  width: 100%;
  min-height: 34px;
}

.account-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

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

.instruction-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-muted);
}

.instruction-card span {
  display: inline-flex;
  min-width: 34px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #e7f0fa;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
}

.instruction-card h3,
.instruction-support h3 {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}

.instruction-card p,
.instruction-support p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.instruction-support {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid rgb(31 111 178 / 18%);
  border-radius: 8px;
  padding: 14px;
  background: #f3f8fd;
}

.payment-guide-section {
  margin-top: 14px;
  border: 1px solid rgb(31 111 178 / 18%);
  border-radius: 8px;
  padding: 14px;
  background: #f7fbff;
}

.payment-guide-heading {
  padding-top: 0;
  border-top: 0;
}

.payment-guide-heading h3 {
  margin: 0;
  font-size: 18px;
}

.payment-guide-heading p {
  max-width: 720px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.payment-guide-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
}

.payment-steps {
  display: grid;
  gap: 8px;
}

.payment-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.payment-step > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 850;
}

.payment-step h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.payment-step p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.payment-screens {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(190px, 0.75fr);
  gap: 10px;
  align-items: stretch;
}

.guide-screen {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.guide-screen figcaption {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.guide-browser-bar {
  height: 26px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d9e3ef;
  border-radius: 7px 7px 0 0;
  padding: 0 8px;
  background: #eef4fb;
}

.guide-browser-bar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a9b8c8;
}

.guide-browser-bar strong {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.guide-desktop-content {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(110px, 0.72fr);
  gap: 10px;
  min-height: 210px;
  border: 1px solid #d9e3ef;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  padding: 12px;
  background: #f9fbfd;
}

.guide-preview-sheet {
  display: grid;
  gap: 7px;
  align-content: start;
  border: 1px solid #dce5ef;
  border-radius: 6px;
  padding: 18px 14px;
  background:
    repeating-linear-gradient(
      -28deg,
      rgb(31 111 178 / 9%) 0 8px,
      transparent 8px 22px
    ),
    #ffffff;
}

.guide-preview-sheet div {
  height: 12px;
  border-radius: 3px;
  background: #9aa9ba;
}

.guide-preview-sheet div:nth-child(2) {
  width: 74%;
}

.guide-preview-sheet div:nth-child(3) {
  width: 86%;
}

.guide-side-panel {
  display: grid;
  gap: 7px;
  align-content: start;
}

.guide-side-panel strong,
.guide-phone-content strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.guide-side-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.guide-side-panel button,
.guide-phone-content button {
  min-height: 30px;
  border: 1px solid #bdd2e7;
  border-radius: 6px;
  background: #ffffff;
  color: var(--accent-dark);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.guide-side-panel button:first-of-type,
.guide-phone-content button:first-of-type,
.guide-phone-modal button:first-of-type {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.guide-phone-shell {
  width: min(100%, 210px);
  margin: 0 auto;
  border: 2px solid #2e3a49;
  border-radius: 22px;
  padding: 8px;
  background: #182230;
}

.guide-phone-top {
  width: 58px;
  height: 5px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: #687789;
}

.guide-phone-content {
  display: grid;
  gap: 8px;
  min-height: 260px;
  border-radius: 14px;
  padding: 12px;
  background: #f7fafc;
}

.guide-phone-preview {
  height: 82px;
  border: 1px solid #dbe5ef;
  border-radius: 6px;
  background:
    repeating-linear-gradient(
      -28deg,
      rgb(31 111 178 / 10%) 0 7px,
      transparent 7px 19px
    ),
    #ffffff;
}

.guide-phone-modal {
  display: grid;
  gap: 6px;
  border: 1px solid #cdddeb;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgb(24 34 48 / 12%);
}

.guide-phone-modal span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.guide-hotspots {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.guide-hotspots li + li {
  margin-top: 3px;
}

.payment-recovery-note {
  margin-top: 12px;
  border: 1px solid #c8dced;
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
}

.payment-recovery-note strong {
  color: var(--text);
  font-size: 15px;
}

.payment-recovery-note p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.release-notes-section {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-muted);
}

.release-notes-heading {
  padding-top: 0;
  border-top: 0;
}

.release-notes-heading h3 {
  margin: 0;
  font-size: 18px;
}

.release-notes-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.release-notes-wrap {
  margin-top: 10px;
}

.release-notes-wrap td {
  vertical-align: top;
  white-space: normal;
}

.release-notes-wrap td:nth-child(1),
.release-notes-wrap td:nth-child(2) {
  width: 110px;
  white-space: nowrap;
  font-weight: 750;
}

.release-notes-wrap td:nth-child(3) {
  width: 210px;
  font-weight: 750;
}

.release-note-list {
  margin: 0;
  padding-left: 16px;
}

.release-note-list li + li {
  margin-top: 4px;
}

.support-primary {
  width: auto;
  min-width: 190px;
  min-height: 40px;
  padding: 0 18px;
  font-size: 13px;
  text-decoration: none;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.draft-header-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: max-content;
}

.draft-header-actions > span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.draft-header-actions .row-action {
  margin-right: 0;
  white-space: nowrap;
}

.compact-primary {
  width: auto;
  min-height: 36px;
  padding: 0 18px;
  white-space: nowrap;
}

form {
  display: grid;
  gap: 14px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 24px 0 16px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

.auth-tab.is-active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 4px rgb(24 34 48 / 8%);
}

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

.registration-entry {
  display: grid;
  gap: 16px;
}

.registration-entry-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-muted);
}

.registration-entry-heading strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
}

.registration-entry-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
}

.telegram-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #e7f0fa;
  color: var(--accent);
}

.telegram-mark svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.telegram-registration-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 18px;
  text-decoration: none;
}

.registration-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: registration-step;
}

.registration-steps li {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  counter-increment: registration-step;
}

.registration-steps li::before {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e7f0fa;
  color: var(--accent-dark);
  content: counter(registration-step);
  font-size: 11px;
  font-weight: 850;
}

.registration-fallback {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
  text-align: center;
}

.registration-fallback a {
  color: var(--accent-dark);
  font-weight: 750;
}

.registration-mini-app {
  display: grid;
  gap: 14px;
}

.registration-mini-app .identity-row {
  margin: 0;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.ocr-import-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgb(31 111 178 / 24%);
  border-radius: 6px;
  background: linear-gradient(180deg, rgb(31 111 178 / 7%), #ffffff);
}

.ocr-import-card strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.ocr-import-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
}

.file-action-group {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.file-action {
  min-width: 118px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 14px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.file-action:hover {
  border-color: var(--accent);
}

.file-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ocr-import-result {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.ocr-import-result.is-pending {
  color: var(--accent-strong);
}

.ocr-import-result.is-error {
  color: #b42318;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: #ffffff;
}

select {
  appearance: none;
  cursor: pointer;
  padding-right: 42px;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #49627d 50%),
    linear-gradient(135deg, #49627d 50%, transparent 50%),
    linear-gradient(to right, #e5ecf3, #e5ecf3);
  background-position:
    calc(100% - 20px) 50%,
    calc(100% - 14px) 50%,
    calc(100% - 38px) 50%;
  background-size:
    6px 6px,
    6px 6px,
    1px 24px;
  background-repeat: no-repeat;
}

select:hover {
  border-color: #9fb0c3;
}

select option {
  color: var(--text);
  background: #ffffff;
  font-size: 14px;
}

input[name="ipdsAmount"],
input[name="certificateDate"],
input[name="birthDate"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

input:focus,
select:focus {
  outline: 3px solid rgb(31 111 178 / 18%);
  border-color: var(--accent);
}

.field-with-help {
  position: relative;
}

.input-help-wrap {
  position: relative;
  display: block;
}

.input-help-wrap input {
  padding-right: 46px;
}

.field-info-button {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.field-info-button:focus {
  outline: 3px solid rgb(31 111 178 / 18%);
  border-color: var(--accent);
}

.field-hint {
  padding: 10px 12px;
  border: 1px solid rgb(31 111 178 / 24%);
  border-radius: 6px;
  background: rgb(31 111 178 / 8%);
  color: var(--text);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

output {
  display: block;
  min-height: 24px;
  margin-top: 16px;
  font-size: 14px;
  color: #314156;
}

output:empty {
  display: none;
}

.draft-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 540px);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.draft-agent-panel {
  display: contents;
  min-width: 0;
}

.draft-preview-layout {
  display: contents;
}

.draft-preview-card {
  width: 100%;
  max-width: 560px;
  justify-self: center;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.draft-preview-card img {
  width: 100%;
  max-height: calc(100vh - 250px);
  min-height: 480px;
  display: block;
  object-fit: contain;
  border: 1px solid #edf1f5;
  border-radius: 6px;
  background: #ffffff;
  cursor: zoom-in;
}

.draft-preview-card figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.draft-preview-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.draft-preview-actions .row-action {
  min-width: 132px;
  margin-right: 0;
}

.agent-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-muted);
}

.agent-card-section {
  min-width: 0;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.agent-card-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.agent-card span,
.income-code-list > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-card-main > strong,
.recipient-summary > strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.2;
}

.recipient-summary > strong {
  font-size: 21px;
}

.recipient-summary small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.agent-card dl,
.agent-requisites {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.agent-requisites div:nth-child(4),
.agent-requisite-wide {
  grid-column: 1 / -1;
}

.agent-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.agent-card dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.agent-edit-block {
  display: grid;
  gap: 12px;
}

.agent-edit-block label,
.income-code-picker {
  display: grid;
  gap: 7px;
}

.agent-edit-block select {
  min-width: 0;
  width: 100%;
  height: 46px;
  text-overflow: ellipsis;
}

.income-code-picker > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.income-code-choice {
  display: grid;
  grid-template-columns: 18px 52px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  min-height: 46px;
  padding: 8px 9px;
  background: #ffffff;
}

.income-code-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.income-code-choice:has(input:disabled:not(:checked)) {
  opacity: 0.55;
}

.income-code-choice span {
  color: var(--accent-dark);
  font-size: 14px;
  text-transform: none;
}

.income-code-choice small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.income-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.income-code-list > span,
.income-code-list > .muted-note {
  grid-column: 1 / -1;
}

.income-code-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.income-code-item strong {
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 5px 6px;
  background: #edf4fb;
  color: var(--accent-dark);
  font-size: 12px;
  text-align: center;
}

.income-code-item p,
.muted-note {
  margin: 0;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.vehicle-sales-editor,
#vehicle-sales-rows,
.form-vehicle-sales,
#form-vehicle-sales-rows {
  display: grid;
  gap: 10px;
}

.vehicle-sale-row {
  display: grid;
  grid-template-columns: 72px repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.section-heading-secondary {
  margin-top: 24px;
}

.account-security {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.account-security .section-heading {
  margin-bottom: 16px;
}

.password-change-form {
  margin: 0;
  padding: 0;
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #e6ebf0;
  padding: 11px 8px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.row-action {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  margin-right: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.row-action:disabled {
  cursor: default;
  opacity: 0.55;
}

.danger-row-action {
  border-color: #f2b8b5;
  color: #b42318;
  background: #fff5f5;
}

.admin-users-table td:first-child,
.admin-users-table th:first-child {
  width: 34px;
  text-align: center;
}

.admin-users-table .status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgb(24 34 48 / 5%);
}

.admin-users-table .status-dot.status-ok {
  background: var(--success);
}

.admin-users-table .status-dot.status-blocked {
  background: #d92d20;
}

.role-chip,
.admin-role-select {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.role-super_admin {
  border-color: rgb(31 111 178 / 35%);
  color: var(--accent-dark);
  background: #edf4fb;
}

.role-admin {
  border-color: #cfe1d8;
  color: #176348;
  background: #f4fbf7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status-ok {
  color: #176348;
  background: #e6f5ef;
}

.status-blocked {
  color: #9a3412;
  background: #fff0e8;
}

.admin-balance-control {
  display: grid;
  grid-template-columns: 96px auto;
  gap: 8px;
  align-items: center;
}

.admin-balance-control input {
  min-height: 32px;
  padding: 6px 8px;
}

.admin-action-result {
  display: block;
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.download-action {
  color: var(--accent-dark);
}

body.is-lightbox-open,
body.is-modal-open {
  overflow: hidden;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  background: rgb(15 23 42 / 82%);
}

.image-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.image-lightbox-bar strong {
  margin-right: auto;
  color: #ffffff;
  font-size: 14px;
}

.image-lightbox img {
  min-width: 0;
  max-width: min(100%, 980px);
  max-height: 100%;
  justify-self: center;
  align-self: start;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgb(0 0 0 / 35%);
  object-fit: contain;
}

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(15 23 42 / 52%);
}

.payment-modal-card {
  width: min(100%, 620px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgb(15 23 42 / 28%);
}

.payment-modal-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.payment-modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.payment-balance-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px;
  background: var(--surface-muted);
}

.payment-balance-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.payment-balance-strip strong {
  font-size: 22px;
  line-height: 1.1;
}

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

.payment-choice {
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 13px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.payment-choice:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgb(31 111 178 / 10%);
}

.payment-choice strong {
  color: var(--accent-dark);
  font-size: 16px;
  line-height: 1.2;
}

.payment-choice span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.is-hidden {
  display: none !important;
}

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

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    margin-bottom: 16px;
  }

  .topbar-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .topbar-status {
    justify-self: end;
    max-width: min(230px, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-nav-button,
  .topbar-status {
    flex: 0 0 auto;
  }

  .access-screen,
  .workspace,
  .account-grid,
  .draft-workspace,
  .draft-preview-layout,
  .admin-request-grid,
  .agent-card {
    grid-template-columns: 1fr;
  }

  .payment-invoice-body {
    grid-template-columns: 1fr;
  }

  .ocr-import-card {
    grid-template-columns: 1fr;
  }

  .file-action-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .file-action {
    min-width: 0;
    width: 100%;
  }

  .payment-qr-box {
    width: 100%;
  }

  .access-primary {
    padding: 24px;
  }

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

  .payment-guide-layout {
    grid-template-columns: 1fr;
  }

  .instruction-support {
    grid-template-columns: 1fr;
  }

  .support-primary {
    width: 100%;
  }

  .admin-users-wrap {
    overflow-x: visible;
  }

  .admin-users-table,
  .admin-users-table tbody,
  .admin-users-table tr,
  .admin-users-table td {
    display: block;
    width: 100%;
  }

  .admin-users-table thead {
    display: none;
  }

  .admin-users-table tr {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
  }

  .admin-users-table td {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border-bottom: 0;
    padding: 7px 0;
    white-space: normal;
  }

  .admin-users-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .admin-users-table td:first-child {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 6px;
  }

  .admin-users-table td:first-child::before {
    content: "";
  }

  .admin-balance-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-balance-control input,
  .admin-balance-control .row-action,
  .admin-users-table .row-action,
  .admin-role-select {
    width: 100%;
  }

  .admin-users-table .row-action {
    margin: 0 0 8px;
  }

  .admin-request-grid .table-wrap {
    overflow-x: visible;
  }

  .admin-request-grid table,
  .admin-request-grid tbody,
  .admin-request-grid tr,
  .admin-request-grid td {
    display: block;
    width: 100%;
  }

  .admin-request-grid thead {
    display: none;
  }

  .admin-request-grid tr {
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
  }

  .admin-request-grid td {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border-bottom: 0;
    padding: 7px 0;
    white-space: normal;
  }

  .admin-request-grid td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .admin-request-grid td:last-child .row-action {
    width: 100%;
    margin: 0;
  }

  h1 {
    font-size: 31px;
  }
}

@media (max-width: 1180px) {
  .draft-workspace {
    grid-template-columns: minmax(330px, 0.85fr) minmax(420px, 500px);
  }

  .agent-card {
    max-height: calc(100vh - 120px);
  }

  .agent-requisites div:nth-child(4) {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .section-heading {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .draft-header-actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    max-width: calc(100vw - 28px);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .draft-header-actions > span {
    display: none;
  }

  .draft-workspace {
    grid-template-columns: 1fr;
  }

  .draft-preview-card {
    order: 1;
    max-width: 520px;
  }

  .draft-preview-card img {
    min-height: auto;
    max-height: 72vh;
  }

  .agent-card {
    order: 2;
    position: static;
    max-height: none;
  }

  .income-code-picker > div,
  .income-code-list,
  .instruction-grid,
  .payment-screens,
  .payment-choice-grid {
    grid-template-columns: 1fr;
  }

  .guide-desktop-content {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .payment-modal-card {
    padding: 16px;
  }

  .payment-modal-head {
    grid-template-columns: 1fr;
  }

  .image-lightbox {
    padding: 12px;
  }

  .image-lightbox-bar {
    flex-wrap: wrap;
  }

  .image-lightbox-bar strong {
    flex-basis: 100%;
  }
}

@media (max-width: 460px) {
  .registration-steps {
    grid-template-columns: 1fr;
  }

  .registration-steps li {
    min-height: 44px;
  }

  .access-primary,
  .access-secondary,
  .panel,
  .admin-panel {
    padding: 16px;
  }

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

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

  .agent-card dl,
  .income-code-item {
    grid-template-columns: 1fr;
  }

  .payment-field {
    grid-template-columns: 1fr;
  }

  .copy-action {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }

  .section-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    width: 100%;
  }

  .admin-tab {
    flex: 1 1 0;
    justify-content: center;
  }

  .admin-role-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-users-table td {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .admin-request-grid td {
    grid-template-columns: 98px minmax(0, 1fr);
  }
}

/* Private deployment: registration is not offered. */

.ipds-native .topbar { padding-top: 12px; }

#registration-web-entry {display:none!important;} #registration-mini-app {display:block!important;}
.auth-tabs {display:flex;}

#registration-mini-app .identity-row {display:none;}

/* Prevent iOS focus zoom while keeping text legible in the native clients. */
.ipds-native input, .ipds-native select, .ipds-native textarea { font-size: 16px; }
.ipds-native button, .ipds-native a { touch-action: manipulation; }
