:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f8fb;
  color: #171c2a;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f9fbfd;
  --line: #dce4ee;
  --line-strong: #c5d0df;
  --ink: #171c2a;
  --muted: #65758b;
  --blue: #245fe0;
  --blue-dark: #1748ad;
  --cyan: #0798b8;
  --green: #21835b;
  --coral: #e15c48;
  --amber: #b36b00;
  --red: #b33a2b;
  --shadow: 0 20px 60px rgba(28, 39, 64, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eef5ff 0%, #f8fbff 520px, var(--bg) 100%),
    var(--bg);
}

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

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

main,
.site-header {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 20px;
  background: rgba(246, 248, 251, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 850;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #171c2a;
  color: #ffffff;
  font-size: 16px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #3b4d65;
  font-size: 14px;
  font-weight: 760;
}

.site-nav a {
  padding: 8px 0;
}

.locale-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.72);
}

.locale-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 5px 9px;
  background: transparent;
  color: #3b4d65;
  font-size: 12px;
  font-weight: 850;
}

.locale-switch button.active {
  background: #172033;
  color: #ffffff;
}

.public-shell {
  display: grid;
  gap: 52px;
  padding-bottom: 56px;
}

.trial-banner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  margin-top: 22px;
  padding: 17px 20px;
  border: 1px solid #cbd9ed;
  border-radius: 10px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 255, 0.94)),
    var(--surface);
  box-shadow: 0 14px 36px rgba(32, 72, 122, 0.08);
}

.trial-banner::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #245fe0, #08a5bb);
  content: "";
}

.trial-banner-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.trial-banner-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 12px;
  row-gap: 2px;
}

.trial-banner-copy .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 1px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.trial-banner-copy strong {
  font-size: 17px;
  letter-spacing: 0;
}

.trial-banner-copy span:not(.eyebrow) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.trial-banner-action {
  position: relative;
  z-index: 1;
  min-height: 38px;
  border: 1px solid #b9cbe6;
  border-radius: 7px;
  padding: 8px 15px;
  background: #ffffff;
  color: #1748ad;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 46px;
  align-items: center;
  min-height: min(500px, calc(100vh - 190px));
  padding: 18px 0 34px;
}

.hero-copy {
  max-width: 660px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #27627a;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 20px;
  max-width: 760px;
  font-size: clamp(46px, 5.6vw, 74px);
  line-height: 1.02;
  letter-spacing: 0;
}

.title-line {
  display: block;
}

html[lang="zh-CN"] .title-line {
  white-space: nowrap;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.lead {
  max-width: 620px;
  color: #495c74;
  font-size: 19px;
  line-height: 1.75;
}

.hero-promise {
  max-width: 620px;
  margin-top: 26px;
  padding: 18px 0 17px;
  border-top: 1px solid #cbd8e8;
  border-bottom: 1px solid #cbd8e8;
}

.hero-promise-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.promise-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #19795a;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.promise-status span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ca06e;
  box-shadow: 0 0 0 4px rgba(44, 160, 110, 0.12);
}

.promise-label {
  color: #71839a;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-promise > strong {
  display: block;
  color: #172033;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.2;
}

.hero-promise > p {
  max-width: 540px;
  margin: 9px 0 15px;
  color: #536780;
  font-size: 15px;
  line-height: 1.65;
}

.promise-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #27627a;
  font-size: 12px;
  font-weight: 800;
}

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

.promise-points span::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #0798b8;
  content: "";
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--blue-dark);
  border-radius: 7px;
  padding: 10px 18px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 820;
  cursor: pointer;
}

.secondary-link,
button.secondary {
  border-color: var(--line-strong);
  background: #ffffff;
  color: #24364d;
}

button.danger {
  border-color: #d6aaa2;
  color: var(--red);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.device-showcase {
  position: relative;
  min-height: 450px;
  padding: 24px 0 24px;
}

.browser-window {
  overflow: hidden;
  border: 1px solid rgba(150, 167, 190, 0.42);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.window-bar {
  display: flex;
  gap: 7px;
  height: 34px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid #e7edf4;
  background: #f9fbfe;
}

.window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d2dbe7;
}

.window-bar span:first-child {
  background: var(--coral);
}

.window-bar span:nth-child(2) {
  background: #efb84a;
}

.window-bar span:nth-child(3) {
  background: var(--green);
}

.app-preview {
  display: grid;
  grid-template-columns: 146px minmax(0, 1fr);
  min-height: 330px;
}

.app-preview aside {
  display: grid;
  align-content: start;
  gap: 12px;
  border-right: 1px solid #e7edf4;
  padding: 22px 18px;
  color: #4e5f75;
  font-size: 13px;
  font-weight: 780;
  background: #f7fafc;
}

.active-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  background: #e9f2ff;
  color: var(--blue-dark);
}

.app-preview section {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 26px;
  background:
    linear-gradient(135deg, rgba(36, 95, 224, 0.08), transparent 48%),
    linear-gradient(225deg, rgba(7, 152, 184, 0.08), transparent 45%),
    #ffffff;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview-head small,
.preview-grid small,
.download-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

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

.preview-switch {
  width: 66px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 4px;
  background: var(--green);
}

.preview-switch::after {
  content: "";
  display: block;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border-radius: 50%;
  background: #ffffff;
}

.speed-line {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.speed-line span {
  display: block;
  width: 82%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
}

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

.preview-grid div {
  min-height: 86px;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.preview-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
}

.phone-window {
  position: absolute;
  right: 18px;
  bottom: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  width: 138px;
  height: 246px;
  border: 1px solid rgba(150, 167, 190, 0.46);
  border-radius: 22px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(28, 39, 64, 0.16);
}

.phone-window > span {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: #d2dbe7;
}

.phone-window strong {
  margin-top: 26px;
  font-size: 20px;
}

.phone-window small {
  color: var(--green);
  font-weight: 850;
}

.phone-ring {
  width: 92px;
  height: 92px;
  margin: 30px 0 18px;
  border: 12px solid #e8eef6;
  border-top-color: var(--blue);
  border-right-color: var(--cyan);
  border-radius: 50%;
}

.feature-section,
.public-plans-section,
.download-section,
.auth-section {
  padding: 24px 0;
}

.auth-section {
  display: grid;
  align-content: center;
  gap: 22px;
  min-height: calc(100vh - 120px);
  padding: 44px 0 64px;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 22px;
}

.center-heading {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.feature-grid,
.guide-grid,
.plan-grid,
.public-plan-grid,
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.public-plan-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.download-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.feature-card,
.guide-item,
.plan-card,
.public-plan-card,
.metric,
.item,
.download-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.public-plan-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-height: 210px;
  padding: 18px;
}

.public-plan-card > div {
  display: grid;
  gap: 8px;
}

.public-plan-card strong {
  color: var(--ink);
  font-size: 22px;
}

.public-plan-card span {
  color: var(--teal);
  font-size: 28px;
  font-weight: 900;
}

.public-plan-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
  list-style: none;
}

.public-plan-card .plan-benefit,
.plan-card .plan-benefit {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #dbe9f2;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f5fbfd;
  color: #27627a;
  font-size: 13px;
  font-weight: 760;
}

.public-plan-card .button-link {
  width: 100%;
  justify-content: center;
}

.custom-plan-card {
  border-color: rgba(31, 126, 154, 0.32);
  background:
    linear-gradient(135deg, rgba(31, 126, 154, 0.08), rgba(255, 255, 255, 0) 48%),
    var(--surface);
}

.custom-plan-card > div span,
.custom-plan-card > div > span {
  color: #1f7e9a;
}

.custom-plan-card .button-link {
  width: 100%;
  justify-content: center;
}

.public-plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.muted-card {
  min-height: auto;
  color: var(--muted);
}

.feature-card {
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 20px;
}

.large-feature {
  grid-column: span 2;
}

.feature-index {
  color: var(--coral);
  font-size: 13px;
  font-weight: 900;
}

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

.feature-card p,
.guide-item span {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.product-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 95, 224, 0.09), transparent 42%),
    linear-gradient(225deg, rgba(33, 131, 91, 0.08), transparent 44%),
    #ffffff;
  box-shadow: var(--shadow);
}

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

.platform-chip {
  min-height: 92px;
  border: 1px solid #dce4ee;
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.8);
  color: #233149;
  font-size: 19px;
  font-weight: 850;
}

.download-grid {
  align-items: stretch;
}

.download-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 230px;
  padding: 20px;
}

.download-card strong {
  font-size: 23px;
}

.download-card span {
  color: var(--muted);
}

.download-note {
  max-width: 780px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.download-help {
  margin-top: 16px;
}

.download-help a,
.guide-item a {
  color: var(--blue-dark);
  font-weight: 850;
}

.download-card .button-link {
  width: fit-content;
  margin-top: auto;
}

.doc-shell {
  display: grid;
  gap: 34px;
  padding-bottom: 52px;
}

.install-shell {
  gap: 28px;
}

.doc-hero {
  max-width: 920px;
  padding: 34px 0 8px;
}

.install-hero {
  max-width: 980px;
  padding-bottom: 0;
}

.doc-hero h1 {
  max-width: 860px;
}

.install-hero h1 {
  max-width: 900px;
}

.install-packages-section {
  border: 0;
  padding: 4px 0 0;
  background: transparent;
}

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

.dashboard-download-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.install-package-card {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 18px 46px rgba(37, 50, 76, 0.08);
}

.install-package-card > div {
  display: grid;
  gap: 10px;
}

.install-package-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
}

.install-package-card p {
  margin: 0;
  color: #56677e;
  line-height: 1.65;
}

.install-package-card .button-link {
  width: 100%;
  justify-content: center;
}

.install-package-card.primary-download h3 {
  color: #ffffff;
}

.install-package-card.primary-download p {
  color: rgba(255, 255, 255, 0.78);
}

.install-package-card.primary-download .feature-index {
  color: #b7c6d8;
}

.install-package-card.primary-download .button-link {
  border-color: #ffffff;
  background: #ffffff;
  color: #172033;
}

.install-flow,
.platform-guide-list {
  display: grid;
  gap: 14px;
}

.install-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-install-flow {
  margin-top: 12px;
}

.install-flow div,
.platform-guide {
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-soft);
}

.install-flow strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
}

.install-flow span {
  color: var(--muted);
  line-height: 1.65;
}

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

.platform-guide h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 22px;
}

.platform-guide ol {
  margin: 0;
  padding-left: 20px;
}

.platform-guide li {
  color: #465870;
  line-height: 1.75;
}

.platform-guide code {
  border-radius: 6px;
  padding: 2px 5px;
  background: #eef3fa;
  color: #22334c;
  font-size: 0.92em;
}

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

.doc-card,
.doc-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.doc-card {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.doc-card h2,
.doc-section h2 {
  font-size: 30px;
}

.doc-card ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
  color: #364961;
  line-height: 1.65;
}

.doc-note {
  margin: 2px 0 0;
  border-left: 3px solid var(--cyan);
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.doc-section {
  padding: 26px;
}

.step-list,
.faq-list {
  display: grid;
  gap: 12px;
}

.step-list div,
.faq-list details {
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  padding: 15px;
  background: var(--surface-soft);
}

.step-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.step-list span,
.faq-list p {
  color: var(--muted);
  line-height: 1.65;
}

.faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer div,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer strong {
  color: var(--ink);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.site-footer a:hover {
  color: var(--blue-dark);
}

.legal-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 72px;
}

.legal-document {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 48px);
  background: var(--surface);
}

.legal-document h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.legal-document h2 {
  margin: 34px 0 12px;
  font-size: 22px;
}

.legal-document p,
.legal-document li {
  color: #405064;
  font-size: 16px;
  line-height: 1.85;
}

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

.legal-meta {
  color: var(--muted);
  font-weight: 800;
}

.auth-callback-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.auth-callback-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
}

.auth-callback-nav-link {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.76);
  color: #34445a;
  font-size: 14px;
  font-weight: 850;
}

.auth-callback-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(420px, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 124px);
}

.auth-callback-copy {
  display: grid;
  gap: 18px;
  max-width: 500px;
}

.auth-callback-copy h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 4.4vw, 60px);
  line-height: 1.04;
}

.auth-callback-copy p:not(.eyebrow) {
  margin: 0;
  color: #526176;
  font-size: 17px;
  line-height: 1.75;
}

.auth-callback-panel {
  width: 100%;
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  padding: clamp(24px, 4vw, 38px);
  background:
    linear-gradient(135deg, rgba(36, 95, 224, 0.075), transparent 42%),
    #ffffff;
  box-shadow: 0 26px 80px rgba(28, 39, 64, 0.12);
}

.auth-status-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.auth-status-header h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-status-mark {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #eff5ff;
  border: 1px solid #cddbf0;
}

.auth-status-mark::after {
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.auth-status-mark.is-processing::before {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(36, 95, 224, 0.22);
  border-top-color: var(--blue);
  border-radius: 50%;
  content: "";
  animation: auth-spin 0.9s linear infinite;
}

.auth-status-mark.is-ready::after {
  color: var(--blue);
  content: "?";
}

.auth-status-mark.is-success {
  background: var(--green);
  border-color: var(--green);
}

.auth-status-mark.is-success::after {
  content: "✓";
}

.auth-status-mark.is-error {
  background: var(--red);
  border-color: var(--red);
}

.auth-status-mark.is-error::after {
  content: "!";
}

.auth-callback-panel > .muted {
  margin: 18px 0 0;
  color: #5f6f84;
  font-size: 17px;
  line-height: 1.7;
}

.auth-callback-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 24px;
}

.auth-callback-steps span {
  height: 5px;
  border-radius: 999px;
  background: #e4ebf5;
}

.auth-callback-steps span.active {
  background: var(--blue);
}

.auth-callback-steps span.error {
  background: var(--red);
}

.auth-reset-form {
  margin-top: 24px;
}

.auth-callback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.error-text {
  color: var(--red);
  font-weight: 800;
}

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

.primary-download {
  background: #172033;
  color: #ffffff;
}

.primary-download small,
.primary-download span {
  color: #b7c6d8;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
  gap: 32px;
  padding: 28px;
  align-items: center;
}

.dashboard {
  width: min(1180px, calc(100% - 36px));
  margin: 24px auto 42px;
  padding: 22px;
}

.dashboard-shell {
  width: min(1200px, calc(100% - 40px));
  margin: 22px auto 56px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dashboard-brand {
  width: fit-content;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.account-panel,
.dashboard-main {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.account-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 16px;
  align-items: center;
  padding: 20px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(36, 95, 224, 0.08), transparent 42%),
    linear-gradient(225deg, rgba(7, 152, 184, 0.08), transparent 45%),
    #ffffff;
  color: var(--ink);
}

.account-panel .eyebrow {
  color: #27627a;
}

.account-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.account-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.account-panel h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.account-state-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.account-state-card button {
  width: 100%;
  margin-top: 6px;
}

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

.account-state-card strong {
  font-size: 28px;
}

.account-state-card small {
  color: var(--muted);
  line-height: 1.55;
}

.account-state-card strong[data-state="active"] {
  color: var(--green);
}

.account-state-card strong[data-state="expired"],
.account-state-card strong[data-state="locked"],
.account-state-card strong[data-state="traffic_exceeded"],
.account-state-card strong[data-state="device_limited"] {
  color: var(--red);
}

.dashboard-main {
  min-width: 0;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-section-title h3 {
  font-size: 28px;
}

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

.primary-metric {
  background:
    linear-gradient(135deg, rgba(36, 95, 224, 0.08), transparent 46%),
    #ffffff;
}

.dashboard-hero {
  min-height: 92px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.hidden {
  display: none !important;
}

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

label {
  display: grid;
  gap: 8px;
  color: #344258;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(36, 95, 224, 0.24);
  outline-offset: 2px;
  border-color: var(--blue);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.actions,
.block-title,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dashboard-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 0;
  scrollbar-width: none;
}

.dashboard-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  border-color: var(--line);
  background: #f5f8fc;
  color: #33455e;
}

.tab-button.active {
  border-color: var(--blue-dark);
  background: var(--blue);
  color: #ffffff;
}

.tab-panel {
  display: none;
  padding-top: 14px;
}

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

.ai-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.ai-status-panel,
.ai-chat-panel {
  display: grid;
  gap: 12px;
}

.ai-chat-panel {
  min-width: 0;
}

.ai-conversation {
  display: grid;
  gap: 10px;
  min-height: 320px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfd;
}

.ai-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.ai-message {
  display: grid;
  gap: 7px;
  width: min(86%, 760px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
}

.ai-message.user {
  justify-self: end;
  border-color: rgba(36, 95, 224, 0.32);
  background: #edf4ff;
}

.ai-message strong {
  color: #33455e;
  font-size: 12px;
}

.ai-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #25364b;
  line-height: 1.65;
}

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

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

.metric {
  min-height: 112px;
  padding: 18px;
  background: #ffffff;
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 22px;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.metric strong[data-state="active"] {
  color: var(--green);
}

.metric strong[data-state="expired"],
.metric strong[data-state="locked"],
.metric strong[data-state="traffic_exceeded"],
.metric strong[data-state="device_limited"] {
  color: var(--red);
}

.block {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 22px;
}

.billing-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  border: 1px solid rgba(36, 95, 224, 0.18);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(36, 95, 224, 0.09), transparent 44%),
    #ffffff;
}

.billing-cta h3 {
  margin-bottom: 8px;
  font-size: 24px;
}

.billing-cta p:last-child {
  margin-bottom: 0;
}

.billing-cta .inline-actions {
  flex: 0 0 auto;
}

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

.plan-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-height: 230px;
  padding: 18px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.plan-card:hover {
  border-color: rgba(36, 95, 224, 0.42);
  box-shadow: 0 14px 36px rgba(28, 39, 64, 0.08);
  transform: translateY(-1px);
}

.plan-card-current {
  border-color: rgba(33, 131, 91, 0.5);
  background:
    linear-gradient(135deg, rgba(33, 131, 91, 0.08), transparent 42%),
    #ffffff;
}

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

.plan-card strong {
  margin-bottom: 8px;
  font-size: 17px;
}

.plan-card span {
  color: var(--blue);
  font-size: 23px;
  font-weight: 850;
}

.current-plan {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e6f5ec;
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.plan-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: #526176;
}

.plan-card .plan-benefit {
  margin-left: -18px;
  list-style: none;
}

.plan-period-picker {
  display: grid;
  gap: 7px;
}

.plan-period-picker span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.plan-period-picker select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--ink);
}

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

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

.item {
  display: grid;
  gap: 10px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(36, 95, 224, 0.035), transparent 40%),
    #ffffff;
}

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

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-input {
  width: 84px;
  min-height: 36px;
}

.inline-actions button,
.item-row > button {
  min-height: 36px;
  padding: 7px 12px;
}

.virtual-region-editor {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}

.virtual-region-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.virtual-region-rows {
  display: grid;
  gap: 8px;
}

.virtual-region-row {
  display: grid;
  grid-template-columns: 72px minmax(160px, 1fr) minmax(92px, 120px) minmax(92px, 120px);
  align-items: center;
  gap: 8px;
}

.virtual-region-index {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.virtual-region-row input {
  width: 100%;
  min-height: 36px;
}

@media (max-width: 720px) {
  .virtual-region-row {
    grid-template-columns: 1fr 1fr;
  }

  .virtual-region-index {
    grid-column: 1 / -1;
  }
}

.button-like {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  background: #fff;
}

.notification-unread {
  border-color: rgba(37, 99, 235, 0.24);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 44%),
    #ffffff;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef3fa;
  color: #233852;
  font-size: 12px;
  font-weight: 780;
}

.status-chip.active,
.status-chip.paid {
  background: #e6f5ec;
  color: var(--green);
}

.status-chip.revoked {
  background: #f8ebe8;
  color: var(--red);
}

.status-chip.pending {
  background: #fff5d8;
  color: var(--amber);
}

.subscription-link {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.subscription-link + .subscription-link {
  border-top: 1px solid #eef2f7;
}

.subscription-export-list {
  margin-top: 16px;
}

.fallback-note {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #dce5f0;
  background: #f8fafc;
}

.fallback-note strong {
  color: var(--ink);
  font-weight: 850;
}

.fallback-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.guide-item {
  display: grid;
  gap: 8px;
  min-height: 100px;
  padding: 14px;
  background: var(--surface-soft);
}

.guide-item strong,
.guide-item span {
  overflow-wrap: anywhere;
}

.mono {
  padding: 10px 12px;
  border-radius: 7px;
  background: #f0f5fb;
  color: #233852;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message {
  width: min(1180px, calc(100% - 36px));
  min-height: 24px;
  margin: 0 auto 24px;
  color: var(--red);
  font-weight: 700;
}

.small {
  font-size: 13px;
}

.admin-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.admin-shell .dashboard {
  width: auto;
  margin: 0;
}

.admin-shell h1 {
  margin-bottom: 14px;
  font-size: 34px;
  line-height: 1.15;
}

.admin-nav {
  margin: 8px 0 18px;
}

.admin-login-panel {
  max-width: 620px;
  margin: 18px auto 0;
}

.admin-login-panel .block-title {
  align-items: flex-start;
}

.admin-panel {
  display: none;
}

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

.admin-token-form,
.toolbar-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-test-user-form {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(160px, 0.6fr) auto;
  margin-top: 10px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 20px;
}

.compact-form {
  align-content: start;
}

.section-label {
  margin-top: 10px;
  color: #27627a;
  font-size: 13px;
  font-weight: 850;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: 18px;
  min-height: 18px;
}

@media (max-width: 980px) {
  .hero,
  .auth-panel,
  .auth-callback-hero,
  .product-story,
  .two-column,
  .ai-layout {
    grid-template-columns: 1fr;
  }

  .auth-callback-hero {
    align-content: center;
    gap: 26px;
  }

  .auth-callback-copy {
    max-width: 720px;
  }

  .opera-grid,
  .install-package-grid,
  .install-flow,
  .platform-guide-list,
  .public-plan-grid,
  .download-grid,
  .grid,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .large-feature {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  main,
  .site-header,
  .dashboard,
  .message {
    width: min(100% - 22px, 1180px);
  }

  .dashboard-shell {
    width: min(100% - 22px, 1180px);
    margin: 12px auto 28px;
  }

  .dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    min-height: 64px;
    margin: 0 -11px 12px;
    padding: 10px 11px;
    background: rgba(246, 248, 251, 0.9);
    backdrop-filter: blur(18px);
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .account-panel {
    position: static;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }

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

  .account-avatar {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }

  .account-panel h2 {
    font-size: 21px;
  }

  .account-state-card {
    padding: 14px;
  }

  .account-state-card strong {
    font-size: 26px;
  }

  .billing-cta {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .billing-cta h3 {
    font-size: 22px;
  }

  .dashboard-main {
    padding: 16px;
  }

  .dashboard-section-title {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-section-title h3 {
    font-size: 24px;
  }

  .dashboard-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0 -18px -2px;
    padding: 0 18px 2px;
    scrollbar-width: none;
  }

  .dashboard-tabs::-webkit-scrollbar {
    display: none;
  }

  .dashboard-tabs .tab-button {
    flex: 0 0 auto;
    width: auto;
    min-width: 58px;
    padding: 9px 12px;
    justify-content: center;
    white-space: nowrap;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    min-height: 0;
    padding: 10px 0;
  }

  .trial-banner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    margin-top: 12px;
    padding: 15px;
  }

  .trial-banner-copy {
    display: block;
  }

  .trial-banner-copy .eyebrow {
    margin-bottom: 4px;
  }

  .trial-banner-copy strong,
  .trial-banner-copy span:not(.eyebrow) {
    display: block;
  }

  .trial-banner-copy span:not(.eyebrow) {
    margin-top: 3px;
    font-size: 13px;
  }

  .trial-banner-action {
    grid-column: 2;
    justify-self: start;
  }

  .hero-promise-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .hero-promise > p {
    font-size: 14px;
  }

  .auth-callback-shell {
    width: min(100% - 22px, 1180px);
    padding: 14px 0 28px;
  }

  .auth-callback-nav {
    min-height: 54px;
  }

  .auth-callback-hero {
    min-height: calc(100vh - 96px);
  }

  .auth-callback-copy h1 {
    font-size: 32px;
    line-height: 1.12;
  }

  .auth-callback-copy p:not(.eyebrow) {
    font-size: 15px;
  }

  .auth-callback-panel {
    padding: 20px;
  }

  .auth-status-header {
    gap: 12px;
  }

  .auth-status-mark {
    width: 42px;
    height: 42px;
  }

  .auth-status-header h2 {
    font-size: 26px;
  }

  .auth-callback-panel > .muted {
    font-size: 15px;
  }

  .auth-callback-actions .button-link {
    width: 100%;
    justify-content: center;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    white-space: nowrap;
    font-size: 12px;
    scrollbar-width: none;
  }

  .site-nav a {
    flex: 0 0 auto;
    padding: 7px 0;
  }

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

  .hero {
    min-height: auto;
    padding: 24px 0 32px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 30px;
  }

  .lead {
    font-size: 17px;
  }

  .device-showcase {
    min-height: 238px;
    padding: 4px 0 12px;
  }

  .browser-window {
    max-height: 238px;
  }

  .app-preview {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .app-preview aside {
    display: none;
  }

  .app-preview section {
    gap: 14px;
    padding: 18px;
  }

  .preview-head strong {
    font-size: 26px;
  }

  .preview-grid,
  .doc-grid,
  .install-package-grid,
  .install-flow,
  .platform-guide-list,
  .feature-grid,
  .guide-grid,
  .plan-grid,
  .public-plan-grid,
  .download-grid,
  .grid,
  .overview-grid,
  .opera-grid,
  .client-stack {
    grid-template-columns: 1fr;
  }

  .ai-message {
    width: 100%;
  }

  .ai-conversation {
    min-height: 280px;
  }

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

  .device-showcase .preview-grid div {
    min-height: 72px;
    padding: 12px;
  }

  .device-showcase .preview-grid div:nth-child(n + 3) {
    display: none;
  }

  .device-showcase .preview-grid strong {
    font-size: 20px;
  }

  .large-feature {
    grid-column: auto;
  }

  .phone-window {
    display: none;
  }

  .product-story {
    padding: 24px;
  }

  .download-card .button-link {
    width: 100%;
  }

  .topbar,
  .block-title,
  .item-row,
  .site-footer,
  .site-footer div,
  .site-footer nav {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-token-form,
  .toolbar-form,
  .admin-test-user-form {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    width: 100%;
  }

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

  .locale-switch button {
    width: auto;
    padding-right: 7px;
    padding-left: 7px;
  }

  .dashboard-tabs .tab-button {
    width: auto;
  }

  .dashboard-topbar button {
    width: auto;
  }

  .metric,
  .plan-card,
  .item,
  .guide-item {
    min-height: auto;
  }

  .item-row {
    gap: 10px;
  }

  .inline-actions button,
  .item-row > button {
    width: 100%;
  }

  .subscription-link {
    gap: 10px;
  }

  .mono {
    max-height: 110px;
    overflow: auto;
  }
}

/* Referral card */
.referral-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  display: grid;
  gap: 14px;
  margin-top: 16px;
}
.referral-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.referral-code {
  display: block;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--teal);
}
.referral-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.referral-stats .metric {
  padding: 12px;
  display: grid;
  gap: 4px;
}
@media (max-width: 560px) {
  .referral-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Group buy */
.group-badge {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.group-panel {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.group-panel .group-members {
  font-weight: 700;
  color: var(--ink);
}
.group-join-card {
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

/* ============================================================
   Admin console refinements — feedback, loading, login, nav.
   Scoped to .admin-shell (plus body-level toast/progress hosts)
   so the public site is unaffected. Reuses existing tokens.
   ============================================================ */

/* Old bottom status line becomes an accessible-only mirror; the
   visible feedback is now the floating toast (see setMessage). */
#adminMessage {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Toast notifications */
.toast-host {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 650;
  font-size: 14px;
  line-height: 1.45;
  color: #fff;
  box-shadow: 0 14px 40px rgba(20, 30, 55, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  background: linear-gradient(135deg, #e2503c, var(--red));
}

.toast-success {
  background: linear-gradient(135deg, #23935f, var(--green));
}

/* Indeterminate top progress bar shown while setBusy(true) */
.admin-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 70;
  background: transparent;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.admin-progress.active {
  opacity: 1;
}

.admin-progress span {
  position: absolute;
  height: 100%;
  width: 40%;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  animation: adminProgressSlide 1.1s ease-in-out infinite;
}

@keyframes adminProgressSlide {
  0% { left: -42%; }
  60% { left: 100%; }
  100% { left: 100%; }
}

/* Login card polish */
.admin-shell .admin-login-panel {
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  flex: 1;
  padding-right: 64px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  width: auto;
  min-height: 30px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 650;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.password-toggle:hover {
  color: var(--blue);
  border-color: var(--line-strong);
}

/* Sticky, elevated nav with a clearer active pill */
.admin-shell .admin-nav {
  position: sticky;
  top: 8px;
  z-index: 6;
  padding: 8px;
  margin: 8px 0 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(28, 39, 64, 0.06);
}

.admin-shell .tab-button {
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  font-weight: 650;
}

.admin-shell .tab-button:hover:not(.active) {
  border-color: var(--line-strong);
  background: #eef3fb;
  color: var(--blue-dark);
}

.admin-shell .tab-button.active {
  box-shadow: 0 6px 16px rgba(36, 95, 224, 0.28);
}

.admin-shell .tab-button:active {
  transform: translateY(1px);
}

/* List item hover affordance for clickable rows */
.admin-shell .item {
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.admin-shell .item:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 26px rgba(28, 39, 64, 0.08);
}

/* Buttons: gentle press + disabled clarity while busy */
.admin-shell button:not(:disabled):active {
  transform: translateY(1px);
}

.admin-shell button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.admin-shell .block-title h3 {
  letter-spacing: -0.01em;
}

@media (max-width: 720px) {
  .toast-host {
    top: 10px;
  }
  .admin-shell .admin-nav {
    top: 4px;
  }
}

/* Activation dialog — register success / login blocked (email_not_verified).
   A blocking modal so the "check your email" instruction is actually seen,
   instead of a line at the bottom of the page. */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 26, 44, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.app-modal-overlay.show {
  opacity: 1;
}
.app-modal {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 26px 26px 22px;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}
.app-modal-overlay.show .app-modal {
  transform: translateY(0) scale(1);
}
.app-modal-overlay.tone-success .app-modal {
  border-top-color: var(--green);
}
.app-modal-overlay.tone-error .app-modal {
  border-top-color: var(--red);
}
.app-modal-title {
  margin: 0 0 10px;
  font-size: 1.14rem;
  font-weight: 820;
  color: var(--ink);
}
.app-modal-body {
  margin: 0 0 20px;
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--muted);
}
.app-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.app-modal-actions button {
  min-height: 42px;
}
@media (max-width: 480px) {
  .app-modal-actions {
    flex-direction: column-reverse;
  }
  .app-modal-actions button {
    width: 100%;
  }
}

/* Plan tier / group-buy editor — labeled number fields so admins can tell the
   team-size box from the discount box, with a live group-price preview. */
#planTierList .item-row {
  flex-wrap: wrap;
  align-items: flex-end;
  row-gap: 14px;
}
#planTierList .item-row > div:first-child {
  flex: 1 1 100%;
}
.inline-actions.group-config {
  align-items: flex-end;
  flex-wrap: wrap;
}
.labeled-field {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}
.labeled-field-caption {
  font-size: 0.78rem;
  font-weight: 720;
  color: var(--ink);
}
.labeled-field-hint {
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--muted);
}
.labeled-field .tier-input {
  width: 96px;
}
.group-preview {
  display: block;
  margin-top: 12px;
  font-weight: 600;
  color: var(--green);
}
.group-preview.is-off {
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 720px) {
  /* Keep the plan tier / group editor stacked on mobile — the #id rule above
     out-specifies the generic .item-row column rule, so restate it here. */
  #planTierList .item-row {
    flex-direction: column;
    align-items: stretch;
  }
  #planTierList .item-row > div:first-child {
    flex: none;
  }
  .inline-actions.group-config {
    width: 100%;
    align-items: stretch;
  }
  .inline-actions.group-config .labeled-field {
    width: 100%;
  }
  .labeled-field .tier-input {
    width: 100%;
  }
}

/* Subscription status badge in the admin user detail — the label reflects the
   real state derived from expire_at (enforcement is expire_at-based), not the
   stale stored status field. */
.sub-status {
  font-weight: 800;
}
.sub-status-active { color: var(--green); }
.sub-status-expired { color: var(--red); }
.sub-status-locked { color: var(--amber); }
.sub-status-other { color: var(--muted); }
.sub-expiry-overdue { color: var(--red); font-weight: 600; }
