:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #131419;
  --surface-alt: #0f1014;
  --card-start: #181a22;
  --card-end: #101115;
  --text: #e8ecf2;
  --muted: #aab2c0;
  --border: #1e2027;
  --accent: #c0c7d1;
  --accent-strong: #e2e6ed;
  --warm: #9fa8b8;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 18% -10%, rgba(192, 199, 209, 0.16), transparent 32rem),
    radial-gradient(circle at 100% 0%, rgba(159, 168, 184, 0.12), transparent 26rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 16px calc(86px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.88);
  border-bottom: 1px solid rgba(30, 32, 39, 0.72);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #05070b;
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand strong {
  font-size: 17px;
  line-height: 1.1;
}

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

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-main {
  display: grid;
  gap: 14px;
  width: min(100%, 680px);
  margin: 12px auto 0;
}

.hero-card,
.card,
.notice-card,
.article-body {
  border: 1px solid rgba(30, 32, 39, 0.92);
  background: linear-gradient(145deg, var(--card-start), var(--card-end));
  box-shadow: var(--shadow);
}

.hero-card,
.card,
.notice-card {
  border-radius: var(--radius);
  padding: 20px;
}

.hero-card h1,
.card h2,
.card h3,
.article-body h1,
.article-body h2,
.article-body h3 {
  margin: 0;
  letter-spacing: 0;
}

.hero-card h1 {
  font-size: clamp(27px, 9vw, 42px);
  line-height: 1.04;
}

.hero-card p,
.card p {
  margin: 8px 0 0;
}

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

.stack {
  display: grid;
  gap: 12px;
}

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

.metric {
  min-height: 94px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.progress {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress span {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--warm));
}

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

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid transparent;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  color: #05070b;
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.09);
}

.ghost-button {
  min-height: 38px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.danger-button {
  color: #fff;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
}

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

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

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

.field input {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  outline: none;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

.field input:focus {
  border-color: rgba(226, 230, 237, 0.58);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 5px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.tabs button {
  border: 0;
  border-radius: 12px;
  padding: 10px 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.tabs button.is-active {
  color: #05070b;
  background: var(--accent-strong);
}

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

.list-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.list-button strong {
  display: block;
  font-size: 16px;
}

.list-button small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-head p {
  margin-top: 6px;
}

.notice-list,
.plan-list,
.payment-list {
  display: grid;
  gap: 10px;
}

.notice-body {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.notice-body p {
  margin: 0 0 10px;
}

.notice-body p:last-child {
  margin-bottom: 0;
}

.plan-card,
.period-button,
.payment-button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  cursor: pointer;
}

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

.plan-card span,
.payment-button span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.plan-card strong,
.payment-button strong {
  font-size: 16px;
}

.plan-card small,
.payment-button small {
  color: var(--muted);
  font-size: 13px;
}

.plan-card b {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

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

.period-button {
  display: grid;
  gap: 6px;
  text-align: center;
}

.period-button span {
  color: var(--muted);
  font-size: 13px;
}

.period-button strong {
  font-size: 18px;
}

.plan-card.is-selected,
.period-button.is-selected,
.payment-button.is-selected {
  color: #05070b;
  background: var(--accent-strong);
  border-color: rgba(226, 230, 237, 0.88);
}

.plan-card.is-selected small,
.period-button.is-selected span,
.payment-button.is-selected small {
  color: rgba(5, 7, 11, 0.72);
}

.plan-card.is-selected b {
  color: #05070b;
}

.summary-box,
.inline-payment {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-box {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.coupon-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.summary-box span,
.summary-item small {
  color: var(--muted);
}

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

.summary-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-item strong {
  overflow-wrap: anywhere;
}

.inline-payment code {
  color: var(--accent-strong);
  overflow-wrap: anywhere;
}

.inline-payment a {
  color: var(--accent-strong);
}

.full-width {
  width: 100%;
}

.client-grid {
  display: grid;
  gap: 12px;
}

.client-card {
  display: grid;
  gap: 14px;
}

.client-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #05070b;
  background: linear-gradient(145deg, var(--accent-strong), var(--accent));
  font-size: 18px;
  font-weight: 850;
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.platform-row span {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
  font-weight: 750;
}

.client-section {
  display: grid;
  gap: 8px;
}

.client-section > strong {
  color: var(--text);
  font-size: 13px;
}

.button-row.compact {
  gap: 8px;
}

.button-row.compact .primary-button,
.button-row.compact .secondary-button {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 14px;
}

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

.client-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.client-note.is-success {
  color: #86efac;
}

.link-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.link-code {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.link-code strong {
  font-size: 14px;
}

.link-code code {
  color: var(--accent-strong);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.article-body {
  border-radius: var(--radius-sm);
  padding: 16px;
  color: #333;
  background: #fff;
}

.article-body :where(img, video) {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.article-body :where(a) {
  color: #1677ff;
}

.article-body :where(*) {
  max-width: 100%;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
}

.alert {
  border-radius: 16px;
  padding: 12px 14px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.success {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
}

.bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(12, 13, 17, 0.96);
  box-shadow: var(--shadow);
}

.nav-item {
  min-height: 42px;
  border: 0;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.nav-item.is-active {
  color: #05070b;
  background: var(--accent-strong);
}

.hidden {
  display: none !important;
}

@media (min-width: 720px) {
  .app-shell {
    padding-left: 28px;
    padding-right: 28px;
  }

  .topbar {
    margin-left: -28px;
    margin-right: -28px;
    padding-left: 28px;
    padding-right: 28px;
  }
}
