:root {
  --black: #020407;
  --black-soft: #060a10;
  --panel: #09111c;
  --panel-soft: #07101a;
  --white: #f7f9fb;
  --silver: #a7b2bf;
  --muted: #718093;
  --line: rgba(117, 157, 195, .18);
  --line-bright: rgba(15, 185, 255, .46);
  --cyan: #05bdf7;
  --cyan-soft: #7ddcff;
  --green: #50d99a;
  --danger: #ff7784;
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --ease: cubic-bezier(.2, .75, .25, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--black);
  color-scheme: dark;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  background: var(--black);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

body.sidebar-active {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 11px 16px;
  color: #001019;
  background: var(--cyan);
  transform: translateY(-150%);
}

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

/* Public welcome */
.public-view {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 48%, rgba(0, 120, 218, .16), transparent 31rem),
    radial-gradient(circle at 76% 42%, rgba(0, 79, 151, .09), transparent 40rem),
    linear-gradient(126deg, #010307 0%, #030813 50%, #010307 100%);
}

.public-view::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: .3;
  background-image:
    linear-gradient(110deg, transparent 0 48%, rgba(255, 255, 255, .018) 50%, transparent 52%),
    linear-gradient(18deg, transparent 0 49%, rgba(0, 167, 255, .02) 50%, transparent 51%);
  background-size: 13px 13px, 19px 19px;
}

.public-view::after {
  position: absolute;
  z-index: -1;
  right: -8%;
  bottom: -9%;
  left: -8%;
  height: 30%;
  content: "";
  pointer-events: none;
  opacity: .6;
  background: repeating-radial-gradient(
    ellipse at 50% 120%,
    transparent 0 22px,
    rgba(0, 161, 255, .24) 23px 24px,
    transparent 25px 41px
  );
  mask-image: linear-gradient(to bottom, transparent, #000 36%);
}

.welcome {
  width: min(100% - clamp(40px, 8vw, 150px), 1460px);
  min-height: 0;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(480px, 1.1fr);
  align-items: center;
  gap: clamp(48px, 8vw, 130px);
  padding: clamp(48px, 7vh, 90px) 0 30px;
}

.welcome-mark {
  position: relative;
  width: min(100%, 590px);
  justify-self: end;
  aspect-ratio: 1;
}

.welcome-mark::before {
  position: absolute;
  inset: 2.5%;
  content: "";
  border: 1px solid rgba(0, 174, 255, .5);
  border-radius: 50%;
  box-shadow:
    0 0 18px rgba(0, 174, 255, .16),
    inset 0 0 40px rgba(0, 103, 192, .08);
}

.welcome-mark img {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: contain;
}

.welcome-copy {
  min-width: 0;
  padding-bottom: 3%;
}

.welcome-kicker,
.section-index,
.modal-index,
.app-header p,
.app-nav,
.app-profile small,
.tariff-code {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.welcome-kicker {
  margin: 0 0 22px;
  color: var(--cyan);
}

.welcome-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(66px, 7.3vw, 124px);
  line-height: .91;
  letter-spacing: -.065em;
}

.welcome-line {
  position: relative;
  width: 100%;
  height: 1px;
  margin: clamp(26px, 4vh, 42px) 0 26px;
  background: linear-gradient(90deg, var(--cyan), rgba(5, 189, 247, .25) 68%, transparent);
}

.welcome-line::after {
  position: absolute;
  top: 50%;
  left: 58%;
  width: 34px;
  height: 9px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(ellipse, #fff 0 5%, var(--cyan) 22%, transparent 72%);
  transform: translate(-50%, -50%);
}

.welcome-lead {
  max-width: 800px;
  margin: 0;
  color: #e3e8ed;
  font-size: clamp(25px, 2.55vw, 43px);
  font-weight: 400;
  line-height: 1.27;
  letter-spacing: -.035em;
}

.primary-action {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 21px;
  border: 1px solid rgba(5, 189, 247, .72);
  border-radius: 4px;
  color: #eefbff;
  background: rgba(5, 189, 247, .09);
  box-shadow: inset 0 0 0 1px rgba(5, 189, 247, .04);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}

.primary-action i {
  color: var(--cyan);
  font-size: 19px;
  font-style: normal;
  line-height: 1;
}

.primary-action:disabled {
  opacity: .5;
  cursor: wait;
}

.welcome-action {
  min-width: min(100%, 300px);
  margin-top: clamp(28px, 5vh, 48px);
}

.welcome-footer {
  position: relative;
  z-index: 2;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(24px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  color: #526174;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.welcome-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.welcome-footer button {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  cursor: pointer;
  text-transform: inherit;
}

/* Cabinet */
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -.08em;
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.brand-caption {
  color: #647386;
  font-size: 8px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.app-view {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  background: #03070d;
}

.app-sidebar {
  position: sticky;
  z-index: 110;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0 22px max(24px, env(safe-area-inset-bottom));
  border-right: 1px solid var(--line);
  background: #07101a;
}

.app-brand {
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.app-nav {
  display: grid;
  align-content: start;
  gap: 4px;
  padding-top: 26px;
  overflow-y: auto;
}

.app-nav button {
  position: relative;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #7c8999;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.app-nav button span {
  color: #455365;
  font-size: 8px;
}

.app-nav button.active {
  color: var(--white);
  border-color: rgba(5, 189, 247, .26);
  background: rgba(5, 189, 247, .07);
}

.app-nav button.active::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: -23px;
  width: 2px;
  content: "";
  background: var(--cyan);
}

.app-nav button.active span {
  color: var(--cyan);
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.sidebar-footer a,
.sidebar-footer button {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  border: 0;
  color: #718094;
  background: none;
  cursor: pointer;
  text-align: left;
}

.sidebar-footer span {
  color: var(--cyan);
}

.app-sidebar-backdrop {
  display: none;
}

.app-main {
  min-width: 0;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 clamp(22px, 3.5vw, 52px);
  border-bottom: 1px solid var(--line);
  background: #050b13;
}

.app-header > div:first-of-type p {
  margin: 0 0 4px;
  color: var(--cyan);
}

.app-header h1 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -.03em;
}

.app-profile {
  display: flex;
  align-items: center;
  gap: 11px;
}

.profile-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.app-profile > div {
  display: grid;
  gap: 3px;
}

.app-profile strong {
  max-width: 180px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-profile small {
  color: #68778a;
}

.app-profile button,
.app-menu {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
}

.app-menu {
  display: none;
  place-content: center;
  gap: 6px;
}

.app-menu span {
  width: 18px;
  height: 1px;
  display: block;
  background: currentColor;
}

.app-content {
  width: min(100%, 1580px);
  min-height: calc(100svh - 82px);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 58px);
  outline: none;
}

.app-loading {
  min-height: 44vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: #758397;
}

.app-loading i,
.login-wait i {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(5, 189, 247, .17);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin .85s linear infinite;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: end;
  gap: 36px;
  margin-bottom: 30px;
}

.section-index {
  margin: 0 0 11px;
  color: var(--cyan);
}

.app-hero h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 4.6vw, 61px);
  line-height: .98;
  letter-spacing: -.055em;
}

.app-hero > p {
  margin: 0;
  color: #8694a5;
  font-size: 14px;
  line-height: 1.65;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  background: var(--line);
}

.metric {
  min-height: 137px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 21px;
  background: var(--panel-soft);
}

.metric span {
  color: #68778a;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.metric strong {
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-size: clamp(26px, 2.5vw, 34px);
  letter-spacing: -.04em;
}

.metric small {
  color: #708094;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr);
  gap: 20px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.panel-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 21px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 14px;
}

.panel-head button,
.panel-head a,
.text-action {
  min-height: 40px;
  padding: 0;
  border: 0;
  color: var(--cyan);
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.panel-body {
  padding: 21px;
}

.key-list {
  display: grid;
  gap: 10px;
}

.key-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #050b12;
}

.key-status {
  width: 9px;
  height: 9px;
  border: 2px solid var(--green);
  border-radius: 50%;
}

.key-status.inactive {
  border-color: #657080;
}

.key-row h4 {
  margin: 0 0 5px;
  font-size: 13px;
}

.key-row p {
  margin: 0;
  overflow-wrap: anywhere;
  color: #748196;
  font-size: 11px;
}

.key-row button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
}

.quick-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.quick-list button,
.quick-list a {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 17px;
  border: 0;
  color: #a8b3be;
  background: #07101a;
  cursor: pointer;
  text-align: left;
}

.quick-list span {
  color: var(--cyan);
}

.empty-state {
  min-height: 200px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  color: #758397;
  text-align: center;
}

.empty-state i {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--cyan);
  font-style: normal;
}

.empty-state p {
  max-width: 430px;
  margin: 0;
  line-height: 1.6;
}

.empty-state button {
  margin-top: 4px;
}

.tariff-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 16px;
}

.tariff-card {
  min-width: 0;
  min-height: 405px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
}

.tariff-card.featured {
  border-color: rgba(5, 189, 247, .48);
  background: linear-gradient(180deg, rgba(5, 189, 247, .055), transparent 45%), var(--panel-soft);
}

.tariff-code {
  color: #5f6e81;
}

.tariff-period {
  margin: 24px 0 10px;
  font-size: 21px;
  letter-spacing: -.03em;
}

.tariff-description {
  min-height: 42px;
  margin: 0;
  color: #7d8999;
  font-size: 12px;
  line-height: 1.55;
}

.tariff-price {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 24px 0 20px;
}

.tariff-price strong {
  font-family: var(--display);
  font-size: 39px;
  letter-spacing: -.055em;
}

.tariff-price span {
  color: #6d7b8d;
  font-size: 11px;
}

.tariff-features {
  display: grid;
  gap: 10px;
  margin: 0 0 23px;
  padding: 0;
  color: #8996a6;
  font-size: 11px;
  line-height: 1.4;
  list-style: none;
}

.tariff-features li::before {
  margin-right: 9px;
  color: var(--cyan);
  content: "·";
}

.tariff-card .primary-action {
  width: 100%;
  margin-top: auto;
}

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

.panel-muted-copy,
.modal-copy,
.modal-meta,
.modal-note,
.instruction-lead {
  color: #7f8d9f;
  line-height: 1.65;
}

.panel-muted-copy {
  margin: 0;
}

.spaced-metrics {
  margin-top: 22px;
}

.instruction-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 20px;
}

.instruction-nav {
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.instruction-nav button {
  width: 100%;
  min-height: 47px;
  padding: 0 13px;
  border: 1px solid transparent;
  color: #8390a1;
  background: none;
  cursor: pointer;
  text-align: left;
}

.instruction-nav button.active {
  color: white;
  border-color: var(--line-bright);
  background: rgba(5, 189, 247, .055);
}

.instruction-content {
  min-width: 0;
  min-height: 430px;
  padding: 29px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.instruction-content h3 {
  margin: 0 0 20px;
  font-size: 25px;
}

.instruction-content pre,
.document-text {
  margin: 0;
  overflow-wrap: anywhere;
  color: #a9b4c0;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.download-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line-bright);
  color: var(--cyan-soft);
  font-size: 11px;
}

.support-cta {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 0 17px;
  border: 1px solid var(--line-bright);
  color: var(--cyan-soft);
  background: rgba(5, 189, 247, .045);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.support-cta span {
  color: var(--cyan);
}

.referral-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 34px;
  padding: 31px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.referral-card h3 {
  margin: 0 0 11px;
  font-size: 26px;
}

.referral-card p {
  max-width: 590px;
  margin: 0;
  color: #8794a5;
  line-height: 1.65;
}

.referral-link,
.copy-row {
  min-width: 0;
  display: flex;
  gap: 8px;
  margin-top: 21px;
}

.referral-link input,
.copy-row input {
  min-width: 0;
  flex: 1;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  color: #b5c0ca;
  background: #03070d;
}

.referral-link button,
.copy-row button {
  width: 46px;
  flex: 0 0 46px;
  border: 1px solid var(--line-bright);
  color: var(--cyan);
  background: transparent;
  cursor: pointer;
}

.referral-orb {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--cyan);
  font-family: var(--display);
  font-size: 28px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  color: #607084;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.data-table td {
  color: #a7b2bf;
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  padding: 6px 9px;
  border: 1px solid rgba(80, 217, 154, .22);
  color: var(--green);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-pill.pending {
  border-color: rgba(245, 200, 103, .3);
  color: #f5c867;
}

.status-pill.failed {
  border-color: rgba(255, 119, 132, .3);
  color: var(--danger);
}

.document-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.document-tabs button {
  min-height: 43px;
  padding: 0 14px;
  border: 1px solid var(--line);
  color: #8290a1;
  background: var(--panel-soft);
  cursor: pointer;
}

.document-tabs button.active {
  color: white;
  border-color: var(--line-bright);
}

.document-panel {
  min-width: 0;
  padding: 29px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

/* Dialogs */
.modal {
  width: min(calc(100% - 28px), 560px);
  max-height: min(790px, calc(100svh - 28px));
  overflow: auto;
  padding: 38px;
  border: 1px solid rgba(5, 189, 247, .4);
  border-radius: 8px;
  color: var(--white);
  background: #08121e;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .72);
}

.modal::backdrop {
  background: rgba(0, 3, 8, .84);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 44px;
  height: 44px;
  border: 0;
  color: #7b899a;
  background: transparent;
  cursor: pointer;
  font-size: 28px;
}

.modal-index {
  margin-bottom: 25px;
  color: var(--cyan);
}

.modal h2 {
  margin: 0 0 14px;
  padding-right: 28px;
  font-size: 30px;
  letter-spacing: -.04em;
}

.modal > p {
  margin: 0;
  color: #96a3b2;
  font-size: 14px;
  line-height: 1.65;
}

.telegram-glyph {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 21px;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
}

.telegram-glyph i {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 25px solid var(--cyan);
  transform: rotate(-29deg) translateX(2px);
}

.login-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 25px 0;
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

.login-steps li {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 9px;
}

.login-steps li + li {
  border-left: 1px solid var(--line);
}

.login-steps span {
  color: #4e5d70;
  font-size: 8px;
  letter-spacing: .15em;
}

.login-steps p {
  margin: 0;
  color: #68778a;
  font-size: 11px;
  line-height: 1.4;
}

.login-steps li.active span {
  color: var(--cyan);
}

.login-steps li.active p {
  color: white;
}

.modal-action {
  width: 100%;
}

.fallback-login {
  display: block;
  margin: 15px auto 0;
  color: var(--cyan-soft);
  font-size: 11px;
  text-align: center;
}

.login-wait {
  margin-top: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: #9ba8b7;
  font-size: 11px;
}

.login-wait i {
  width: 18px;
  height: 18px;
}

.modal > small,
.modal-note {
  display: block;
  margin-top: 18px;
  color: #637286;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.modal-alert {
  display: grid;
  gap: 5px;
  margin: 18px 0;
  padding: 13px 15px;
  border: 1px solid rgba(255, 119, 132, .38);
  border-radius: 3px;
  color: #e2aab1;
  background: rgba(255, 119, 132, .055);
  font-size: 11px;
  line-height: 1.5;
}

.modal-alert strong {
  color: #ffd1d6;
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.action-modal {
  width: min(calc(100% - 28px), 700px);
}

.modal-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 22px 0;
  background: var(--line);
}

.modal-summary div {
  min-height: 80px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 13px;
  background: #050b13;
}

.modal-summary span {
  color: #637286;
  font-size: 8px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.modal-summary strong {
  font-size: 13px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.modal-actions button,
.modal-actions a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  color: #d1d9e1;
  background: rgba(5, 189, 247, .045);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.modal-actions .danger {
  color: #ff9da7;
  border-color: rgba(255, 119, 132, .35);
}

.qr-box {
  width: min(100%, 220px);
  aspect-ratio: 1;
  margin: 22px auto;
  padding: 11px;
  background: white;
}

.qr-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.protocol-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.protocol-choice {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  border: 1px solid var(--line);
  color: #aeb9c4;
  background: #050c15;
  cursor: pointer;
  text-align: left;
}

.protocol-choice span {
  color: var(--cyan);
}

/* Owner administration */
#admin-nav-mount {
  display: contents;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-tabs {
  min-width: 0;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.admin-tabs button,
.admin-lock,
.secondary-action {
  min-height: 44px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid var(--line);
  color: #8492a3;
  background: #07101a;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.admin-tabs button.active,
.secondary-action.active {
  border-color: var(--line-bright);
  color: white;
  background: rgba(5, 189, 247, .08);
}

.admin-lock {
  margin-bottom: 10px;
  border-color: rgba(255, 119, 132, .25);
  color: #cf8992;
}

.admin-stage {
  min-width: 0;
}

.admin-overview-grid {
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
}

.admin-status-row {
  min-height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  color: #8795a6;
  font-size: 12px;
}

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

.admin-audit-list {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.admin-audit-list > div {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  background: #050b13;
}

.admin-audit-list p {
  min-width: 0;
  display: grid;
  gap: 5px;
  margin: 0;
}

.admin-audit-list strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-audit-list small {
  color: #68778a;
  font-size: 11px;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: 0 0 auto;
  border: 2px solid #5d6979;
  border-radius: 50%;
}

.status-dot.ok {
  border-color: var(--green);
  box-shadow: 0 0 12px rgba(80, 217, 154, .18);
}

.status-dot.bad {
  border-color: var(--danger);
}

.status-dot.wait {
  border-color: #f5c867;
}

.admin-section-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
}

.admin-section-head p {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.admin-section-head h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.035em;
}

.admin-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 15px;
}

.admin-search input,
.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-code-form input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: #d9e1e8;
  background: #03070d;
  font: inherit;
}

.admin-form textarea {
  min-height: 90px;
  resize: vertical;
}

.admin-search button,
.admin-form > button:not(.primary-action),
.secondary-action.full {
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid var(--line-bright);
  color: var(--cyan-soft);
  background: rgba(5, 189, 247, .055);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.secondary-action.full {
  width: 100%;
  margin-top: 16px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.admin-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, .65fr) minmax(0, 1.35fr);
  align-items: center;
  gap: 20px;
  padding: 17px 19px;
}

.admin-card-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.admin-card-title h4,
.admin-card-title p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-title h4 {
  margin: 0 0 5px;
  font-size: 13px;
}

.admin-card-title p {
  margin: 0;
  color: #68778a;
  font-size: 11px;
}

.admin-card-stats {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: clamp(15px, 3vw, 34px);
}

.admin-card-stats span {
  display: grid;
  gap: 5px;
  color: #617084;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-card-stats strong {
  color: #b5c0cb;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.admin-card-actions {
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--line);
}

.admin-card-actions button {
  min-width: 78px;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--line);
  color: #8d9aaa;
  background: #050b13;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.admin-card-actions button:first-child {
  border-left: 0;
}

.admin-card-actions .danger-text {
  color: #d9828d;
}

.admin-form,
.admin-code-form {
  display: grid;
  gap: 15px;
  margin-top: 22px;
}

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

.admin-form .span-2 {
  grid-column: 1 / -1;
}

.admin-form label,
.admin-code-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.admin-form label > span,
.admin-code-form label > span {
  color: #748397;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-form small {
  color: #69788b;
}

.admin-check {
  min-height: 46px;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center;
  gap: 11px !important;
}

.admin-check input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--cyan);
}

.admin-check span {
  color: #a4b0bc !important;
  font-size: 11px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.form-warning,
.danger-panel,
.security-note {
  padding: 14px 16px;
  border: 1px solid rgba(245, 200, 103, .22);
  color: #a99d80;
  background: rgba(245, 200, 103, .04);
  font-size: 11px;
  line-height: 1.55;
}

.danger-panel {
  border-color: rgba(255, 119, 132, .3);
  color: #d9a1a8;
  background: rgba(255, 119, 132, .045);
}

.danger-panel strong,
.danger-panel p {
  display: block;
  margin: 0;
}

.danger-panel p {
  margin-top: 7px;
  color: #99858c;
}

.danger-action {
  border-color: rgba(255, 119, 132, .45);
  color: #ffe4e7;
  background: rgba(255, 119, 132, .1);
}

.security-note {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 9px;
  border-color: var(--line);
  color: #8d9aaa;
  background: #050b13;
}

.security-note span {
  color: var(--cyan);
  font-size: 9px;
}

.security-note p {
  margin: 0;
}

.admin-code-form input {
  height: 62px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px;
  letter-spacing: .22em;
}

.admin-modal {
  width: min(calc(100% - 28px), 820px);
}

.admin-key-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.admin-key-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: #050b13;
}

.admin-key-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-key-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-key-head h4,
.admin-key-head strong {
  margin: 0;
  font-size: 12px;
}

.admin-key-head strong {
  color: #8f9cad;
  font-weight: 650;
}

.admin-key-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.admin-key-grid span {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #617084;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-key-grid strong {
  overflow: hidden;
  color: #b5c0cb;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.admin-key-card > button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-bright);
  color: var(--cyan-soft);
  background: rgba(5, 189, 247, .055);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.admin-key-card > button:disabled {
  color: #596574;
  cursor: not-allowed;
  opacity: .65;
}

.admin-locked {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 32px;
}

.admin-locked h3 {
  margin: 20px 0 8px;
  font-size: 23px;
}

.admin-locked p {
  max-width: 590px;
  margin: 0;
  color: #7c8a9c;
  line-height: 1.6;
}

.admin-shield {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
  color: var(--cyan);
  font-family: var(--display);
  font-size: 11px;
}

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

.admin-kv {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.admin-kv > div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  background: #050b13;
  color: #8290a1;
  font-size: 11px;
}

.admin-kv strong {
  color: #b9c4ce;
  text-align: right;
}

.compact-empty {
  min-height: 110px;
}

.toast-region {
  position: fixed;
  z-index: 1000;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  gap: 9px;
}

.toast {
  max-width: 380px;
  padding: 14px 17px;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  color: #cbd5df;
  background: #081522;
  box-shadow: 0 14px 45px rgba(0, 0, 0, .42);
  font-size: 12px;
  animation: toast-in .2s ease-out both;
}

.toast.error {
  border-color: rgba(255, 119, 132, .5);
}

.dialog-toast {
  position: fixed;
  z-index: 2;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
}

@media (hover: hover) and (pointer: fine) {
  .primary-action:hover,
  .modal-actions button:hover,
  .modal-actions a:hover,
  .protocol-choice:hover {
    border-color: var(--cyan);
    color: white;
    background-color: rgba(5, 189, 247, .11);
  }

  .welcome-footer a:hover,
  .welcome-footer button:hover,
  .sidebar-footer a:hover,
  .sidebar-footer button:hover,
  .app-nav button:hover {
    color: white;
  }
}

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

@keyframes toast-in {
  from { opacity: 0; }
}

@media (max-width: 1180px) {
  .welcome {
    width: min(100% - 64px, 1080px);
    grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.2fr);
    gap: 55px;
  }

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

  .tariff-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }

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

  .admin-card-actions {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .admin-card-actions button {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .welcome {
    width: min(100% - 40px, 720px);
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
    padding: 35px 0 24px;
    text-align: center;
  }

  .welcome-mark {
    width: min(53vw, 390px);
    justify-self: center;
  }

  .welcome-copy {
    width: min(100%, 650px);
    padding: 0;
  }

  .welcome-copy h1 {
    font-size: clamp(54px, 12vw, 89px);
  }

  .welcome-kicker {
    margin-bottom: 15px;
  }

  .welcome-line {
    margin: 20px 0;
  }

  .welcome-lead {
    margin: auto;
    font-size: clamp(21px, 4.7vw, 32px);
  }

  .welcome-action {
    margin-top: 25px;
  }

  .app-view {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(84vw, 300px);
    transform: translateX(-105%);
    transition: transform .22s var(--ease);
    box-shadow: 22px 0 70px rgba(0, 0, 0, .55);
  }

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

  .app-sidebar-backdrop {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: block;
    padding: 0;
    border: 0;
    opacity: 0;
    background: rgba(0, 3, 8, .7);
    pointer-events: none;
    transition: opacity .18s ease;
  }

  .app-view.sidebar-open .app-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .app-header {
    height: 72px;
    padding: 0 16px;
  }

  .app-menu {
    display: grid;
  }

  .app-content {
    min-height: calc(100svh - 72px);
    padding: 26px 18px 48px;
  }

  .app-hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 15px;
  }

  .app-hero > p {
    max-width: 610px;
  }

  .dashboard-grid,
  .instruction-layout {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .admin-lock {
    align-self: flex-start;
  }

  .admin-card-main {
    grid-template-columns: 1fr;
  }

  .admin-card-stats {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .instruction-nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .instruction-nav button {
    width: auto;
    min-width: 132px;
    flex: 0 0 auto;
  }

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

  .referral-orb {
    display: none;
  }
}

@media (max-width: 640px) {
  .public-view::after {
    height: 22%;
    opacity: .42;
  }

  .welcome {
    width: min(100% - 28px, 520px);
    align-content: center;
    gap: 12px;
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .welcome-mark {
    width: min(64vw, 310px);
  }

  .welcome-copy h1 {
    font-size: clamp(47px, 15vw, 72px);
  }

  .welcome-kicker {
    font-size: 8px;
  }

  .welcome-line {
    margin: 16px 0;
  }

  .welcome-lead {
    font-size: clamp(19px, 5.7vw, 27px);
    line-height: 1.3;
  }

  .welcome-action {
    width: 100%;
    margin-top: 21px;
  }

  .welcome-footer {
    min-height: 66px;
    display: grid;
    justify-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px max(10px, env(safe-area-inset-bottom));
    text-align: center;
  }

  .welcome-footer nav {
    justify-content: center;
    gap: 12px;
  }

  .brand-caption,
  .brand-divider,
  .app-profile > div,
  .app-profile button {
    display: none;
  }

  .app-header h1 {
    font-size: 18px;
  }

  .app-header > div:first-of-type p {
    font-size: 8px;
  }

  .app-content {
    padding-inline: 14px;
  }

  .app-hero h2 {
    font-size: clamp(34px, 11vw, 49px);
  }

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

  .metric {
    min-height: 121px;
    padding: 16px;
  }

  .metric strong {
    font-size: 25px;
  }

  .panel-head,
  .panel-body {
    padding-inline: 16px;
  }

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

  .key-row {
    padding: 14px;
  }

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

  .tariff-card {
    min-height: 380px;
    padding: 22px;
  }

  .referral-card,
  .instruction-content,
  .document-panel {
    padding: 21px;
  }

  .referral-link input {
    font-size: 11px;
  }

  .document-tabs {
    display: grid;
  }

  .modal {
    padding: 32px 20px 24px;
  }

  .modal h2 {
    font-size: 27px;
  }

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

  .login-steps li {
    min-height: 49px;
    grid-template-columns: 35px 1fr;
    align-items: center;
  }

  .login-steps li + li {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

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

  .modal-actions {
    display: grid;
  }

  .modal-actions button,
  .modal-actions a {
    width: 100%;
  }

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

  .admin-section-head .primary-action,
  .admin-section-head .secondary-action {
    width: 100%;
  }

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

  .admin-search button {
    min-height: 48px;
  }

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

  .admin-form .span-2 {
    grid-column: auto;
  }

  .admin-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-card-actions button {
    min-width: 0;
    min-height: 48px;
    border-top: 1px solid var(--line);
  }

  .admin-card-actions button:nth-child(odd) {
    border-left: 0;
  }

  .admin-locked {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }

  .admin-locked .primary-action {
    width: 100%;
  }

  .admin-modal {
    width: calc(100% - 16px);
    max-height: calc(100svh - 16px);
  }

  .admin-key-card {
    grid-template-columns: 1fr;
  }

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

  .admin-key-card > button {
    width: 100%;
  }

  .toast-region {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
  }

  .dialog-toast {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 410px) {
  .welcome-break {
    display: none;
  }

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

  .metric {
    min-height: 108px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding-block: 12px;
  }
}

@media (max-height: 670px) and (min-width: 901px) {
  .welcome {
    padding-top: 26px;
    gap: 54px;
  }

  .welcome-mark {
    width: min(61vh, 470px);
  }

  .welcome-copy h1 {
    font-size: clamp(58px, 10vh, 88px);
  }

  .welcome-line {
    margin: 20px 0;
  }

  .welcome-lead {
    font-size: clamp(22px, 4vh, 31px);
  }

  .welcome-action {
    margin-top: 22px;
  }
}

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