﻿:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-strong: #eef4f3;
  --text: #17212b;
  --muted: #667482;
  --line: #dce3e8;
  --line-strong: #bdc8d3;
  --accent: #11685d;
  --accent-strong: #0b554d;
  --accent-soft: #e5f3f0;
  --danger: #b3333d;
  --danger-soft: #fdebed;
  --success: #187245;
  --success-soft: #e8f6ee;
  --warning: #9a620f;
  --warning-soft: #fff4df;
  --shadow: 0 12px 34px rgba(24, 36, 48, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

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

button {
  white-space: nowrap;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 10px clamp(14px, 1.6vw, 22px);
  background: rgba(245, 247, 248, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.brand small {
  display: none;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 820;
}

.nav a:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav a.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

[data-admin-link] {
  display: none !important;
}

body.is-admin [data-admin-link] {
  display: inline-flex !important;
}

.top-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.api-indicator,
.account-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.api-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--warning);
}

.api-indicator[data-status="online"] span {
  background: var(--success);
}

.api-indicator[data-status="offline"] span {
  background: var(--danger);
}

.account-chip {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-hero,
.page-title {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.54fr);
  gap: 18px;
  align-items: stretch;
  padding: 28px;
}

.home-hero > *,
.intro-band > *,
.cabinet-grid > *,
.summary-grid > *,
.dashboard-grid > *,
.support-grid > *,
.support-page-grid > *,
.admin-support-grid > *,
.admin-grid > *,
.admin-split > *,
.form-row > *,
.filters-row > * {
  min-width: 0;
}

.home-hero h1,
.page-title h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: 40px;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.home-hero p,
.page-title p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-preview {
  display: grid;
  gap: 10px;
  align-content: stretch;
}

.hero-preview > div {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.hero-preview span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.hero-preview strong {
  font-size: 22px;
  line-height: 1.12;
}

.page-title {
  padding: 24px;
}

.primary-link,
.secondary-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
}

.primary-link {
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
}

.primary-link:hover {
  background: var(--accent-strong);
}

.secondary-link {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.compact-link {
  min-height: 38px;
  font-size: 14px;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.56fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 12px;
}

.intro-band > div:first-child,
.intro-metrics,
.section,
.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intro-band > div:first-child {
  padding: 28px;
}

.intro-band h1 {
  max-width: 740px;
  margin-bottom: 12px;
  font-size: 40px;
  line-height: 1.06;
}

.intro-band p {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.intro-metrics {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.intro-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.intro-metrics span,
.summary-card span,
.signed-in span,
.checkout-box span,
.details-grid span,
.url-box span,
.orders-table td span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.intro-metrics strong {
  font-size: 22px;
}

.section {
  margin-top: 18px;
  padding: 22px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-header.compact {
  margin-bottom: 14px;
}

.section-header h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

.section-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 680;
  line-height: 1.45;
}

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

.plan-card {
  min-height: 255px;
  display: flex;
  flex-direction: column;
  gap: 17px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.plan-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 104, 93, 0.12);
}

.plan-head {
  display: grid;
  gap: 14px;
}

.plan-head h3 {
  margin-bottom: 5px;
  font-size: 20px;
  line-height: 1.25;
}

.plan-head span,
code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.plan-head span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.plan-head strong {
  font-size: 30px;
  line-height: 1;
}

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

.term-option {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.term-option.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px rgba(17, 104, 93, 0.12);
}

.term-option strong {
  font-size: 14px;
  line-height: 1.1;
}

.term-option span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
}

.term-option span:last-child:not(:only-child) {
  color: var(--accent);
  font-weight: 800;
}

.plan-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.plan-facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.plan-facts dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.plan-facts dd {
  margin: 0;
  font-weight: 850;
  text-align: right;
}

.plan-payment-note {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 107, 96, 0.16);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.cabinet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.52fr);
  gap: 18px;
  align-items: start;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(24, 36, 48, 0.08);
}

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

.auth-providers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.provider-button,
.google-provider-slot {
  position: relative;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
}

.provider-button:hover:not(:disabled),
.google-provider-slot:hover:not(.is-disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 104, 93, 0.1);
}

.provider-button:disabled,
.google-provider-slot.is-disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.provider-button-content {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  pointer-events: none;
}

.provider-button-content span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: block;
}

.telegram-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.18));
}

.google-provider-hitbox {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  opacity: 0;
  overflow: hidden;
}

.google-provider-slot.is-disabled .google-provider-hitbox {
  display: none;
}

.google-provider-hitbox > div,
.google-provider-hitbox iframe {
  width: 100% !important;
  height: 100% !important;
}

.auth-form .primary-button {
  align-self: end;
}

.email-code-field {
  grid-column: 1 / -1;
}

.field-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.field-action .secondary-button {
  min-height: 44px;
  white-space: nowrap;
}

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

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

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 126px;
  padding: 11px 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 104, 93, 0.12);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(179, 51, 61, 0.12);
}

.field-hint,
.field-error {
  min-height: 17px;
  font-size: 12px;
  font-weight: 740;
}

.field-hint {
  color: var(--muted);
}

.field-hint.is-good {
  color: var(--success);
}

.field-hint.is-ok {
  color: var(--warning);
}

.field-hint.is-bad,
.field-error {
  color: var(--danger);
}

.signed-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.signed-in strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.checkout-box {
  display: grid;
  gap: 14px;
}

.checkout-box strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.checkout-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.45;
}

.checkout-note[hidden] {
  display: none;
}

#plans.is-plan-change .plan-card {
  border-color: rgba(37, 199, 179, 0.42);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 14px;
  margin-top: 18px;
}

.recovery-reminder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(179, 51, 61, 0.28);
  border-radius: 8px;
  background: #fff8f2;
}

.recovery-reminder[hidden] {
  display: none;
}

.recovery-reminder span,
.recovery-reminder strong,
.recovery-reminder p {
  display: block;
}

.recovery-reminder span {
  color: var(--danger);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.recovery-reminder strong {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.25;
}

.recovery-reminder p {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.45;
}

.summary-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.summary-card strong {
  font-size: 26px;
  line-height: 1.1;
}

.summary-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
}

.primary-summary {
  background: var(--accent);
  color: #ffffff;
}

.primary-summary span,
.primary-summary p {
  color: rgba(255, 255, 255, 0.78);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(300px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.subscription-panel {
  grid-column: 1;
  grid-row: 1 / span 3;
}

.promo-panel,
.referral-panel,
.security-panel {
  grid-column: 2;
}

.promo-panel {
  grid-row: 1;
}

.referral-panel {
  grid-row: 2;
}

.security-panel {
  grid-row: 3;
}

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

.details-grid > div {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.details-grid strong {
  overflow-wrap: anywhere;
}

.url-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.url-box span,
.url-box code {
  grid-column: 1;
}

.url-box code {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.url-box button {
  grid-column: 2;
  grid-row: 1 / 3;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.copy-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.copy-line code {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow-wrap: anywhere;
}

.orders-table-wrap {
  overflow-x: auto;
}

.orders-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

.orders-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.orders-table td {
  font-size: 14px;
  font-weight: 720;
}

.orders-table td strong,
.orders-table td span {
  display: block;
}

.orders-table td span:not(.status-pill) {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

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

.status-pill.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.is-muted {
  background: var(--surface-strong);
  color: var(--muted);
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.support-page-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.support-form {
  display: grid;
  gap: 12px;
}

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

.ticket-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.ticket-card strong,
.ticket-card span,
.ticket-card p {
  display: block;
}

.ticket-card span:not(.status-pill) {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.ticket-card .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: start;
  line-height: 1;
  white-space: nowrap;
}

.ticket-card p {
  grid-column: 1 / -1;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.ticket-button {
  cursor: pointer;
}

.ticket-button:hover,
.ticket-button.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 104, 93, 0.1);
}

.threaded-list {
  margin-top: 14px;
}

.ticket-thread-panel {
  position: sticky;
  top: 76px;
}

.ticket-thread {
  display: grid;
  gap: 12px;
}

.diagnostic-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.diagnostic-form[hidden] {
  display: none;
}

.diagnostic-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.diagnostic-preview strong {
  font-size: 13px;
}

.diagnostic-preview ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.diagnostics-main {
  max-width: 1180px;
  margin: 0 auto;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

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

.diagnostics-preview-panel {
  min-width: 0;
}

.diagnostics-preview {
  min-height: 520px;
  max-height: 680px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.thread-ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.thread-ticket-header strong,
.thread-ticket-header span {
  display: block;
}

.thread-ticket-header span:not(.status-pill) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.security-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.security-actions > .provider-button,
.security-actions > .google-provider-slot {
  flex: 1 1 180px;
  min-width: 0;
  width: 100%;
}

.security-actions .provider-button-content {
  width: 100%;
}

.identity-actions {
  margin-top: 12px;
}

.password-fallback-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.password-fallback-form .field {
  flex: 1 1 190px;
  min-width: 0;
}

.password-fallback-form .primary-button {
  flex: 1 1 160px;
  width: auto;
  min-height: 44px;
  white-space: nowrap;
}

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

.identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.identity-row div > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  overflow-wrap: anywhere;
}

.thread-ticket-header .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  white-space: nowrap;
}

.thread-messages {
  display: grid;
  gap: 10px;
}

.thread-message {
  display: grid;
  gap: 8px;
  max-width: 86%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.thread-message > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.thread-message strong {
  font-size: 13px;
}

.thread-message span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.thread-message p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.thread-message.is-admin-message {
  justify-self: end;
  background: var(--accent-soft);
  border-color: rgba(17, 104, 93, 0.22);
}

.thread-message.is-internal {
  justify-self: stretch;
  max-width: 100%;
  background: var(--warning-soft);
  border-color: rgba(154, 98, 15, 0.24);
}

.thread-reply-form {
  grid-template-columns: 1fr;
  margin-top: 14px;
  align-items: stretch;
}

.thread-reply-form .field textarea {
  min-height: 96px;
}

.thread-reply-form .primary-button {
  justify-self: end;
  min-width: 124px;
}

.admin-support-section {
  margin-top: 18px;
}

.admin-support-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}

.admin-ticket-workbench {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-access-row p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 720;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.security-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

body[data-page="admin"]:not(.is-admin) .admin-stats,
body[data-page="admin"]:not(.is-admin) .admin-workspace,
body[data-page="admin"]:not(.is-admin) [data-admin-panel] {
  display: none !important;
}

body.is-admin .admin-guest-note {
  display: none !important;
}

.admin-stats article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-stats strong {
  font-size: 22px;
  line-height: 1;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-tabs {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 4px;
  margin-bottom: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-tab {
  min-height: 40px;
  width: 100%;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  text-align: left;
}

.admin-tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(24, 36, 48, 0.08);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.is-active {
  display: block;
}

.admin-panels {
  display: grid;
  gap: 16px;
}

.admin-tab-panel[data-admin-panel="active-subscriptions"] {
  order: -1;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  align-items: start;
}

.admin-tab-panel[data-admin-group="marketing"] .admin-split {
  grid-template-columns: minmax(280px, 0.54fr) minmax(0, 1.46fr);
}

.admin-tab-panel[data-admin-group="system"] .admin-split {
  grid-template-columns: minmax(300px, 0.64fr) minmax(0, 1.36fr);
}

.admin-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-panel h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.25;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wide-panel {
  grid-column: 1 / -1;
}

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

.admin-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

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

.admin-overview-card {
  align-content: start;
}

.admin-quick-actions {
  display: grid;
  gap: 8px;
}

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

.admin-overview-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.admin-overview-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-overview-list strong {
  font-size: 18px;
}

.admin-referral-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.admin-referral-summary:empty {
  display: none;
}

.admin-referral-summary > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-referral-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-referral-summary strong {
  font-size: 18px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row > .field,
.admin-form > .field {
  min-width: 0;
}

.admin-tab-panel[data-admin-panel="promos"] .form-row {
  grid-template-columns: 1fr;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

.admin-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-table td {
  font-size: 14px;
  font-weight: 560;
}

.admin-table td strong,
.admin-table td span {
  display: block;
  max-width: 100%;
}

.admin-table td strong {
  line-height: 1.25;
}

.admin-table td span:not(.status-pill) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.admin-table .status-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

.admin-table .table-actions {
  display: grid;
  gap: 6px;
  justify-items: stretch;
}

.admin-table .table-actions .secondary-button,
.admin-table .table-actions .danger-button {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.admin-promo-table th:nth-child(1),
.admin-promo-table td:nth-child(1) {
  width: 28%;
}

.admin-promo-table th:nth-child(2),
.admin-promo-table td:nth-child(2) {
  width: 15%;
}

.admin-promo-table th:nth-child(3),
.admin-promo-table td:nth-child(3) {
  width: 12%;
}

.admin-promo-table th:nth-child(4),
.admin-promo-table td:nth-child(4) {
  width: 18%;
}

.admin-promo-table th:nth-child(5),
.admin-promo-table td:nth-child(5) {
  width: 128px;
}

.admin-plans-table th:nth-child(1),
.admin-plans-table td:nth-child(1) {
  width: 34%;
}

.admin-plans-table th:nth-child(2),
.admin-plans-table td:nth-child(2) {
  width: 24%;
}

.admin-plans-table th:nth-child(3),
.admin-plans-table td:nth-child(3) {
  width: 132px;
}

.admin-plans-table th:nth-child(4),
.admin-plans-table td:nth-child(4) {
  width: 156px;
}

.admin-subscriptions-table th:nth-child(5),
.admin-subscriptions-table td:nth-child(5),
.admin-customers-table th:nth-child(4),
.admin-customers-table td:nth-child(4),
.admin-referrals-table th:nth-child(4),
.admin-referrals-table td:nth-child(4) {
  width: 150px;
}

body[data-page="admin"] .field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

body[data-page="admin"] .field input,
body[data-page="admin"] .field select,
body[data-page="admin"] .field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  box-sizing: border-box;
}

.admin-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-plan strong,
.admin-plan span {
  display: block;
}

.admin-plan span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.admin-actions-row {
  padding-top: 4px;
}

.mini-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-result {
  min-height: 86px;
  display: grid;
  gap: 10px;
}

.admin-result:empty::before {
  content: "Результат появится здесь";
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.admin-result pre,
.admin-record pre {
  max-height: 260px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: #dce9e7;
  font-size: 12px;
  line-height: 1.45;
}

.admin-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-record strong,
.admin-record span,
.admin-record p {
  display: block;
}

.admin-record span:not(.status-pill) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
  overflow-wrap: anywhere;
}

.admin-record p,
.admin-record pre {
  grid-column: 1 / -1;
}

.admin-record p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.admin-details-grid {
  margin-top: 10px;
}

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

.readiness-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.readiness-summary-card span,
.readiness-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.readiness-record pre {
  max-height: 180px;
}

.empty-mini {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.primary-button {
  width: 100%;
  margin-top: auto;
  padding: 0 16px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.danger-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.secondary-button,
.danger-button {
  padding: 0 14px;
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.danger-button {
  border-color: rgba(179, 51, 61, 0.24);
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.message.is-error {
  border: 1px solid rgba(179, 51, 61, 0.28);
  background: var(--danger-soft);
  color: var(--danger);
}

.message.is-success {
  border: 1px solid rgba(24, 114, 69, 0.25);
  background: var(--success-soft);
  color: var(--success);
}

.empty-state {
  min-height: 156px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

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

.empty-state strong {
  color: var(--text);
}

.brand-mark {
  font-weight: 800;
}

.brand small,
.api-indicator,
.account-chip,
.nav a,
.admin-tab,
.status-pill,
.message,
.empty-mini,
.admin-result:empty::before,
.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  font-weight: 700;
}

.home-hero h1,
.page-title h1 {
  font-weight: 800;
}

.section-header h2,
.admin-panel h3,
.plan-card h3,
.thread-ticket-header strong,
.ticket-card strong {
  font-weight: 750;
}

.orders-table th,
.admin-table th,
.admin-stats span {
  font-weight: 700;
  letter-spacing: 0;
}

.orders-table td,
.admin-table td,
.admin-note,
.admin-access-row p,
.ticket-card span:not(.status-pill),
.thread-ticket-header span:not(.status-pill),
.thread-message span,
.admin-record span:not(.status-pill) {
  font-weight: 500;
}

.admin-table td strong,
.orders-table td strong,
.details-grid strong,
.admin-stats strong {
  font-weight: 750;
}

.inline-actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px;
}

.compact-field {
  width: 118px;
}

.compact-field input {
  min-height: 38px;
}

.table-actions .secondary-button,
.table-actions .danger-button,
.inline-actions .secondary-button {
  min-height: 34px;
  width: auto;
  padding: 0 10px;
  font-size: 13px;
}

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

.admin-record p {
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar,
  .home-hero,
  .intro-band,
  .cabinet-grid,
  .summary-grid,
  .dashboard-grid,
  .support-grid,
  .support-page-grid,
  .diagnostics-grid,
  .admin-support-grid,
  .admin-grid,
  .admin-workspace,
  .admin-split,
  .admin-stats,
  .admin-overview-grid,
  .filters-row,
  .form-row,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .admin-tab {
    width: auto;
    white-space: nowrap;
  }

  .admin-table-wrap {
    overflow-x: auto;
  }

  .admin-table {
    min-width: 620px;
    table-layout: auto;
  }

  .admin-promo-table,
  .admin-plans-table,
  .admin-history-table,
  .admin-referrals-table,
  .admin-customers-table,
  .admin-subscriptions-table {
    min-width: 0;
    table-layout: fixed;
  }

  .admin-promo-table th:nth-child(5),
  .admin-promo-table td:nth-child(5),
  .admin-plans-table th:nth-child(4),
  .admin-plans-table td:nth-child(4),
  .admin-subscriptions-table th:nth-child(5),
  .admin-subscriptions-table td:nth-child(5),
  .admin-customers-table th:nth-child(4),
  .admin-customers-table td:nth-child(4),
  .admin-referrals-table th:nth-child(4),
  .admin-referrals-table td:nth-child(4) {
    width: 128px;
  }

  .topbar {
    position: static;
  }

  .nav,
  .top-status {
    justify-content: flex-start;
  }

  .top-status,
  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .account-chip {
    max-width: none;
  }

  .diagnostics-preview {
    min-height: 360px;
  }

  .subscription-panel,
  .promo-panel,
  .referral-panel {
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
  }

  .ticket-thread-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: calc(100% - 20px);
    max-width: 1220px;
    padding-top: 10px;
  }

  .home-hero,
  .page-title,
  .intro-band > div:first-child,
  .section {
    padding: 16px;
    min-width: 0;
  }

  .home-hero h1,
  .page-title h1,
  .intro-band h1 {
    font-size: 29px;
    line-height: 1.12;
  }

  .section-header,
  .signed-in,
  .admin-plan {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-form,
  .details-grid,
  .inline-form,
  .mini-action,
  .copy-line,
  .url-box,
  .subscription-access,
  .connection-guide,
  .field-action,
  .subscription-meta {
    grid-template-columns: 1fr;
  }

  .subscription-url-card,
  .subscription-qr,
  .subscription-meta > div,
  .promo-panel,
  .referral-panel,
  .orders-panel,
  .support-create-panel {
    min-width: 0;
  }

  .subscription-url-card {
    min-height: 0;
  }

  .subscription-qr {
    min-height: 0;
    padding: 12px;
  }

  .subscription-qr svg {
    max-width: min(100%, 280px);
  }

  .inline-form .primary-button,
  .field-action .secondary-button,
  .copy-line .secondary-button,
  .guide-actions .secondary-button,
  .guide-actions .secondary-link {
    width: 100%;
  }

  .url-box span,
  .url-box code,
  .url-box button {
    grid-column: auto;
    grid-row: auto;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .thread-message {
    max-width: 100%;
  }
}

/* Landing/profile design pass */
:root {
  --bg: #f4f7f6;
  --surface-soft: #f9fbfb;
  --surface-strong: #edf4f2;
  --text: #0d1b24;
  --muted: #5c6c78;
  --line: #d7e0e4;
  --line-strong: #b9c7ce;
  --accent: #0f6b60;
  --accent-strong: #094c44;
  --accent-soft: #e2f3ef;
  --shadow: 0 18px 44px rgba(15, 33, 45, 0.08);
}

body:not([data-page="admin"]) .api-indicator {
  display: none;
}

.topbar {
  border-bottom: 1px solid rgba(215, 224, 228, 0.72);
}

.brand strong,
.nav a,
.account-chip,
.primary-link,
.secondary-link,
.primary-button,
.secondary-button {
  letter-spacing: 0;
}

.account-chip {
  color: var(--accent);
  text-decoration: none;
}

.account-chip:hover {
  border-color: rgba(15, 107, 96, 0.26);
  background: var(--accent-soft);
}

body[data-page="home"] .app-shell {
  width: min(1180px, calc(100% - 36px));
}

body[data-page="home"] .home-hero {
  min-height: min(690px, calc(100vh - 90px));
  margin-top: 0;
  padding: 58px 0 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  gap: 36px;
  align-items: center;
}

.hero-copy h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(46px, 7vw, 76px);
  line-height: 0.95;
  font-weight: 800;
}

.hero-copy p {
  max-width: 620px;
  color: #425465;
  font-size: 19px;
  line-height: 1.55;
}

.hero-actions {
  margin-top: 26px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.hero-points span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-points span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.hero-visual {
  min-height: 430px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 58px rgba(11, 32, 44, 0.09);
}

.hero-visual img {
  width: 118%;
  max-width: none;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
  object-position: center;
  display: block;
}

body[data-page="home"] #plans {
  margin-top: 0;
}

body[data-page="home"] .section,
.landing-band {
  border-color: rgba(215, 224, 228, 0.92);
  box-shadow: 0 12px 30px rgba(15, 33, 45, 0.055);
}

body[data-page="home"] .section-header h2,
.landing-band h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

body[data-page="home"] .plans-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.plan-card {
  background: #ffffff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 107, 96, 0.28);
  box-shadow: 0 16px 34px rgba(15, 33, 45, 0.08);
}

.plan-head strong {
  color: var(--accent);
}

.plan-head span {
  font-family: inherit;
  font-weight: 650;
}

.plan-card .primary-link,
.plan-card .primary-button {
  width: 100%;
}

.landing-band {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 24px;
  align-items: start;
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.landing-band p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.steps-grid {
  display: grid;
  gap: 10px;
}

.steps-grid article {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.steps-grid strong {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
}

.steps-grid span {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

body[data-page="account"] .page-title {
  padding: 20px 24px;
  background: #0d1b24;
  color: #ffffff;
}

body[data-page="account"]:not(.is-signed-in) .page-title {
  display: none;
}

body[data-page="account"] .page-title h1 {
  margin-bottom: 8px;
  font-size: 34px;
}

body[data-page="account"] .page-title p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
}

body[data-page="account"] .cabinet-grid {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

body[data-page="account"] main {
  display: flex;
  flex-direction: column;
}

body[data-page="account"] #plans,
body[data-page="account"] .profile-tabs a[href="#plans"] {
  display: none !important;
}

body[data-page="account"].is-signed-in #dashboard {
  order: 1;
}

body[data-page="account"].is-signed-in #plans {
  order: 2;
}

body[data-page="account"].is-signed-in.is-changing-plan #plans {
  display: block !important;
}

body[data-page="account"].is-signed-in .cabinet-grid {
  display: none;
}

body[data-page="account"].is-signed-in.is-checkout-active .cabinet-grid {
  display: grid;
  order: 3;
}

body[data-page="account"].is-signed-in.is-checkout-active .auth-panel {
  display: none;
}

.auth-panel,
.checkout-panel {
  align-self: stretch;
}

body[data-page="account"] .auth-panel {
  width: 100%;
  padding: 24px;
  border-color: rgba(37, 199, 179, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--surface);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.16);
}

body[data-page="account"] .auth-panel .section-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

body[data-page="account"] .auth-panel .section-header h2 {
  font-size: 28px;
}

body[data-page="account"] .auth-panel .tabs {
  width: 100%;
}

body[data-page="account"] .auth-panel .tab {
  flex: 1;
}

body[data-page="account"] .auth-panel .auth-providers {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

body[data-page="account"] .auth-panel .provider-button,
body[data-page="account"] .auth-panel .google-provider-slot {
  min-height: 52px;
  padding: 0 12px;
  border-color: rgba(154, 173, 185, 0.3);
  background: rgba(255, 255, 255, 0.045);
}

body[data-page="account"] .auth-panel .provider-button:hover:not(:disabled),
body[data-page="account"] .auth-panel .google-provider-slot:hover:not(.is-disabled) {
  background: rgba(37, 199, 179, 0.08);
}

body[data-page="account"] .auth-panel .auth-form {
  grid-template-columns: 1fr;
  gap: 13px;
}

body[data-page="account"] .auth-panel .field {
  gap: 8px;
}

body[data-page="account"] .auth-panel .field label {
  color: var(--text);
}

body[data-page="account"] .auth-panel .field input {
  min-height: 50px;
  padding: 0 15px;
  border-color: rgba(154, 173, 185, 0.34);
  background: #f6fbfa;
  color: #0d1a21;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

body[data-page="account"] .auth-panel .field input::placeholder {
  color: #72838d;
}

body[data-page="account"] .auth-panel .field input:-webkit-autofill,
body[data-page="account"] .auth-panel .field input:-webkit-autofill:hover,
body[data-page="account"] .auth-panel .field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0d1a21;
  caret-color: #0d1a21;
  box-shadow: 0 0 0 1000px #f6fbfa inset, 0 0 0 3px rgba(37, 199, 179, 0.12);
}

body[data-page="account"] .auth-panel .primary-button {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
}

.auth-panel.is-signed-in {
  padding: 18px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.24fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.profile-sidebar {
  position: sticky;
  top: 72px;
  z-index: 6;
  display: grid;
  gap: 12px;
}

.profile-menu-card,
.profile-tabs {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.profile-menu-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.profile-menu-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.profile-menu-card .secondary-button {
  width: 100%;
  margin-top: 2px;
}

.profile-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.profile-tabs a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 13px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.profile-tabs a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.summary-grid {
  margin-top: 14px;
}

.profile-content > .summary-grid {
  margin-top: 0;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-content > .section,
.profile-content .dashboard-grid > .section {
  margin-top: 0;
}

.support-create-panel {
  order: 3;
}

.orders-panel {
  order: 4;
}

.subscription-panel,
.promo-panel,
.referral-panel,
.security-panel,
.orders-panel {
  scroll-margin-top: 130px;
}

.url-box code,
.copy-line code {
  color: #0b554d;
  font-size: 13px;
}

.subscription-access {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
}

.subscription-url-card,
.subscription-qr,
.subscription-meta > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.subscription-url-card {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 220px;
  padding: 18px;
}

.subscription-url-card span,
.subscription-meta span,
.subscription-qr span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.subscription-url-card code {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.subscription-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subscription-actions .primary-button,
.subscription-actions .secondary-button,
.subscription-actions .secondary-link {
  width: auto;
}

.subscription-actions .secondary-link[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

.connection-guide {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.connection-guide > div:first-child {
  display: grid;
  align-content: start;
  gap: 8px;
}

.happ-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.happ-downloads .secondary-link {
  min-height: 34px;
}

.connection-guide span,
.connection-guide p {
  color: var(--muted);
}

.connection-guide > div:first-child > span {
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.connection-guide h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.connection-guide p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.connection-guide ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: happ-step;
}

.connection-guide li {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 54px;
  padding: 10px 12px 10px 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  counter-increment: happ-step;
}

.connection-guide li::before {
  content: counter(happ-step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.connection-guide li strong {
  font-size: 14px;
}

.connection-guide li span {
  font-size: 13px;
  line-height: 1.35;
}

.guide-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subscription-qr {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 14px;
}

.subscription-qr svg {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
}

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

.subscription-meta > div {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
}

.subscription-meta strong {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  body[data-page="home"] .home-hero,
  .landing-band,
  .profile-layout,
  body[data-page="account"] .cabinet-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .subscription-panel,
  .promo-panel,
  .referral-panel,
  .security-panel {
    grid-column: auto;
    grid-row: auto;
  }

  body[data-page="home"] .home-hero {
    min-height: auto;
    padding: 38px 0 22px;
  }

  .hero-visual {
    min-height: 320px;
  }

  .hero-visual img {
    min-height: 320px;
  }

  .profile-sidebar {
    position: static;
    min-width: 0;
  }

  .profile-tabs {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-content {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  body[data-page="home"] .app-shell {
    width: calc(100% - 20px);
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-inline: 12px;
  }

  .brand {
    min-width: 0;
  }

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

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav a {
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
    font-size: 13px;
    text-align: center;
  }

  .top-status {
    grid-column: 2;
    grid-row: 1;
  }

  .account-chip {
    max-width: 100px;
  }

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

  .hero-copy p {
    font-size: 16px;
  }

  .hero-points {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-points span {
    min-width: 0;
  }

  .hero-visual {
    min-height: 240px;
  }

  .hero-visual img {
    min-height: 240px;
  }

  .profile-tabs a {
    flex: 1 1 auto;
    justify-content: center;
  }

  .subscription-access,
  .connection-guide,
  .subscription-meta {
    grid-template-columns: 1fr;
  }

  .subscription-access,
  .connection-guide {
    gap: 12px;
  }
}

/* Mobile conversion pass */
@media (max-width: 720px) {
  html {
    scroll-padding-top: 118px;
  }

  body {
    font-size: 16px;
  }

  .app-shell,
  body[data-page="home"] .app-shell {
    width: min(100% - 16px, 440px);
    padding-top: 8px;
    padding-bottom: 28px;
  }

  .topbar {
    top: 0;
    margin-inline: -8px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    background: rgba(244, 247, 246, 0.96);
  }

  .brand strong {
    font-size: 21px;
  }

  .theme-toggle,
  .account-chip {
    min-height: 40px;
  }

  .theme-toggle {
    width: 40px;
  }

  .account-chip {
    max-width: 112px;
    padding-inline: 10px;
  }

  .nav {
    overflow-x: auto;
    grid-template-columns: repeat(3, minmax(104px, 1fr));
    gap: 6px;
    padding: 6px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    min-height: 40px;
    padding-inline: 10px;
    font-size: 14px;
  }

  body[data-page="home"] .home-hero {
    padding: 22px 0 10px;
    gap: 18px;
  }

  .hero-copy h1 {
    max-width: 340px;
    margin-bottom: 12px;
    font-size: 40px;
    line-height: 1;
  }

  .hero-copy p {
    max-width: 100%;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.45;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
  }

  .hero-actions .primary-link,
  .hero-actions .secondary-link,
  .plan-card .primary-link,
  .plan-card .primary-button,
  .checkout-box .primary-button,
  .auth-form .primary-button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .hero-points {
    gap: 8px;
    margin-top: 16px;
    font-size: 13px;
  }

  .hero-points span {
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .hero-visual {
    min-height: 168px;
    max-height: 190px;
  }

  .hero-visual img {
    width: 100%;
    min-height: 168px;
  }

  .section,
  .summary-card,
  .landing-band,
  .profile-menu-card,
  .profile-tabs,
  .profile-content > .section,
  .profile-content .dashboard-grid > .section {
    padding: 16px;
  }

  .section-header,
  body[data-page="account"] .auth-panel .section-header {
    gap: 12px;
  }

  .section-header h2,
  body[data-page="home"] .section-header h2,
  .landing-band h2 {
    font-size: 24px;
    line-height: 1.1;
  }

  .section-header p,
  .landing-band p,
  body[data-page="account"] .page-title p {
    font-size: 14px;
    line-height: 1.45;
  }

  body[data-page="account"] .page-title {
    margin-top: 10px;
    padding: 18px 0 8px;
  }

  body[data-page="account"] .page-title h1 {
    font-size: 34px;
  }

  body[data-page="account"] main {
    gap: 14px;
  }

  body[data-page="account"] .cabinet-grid,
  .summary-grid,
  .dashboard-grid,
  .plans-grid {
    gap: 12px;
  }

  body[data-page="account"] .auth-panel {
    max-width: none;
    padding: 18px;
  }

  body[data-page="account"] .auth-panel .tabs,
  body[data-page="account"] .auth-panel .auth-providers {
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    order: -1;
  }

  .checkout-box,
  .inline-form,
  .copy-line,
  .recovery-reminder,
  .happ-downloads,
  .subscription-actions,
  .guide-actions {
    grid-template-columns: 1fr;
  }

  .security-actions > .provider-button,
  .security-actions > .google-provider-slot,
  .password-fallback-form .field,
  .password-fallback-form .primary-button {
    flex-basis: 100%;
  }

  .password-fallback-form .primary-button {
    width: 100%;
  }

  .copy-line code,
  .subscription-url-card code {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .profile-layout {
    gap: 12px;
  }

  .profile-menu-card {
    display: none;
  }

  .profile-tabs {
    position: sticky;
    top: 98px;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
  }

  .profile-tabs a {
    min-height: 40px;
    justify-content: center;
    padding: 8px;
    text-align: center;
    white-space: normal;
  }

  .summary-card strong {
    font-size: 22px;
  }

  .subscription-qr {
    min-height: 220px;
  }

  .orders-table-wrap {
    margin-inline: -16px;
    padding-inline: 16px;
    overflow-x: auto;
  }

  .orders-table {
    min-width: 680px;
  }
}

@media (max-width: 380px) {
  .nav {
    grid-template-columns: repeat(3, minmax(92px, 1fr));
  }

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

  .hero-copy h1 {
    font-size: 36px;
  }

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

/* Theme toggle and dark palette */
.theme-toggle {
  width: 42px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.theme-toggle span {
  position: relative;
  width: 17px;
  height: 17px;
  display: block;
  border-radius: 999px;
  background: var(--text);
  box-shadow: inset -6px -4px 0 var(--surface);
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.theme-toggle:hover {
  border-color: rgba(15, 107, 96, 0.28);
  background: var(--accent-soft);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071015;
  --surface: #0d1a21;
  --surface-soft: #12232b;
  --surface-strong: #1a313a;
  --text: #edf7f6;
  --muted: #9aadb9;
  --line: #243b46;
  --line-strong: #3a535f;
  --accent: #25c7b3;
  --accent-strong: #5be4d4;
  --accent-soft: #123934;
  --danger: #ff8993;
  --danger-soft: #391a21;
  --success: #72dfa2;
  --success-soft: #143522;
  --warning: #f0c16d;
  --warning-soft: #382b15;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 199, 179, 0.08), transparent 36%),
    radial-gradient(circle at 85% 12%, rgba(91, 228, 212, 0.06), transparent 32%),
    var(--bg);
}

:root[data-theme="dark"] .topbar {
  border-bottom-color: rgba(58, 83, 95, 0.74);
  background: rgba(7, 16, 21, 0.9);
}

:root[data-theme="dark"] .brand-mark,
:root[data-theme="dark"] .primary-link,
:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .steps-grid strong,
:root[data-theme="dark"] .primary-summary {
  color: #06211e;
}

:root[data-theme="dark"] .primary-link,
:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .steps-grid strong,
:root[data-theme="dark"] .brand-mark,
:root[data-theme="dark"] .primary-summary {
  background: var(--accent);
}

:root[data-theme="dark"] .primary-link:hover,
:root[data-theme="dark"] .primary-button:hover {
  background: var(--accent-strong);
}

:root[data-theme="dark"] .secondary-link,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .danger-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .api-indicator,
:root[data-theme="dark"] .account-chip,
:root[data-theme="dark"] .theme-toggle {
  background: var(--surface-soft);
}

:root[data-theme="dark"] .theme-toggle span {
  width: 16px;
  height: 16px;
  background: #f4d56d;
  box-shadow:
    0 0 0 4px rgba(244, 213, 109, 0.12),
    0 0 14px rgba(244, 213, 109, 0.28);
}

:root[data-theme="dark"] .home-hero p,
:root[data-theme="dark"] .hero-copy p {
  color: var(--muted);
}

:root[data-theme="dark"] .hero-visual {
  border-color: var(--line);
  background: #0b171d;
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .hero-visual img {
  opacity: 0.9;
  filter: brightness(0.78) saturate(0.92);
}

:root[data-theme="dark"] .plan-card,
:root[data-theme="dark"] body[data-page="home"] .section,
:root[data-theme="dark"] .landing-band,
:root[data-theme="dark"] .section,
:root[data-theme="dark"] .summary-card,
:root[data-theme="dark"] .profile-menu-card,
:root[data-theme="dark"] .subscription-url-card,
:root[data-theme="dark"] .subscription-meta > div,
:root[data-theme="dark"] .admin-panel,
:root[data-theme="dark"] .admin-record,
:root[data-theme="dark"] .ticket-card,
:root[data-theme="dark"] .thread-message,
:root[data-theme="dark"] .thread-ticket-header,
:root[data-theme="dark"] .admin-ticket-workbench,
:root[data-theme="dark"] .admin-stats article,
:root[data-theme="dark"] .admin-referral-summary > div,
:root[data-theme="dark"] .admin-overview-list button,
:root[data-theme="dark"] .details-grid > div,
:root[data-theme="dark"] .url-box,
:root[data-theme="dark"] .subscription-url-card code,
:root[data-theme="dark"] .copy-line code,
:root[data-theme="dark"] .signed-in,
:root[data-theme="dark"] .recovery-reminder,
:root[data-theme="dark"] .admin-access-row p {
  background: var(--surface-soft);
}

:root[data-theme="dark"] .recovery-reminder {
  border-color: rgba(255, 137, 147, 0.28);
}

:root[data-theme="dark"] .tabs,
:root[data-theme="dark"] .nav,
:root[data-theme="dark"] .admin-tabs,
:root[data-theme="dark"] .profile-tabs,
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select {
  background: var(--surface);
}

:root[data-theme="dark"] .tab.is-active,
:root[data-theme="dark"] .admin-tab.is-active,
:root[data-theme="dark"] .nav a.is-active,
:root[data-theme="dark"] .profile-tabs a:hover,
:root[data-theme="dark"] .account-chip:hover,
:root[data-theme="dark"] .theme-toggle:hover,
:root[data-theme="dark"] .thread-message.is-admin-message {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

:root[data-theme="dark"] .page-title,
:root[data-theme="dark"] body[data-page="account"] .page-title {
  border-color: #1f333d;
  background: linear-gradient(135deg, #09151b, #10242b);
  color: var(--text);
}

:root[data-theme="dark"] body[data-page="account"] .page-title p {
  color: rgba(237, 247, 246, 0.72);
}

:root[data-theme="dark"] .primary-summary span,
:root[data-theme="dark"] .primary-summary p {
  color: rgba(6, 33, 30, 0.72);
}

:root[data-theme="dark"] .primary-summary strong {
  color: #06211e;
}

:root[data-theme="dark"] .primary-summary {
  background: var(--accent);
  color: #06211e;
}

:root[data-theme="dark"] .primary-summary span,
:root[data-theme="dark"] .primary-summary p,
:root[data-theme="dark"] .primary-summary strong {
  color: #06211e;
}

:root[data-theme="dark"] .status-pill.is-success {
  background: var(--success-soft);
  color: var(--success);
}

:root[data-theme="dark"] .status-pill.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

:root[data-theme="dark"] .status-pill.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

:root[data-theme="dark"] .thread-message.is-internal {
  background: var(--warning-soft);
  border-color: rgba(240, 193, 109, 0.28);
}

:root[data-theme="dark"] .admin-result pre,
:root[data-theme="dark"] .admin-record pre {
  background: #081015;
  color: #dce9e7;
}

:root[data-theme="dark"] .url-box code,
:root[data-theme="dark"] .copy-line code,
  color: var(--accent-strong);
}

/* Auth modal */
body.auth-modal-open {
  overflow: hidden;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 16, 21, 0.58);
  backdrop-filter: blur(10px);
}

.auth-modal-panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.auth-modal-head {
  padding-right: 54px;
}

.auth-modal-head h2 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.08;
}

.auth-modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.auth-modal-plan {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-modal-plan span,
.auth-modal-plan small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.auth-modal-plan strong {
  font-size: 18px;
}

.auth-modal-tabs {
  width: 100%;
}

.auth-modal-tabs .tab {
  flex: 1;
}

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

.auth-modal-form .primary-button {
  margin-top: 4px;
}

.email-verification-target {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.email-verification-target span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.email-verification-target strong {
  overflow-wrap: anywhere;
}

.email-verification-form .email-code-field,
.email-verification-form .primary-button {
  grid-column: 1 / -1;
}

:root[data-theme="dark"] .auth-modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

:root[data-theme="dark"] .auth-modal-panel {
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .auth-modal-plan {
  background: var(--surface-soft);
}

@media (max-width: 640px) {
  .auth-modal {
    align-items: end;
    padding: 10px;
  }

  .auth-modal-panel {
    width: 100%;
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .auth-modal-head h2 {
    font-size: 26px;
  }
}

/* Site footer with legal links */
.site-footer {
  margin-top: 40px;
  padding: 28px clamp(14px, 1.6vw, 22px) 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 40px;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 440px;
}

.site-footer__brand strong {
  font-size: 16px;
  color: var(--accent);
}

.site-footer__brand span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-content: flex-start;
}

.site-footer__nav a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer__nav a:hover {
  color: var(--accent);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-footer__legal {
    flex-direction: column;
  }
}

:root[data-theme="dark"] .site-footer,
:root[data-theme="dark"] .site-footer__legal {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Legal document pages (offer / privacy / refund) */
.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 0 24px;
}

.legal-page h1 {
  font-size: clamp(23px, 3vw, 30px);
  margin-bottom: 6px;
}

.legal-page h2 {
  font-size: 18px;
  margin-top: 30px;
  margin-bottom: 10px;
  color: var(--accent);
}

.legal-page p {
  color: var(--text);
  line-height: 1.62;
  margin-bottom: 12px;
}

.legal-page ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.legal-page li {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 6px;
}

.legal-page a {
  color: var(--accent);
}

.legal-page .legal-requisites {
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  line-height: 1.7;
}

