@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-background-app: #f5f7fb;
  --color-background-surface: #ffffff;
  --color-text-primary: #172033;
  --color-text-secondary: #566070;
  --color-text-inverse: #ffffff;
  --color-border-default: #e5e9f2;
  --color-accent-primary: #5b3fd1;
  --color-accent-primary-soft: #eeeafe;
  --color-status-info: #145c91;
  --color-status-info-soft: #eaf5fe;
  --color-status-success: #0b6b4d;
  --color-status-success-soft: #e9f8f1;
  --color-status-warning: #865000;
  --color-status-warning-soft: #fff4de;
  --color-status-danger: #a02f3f;
  --color-status-danger-soft: #fdecef;
  --color-disabled: #b9c1d4;
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --radius-control: 10px;
  --radius-card: 14px;
  --nexus-bg-app: var(--color-background-app);
  --nexus-bg-surface: var(--color-background-surface);
  --nexus-bg-sidebar: #172033;
  --nexus-text-primary: var(--color-text-primary);
  --nexus-text-secondary: var(--color-text-secondary);
  --nexus-text-inverse: var(--color-text-inverse);
  --nexus-border: var(--color-border-default);
  --nexus-brand: var(--color-accent-primary);
  --nexus-brand-soft: var(--color-accent-primary-soft);
  --nexus-info: var(--color-status-info);
  --nexus-info-soft: var(--color-status-info-soft);
  --nexus-success: var(--color-status-success);
  --nexus-success-soft: var(--color-status-success-soft);
  --nexus-warning: var(--color-status-warning);
  --nexus-warning-soft: var(--color-status-warning-soft);
  --nexus-danger: var(--color-status-danger);
  --nexus-danger-soft: var(--color-status-danger-soft);
  --nexus-disabled: var(--color-disabled);
  --nexus-shadow-card: 0 4px 16px rgba(23, 32, 51, .08);
  --nexus-radius-card: var(--radius-card);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--nexus-bg-app); color: var(--nexus-text-primary); }
body.nexus-site { min-width: 320px; margin: 0; background: var(--nexus-bg-app); color: var(--nexus-text-primary); }
body.nexus-nav-locked { overflow: hidden; }
body.nexus-modal-locked { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.nexus-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nexus-skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--nexus-brand);
  color: #fff;
  text-decoration: none;
  transform: translateY(-160%);
}
.nexus-skip-link:focus { transform: translateY(0); }

.nexus-brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
}
.nexus-brand__mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--nexus-brand);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.nexus-brand--inverse { color: var(--nexus-text-inverse); }

.nexus-public-header,
.nexus-public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px);
  background: var(--nexus-bg-surface);
  border-bottom: 1px solid var(--nexus-border);
}
.nexus-public-footer {
  border-top: 1px solid var(--nexus-border);
  border-bottom: 0;
  color: var(--nexus-text-secondary);
  font-size: 13px;
}
.nexus-public-nav,
.nexus-public-footer nav { display: flex; gap: 22px; }
.nexus-public-nav a,
.nexus-public-footer a { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }
.nexus-public-nav a:hover,
.nexus-public-nav a:focus-visible,
.nexus-public-footer a:hover,
.nexus-public-footer a:focus-visible { color: var(--nexus-brand); }

.nexus-native-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  width: min(1240px, calc(100% - 40px));
  min-height: 60vh;
  margin: 32px auto;
}
.nexus-native-main { min-width: 0; }
.nexus-native-speedbar { margin-bottom: 16px; color: var(--nexus-text-secondary); font-size: 13px; }
.nexus-native-content,
.nexus-native-widget {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-card);
  background: var(--nexus-bg-surface);
  box-shadow: var(--nexus-shadow-card);
}
.nexus-native-content { padding: clamp(20px, 4vw, 40px); }
.nexus-native-sidebar { display: grid; align-content: start; gap: 16px; }
.nexus-native-widget { padding: 18px; }

.nexus-route-document { min-height: 100vh; }
.nexus-app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--nexus-bg-app);
}
.nexus-sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  width: 232px;
  height: 100vh;
  flex-direction: column;
  gap: 30px;
  padding: 28px 24px;
  overflow-y: auto;
  background: var(--nexus-bg-sidebar);
  color: var(--nexus-text-inverse);
}
.nexus-sidebar__header { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 12px; }
.nexus-sidebar__brand {
  color: var(--nexus-text-inverse);
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
}
.nexus-sidebar__close {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
}
.nexus-sidebar__nav { display: grid; gap: 5px; }
.nexus-nav-item {
  display: flex;
  width: 184px;
  height: 38px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
}
.nexus-nav-item:hover,
.nexus-nav-item:focus-visible { background: rgba(255, 255, 255, .08); color: #fff; }
.nexus-nav-item.is-active { background: var(--nexus-brand); color: #fff; }
.nexus-nav-subitem {
  position: relative;
  display: none;
  width: 172px;
  height: 27px;
  align-items: center;
  margin-left: 12px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--nexus-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.nexus-nav-item[data-nexus-route="profile"].is-active + .nexus-nav-subitem { display: flex; }
.nexus-nav-subitem > span {
  position: absolute;
  left: 0;
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--nexus-brand);
}

.nexus-navigation-backdrop {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: none;
  border: 0;
  background: rgba(23, 32, 51, .44);
  cursor: pointer;
}
.nexus-workspace { min-width: 0; }
.nexus-topbar {
  position: relative;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 32px 12px 31px;
  box-shadow: inset 0 0 0 1px var(--nexus-border);
  background: var(--nexus-bg-surface);
}
.nexus-topbar__title { min-width: 0; }
.nexus-topbar__heading { width: 252px; margin: 0; font-size: 20px; font-weight: 600; line-height: 24px; }
.nexus-breadcrumbs { display: none; }
.nexus-topbar__actions { position: absolute; top: 17px; left: 639px; display: flex; align-items: center; gap: 14px; }
.nexus-topbar__wallet,
.nexus-topbar__notifications {
  display: flex;
  width: 170px;
  height: 36px;
  align-items: center;
  padding: 0 18px;
  border-radius: 10px;
  color: var(--nexus-text-primary);
  font-size: 13px;
  line-height: 18px;
  text-decoration: none;
}
.nexus-topbar__wallet { background: var(--nexus-border); font-weight: 600; }
.nexus-topbar__notifications { background: var(--nexus-bg-app); font-weight: 500; }
.nexus-topbar__identity { display: flex; width: 84px; align-items: center; gap: 8px; margin-left: 12px; font-size: 13px; font-weight: 500; line-height: 16px; white-space: nowrap; }
.nexus-topbar__identity b { font-weight: 500; }
.nexus-topbar__mobile-account { display: none; }
.nexus-bottom-nav { display: none; }
.nexus-page {
  min-height: calc(100vh - 72px);
  padding: 24px 40px 24px 32px;
  outline: none;
}
.nexus-page > :first-child { margin-top: 0; }
.nexus-page > :last-child { margin-bottom: 0; }
.nexus-card {
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-card);
  background: var(--nexus-bg-surface);
  box-shadow: var(--nexus-shadow-card);
}

.nexus-button,
.nexus-icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
  cursor: pointer;
}
.nexus-button { padding: 12px 16px; }
.nexus-icon-button { width: 44px; padding: 0; }
.nexus-button--primary { background: var(--nexus-brand); color: var(--nexus-text-inverse); }
.nexus-button--secondary { background: var(--nexus-brand-soft); color: var(--nexus-brand); }
.nexus-button--ghost { background: transparent; color: var(--nexus-text-primary); }
.nexus-button--danger { background: var(--nexus-danger); color: var(--nexus-text-inverse); }
.nexus-button:hover:not(:disabled),
.nexus-icon-button:hover:not(:disabled) { filter: brightness(.96); }
.nexus-button:disabled,
.nexus-button[aria-disabled="true"],
.nexus-icon-button:disabled,
.nexus-icon-button[aria-disabled="true"] {
  background: var(--nexus-disabled);
  color: var(--nexus-text-primary);
  cursor: not-allowed;
  filter: none;
}

.nexus-field { display: grid; gap: var(--spacing-xs); }
.nexus-field__label { font-size: 13px; font-weight: 600; line-height: 18px; }
.nexus-field__hint,
.nexus-field__error { margin: 0; font-size: 12px; line-height: 18px; }
.nexus-field__hint { color: var(--nexus-text-secondary); }
.nexus-field__error { color: var(--nexus-danger); }
.nexus-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--nexus-border);
  border-radius: var(--radius-control);
  background: var(--nexus-bg-surface);
  color: var(--nexus-text-primary);
  font-size: 13px;
  line-height: 20px;
}
.nexus-input::placeholder { color: var(--nexus-text-secondary); opacity: 1; }
.nexus-input[aria-invalid="true"] { border-color: var(--nexus-danger); }
.nexus-input:disabled { background: var(--nexus-bg-app); color: var(--nexus-text-secondary); cursor: not-allowed; }

.nexus-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--spacing-sm);
  align-items: start;
  padding: var(--spacing-md);
  border: 1px solid var(--nexus-info);
  border-radius: var(--radius-control);
  background: var(--nexus-info-soft);
}
.nexus-alert--success { border-color: var(--nexus-success); background: var(--nexus-success-soft); }
.nexus-alert--warning { border-color: var(--nexus-warning); background: var(--nexus-warning-soft); }
.nexus-alert--danger { border-color: var(--nexus-danger); background: var(--nexus-danger-soft); }
.nexus-alert__title { margin: 0; font-size: 13px; font-weight: 600; line-height: 18px; }
.nexus-alert__body { margin: 2px 0 0; color: var(--nexus-text-secondary); font-size: 13px; line-height: 20px; }

.nexus-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-card);
  background: var(--nexus-bg-surface);
  box-shadow: var(--nexus-shadow-card);
}
.nexus-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 20px; }
.nexus-table th,
.nexus-table td { min-width: 120px; height: 44px; padding: 10px 16px; border-bottom: 1px solid var(--nexus-border); text-align: left; vertical-align: middle; }
.nexus-table th { background: var(--nexus-bg-app); font-weight: 600; }
.nexus-table tr:last-child td { border-bottom: 0; }

.nexus-state-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacing-md);
}
.nexus-state {
  display: flex;
  width: 100%;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  padding: var(--spacing-xl);
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-card);
  background: var(--nexus-bg-surface);
  text-align: center;
}
.nexus-state__indicator { width: 16px; height: 16px; border-radius: 50%; background: var(--nexus-text-secondary); }
.nexus-state__title { margin: 0; font-size: 16px; font-weight: 600; line-height: 22px; }
.nexus-state__body { max-width: 340px; margin: 0; color: var(--nexus-text-secondary); font-size: 13px; line-height: 20px; }
.nexus-state[data-nexus-state="loading"] { border-color: var(--nexus-info); background: var(--nexus-info-soft); }
.nexus-state[data-nexus-state="loading"] .nexus-state__indicator { background: var(--nexus-info); }
.nexus-state[data-nexus-state="success"] { border-color: var(--nexus-success); background: var(--nexus-success-soft); }
.nexus-state[data-nexus-state="success"] .nexus-state__indicator { background: var(--nexus-success); }
.nexus-state[data-nexus-state="error"],
.nexus-state[data-nexus-state="permission-denied"] { border-color: var(--nexus-danger); background: var(--nexus-danger-soft); }
.nexus-state[data-nexus-state="error"] .nexus-state__indicator,
.nexus-state[data-nexus-state="permission-denied"] .nexus-state__indicator { background: var(--nexus-danger); }
.nexus-state[data-nexus-state="disabled"] { background: var(--nexus-bg-app); }
.nexus-state[data-nexus-state="disabled"] .nexus-state__indicator { background: var(--nexus-disabled); }
.nexus-state[data-nexus-state="expired"] { border-color: var(--nexus-warning); background: var(--nexus-warning-soft); }
.nexus-state[data-nexus-state="expired"] .nexus-state__indicator { background: var(--nexus-warning); }
.nexus-state[data-nexus-state="loading"] .nexus-state__indicator {
  border: 2px solid var(--nexus-brand-soft);
  border-top-color: var(--nexus-brand);
  background: transparent;
  animation: nexus-spin .8s linear infinite;
}

.nexus-dashboard {
  display: grid;
  width: min(100%, 1136px);
  margin: 0 auto;
  gap: 24px;
}
.nexus-dashboard__subscription {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
}
.nexus-dashboard__subscription-title,
.nexus-dashboard__subscription-detail,
.nexus-dashboard__section-title,
.nexus-dashboard__metric p,
.nexus-dashboard__metric strong,
.nexus-dashboard__service h3,
.nexus-dashboard__service p { margin: 0; }
.nexus-dashboard__subscription-title { font-size: 18px; line-height: 25px; }
.nexus-dashboard__subscription-title--success { color: var(--nexus-success); }
.nexus-dashboard__subscription-title--warning { color: var(--nexus-warning); }
.nexus-dashboard__subscription-title--danger { color: var(--nexus-danger); }
.nexus-dashboard__subscription-title--neutral { color: var(--nexus-text-primary); }
.nexus-dashboard__subscription-detail { margin-top: 6px; font-size: 14px; line-height: 20px; }
.nexus-dashboard__subscription-action { min-width: 170px; flex: 0 0 auto; }
.nexus-dashboard__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}
.nexus-dashboard__metric {
  display: grid;
  min-height: 120px;
  align-content: center;
  gap: 12px;
  padding: 18px 20px;
}
.nexus-dashboard__metric p { color: var(--nexus-text-secondary); font-size: 13px; line-height: 18px; }
.nexus-dashboard__metric strong { font-size: clamp(20px, 2vw, 25px); line-height: 35px; }
.nexus-dashboard__metric--warning strong { color: var(--nexus-warning); }
.nexus-dashboard__metric--info strong { color: var(--nexus-info); }
.nexus-dashboard__metric--success strong { color: var(--nexus-success); }
.nexus-dashboard__metric--danger strong { color: var(--nexus-danger); }
.nexus-dashboard__content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
}
.nexus-dashboard__chart,
.nexus-dashboard__activity { min-height: 300px; padding: 20px; }
.nexus-dashboard__section-title { font-size: 18px; line-height: 25px; }
.nexus-dashboard__bars {
  display: flex;
  height: 220px;
  align-items: end;
  justify-content: space-around;
  gap: 20px;
  margin: 16px 0 0;
  padding: 0 12px;
  list-style: none;
}
.nexus-dashboard__bar {
  --nexus-chart-value: 0%;
  display: flex;
  width: min(62px, 14%);
  height: 100%;
  align-items: end;
}
.nexus-dashboard__bar > span:first-child {
  display: block;
  width: 100%;
  height: var(--nexus-chart-value);
  min-height: 4px;
  border-radius: 10px 10px 4px 4px;
  background: var(--nexus-brand);
}
.nexus-dashboard__activity-list {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.nexus-dashboard__activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 48px;
  align-items: center;
  border-bottom: 1px solid var(--nexus-border);
  font-size: 13px;
  line-height: 18px;
}
.nexus-dashboard__activity-item:last-child { border-bottom: 0; }
.nexus-dashboard__activity-item strong { white-space: nowrap; }
.nexus-dashboard__activity-item span { color: var(--nexus-text-secondary); }
.nexus-dashboard__activity-item--success strong { color: var(--nexus-success); }
.nexus-dashboard__activity-item--warning strong { color: var(--nexus-warning); }
.nexus-dashboard__activity-item--danger strong { color: var(--nexus-danger); }
.nexus-dashboard__services { padding: 20px; }
.nexus-dashboard__service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 18px;
}
.nexus-dashboard__service {
  display: grid;
  min-height: 160px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-card);
  background: var(--nexus-bg-surface);
}
.nexus-dashboard__service h3 { font-size: 16px; line-height: 22px; }
.nexus-dashboard__service-status { margin-top: 10px !important; font-size: 13px; line-height: 18px; }
.nexus-dashboard__service-status--success { color: var(--nexus-success); }
.nexus-dashboard__service-status--warning { color: var(--nexus-warning); }
.nexus-dashboard__service-status--danger { color: var(--nexus-danger); }
.nexus-dashboard__service-status--neutral { color: var(--nexus-text-secondary); }
.nexus-dashboard__service a {
  display: inline-flex;
  min-height: 44px;
  align-items: end;
  margin-top: auto;
  color: var(--nexus-info);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.nexus-dashboard__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: var(--nexus-text-secondary);
  text-align: center;
}
.nexus-dashboard__topup-body { display: grid; gap: 24px; }
.nexus-dashboard__topup-body > p { margin: 0; }

.nexus-profile {
  width: min(100%, 1136px);
  margin: 0 auto;
}
.nexus-profile__form,
.nexus-profile__fieldset { display: grid; gap: 20px; }
.nexus-profile__fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.nexus-profile .nexus-card { box-shadow: none; }
.nexus-profile__header {
  display: flex;
  width: 100%;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 19px;
  overflow: hidden;
}
.nexus-profile__heading { display: grid; width: 720px; height: 50px; align-content: start; gap: 4px; }
.nexus-profile__heading h2,
.nexus-profile__heading p,
.nexus-profile h3,
.nexus-profile__visibility-label,
.nexus-profile__visibility-help,
.nexus-profile__protected p,
.nexus-profile__after-save p { margin: 0; }
.nexus-profile__heading h2 { font-size: 21px; font-weight: 600; line-height: 25px; }
.nexus-profile__heading p { color: var(--nexus-text-secondary); font-size: 13px; line-height: 16px; }
.nexus-profile__save { width: 170px; height: 44px; flex: 0 0 170px; padding: 12px; white-space: nowrap; }
.nexus-profile__status {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--nexus-info);
  border-radius: 10px;
  background: var(--nexus-info-soft);
  color: var(--nexus-text-secondary);
  font-size: 13px;
  line-height: 18px;
}
.nexus-profile__status strong { color: var(--nexus-text-primary); font-size: 12px; font-weight: 500; }
.nexus-profile__status--success { border-color: var(--nexus-success); background: var(--nexus-success-soft); }
.nexus-profile__status--warning { border-color: var(--nexus-warning); background: var(--nexus-warning-soft); }
.nexus-profile__status--danger { border-color: var(--nexus-danger); background: var(--nexus-danger-soft); }
.nexus-profile__columns {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 396px);
  gap: 20px;
  height: 500px;
}
.nexus-profile__main-card,
.nexus-profile__visibility-card { height: 500px; padding: 19px; overflow: hidden; }
.nexus-profile__main-card { display: flex; flex-direction: column; gap: 12px; }
.nexus-profile h3 { font-size: 18px; font-weight: 600; line-height: 22px; }
.nexus-profile__field { position: relative; display: grid; height: 76px; grid-template-rows: 15px 46px; align-content: start; gap: 6px; color: var(--nexus-text-secondary); font-size: 12px; font-weight: 500; line-height: 15px; }
.nexus-profile__field--bio { height: 144px; }
.nexus-profile__field--bio { grid-template-rows: 15px 114px; }
.nexus-profile__control {
  width: 100%;
  height: 46px;
  padding: 13px;
  border: 1px solid var(--nexus-border);
  border-radius: 10px;
  appearance: none;
  background: var(--nexus-bg-surface);
  color: var(--nexus-text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 16px;
}
textarea.nexus-profile__control { height: 114px; min-height: 114px; resize: none; }
.nexus-profile__control:focus { border-color: var(--nexus-brand); outline: 3px solid rgba(91, 63, 209, .18); outline-offset: 0; }
.nexus-profile__control[aria-invalid="true"] { border-color: var(--nexus-danger); }
.nexus-profile__field small,
.nexus-profile__visibility-card > small { position: absolute; z-index: 2; right: 10px; bottom: -2px; padding: 0 4px; background: #fff; color: var(--nexus-danger); font-size: 11px; font-weight: 400; }
.nexus-profile__visibility-card { position: relative; display: flex; flex-direction: column; gap: 12px; }
.nexus-profile__visibility-label { color: var(--nexus-text-secondary); font-size: 12px; font-weight: 500; line-height: 15px; }
.nexus-profile__choice {
  position: relative;
  display: flex;
  width: 100%;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--nexus-border);
  border-radius: 10px;
  color: var(--nexus-text-secondary);
  cursor: pointer;
  font-size: 13px;
  line-height: 16px;
}
.nexus-profile__choice:has(input:checked) { border-color: var(--nexus-brand); background: var(--nexus-brand-soft); }
.nexus-profile__choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.nexus-profile__choice span { display: inline-flex; align-items: center; }
.nexus-profile__choice span::before {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  margin-right: 9px;
  border: 1px solid var(--nexus-text-secondary);
  border-radius: 50%;
  content: "";
}
.nexus-profile__choice input:checked + span::before { background: var(--nexus-text-secondary); }
.nexus-profile__choice input:focus-visible + span { outline: 3px solid rgba(91, 63, 209, .32); outline-offset: 5px; }
.nexus-profile__visibility-help { color: var(--nexus-text-secondary); font-size: 13px; line-height: 16px; }
.nexus-profile__protected {
  display: flex;
  width: 100%;
  height: 142px;
  flex: 0 0 142px;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  overflow: hidden;
  border: 1px solid var(--nexus-info);
  border-radius: 10px;
  background: var(--nexus-info-soft);
  color: var(--nexus-text-secondary);
}
.nexus-profile__protected strong { font-size: 12px; font-weight: 500; line-height: 15px; }
.nexus-profile__protected p { font-size: 13px; line-height: 16px; }
.nexus-profile__after-save {
  display: flex;
  width: 100%;
  height: 240px;
  flex-direction: column;
  gap: 14px;
  padding: 17px;
  overflow: hidden;
}
.nexus-profile__after-save p { color: var(--nexus-text-secondary); font-size: 13px; line-height: 16px; }
.nexus-profile__revision-help {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--nexus-warning);
  border-radius: 10px;
  background: var(--nexus-warning-soft);
}

.nexus-notification-host {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 40px));
}
.nexus-notification {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--spacing-sm);
  align-items: start;
  padding: var(--spacing-md);
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-card);
  background: var(--nexus-bg-surface);
  box-shadow: var(--nexus-shadow-card);
}
.nexus-notification__title { margin: 0; font-size: 13px; font-weight: 600; line-height: 18px; }
.nexus-notification__body { margin: 4px 0 0; color: var(--nexus-text-secondary); font-size: 13px; line-height: 20px; }

.nexus-overlay-host {
  position: fixed;
  z-index: 70;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--spacing-xl);
  overflow-y: auto;
  background: rgba(23, 32, 51, .56);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, visibility .16s ease;
}
.nexus-overlay-host[aria-hidden="false"] { opacity: 1; visibility: visible; pointer-events: auto; }
.nexus-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--nexus-border);
  border-radius: var(--nexus-radius-card);
  background: var(--nexus-bg-surface);
  box-shadow: 0 20px 60px rgba(23, 32, 51, .2);
}
.nexus-modal__header,
.nexus-modal__body,
.nexus-modal__actions { padding: var(--spacing-xl); }
.nexus-modal__header { display: flex; align-items: start; justify-content: space-between; gap: var(--spacing-md); border-bottom: 1px solid var(--nexus-border); }
.nexus-modal__title { margin: 0; font-size: 16px; font-weight: 600; line-height: 22px; }
.nexus-modal__body { color: var(--nexus-text-secondary); font-size: 13px; line-height: 20px; }
.nexus-modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--spacing-sm); border-top: 1px solid var(--nexus-border); }
[hidden] { display: none !important; }

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

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(91, 63, 209, .32);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .nexus-public-nav { display: none; }
  .nexus-native-layout { grid-template-columns: 1fr; }
  .nexus-native-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nexus-app { display: block; min-height: 100vh; }
  .nexus-workspace { min-height: 100vh; padding-bottom: 70px; }
  .nexus-topbar { height: 64px; padding: 12px 16px; }
  .nexus-topbar__title { display: block; flex: 1; }
  .nexus-topbar__heading { width: 260px; overflow: hidden; font-size: 20px; line-height: 24px; text-overflow: ellipsis; white-space: nowrap; }
  .nexus-topbar__actions { display: none; }
  .nexus-topbar__mobile-account {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center end;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
  }
  .nexus-topbar__mobile-account > span { display: block; width: 40px; line-height: 16px; text-align: right; }
  .nexus-page { min-height: calc(100vh - 64px); padding: 20px 16px 46px; }
  .nexus-sidebar {
    position: fixed;
    z-index: 60;
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    height: auto;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    border: 1px solid var(--nexus-border);
    border-radius: 14px;
    background: var(--nexus-bg-surface);
    color: var(--nexus-text-primary);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
  }
  .nexus-sidebar__brand { color: var(--nexus-text-primary); }
  .nexus-sidebar__close { display: grid; place-items: center; }
  .nexus-sidebar__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .nexus-nav-item { width: 100%; min-height: 44px; height: 44px; color: var(--nexus-text-secondary); }
  .nexus-nav-item:hover,
  .nexus-nav-item:focus-visible { background: var(--nexus-brand-soft); color: var(--nexus-brand); }
  .nexus-nav-item.is-active { background: var(--nexus-brand-soft); color: var(--nexus-brand); }
  .nexus-nav-subitem { grid-column: 1 / -1; width: calc(100% - 12px); color: #fff; }
  .nexus-app.is-nav-open .nexus-navigation-backdrop { display: block; z-index: 55; }
  .nexus-app.is-nav-open .nexus-sidebar {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nexus-bottom-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 100%;
    height: 70px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 9px;
    overflow: hidden;
    border: 1px solid var(--nexus-border);
    background: var(--nexus-bg-surface);
  }
  .nexus-bottom-nav a {
    display: flex;
    width: 44px;
    min-width: 0;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    color: var(--nexus-text-secondary);
    font-size: 10px;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
  }
  .nexus-bottom-nav a:nth-child(2) { width: 45px; flex-basis: 45px; }
  .nexus-bottom-nav a:nth-child(4) { width: 46px; flex-basis: 46px; }
  .nexus-bottom-nav a.is-active { color: var(--nexus-brand); font-weight: 600; }
  .nexus-notification-host { bottom: 90px; }
  .nexus-profile__form { gap: 20px; }
  .nexus-profile__header {
    height: 142px;
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 15px 19px;
  }
  .nexus-profile__heading { width: 100%; height: 50px; }
  .nexus-profile__save { width: 100%; flex: 0 0 44px; }
  .nexus-profile__columns { display: flex; height: 886px; flex-direction: column; gap: 16px; }
  .nexus-profile__main-card { width: 100%; height: 500px; flex: 0 0 500px; }
  .nexus-profile__visibility-card { width: 100%; height: 370px; flex: 0 0 370px; }
  .nexus-profile__protected { height: 122px; flex-basis: 122px; }
  .nexus-profile__after-save { display: none; }
  .nexus-state-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nexus-dashboard__metrics,
  .nexus-dashboard__service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nexus-dashboard__content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nexus-public-header,
  .nexus-public-footer { align-items: flex-start; flex-direction: column; }
  .nexus-public-account { width: 100%; }
  .nexus-native-layout { width: min(100% - 28px, 1240px); margin: 20px auto; }
  .nexus-native-sidebar { grid-template-columns: 1fr; }
  .nexus-app.is-nav-open .nexus-sidebar__nav { grid-template-columns: 1fr; }
  .nexus-state-grid { grid-template-columns: 1fr; }
  .nexus-dashboard { gap: 16px; }
  .nexus-dashboard__subscription { align-items: stretch; flex-direction: column; padding: 18px; }
  .nexus-dashboard__subscription-action { width: 100%; min-width: 0; }
  .nexus-dashboard__metrics,
  .nexus-dashboard__service-grid { grid-template-columns: 1fr; gap: 16px; }
  .nexus-dashboard__chart,
  .nexus-dashboard__activity,
  .nexus-dashboard__services { padding: 18px; }
  .nexus-dashboard__bars { gap: 10px; padding: 0; }
  .nexus-dashboard__activity-item { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; }
  .nexus-alert { grid-template-columns: auto minmax(0, 1fr); }
  .nexus-alert > :last-child { grid-column: 1 / -1; }
  .nexus-modal__header,
  .nexus-modal__body,
  .nexus-modal__actions { padding: var(--spacing-md); }
  .nexus-modal__actions { flex-direction: column-reverse; }
  .nexus-modal__actions .nexus-button { width: 100%; }
}

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