:root {
  --stellar-green: #075e54;
  --stellar-green-dark: #06473f;
  --stellar-mint: #d9f4ed;
  --stellar-ink: #10231f;
  --stellar-muted: #62716d;
  --stellar-line: rgba(15, 72, 62, 0.14);
  --stellar-surface: rgba(255, 255, 255, 0.96);
}

#stellar-membership-widget,
#stellar-membership-sidebar-row,
.stellar-membership-modal,
.stellar-membership-page {
  box-sizing: border-box;
  color: var(--stellar-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#stellar-membership-widget *,
#stellar-membership-sidebar-row *,
.stellar-membership-modal *,
.stellar-membership-page * {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body.stellar-modal-open {
  overflow: hidden;
}

#stellar-membership-widget {
  position: static;
  width: auto;
  margin: 5px 4px 7px;
  padding: 11px;
  border: 1px solid var(--stellar-line);
  border-radius: 12px;
  background: rgba(7, 94, 84, 0.055);
  box-shadow: none;
}

.stellar-membership-sidebar-row {
  display: flex;
  justify-content: center;
  padding: 1px 7px;
}

.stellar-membership-sidebar-action {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(7, 94, 84, 0.12);
  border-radius: 16px;
  color: var(--stellar-green-dark);
  background: rgba(7, 94, 84, 0.07);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}

.stellar-membership-sidebar-action:hover {
  border-color: rgba(7, 94, 84, 0.2);
  background: rgba(7, 94, 84, 0.12);
}

.stellar-membership-sidebar-action:focus-visible {
  outline: 3px solid rgba(7, 94, 84, 0.22);
  outline-offset: 1px;
}

.stellar-sidebar-upgrade-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.stellar-sidebar-upgrade-label {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stellar-sidebar-upgrade-detail {
  flex: none;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--stellar-green-dark);
  background: var(--stellar-mint);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.stellar-membership-head,
.stellar-membership-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stellar-membership-name {
  overflow: hidden;
  max-width: 150px;
  color: var(--stellar-ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stellar-membership-badge {
  flex: none;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--stellar-green-dark);
  background: var(--stellar-mint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.03em;
}

.stellar-membership-usage-row {
  margin-top: 10px;
  color: var(--stellar-muted);
  font-size: 11px;
}

.stellar-membership-progress {
  overflow: hidden;
  width: 100%;
  height: 6px;
  margin-top: 7px;
  border-radius: 999px;
  background: #e9efed;
}

.stellar-membership-progress > span {
  display: block;
  width: var(--stellar-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b7a69, #20a88e);
  transition: width 240ms ease;
}

#stellar-membership-widget[data-level="warning"] .stellar-membership-progress > span {
  background: #d59c00;
}

#stellar-membership-widget[data-level="danger"] .stellar-membership-progress > span {
  background: #d4583f;
}

.stellar-membership-reset {
  margin-top: 7px;
  color: var(--stellar-muted);
  font-size: 10px;
}

.stellar-membership-action {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--stellar-green);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.stellar-membership-action:hover {
  background: var(--stellar-green-dark);
}

.stellar-membership-support-action {
  width: 100%;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(7, 94, 84, 0.2);
  border-radius: 10px;
  color: var(--stellar-green-dark);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.stellar-membership-support-action:hover {
  border-color: rgba(7, 94, 84, 0.34);
  background: #fff;
}

.stellar-membership-action:focus-visible,
.stellar-membership-support-action:focus-visible,
.stellar-plan-button:focus-visible,
.stellar-secondary-button:focus-visible,
.stellar-table-action:focus-visible,
.stellar-issue-form input:focus-visible {
  outline: 3px solid rgba(7, 94, 84, 0.24);
  outline-offset: 2px;
}

.stellar-membership-modal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 22, 19, 0.58);
}

.stellar-membership-modal-card {
  position: relative;
  width: min(440px, 100%);
  padding: 28px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.stellar-redeem-card {
  width: min(520px, 100%);
}

.stellar-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  color: var(--stellar-muted);
  background: #eef3f1;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.stellar-redeem-card form {
  display: grid;
  gap: 12px;
}

.stellar-code-label {
  color: var(--stellar-ink);
  font-size: 13px;
  font-weight: 750;
}

.stellar-code-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(15, 72, 62, 0.24);
  border-radius: 12px;
  color: var(--stellar-ink);
  background: #fff;
  font: 700 15px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stellar-code-input:focus {
  border-color: var(--stellar-green);
  outline: 3px solid rgba(7, 94, 84, 0.12);
}

.stellar-support-toggle {
  display: block;
  margin: 17px auto 0;
  border: 0;
  color: var(--stellar-green);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.stellar-support-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--stellar-line);
  border-radius: 14px;
  background: #f4f8f6;
}

.stellar-support-panel p {
  margin: 0 0 10px;
  font-size: 13px;
}

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

.stellar-support-link {
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  background: var(--stellar-green);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.stellar-support-link.telegram {
  background: #267db8;
}

.stellar-support-link.disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.stellar-support-status,
.stellar-redeem-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--stellar-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.stellar-support-status.error,
.stellar-redeem-status.error {
  color: #a6311e;
}

.stellar-support-contact-card {
  width: min(430px, 100%);
}

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

.stellar-support-contact-status {
  min-height: 18px;
  margin-top: 12px;
  color: var(--stellar-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.stellar-support-contact-status.error {
  color: #a6311e;
}

.stellar-redeem-status.success {
  color: var(--stellar-green);
  font-weight: 750;
}

.stellar-membership-modal-card h2 {
  margin: 0;
  font-size: 22px;
}

.stellar-membership-modal-card p {
  margin: 12px 0 22px;
  color: var(--stellar-muted);
  line-height: 1.65;
}

.stellar-membership-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.stellar-secondary-button,
.stellar-plan-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.stellar-secondary-button {
  border: 1px solid var(--stellar-line);
  color: var(--stellar-ink);
  background: #fff;
}

.stellar-plan-button {
  border: 0;
  color: #fff;
  background: var(--stellar-green);
}

.stellar-plan-button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.stellar-secondary-button[disabled],
.stellar-table-action[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

body.stellar-membership-upgrade {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(45, 185, 151, 0.16), transparent 32rem),
    radial-gradient(circle at 88% 2%, rgba(8, 94, 83, 0.14), transparent 28rem),
    #f4f8f6;
}

.stellar-membership-page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.stellar-upgrade-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stellar-brand {
  color: var(--stellar-green-dark);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stellar-back-link {
  color: var(--stellar-muted);
  text-decoration: none;
}

.stellar-upgrade-hero {
  max-width: 720px;
  margin: 70px auto 34px;
  text-align: center;
}

.stellar-upgrade-kicker {
  color: var(--stellar-green);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stellar-upgrade-hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.stellar-upgrade-hero p {
  margin: 0;
  color: var(--stellar-muted);
  font-size: 17px;
  line-height: 1.7;
}

.stellar-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 820px;
  margin: 0 auto;
}

.stellar-plan-card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--stellar-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 42px rgba(20, 74, 64, 0.08);
}

.stellar-plan-card.pro {
  border-color: rgba(7, 94, 84, 0.45);
  box-shadow: 0 18px 52px rgba(7, 94, 84, 0.16);
}

.stellar-recommended {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--stellar-green-dark);
  background: var(--stellar-mint);
  font-size: 11px;
  font-weight: 800;
}

.stellar-plan-card h2 {
  margin: 0;
  font-size: 22px;
}

.stellar-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 18px 0 6px;
}

.stellar-price strong {
  font-size: 42px;
  letter-spacing: -0.04em;
}

.stellar-price span,
.stellar-plan-note,
.stellar-account-status,
.stellar-legal {
  color: var(--stellar-muted);
}

.stellar-admin-page {
  width: min(1320px, calc(100% - 32px));
}

.stellar-admin-nav-actions,
.stellar-admin-header,
.stellar-admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.stellar-admin-nav-actions {
  gap: 20px;
}

.stellar-admin-header {
  align-items: flex-end;
  margin: 58px 0 28px;
}

.stellar-admin-header h1 {
  margin: 9px 0 8px;
  font-size: clamp(34px, 5vw, 52px);
  letter-spacing: -0.04em;
}

.stellar-admin-header p,
.stellar-admin-panel-head p {
  margin: 0;
  color: var(--stellar-muted);
  line-height: 1.65;
}

.stellar-accounting-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stellar-accounting-grid article,
.stellar-admin-panel {
  border: 1px solid var(--stellar-line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 42px rgba(20, 74, 64, 0.07);
}

.stellar-accounting-grid article {
  display: grid;
  gap: 8px;
  padding: 20px;
  border-radius: 18px;
}

.stellar-accounting-grid span,
.stellar-accounting-grid small {
  color: var(--stellar-muted);
}

.stellar-accounting-grid strong {
  font-size: 30px;
  letter-spacing: -0.035em;
}

.stellar-admin-panel {
  margin-top: 18px;
  padding: 24px;
  border-radius: 22px;
}

.stellar-admin-panel-head h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.stellar-issue-form {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1fr 2.2fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 20px;
}

.stellar-support-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 20px;
}

.stellar-support-form label {
  display: grid;
  gap: 7px;
  color: var(--stellar-muted);
  font-size: 12px;
  font-weight: 700;
}

.stellar-support-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(15, 72, 62, 0.2);
  border-radius: 10px;
  color: var(--stellar-ink);
  background: #fff;
  font: inherit;
}

.stellar-support-form .stellar-plan-button {
  min-width: 140px;
  white-space: nowrap;
}

.stellar-issue-form label {
  display: grid;
  gap: 7px;
  color: var(--stellar-muted);
  font-size: 12px;
  font-weight: 700;
}

.stellar-issue-form input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(15, 72, 62, 0.2);
  border-radius: 10px;
  color: var(--stellar-ink);
  background: #fff;
  font: inherit;
}

.stellar-issue-form input[disabled] {
  color: var(--stellar-muted);
  background: #f2f5f4;
}

.stellar-issue-form .stellar-plan-button {
  min-width: 130px;
  white-space: nowrap;
}

.stellar-admin-status {
  min-height: 20px;
  margin-top: 13px;
  color: var(--stellar-muted);
  font-size: 13px;
}

.stellar-admin-status.error {
  color: #a6311e;
}

.stellar-admin-status.success {
  color: var(--stellar-green);
}

.stellar-code-table-wrap {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--stellar-line);
  border-radius: 14px;
}

.stellar-code-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.stellar-code-table th {
  color: var(--stellar-muted);
  background: #f5f8f7;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.stellar-code-table tbody tr:last-child td {
  border-bottom: 0;
}

.stellar-code-mask {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 750;
  white-space: nowrap;
}

.stellar-code-note {
  max-width: 250px;
  overflow-wrap: anywhere;
}

.stellar-code-status {
  color: #766000;
  font-weight: 750;
  white-space: nowrap;
}

.stellar-code-status.redeemed {
  color: var(--stellar-green);
}

.stellar-code-status.expired,
.stellar-code-status.revoked {
  color: #9a3b2a;
}

.stellar-table-action {
  padding: 7px 10px;
  border: 1px solid rgba(7, 94, 84, 0.22);
  border-radius: 8px;
  color: var(--stellar-green);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.stellar-table-action:not([disabled]):hover {
  color: #fff;
  background: var(--stellar-green);
}

.stellar-empty-row {
  padding: 34px !important;
  color: var(--stellar-muted);
  text-align: center !important;
}

.stellar-clipboard-fallback {
  position: fixed;
  left: -10000px;
  top: -10000px;
  opacity: 0;
}

.stellar-benefits {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 24px 0 28px;
  list-style: none;
}

.stellar-benefits li {
  position: relative;
  padding-left: 25px;
  line-height: 1.5;
}

.stellar-benefits li::before {
  position: absolute;
  left: 0;
  content: "✓";
  color: var(--stellar-green);
  font-weight: 900;
}

.stellar-plan-card .stellar-plan-button {
  width: 100%;
}

.stellar-account-status {
  min-height: 24px;
  max-width: 820px;
  margin: 18px auto 0;
  text-align: center;
  font-size: 13px;
}

.stellar-account-status.error {
  color: #a6311e;
}

.stellar-upgrade-usage {
  max-width: 820px;
  margin: 16px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--stellar-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(20, 74, 64, 0.07);
}

.stellar-upgrade-usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--stellar-muted);
  font-size: 13px;
}

.stellar-upgrade-usage-row strong {
  color: var(--stellar-ink);
}

.stellar-upgrade-reset {
  margin-top: 8px;
  color: var(--stellar-muted);
  font-size: 11px;
  text-align: right;
}

.stellar-legal {
  max-width: 760px;
  margin: 26px auto 0;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 767px) {
  #stellar-membership-widget {
    width: auto;
  }

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

  .stellar-upgrade-hero {
    margin-top: 44px;
  }

  .stellar-support-actions,
  .stellar-support-contact-actions {
    grid-template-columns: 1fr;
  }

  .stellar-admin-header,
  .stellar-admin-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stellar-admin-header {
    margin-top: 42px;
  }

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

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

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

  .stellar-admin-nav-actions {
    gap: 12px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .stellar-accounting-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: dark) {
  #stellar-membership-widget {
    --stellar-surface: rgba(24, 31, 29, 0.94);
    --stellar-ink: #edf7f4;
    --stellar-muted: #a5b6b1;
    --stellar-line: rgba(195, 229, 220, 0.16);
  }

  .stellar-membership-sidebar-action {
    color: #bdeee2;
    border-color: rgba(146, 225, 206, 0.15);
    background: rgba(24, 126, 105, 0.13);
  }

  .stellar-membership-support-action {
    color: #bdeee2;
    border-color: rgba(146, 225, 206, 0.2);
    background: rgba(255, 255, 255, 0.04);
  }
}
