/*
 * NexSMS UI refine layer (2026-10-30, uiux1).
 * Loaded after every other stylesheet. Visual only: typography, colour, spacing,
 * header layout, overflow and contrast fixes. No element is hidden that carries
 * a business action, and the login telemetry / depth scene component is not styled here.
 */

:root {
  --ui-font: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  --ui-radius: 10px;
  --ui-ring: 0 0 0 3px rgba(56, 189, 248, .28);
}

body {
  font-family: var(--ui-font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Protected login telemetry / depth scene: keep its original font stack. */
.auth-telemetry,
.auth-depth-scene {
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
}

/* Buttons and controls never break a label into single characters. */
.btn,
.navbtn,
.pill,
.method-pill,
.service-tab,
.seg button,
.top-public-link {
  overflow-wrap: normal;
  word-break: keep-all;
}

:where(.btn, .navbtn, .method-pill, .service-tab, .pick-row, .seg button):focus-visible {
  outline: none;
  box-shadow: var(--ui-ring);
}

/* ------------------------------------------------------------------ */
/* 1. Brand-coloured service marks (workbench, CDK picker, directory)  */
/* ------------------------------------------------------------------ */

html body:not(.admin-view):not(.agent-view) .service-mark.service-logo {
  --tile: #1e293b;
  --glyph: #ffffff;
  display: grid;
  place-items: center;
  color: var(--glyph);
  border: 1px solid rgba(255, 255, 255, .10);
  background: var(--tile);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 4px 12px rgba(0, 0, 0, .16);
  filter: none;
}
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo svg {
  width: 62%;
  height: 62%;
  fill: currentColor;
  filter: none;
}
/* Light tiles carry a hairline so they stay defined on white panels. */
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.tile-light {
  border-color: rgba(15, 23, 42, .10);
}
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-openai { --tile: #0d0d0d; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-claude { --tile: #f5efe6; border-color: rgba(217, 119, 87, .25); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-google { --tile: #ffffff; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-amazon { --tile: #232f3e; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-amazon .amazon-smile { fill: #ff9900; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-cursor { --tile: #0b0b0b; --glyph: #f2f2f2; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-azure { --tile: #ffffff; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-whatsapp { --tile: #25d366; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-telegram { --tile: #ffffff; --glyph: #26a5e4; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-telegram svg { width: 74%; height: 74%; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-apple { --tile: #000000; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-line { --tile: #06c755; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-wechat { --tile: #07c160; --glyph: #fff; }
.service-mark.logo-facebook { color: #fff; background: #0866ff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-facebook { --tile: #0866ff; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-tiktokdouyin { --tile: #000000; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-tiktokdouyin svg { filter: drop-shadow(1px 1px 0 #fe2c55) drop-shadow(-1px -1px 0 #25f4ee); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-naturalbrain { --tile: linear-gradient(145deg, #a46bff, #6d36e0); --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-poe { --tile: #ffffff; --glyph: #1f1d2b; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-kimiai { --tile: #000000; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-lightningai { --tile: #ffffff; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-lightningai svg { width: 56%; height: 66%; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-suno { --tile: #000000; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-mistralai { --tile: #ffffff; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-perplexity { --tile: #0f2a2e; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-replit { --tile: #ffffff; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-aistudentpack { --tile: linear-gradient(145deg, #4f7be8, #233f86); --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-cloudchat { --tile: #e8f1ff; --glyph: #2f6fe0; border-color: rgba(47, 111, 224, .22); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-cloudchat svg path[stroke] { stroke: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-grammarly { --tile: #ffffff; --glyph: #15c39a; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-grammarly svg { width: 70%; height: 70%; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-microsoft { --tile: #ffffff; border-color: rgba(15, 23, 42, .10); }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-microsoftoffice365 { --tile: linear-gradient(145deg, #f2703a, #c9390a); --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-github { --tile: #24292f; --glyph: #fff; }
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-claude svg,
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-google svg,
html body:not(.admin-view):not(.agent-view) .service-mark.service-logo.logo-microsoft svg { width: 64%; height: 64%; }

/* Services without a logo get a readable coloured monogram instead of a grey block. */
html[data-theme] body:not(.admin-view):not(.agent-view) .service-mark.service-fallback,
html[data-theme] body:not(.admin-view):not(.agent-view) .directory-service-mark:not(.service-logo) {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .10);
  background: linear-gradient(145deg, #38bdf8, #2563eb);
  font-weight: 700;
}

/* Public directory marks reuse the same logos. */
html body:not(.admin-view):not(.agent-view) .directory-service-mark.service-mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 13px;
}
html body:not(.admin-view):not(.agent-view) .directory-service-mark.service-mark svg {
  width: 19px;
  height: 19px;
}
html body:not(.admin-view):not(.agent-view) .directory-service-mark.logo-google svg,
html body:not(.admin-view):not(.agent-view) .directory-service-mark.logo-microsoft svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ */
/* 2. Signed-in header                                                 */
/* ------------------------------------------------------------------ */

@media (min-width: 1181px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top > .brand {
    grid-column: 1;
    grid-row: 1;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions {
    display: contents;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-utility {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

/* The account group and utility controls share row 1 on wide screens. */
@media (min-width: 1181px) {
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group,
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-utility {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
}

html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn,
html body.user-view:not(.admin-view):not(.agent-view) .nav-utility .btn.secondary.navbtn {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}
html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn.active {
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* 3. Wallet, workbench and order details                              */
/* ------------------------------------------------------------------ */

html body .recharge-title {
  align-items: flex-start;
  gap: 14px;
}
html body .recharge-title > .pill {
  flex: 0 0 auto;
  white-space: nowrap;
  max-width: none;
}

html body .method-pill > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  min-width: 24px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1;
}
html body .method-pill > span svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html body .method-pill > b { white-space: nowrap; }

html body .bulk-copy-actions .btn {
  white-space: nowrap;
}
html body .bulk-copy-actions .btn span {
  white-space: nowrap;
}

/* Thin, visible scrollbars for the independent service / country panes. */
html body .service-list,
html body .country-list,
html body .directory-service-list,
html body .directory-country-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .45) transparent;
}
html body .service-list::-webkit-scrollbar,
html body .country-list::-webkit-scrollbar,
html body .directory-service-list::-webkit-scrollbar,
html body .directory-country-list::-webkit-scrollbar { width: 6px; height: 6px; }
html body .service-list::-webkit-scrollbar-thumb,
html body .country-list::-webkit-scrollbar-thumb,
html body .directory-service-list::-webkit-scrollbar-thumb,
html body .directory-country-list::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(148, 163, 184, .45); }

/* ------------------------------------------------------------------ */
/* 4. Light theme contrast                                             */
/* ------------------------------------------------------------------ */

html[data-theme="light"] body:not(.admin-view):not(.agent-view) .price-line {
  color: #047857;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .label,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .section-title .label {
  color: #0369a1;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .service-mark.service-logo {
  border-color: rgba(15, 23, 42, .08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 3px 10px rgba(15, 23, 42, .10);
}

/* ------------------------------------------------------------------ */
/* 5. Mobile signed-in header                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 760px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 10px 10px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top > .brand {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions {
    display: contents;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-utility {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    width: auto;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-utility .btn.secondary.navbtn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    flex: 0 0 36px;
    justify-content: center;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-utility .btn.secondary.navbtn > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-utility .nav-currency-picker {
    min-width: 0;
    width: auto;
    height: 36px;
    min-height: 36px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 6px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-pill {
    grid-column: auto;
    min-height: 40px;
    padding: 5px 8px;
    justify-content: flex-start;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-pill .account-icon {
    display: none;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-metric {
    min-height: 40px;
    padding: 5px 7px;
    justify-content: flex-start;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    grid-column: 1 / -1;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    overflow: visible;
    width: 100%;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 5px 2px;
    flex-direction: column;
    gap: 3px;
    font-size: 11.5px;
    line-height: 1.15;
    border-radius: 10px;
    text-align: center;
    white-space: normal;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn svg {
    width: 17px;
    height: 17px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn > span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body .active-bulkbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  html body .active-bulkbar .bulk-copy-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  html body .active-bulkbar .bulk-copy-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 8px;
    font-size: 12.5px;
    writing-mode: horizontal-tb;
  }
}

/* ------------------------------------------------------------------ */
/* 7. Public pages (pricing, FAQ, guides, comparison)                  */
/* ------------------------------------------------------------------ */

html body.public-page .public-hero > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
html body.public-page .public-hero .hero-actions {
  justify-content: flex-start;
  align-self: flex-start;
}
html body.public-page:not(.admin-view):not(.agent-view) .public-hero h1 {
  font-size: clamp(30px, 3.3vw, 46px);
  line-height: 1.1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
html body.public-page.pricing-page:not(.admin-view):not(.agent-view) .public-hero {
  padding: 26px 28px;
  min-height: 0;
}
html body.public-page .public-nav a,
html body.public-page .public-nav button {
  white-space: nowrap;
  font-weight: 600;
}
html body.public-page .public-nav a.primary {
  font-weight: 700;
}
html body.public-page .directory-service-copy,
html body.public-page .directory-country-copy {
  min-width: 0;
}
html body.public-page .directory-service-copy strong,
html body.public-page .directory-service-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  html body.public-page:not(.admin-view):not(.agent-view) .public-hero h1 {
    font-size: clamp(26px, 8vw, 34px);
  }
  html body.public-page.pricing-page:not(.admin-view):not(.agent-view) .public-hero {
    padding: 18px 16px;
  }
}

/* ------------------------------------------------------------------ */
/* 8. Signed-in header details                                         */
/* ------------------------------------------------------------------ */

@media (min-width: 761px) {
  html body.user-view:not(.admin-view):not(.agent-view) .nav-utility .btn.secondary.navbtn > span {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-utility .btn.secondary.navbtn {
    width: auto;
    padding-inline: 11px;
  }
}

@media (max-width: 760px) {
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr) minmax(0, 1.2fr);
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-metric .metric-icon {
    display: none;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-metric strong {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  html body.user-view.workbench-view:not(.admin-view):not(.agent-view) .country-tools {
    grid-template-columns: minmax(0, 1fr) 132px;
  }
}

/* ------------------------------------------------------------------ */
/* 10. Signed-out entry: readable small print and light-theme contrast */
/* ------------------------------------------------------------------ */

html body.auth-view .auth-card-foot small {
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
html[data-theme="light"] body.auth-view .auth-card-kicker {
  color: #0f766e;
}
html[data-theme="light"] body.auth-view .legal-line .linkbtn {
  color: #0f766e;
}
html[data-theme="light"] body.auth-view .legal-line .linkbtn:hover {
  color: #115e59;
}
html[data-theme="light"] body.auth-view .auth-card-foot small {
  color: #475569;
}

/* Scrollable service list in the entry directory: fade the cut edge so the
   last visible row reads as "more below" rather than a clipping bug. */
@media (min-width: 761px) {
  html body.auth-view .directory-service-list {
    padding-bottom: 28px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent);
  }
}

/* ------------------------------------------------------------------ */
/* 11. Public footers: one link per line (links ran together on FAQ,  */
/*     guides, comparison and English home)                            */
/* ------------------------------------------------------------------ */

html body .public-footer > div,
html body .seo-footer > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}
html body .public-footer strong,
html body .seo-footer strong {
  margin-bottom: 2px;
}
html body .public-footer a,
html body .seo-footer a {
  line-height: 1.45;
}

/* ------------------------------------------------------------------ */
/* 12. One accent for selected tabs inside the signed-in app           */
/* ------------------------------------------------------------------ */

html body.user-view:not(.admin-view):not(.agent-view) .seg.cdk-tabs button.active {
  color: #fff;
  border-color: transparent;
  background: var(--primary-bg);
  box-shadow: 0 6px 16px rgba(10, 132, 255, .22);
}


/* ------------------------------------------------------------------ */
/* 14. Unified header controls (signed-out entry, public pages, SEO    */
/*     articles and the signed-in app). One height, one radius, one    */
/*     type size. Order: currency, language, theme | log in, sign up.  */
/* ------------------------------------------------------------------ */

:root {
  --hc-h: 36px;
  --hc-r: 10px;
  --hc-text: #e6eef5;
  --hc-muted: #8fa1b3;
  --hc-line: rgba(148, 163, 184, .22);
  --hc-line-hover: rgba(115, 222, 205, .55);
  --hc-bg: rgba(255, 255, 255, .03);
  --hc-bg-hover: rgba(115, 222, 205, .08);
  --hc-cta-bg: #73decd;
  --hc-cta-text: #04241f;
}
html[data-theme="light"] {
  --hc-text: #1f2d3d;
  --hc-muted: #66788a;
  --hc-line: #d5dfe8;
  --hc-line-hover: #4fb3a4;
  --hc-bg: #ffffff;
  --hc-bg-hover: #f1f8f7;
  --hc-cta-bg: #0f8a78;
  --hc-cta-text: #ffffff;
}

/* Shared control look ------------------------------------------------ */
html body:not(.admin-view):not(.agent-view) .top .nav-utility #lang-toggle.navbtn,
html body:not(.admin-view):not(.agent-view) .top .nav-utility .theme-toggle.navbtn,
html body:not(.admin-view):not(.agent-view) .top .nav-utility .logout-btn.navbtn,
html body:not(.admin-view):not(.agent-view) .top .auth-public-account .auth-entry-link.secondary,
html body .public-nav-utility .public-lang-toggle,
html body .public-nav-utility .public-theme-toggle,
html body .public-nav-account .public-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  height: var(--hc-h);
  min-height: var(--hc-h);
  padding: 0 12px;
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-r);
  color: var(--hc-text);
  background: var(--hc-bg);
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
html body:not(.admin-view):not(.agent-view) .top .nav-utility #lang-toggle.navbtn:hover,
html body:not(.admin-view):not(.agent-view) .top .nav-utility .theme-toggle.navbtn:hover,
html body:not(.admin-view):not(.agent-view) .top .nav-utility .logout-btn.navbtn:hover,
html body:not(.admin-view):not(.agent-view) .top .auth-public-account .auth-entry-link.secondary:hover,
html body .public-nav-utility .public-lang-toggle:hover,
html body .public-nav-utility .public-theme-toggle:hover,
html body .public-nav-account .public-login-link:hover {
  border-color: var(--hc-line-hover);
  background: var(--hc-bg-hover);
  color: var(--hc-text);
  transform: none;
}
html body:not(.admin-view):not(.agent-view) .top .nav-utility svg,
html body .public-nav-utility svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Theme toggle is icon-only; the label stays available to screen readers. */
html body:not(.admin-view):not(.agent-view) .top .nav-utility .theme-toggle.navbtn,
html body .public-nav-utility .public-theme-toggle {
  width: var(--hc-h);
  min-width: var(--hc-h);
  padding: 0;
  flex: 0 0 var(--hc-h);
}
html body:not(.admin-view):not(.agent-view) .top .nav-utility .theme-toggle.navbtn > span,
html body .public-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Language switch shows both options; the active one is emphasised. */
html body .lang-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
}
html body .lang-switch-label b {
  color: var(--hc-muted);
  font-weight: 600;
}
html body .lang-switch-label b.on {
  color: var(--hc-text);
  font-weight: 700;
}
html body .lang-switch-label i {
  color: var(--hc-muted);
  font-style: normal;
  opacity: .55;
}

/* Currency picker matches the other controls. */
html body:not(.admin-view):not(.agent-view) .top .nav-utility .nav-currency-picker,
html body .public-nav-utility .public-currency-picker {
  height: var(--hc-h);
  min-height: var(--hc-h);
  width: auto;
  min-width: 88px;
  border-radius: var(--hc-r);
  border-color: var(--hc-line);
  color: var(--hc-text);
  background: var(--hc-bg);
}

/* Sign-up is the single filled call to action. */
html body:not(.admin-view):not(.agent-view) .top .auth-public-account .auth-entry-link:not(.secondary),
html body .public-nav-account a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--hc-h);
  min-height: var(--hc-h);
  padding: 0 16px;
  border: 1px solid var(--hc-cta-bg);
  border-radius: var(--hc-r);
  color: var(--hc-cta-text);
  background: var(--hc-cta-bg);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
html body:not(.admin-view):not(.agent-view) .top .auth-public-account .auth-entry-link:not(.secondary):hover,
html body .public-nav-account a.primary:hover {
  color: var(--hc-cta-text);
  filter: brightness(1.06);
  transform: none;
}

/* Group layout -------------------------------------------------------- */
html body.auth-view .top #top-actions .auth-public-controls,
html body .public-nav-controls,
html body .seo-nav-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
}
html body.auth-view .top #top-actions .auth-public-controls > .nav-currency-picker { order: 1; }
html body.auth-view .top #top-actions .auth-public-controls > #lang-toggle { order: 2; }
html body.auth-view .top #top-actions .auth-public-controls > .theme-toggle { order: 3; }
html body.auth-view .top #top-actions .auth-public-controls > .auth-public-account { order: 4; }
html body .public-nav-utility,
html body .public-nav-account,
html body.auth-view .top .auth-public-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
html body .public-nav-account,
html body.auth-view .top .auth-public-account {
  padding-left: 8px;
  border-left: 1px solid var(--hc-line);
}
html body.auth-view .top #top-actions .auth-public-controls .auth-entry-link {
  width: auto;
  min-width: 0;
}

/* Primary navigation links: quiet text links with a clear current state. */
html body .public-nav-main a,
html body .seo-nav-main a,
html body.auth-view .auth-public-nav .top-public-link {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--hc-muted);
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
html body .public-nav-main a:hover,
html body .seo-nav-main a:hover,
html body.auth-view .auth-public-nav .top-public-link:hover {
  color: var(--hc-text);
  background: var(--hc-bg-hover);
  border-color: transparent;
}
html body .public-nav-main a[aria-current="page"],
html body .seo-nav-main a[aria-current="page"] {
  color: var(--hc-text);
  background: var(--hc-bg-hover);
  border-color: var(--hc-line);
}
html body.auth-view .auth-public-nav .auth-public-country-toggle {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
}
html body.auth-view .auth-public-nav .auth-public-country-toggle > span {
  flex: none;
  white-space: nowrap;
}

/* Signed-in desktop: size utility buttons to their labels. */
@media (min-width: 761px) {
  html body.user-view:not(.admin-view):not(.agent-view) .nav-utility .logout-btn.navbtn > span,
  html body.user-view:not(.admin-view):not(.agent-view) .nav-utility #lang-toggle.navbtn > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
}

/* Phones -------------------------------------------------------------- */
@media (max-width: 760px) {
  /* Signed-out entry: brand + utilities, then full-width account row, then nav. */
  html body.auth-view .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 8px 6px;
    padding: 10px 14px;
  }
  html body.auth-view .top > .brand { grid-column: 1; grid-row: 1; justify-content: flex-start; min-width: 0; }
  html body.auth-view .top #top-actions,
  html body.auth-view .top #top-actions .auth-public-controls { display: contents; }
  html body.auth-view .top #top-actions .auth-public-controls > #lang-toggle { grid-column: 2; grid-row: 1; }
  html body.auth-view .top #top-actions .auth-public-controls > .nav-currency-picker { grid-column: 3; grid-row: 1; min-width: 78px; }
  html body.auth-view .top #top-actions .auth-public-controls > .theme-toggle { grid-column: 4; grid-row: 1; }
  html body.auth-view .top #top-actions .auth-public-controls > .auth-public-account {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-left: 0;
    border-left: 0;
  }
  html body.auth-view .top #top-actions .auth-public-controls .auth-entry-link {
    width: 100%;
    height: 40px;
    min-height: 40px;
    font-size: 14px;
  }
  html body.auth-view .top #top-actions > .auth-public-nav {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  html body.auth-view .top #top-actions .auth-public-controls > #lang-toggle,
  html body.auth-view .top #top-actions .auth-public-controls > .theme-toggle {
    width: auto;
    min-width: var(--hc-h);
    padding: 0 9px;
  }
  html body.auth-view .top #top-actions .auth-public-controls > .theme-toggle { width: var(--hc-h); padding: 0; }
  html body.auth-view .top #top-actions .auth-public-controls > #lang-toggle > svg { display: none; }

  /* Public pages and SEO articles: same three rows, header not sticky. */
  html body .public-header,
  html body .seo-top {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    gap: 10px 8px;
    align-items: center;
  }
  html body .public-header .public-brand,
  html body .seo-top .seo-brand { grid-column: 1; grid-row: 1; min-width: 0; }
  html body .public-nav-controls,
  html body .seo-nav-controls { display: contents; }
  html body .public-nav-utility { grid-column: 2; grid-row: 1; justify-self: end; }
  html body .public-nav-account {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 0;
    border-left: 0;
  }
  html body .public-nav-account a { width: 100%; height: 40px; min-height: 40px; font-size: 14px; }
  /* public-pages.css spans the sign-up link across the row; keep Log in | Sign up side by side. */
  html body .public-nav-account a.primary { grid-column: auto; }
  html body .public-nav-main,
  html body .seo-nav-main {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html body .public-nav-main::-webkit-scrollbar,
  html body .seo-nav-main::-webkit-scrollbar { display: none; }
  html body .public-nav-utility .public-lang-toggle { padding: 0 9px; }
  html body .public-nav-utility .public-lang-toggle > svg { display: none; }
  html body .public-brand small,
  html body .seo-brand small { display: none; }
}

/* SEO article pages get the same light theme as the directory pages. */
html[data-theme="light"] {
  --seo-bg: #f4f7f9;
  --seo-surface: #ffffff;
  --seo-surface-soft: #f2f6f8;
  --seo-line: rgba(15, 23, 42, .10);
  --seo-line-strong: rgba(15, 23, 42, .18);
  --seo-text: #152330;
  --seo-muted: #4b5f6b;
  --seo-faint: #6b7f8a;
  --seo-accent: #0f8a78;
  --seo-warning: #a8670f;
  --seo-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}
html[data-theme="light"]:has(.seo-shell) { color-scheme: light; }

/* Readable filled buttons: dark text on the light teal accent in dark mode. */
html body .seo-btn.primary,
html body .public-button.primary {
  color: var(--hc-cta-text);
  background: var(--hc-cta-bg);
  border-color: var(--hc-cta-bg);
}

/* Header control fixes: icon size, equal heights, visible language label on phones. */
html body:not(.admin-view):not(.agent-view) .top .nav-utility .theme-toggle.navbtn svg,
html body:not(.admin-view):not(.agent-view) .top .nav-utility #lang-toggle.navbtn svg,
html body .public-nav-utility .public-theme-toggle svg,
html body .public-nav-utility .public-lang-toggle svg {
  width: 17px;
  height: 17px;
  min-width: 17px;
}
@media (max-width: 760px) {
  html body.auth-view .top #top-actions .auth-public-controls > #lang-toggle > span.lang-switch-label {
    display: inline-flex;
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
  html body.auth-view .top #top-actions .auth-public-controls > #lang-toggle,
  html body.auth-view .top #top-actions .auth-public-controls > .theme-toggle,
  html body.auth-view .top #top-actions .auth-public-controls > .nav-currency-picker {
    height: var(--hc-h);
    min-height: var(--hc-h);
    max-height: var(--hc-h);
  }
}

/* ------------------------------------------------------------------ */
/* 15. Full names instead of ellipsis in pickers                       */
/* ------------------------------------------------------------------ */

/* Service tiles: name may use two lines; hint stays on one line. */
html body.user-view:not(.admin-view):not(.agent-view) .service-list .pick-row strong,
html body.user-view:not(.admin-view):not(.agent-view) .cdk-picker-list .pick-row strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.22;
  overflow-wrap: anywhere;
}
/* Country rows: long market names (e.g. "OpenAI · United States (physical, 3-5d)") wrap to two lines. */
html body.user-view:not(.admin-view):not(.agent-view) .country-list .pick-row strong,
html body.user-view:not(.admin-view):not(.agent-view) .country-list-mini .pick-row strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.25;
}
/* Phone entry directory: wider service chips so names and counts fit. */
@media (max-width: 760px) {
  html body.auth-view .directory-service-list .directory-service {
    min-width: 168px;
  }
}

/* ------------------------------------------------------------------ */
/* 16. Signed-in header on tablets (761-1180px)                        */
/* ------------------------------------------------------------------ */

@media (min-width: 761px) and (max-width: 1180px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    gap: 8px 10px;
    align-items: center;
    padding: 10px 16px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top > .brand { grid-column: 1; grid-row: 1; }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions { display: contents; }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-utility {
    grid-column: 3;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: end;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group .account-pill,
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group .account-metric {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster .btn.secondary.navbtn {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    padding: 0 12px;
  }
}

/* ------------------------------------------------------------------ */
/* 17. Public page heroes: content first, less empty space              */
/* ------------------------------------------------------------------ */

@media (min-width: 761px) {
  html body.public-page .guide-hero .guide-hero-copy,
  html body.public-page .faq-hero .guide-hero-copy {
    align-self: start;
    padding-top: 28px;
  }
  html body.public-page .guide-hero .public-hero-art,
  html body.public-page .faq-hero .public-hero-art {
    min-height: 0;
    max-height: 150px;
  }
  html body.public-page .guide-hero .public-hero-art img,
  html body.public-page .faq-hero .public-hero-art img {
    min-height: 0;
    max-height: 150px;
    object-position: center 42%;
  }
  html body.public-page .hero-index .preview-row {
    padding-top: 7px;
    padding-bottom: 7px;
  }
  html body.public-page.pricing-page .public-hero > div:first-child {
    align-self: center;
  }
}

/* SEO / guide articles: comfortable line length and calmer headings. */
html body .seo-main p,
html body .seo-main .seo-list,
html body.public-page .public-section.article p,
html body.public-page .public-section.article ol,
html body.public-page .public-section.article ul {
  max-width: 74ch;
}
html body .seo-main h1 {
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.02em;
}
html body .seo-main h2 {
  font-size: clamp(21px, 2.4vw, 28px);
}

/* Popular-services preview on public pricing pages shows brand logos. */
html body .preview-row:has(.preview-mark) {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 10px;
}
html body:not(.admin-view):not(.agent-view) .preview-row .service-mark.preview-mark {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
}
html body:not(.admin-view):not(.agent-view) .preview-row .service-mark.preview-mark svg {
  width: 18px;
  height: 18px;
}
@media (max-width: 760px) {
  html body .preview-row:has(.preview-mark) {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }
  html body .preview-row:has(.preview-mark) .preview-status {
    grid-column: 2 / -1;
    margin-top: -4px;
  }
}

/* Four workbench rule cards: never leave one orphan card on its own row. */
@container sms-market (min-width: 560px) and (max-width: 980px) {
  .workbench-rules:not(.cdk-rules) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (min-width: 761px) and (max-width: 1180px) {
  html body.user-view:not(.admin-view):not(.agent-view) .workbench-rules:not(.cdk-rules) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Settings page was 2px wider than the tablet viewport. */
@media (max-width: 1180px) {
  html body.user-view:not(.admin-view):not(.agent-view) .settings-page {
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
  }
}
html body.user-view:not(.admin-view):not(.agent-view) .workbench-rules .rule-card p {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* ------------------------------------------------------------------ */
/* 18. Currency switch (RMB / USD) replaces the native dropdown        */
/* ------------------------------------------------------------------ */

html body .public-currency-picker.currency-seg {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: auto;
  min-width: 0;
  height: var(--hc-h, 36px);
  min-height: var(--hc-h, 36px);
  padding: 3px;
  border: 1px solid var(--hc-line, rgba(148, 163, 184, .22));
  border-radius: var(--hc-r, 10px);
  background: var(--hc-bg, rgba(255, 255, 255, .03));
  cursor: default;
}
html body .public-currency-picker.currency-seg::after { display: none; }
html body .public-currency-picker.currency-seg > .public-currency-symbol { display: none; }
html body .public-currency-picker.currency-seg > select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
html body .currency-seg-buttons {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}
html body .currency-seg-buttons button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: var(--hc-muted, #8fa1b3);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
html body .currency-seg-buttons button b { font-weight: 700; }
html body .currency-seg-buttons button:hover { color: var(--hc-text, #e6eef5); }
html body .currency-seg-buttons button.on {
  color: var(--hc-cta-text, #04241f);
  background: var(--hc-cta-bg, #73decd);
}
html body .currency-seg-buttons button:focus-visible {
  outline: 2px solid var(--hc-cta-bg, #73decd);
  outline-offset: 1px;
}

/* Native dropdown menus follow the page theme instead of the OS default. */
html[data-theme="dark"] select { color-scheme: dark; }
html[data-theme="light"] select { color-scheme: light; }
html[data-theme="dark"] select option { color: #e6eef5; background: #121c24; }
html[data-theme="light"] select option { color: #1f2d3d; background: #ffffff; }

/* ------------------------------------------------------------------ */
/* 19. Pinned headers                                                  */
/* ------------------------------------------------------------------ */

html body.user-view:not(.admin-view):not(.agent-view) .top,
html body.auth-view .top,
html body .public-header,
html body .seo-top {
  position: sticky;
  top: 0;
  z-index: 60;
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
}
html body.user-view:not(.admin-view):not(.agent-view) .top,
html body.auth-view .top {
  background: color-mix(in srgb, var(--bg, #050608) 86%, transparent);
  border-bottom: 1px solid var(--line-soft, rgba(255, 255, 255, .08));
}
html body .public-header,
html body .seo-top {
  background: color-mix(in srgb, var(--public-bg, var(--seo-bg, #07090b)) 88%, transparent);
}
/* Public pages: header spans the viewport so content does not show at the sides. */
html body .public-header::before,
html body .seo-top::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background: inherit;
  border-bottom: 1px solid var(--public-line, var(--seo-line, rgba(184, 215, 211, .12)));
}

/* Phones: keep the header pinned but compact once the user scrolls. */
@media (max-width: 760px) {
  html body.user-view.ui-scrolled:not(.admin-view):not(.agent-view) #top-actions > .top-account-group { display: none; }
  html body.user-view.ui-scrolled:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    scrollbar-width: none;
  }
  html body.user-view.ui-scrolled:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 0 10px;
    flex-direction: row;
    font-size: 12.5px;
  }
  html body.auth-view.ui-scrolled .top #top-actions .auth-public-controls > .auth-public-account,
  html body.ui-scrolled .public-nav-account { display: none; }
}

/* ------------------------------------------------------------------ */
/* 20. Help-centre layout for Guides and FAQ                           */
/*     Compact hero, sticky table of contents, 760px reading column.  */
/* ------------------------------------------------------------------ */

html body.doc-page .doc-hero {
  padding: 44px 0 28px;
  border-bottom: 1px solid var(--public-line);
  margin-bottom: 36px;
}
html body.doc-page .doc-hero .eyebrow {
  color: var(--public-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
html body.doc-page .doc-hero h1 {
  margin: 10px 0 6px;
  color: var(--public-text);
  font-size: clamp(30px, 3.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -.01em;
}
html body.doc-page .doc-hero .hero-title-note {
  margin: 0 0 8px;
  color: var(--public-accent);
  font-size: 16px;
  font-weight: 600;
}
html body.doc-page .doc-hero .lead {
  max-width: 640px;
  margin: 0;
  color: var(--public-muted);
  font-size: 15.5px;
  line-height: 1.65;
}
html body.doc-page .doc-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  height: 50px;
  margin-top: 22px;
  padding: 0 16px;
  border: 1px solid var(--public-line-strong);
  border-radius: 12px;
  background: var(--public-surface);
  box-shadow: var(--public-shadow);
}
html body.doc-page .doc-search:focus-within { border-color: var(--public-accent); }
html body.doc-page .doc-search svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--public-muted);
  stroke-width: 2;
  stroke-linecap: round;
}
html body.doc-page .doc-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--public-text);
  background: transparent;
  font: inherit;
  font-size: 15px;
}
html body.doc-page .doc-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
html body.doc-page .doc-topics a {
  padding: 7px 13px;
  border: 1px solid var(--public-line);
  border-radius: 999px;
  color: var(--public-text);
  background: var(--public-surface);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
html body.doc-page .doc-topics a:hover { border-color: var(--public-accent); color: var(--public-accent); }

html body.doc-page .doc-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
html body.doc-page .doc-toc {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
}
html body.doc-page .doc-toc-title {
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--public-faint);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
html body.doc-page .doc-toc-title:not(:first-child) { margin-top: 18px; }
html body.doc-page .doc-toc nav { display: grid; gap: 2px; }
html body.doc-page .doc-toc nav a {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--public-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
html body.doc-page .doc-toc nav a:hover { color: var(--public-text); background: var(--public-surface-soft); }
html body.doc-page .doc-toc nav a.active {
  color: var(--public-text);
  background: var(--public-accent-soft);
}
html body.doc-page .doc-toc nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--public-accent);
}
html body.doc-page .doc-toc-num {
  color: var(--public-accent);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
html body.doc-page .doc-toc-related a { flex-direction: column; gap: 2px; }
html body.doc-page .doc-toc-related a small { color: var(--public-faint); font-size: 11.5px; font-weight: 500; }
html body.doc-page .doc-toc-actions { margin-top: 18px; padding: 0 2px; }
html body.doc-page .doc-actions { display: grid; gap: 8px; }
html body.doc-page .doc-actions .public-button { justify-content: center; width: 100%; }

html body.doc-page .doc-body {
  min-width: 0;
  max-width: 780px;
}
html body.doc-page .doc-body > .public-section {
  margin: 0;
  padding: 0 0 36px;
  border: 0;
  background: none;
  box-shadow: none;
  scroll-margin-top: 104px;
}
html body.doc-page .doc-body > .public-section + .public-section {
  padding-top: 32px;
  border-top: 1px solid var(--public-line);
}
html body.doc-page .doc-body .section-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--public-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}
html body.doc-page .doc-body h2 {
  margin: 4px 0 12px;
  color: var(--public-text);
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.3;
}
html body.doc-page .doc-body h3 {
  margin: 24px 0 10px;
  color: var(--public-text);
  font-size: 16px;
}
html body.doc-page .doc-body p,
html body.doc-page .doc-body li {
  max-width: none;
  color: color-mix(in srgb, var(--public-text) 80%, transparent);
  font-size: 15px;
  line-height: 1.78;
}
html body.doc-page .doc-body ol {
  counter-reset: doc-step;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
html body.doc-page .doc-body ol > li {
  counter-increment: doc-step;
  position: relative;
  padding: 12px 14px 12px 52px;
  border: 1px solid var(--public-line);
  border-radius: 12px;
  background: var(--public-surface);
}
html body.doc-page .doc-body ol > li::before {
  content: counter(doc-step);
  position: absolute;
  left: 14px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--public-accent);
  background: var(--public-accent-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
html body.doc-page .doc-body ul { padding-left: 20px; }
html body.doc-page .doc-body ul li::marker { color: var(--public-accent); }
html body.doc-page .doc-body .callout {
  margin-top: 18px;
  padding: 14px 16px;
  border: 0;
  border-left: 3px solid var(--public-accent);
  border-radius: 10px;
  color: var(--public-text);
  background: var(--public-accent-soft);
  font-size: 14px;
  line-height: 1.7;
}
html body.doc-page .doc-body .guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
html body.doc-page .doc-body .guide-card {
  padding: 16px;
  border-radius: 12px;
  transition: border-color .15s ease, transform .15s ease;
}
html body.doc-page .doc-body .guide-card:hover { border-color: var(--public-accent); transform: translateY(-1px); }
html body.doc-page .doc-body .section-head {
  display: block;
  margin-bottom: 14px;
}
html body.doc-page .doc-body .section-head p { margin: 4px 0 0; }

/* FAQ inside the help-centre layout. */
html body.doc-page--faq .doc-body .faq-list {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 0;
}
html body.doc-page--faq .doc-body .faq-list .faq-group > h2 { margin: 4px 0 14px; }
html body.doc-page--faq .doc-body .faq-list details > summary { font-size: 15px; }
html body.doc-page--faq .doc-body .faq-list details > p { font-size: 14.5px; }
html body.doc-page .doc-empty {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px dashed var(--public-line-strong);
  border-radius: 12px;
  color: var(--public-muted);
  text-align: center;
}

/* Tablets and phones: one column; table of contents becomes a chip row. */
@media (max-width: 980px) {
  html body.doc-page .doc-layout { grid-template-columns: 1fr; gap: 20px; }
  html body.doc-page .doc-toc {
    position: static;
    display: block;
    max-height: none;
    overflow: visible;
  }
  html body.doc-page .doc-toc-title,
  html body.doc-page .doc-toc-related,
  html body.doc-page .doc-toc-actions { display: none; }
  html body.doc-page .doc-toc nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  html body.doc-page .doc-toc nav a {
    flex: 0 0 auto;
    padding: 7px 12px;
    border: 1px solid var(--public-line);
    border-radius: 999px;
    background: var(--public-surface);
    font-size: 13px;
    white-space: nowrap;
  }
  html body.doc-page .doc-toc nav a.active::before { display: none; }
  html body.doc-page .doc-body { max-width: none; }
  html body.doc-page--guides .doc-topics { display: none; }
}
@media (max-width: 640px) {
  html body.doc-page .doc-hero { padding: 26px 0 20px; margin-bottom: 20px; }
  html body.doc-page .doc-body .guide-grid { grid-template-columns: 1fr; }
  html body.doc-page .doc-body ol > li { padding-left: 48px; }
}

/* Countries dropdown on public pages. */
html body .public-country-menu { position: relative; display: inline-flex; }
html body .public-country-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--hc-muted);
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
html body .public-country-toggle:hover,
html body .public-country-toggle[aria-expanded="true"] { color: var(--hc-text); background: var(--hc-bg-hover); }
html body .public-country-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
html body .public-country-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 80;
  display: grid;
  gap: 12px;
  width: min(640px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--public-line-strong, var(--seo-line-strong));
  border-radius: 14px;
  background: var(--public-surface, var(--seo-surface));
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  transform: translateX(-50%);
}
html body .public-country-panel[hidden] { display: none; }
html body .public-country-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
html body .public-country-group { display: grid; gap: 4px; align-content: start; }
html body .public-country-group strong {
  color: var(--public-faint, var(--seo-faint));
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
}
html body .public-country-link {
  padding: 4px 0;
  color: var(--public-text, var(--seo-text));
  font-size: 13.5px;
  text-decoration: none;
}
html body .public-country-link:hover { color: var(--public-accent, var(--seo-accent)); }
html body .public-country-all {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--public-line, var(--seo-line));
  color: var(--public-accent, var(--seo-accent));
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
html body .public-country-loading { color: var(--public-muted, var(--seo-muted)); font-size: 13px; }
@media (max-width: 760px) {
  html body .public-country-panel { position: fixed; top: auto; left: 16px; right: 16px; width: auto; transform: none; margin-top: 8px; }
  html body .public-country-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------ */
/* 21. Less text, clearer structure in the signed-in app               */
/* ------------------------------------------------------------------ */

/* Settings: service unlock chips carry the brand logo. */
html body.user-view:not(.admin-view):not(.agent-view) .service-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
html body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  font-size: 12.5px;
  font-weight: 600;
}
html body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip .service-mark {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 7px;
  box-shadow: none;
}
html body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip .service-mark svg { width: 14px; height: 14px; }
html body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip em { font-style: normal; }
html body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip.locked { opacity: .55; }
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip { background: #fff; }
html body .settings-more { margin-top: 6px; }
html body .settings-more > summary {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
html body .settings-more > p { margin: 6px 0 0; }

/* Workbench rule cards: title + two lines; the full text stays in "Full rules". */
html body.user-view:not(.admin-view):not(.agent-view) .workbench-rules .rule-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Country rows always grow with their content; nothing is cut off at the bottom. */
html body.user-view:not(.admin-view):not(.agent-view) .country-list .pick-row,
html body.user-view:not(.admin-view):not(.agent-view) .country-list-mini .pick-row {
  height: auto;
  min-height: 58px;
  align-items: center;
  padding-top: 9px;
  padding-bottom: 9px;
}
html body.user-view:not(.admin-view):not(.agent-view) .country-list .pick-row small,
html body.user-view:not(.admin-view):not(.agent-view) .country-list-mini .pick-row small {
  display: block;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ */
/* 22. Public price directory: compare both price options per row      */
/* ------------------------------------------------------------------ */

html body .directory-country-list { max-height: 460px; gap: 2px; }
html body.auth-view .directory-country-list { max-height: 330px; }
html body .directory-country-head,
html body .directory-country.directory-country--prices {
  grid-template-columns: 34px minmax(0, 1fr) 92px 92px;
  gap: 10px;
}
html body .directory-country-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--public-line);
  color: var(--public-faint);
  background: var(--public-surface);
  font-size: 11.5px;
  font-weight: 700;
}
html body .directory-country-head span:nth-child(n+3) { text-align: right; }
html body .directory-country.directory-country--prices { min-height: 52px; padding: 7px 8px; }
html body .directory-price-cell {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
html body .directory-price-cell strong {
  color: var(--public-text);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}
html body .directory-price-cell small {
  color: var(--public-success, #14744c);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
html body .directory-price-cell.off strong,
html body .directory-price-cell.off small { color: var(--public-faint); }
html body .directory-country.directory-country--prices.active {
  border-color: var(--public-accent);
  box-shadow: inset 3px 0 0 var(--public-accent);
}
@media (max-width: 760px) {
  html body .directory-country-head,
  html body .directory-country.directory-country--prices {
    grid-template-columns: 30px minmax(0, 1fr) 70px 70px;
    gap: 6px;
  }
  html body .directory-price-cell strong { font-size: 12.5px; }
  html body .directory-price-cell small { font-size: 10px; }
}

/* Pricing page hero: compact, so the directory starts in the first screen. */
html body.public-page.pricing-page:not(.admin-view):not(.agent-view) .public-hero {
  padding: 22px 26px;
}
html body.public-page.pricing-page .public-hero h1 { font-size: clamp(28px, 3vw, 40px); }
html body.public-page.pricing-page .directory-preview .preview-row { padding-top: 6px; padding-bottom: 6px; }

/* ------------------------------------------------------------------ */
/* 23. Colour contrast fixes (measured: WCAG ratio per element)        */
/* ------------------------------------------------------------------ */

/* Primary blue: white text on #28b7ff measured 2.86:1. A deeper blue keeps
   the brand look and gives >= 3.5:1 for the bold button labels (both themes). */
:root,
html[data-theme="dark"],
html[data-theme="light"] {
  --primary-bg: linear-gradient(135deg, #0a6fe0, #1a8fe8);
}
html body.user-view:not(.admin-view):not(.agent-view) .btn:not(.secondary):not(.bad):not(.warn):not(.linkbtn),
html body.user-view:not(.admin-view):not(.agent-view) .service-tab.active,
html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn.active,
html body.user-view:not(.admin-view):not(.agent-view) .seg button.active,
html body.user-view:not(.admin-view):not(.agent-view) .order-tabs button.active,
html body.user-view:not(.admin-view):not(.agent-view) .settings-tabs button.active,
html body.user-view:not(.admin-view):not(.agent-view) .api-tabs button.active,
html body.user-view:not(.admin-view):not(.agent-view) .wallet-tab-btn.active,
html body.user-view:not(.admin-view):not(.agent-view) .cdk-service-tabs .service-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #0a6fe0, #1a8fe8);
  border-color: transparent;
}
html body:not(.admin-view):not(.agent-view) .btn.bad {
  color: #fff;
}

/* Light theme ----------------------------------------------------------- */
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .timer,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .timer.small {
  color: #0369a1;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .pill.warn {
  color: #92400e;
  border-color: #fcd34d;
  background: #fffbeb;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .pill.ok {
  color: #166534;
}

/* API Center: rate-limit cards, endpoint rows and response grids were dark
   translucent blocks on a white page. */
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .limit-list > div,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .endpoint-list > *,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .response-grid > div,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .rule-list > span,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .api-card {
  border-color: #dbe4ef;
  color: #182235;
  background: #f6f9fc;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .limit-list span,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .response-grid span,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .response-grid small,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .endpoint-list small,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .endpoint-list em {
  color: #526075;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .limit-list strong { color: #182235; }
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .endpoint-list b { color: #15803d; }
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .api-docs .codeblock,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .api-docs code,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .url-format code {
  color: #0f172a;
  background: #eef3f8;
  border-color: #dbe4ef;
}

/* Wallet ledger / history tables. */
html[data-theme="light"] body:not(.admin-view):not(.agent-view) table th {
  color: #526075;
  background: #f1f5f9;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) table td {
  color: #182235;
  background: #ffffff;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .empty {
  color: #526075;
  background: #f8fafc;
}

/* Wallet top-up rules: pale yellow text on a pale yellow box. */
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .refund-warning,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .wallet-rule {
  border-color: #fcd34d;
  background: #fffbeb;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .refund-warning strong,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .wallet-rule strong { color: #92400e; }
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .refund-warning span,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .wallet-rule span { color: #78350f; }

/* Store / Tools hero: slate text on a mid-blue gradient (2.55:1). */
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .market-hero {
  border-color: #dbe4ef;
  background: linear-gradient(135deg, #f3f8ff, #eaf3ff);
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .market-hero h2 { color: #0f172a; }
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .market-hero .label { color: #0369a1; }
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .market-hero .muted { color: #475569; }

/* Support widget (official entry): the panel stayed dark in the light theme. */
html[data-theme="light"] #support-widget .support-panel,
html[data-theme="light"] #support-widget .support-card {
  border-color: #dbe4ef;
  color: #182235;
  background: #ffffff;
}
html[data-theme="light"] #support-widget .support-head,
html[data-theme="light"] #support-widget .support-body { background: transparent; }
html[data-theme="light"] #support-widget .support-head strong,
html[data-theme="light"] #support-widget .support-card strong,
html[data-theme="light"] #support-widget .support-code strong { color: #0f172a; }
html[data-theme="light"] #support-widget .support-head p,
html[data-theme="light"] #support-widget .support-card p,
html[data-theme="light"] #support-widget .support-code span { color: #526075; }
html[data-theme="light"] #support-widget .support-tabs { background: #f1f5f9; }
html[data-theme="light"] #support-widget .support-tabs button { color: #526075; }
html[data-theme="light"] #support-widget .support-tabs button.active { color: #0f172a; background: #ffffff; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
html[data-theme="light"] #support-widget .support-secondary,
html[data-theme="light"] #support-widget .support-code {
  border-color: #dbe4ef;
  color: #182235;
  background: #f6f9fc;
}
html[data-theme="light"] #support-widget .support-fab {
  border-color: #dbe4ef;
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
}
html[data-theme="light"] #support-widget .support-fab b { color: #0f172a; }
html[data-theme="light"] #support-widget .support-fab small { color: #526075; }

/* ------------------------------------------------------------------ */
/* 24. Contrast fixes, round 2 (re-measured after section 23)          */
/* ------------------------------------------------------------------ */

/* Active nav tab / segmented tabs: the old gradient (#0a84ff -> #2bbbff) won on
   specificity. Same deeper blue, stronger selector. */
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn.active,
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .service-tabs .service-tab.active,
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .wallet-tabs .wallet-tab-btn.active,
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .api-tabs button.active,
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .settings-tabs button.active,
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .order-tabs button.active,
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .seg button.active {
  color: #fff;
  background: linear-gradient(135deg, #0a6fe0, #1a8fe8);
  border-color: transparent;
}
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn.active > span,
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn.active svg {
  color: #fff;
}

/* Public pages, light theme: faint and accent text measured 3.3-3.9:1 at 11-12px. */
html[data-theme="light"],
html:not([data-theme="dark"]) {
  --public-faint: #5d6d69;
  --public-accent: #0d7563;
}
html[data-theme="light"] body.auth-view {
  --entry-faint: #5d6d69;
}
html[data-theme="light"] body.auth-view .directory-service-copy small,
html[data-theme="light"] body.auth-view .directory-country-copy small,
html[data-theme="light"] body.auth-view .directory-pane-head span,
html[data-theme="light"] body.auth-view .preview-meta { color: #5d6d69; }
html[data-theme="light"] body.auth-view .section-label,
html[data-theme="light"] body.auth-view .directory-detail-unit { color: #0d7563; }
html[data-theme="light"] body.auth-view .legal-line label { color: #4b5d59; }
html[data-theme="light"] body.auth-view .auth-tabs button:not(.active) { color: #46594f; }

/* Settings chips: name had a leftover dark pill background; LV badge too pale. */
html body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip em {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
}
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .service-chip-list .service-chip b {
  color: #1d4ed8;
  background: #e0e9ff;
}

/* Store / Tools hero in light theme: the gradient sits on the page wrapper. */
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page .market-topbar,
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page .market-hero {
  background: linear-gradient(135deg, #f3f8ff, #eaf3ff);
  border-color: #dbe4ef;
}
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page .market-hero .label { color: #0369a1; }
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page .market-hero .muted { color: #475569; }
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page .market-hero h2 { color: #0f172a; }

/* API sample link block. */
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .url-format {
  border-color: #dbe4ef;
  background: #eef3f8;
}

/* ------------------------------------------------------------------ */
/* 25. Contrast fixes, round 3                                         */
/* ------------------------------------------------------------------ */

/* The light theme pins the old active-tab gradient with !important. */
html[data-theme] body.user-view:not(.admin-view):not(.agent-view) .top .actions .nav-cluster .btn.secondary.navbtn.active {
  color: #fff !important;
  background: linear-gradient(135deg, #0a6fe0, #1a8fe8) !important;
  border-color: transparent !important;
}

/* Signed-out login / register tabs: white text on light teal measured 1.6-2.1:1.
   The teal fill is pinned with !important in styles.css, so the label turns dark. */
html[data-theme] body.auth-view .auth-card .seg.auth-tabs button.active { color: #04241f !important; }
html[data-theme="dark"] body.auth-view .auth-card-foot small { color: #93aba6; }

/* Danger buttons: dark label on the bright dark-theme red, white on the light-theme red. */
html[data-theme="dark"] body.user-view:not(.admin-view):not(.agent-view) .btn.bad { color: #2a0505; }
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .btn.bad { color: #ffffff; }

/* SEO article pages: faint text in the light theme. */
html[data-theme="light"] { --seo-faint: #56676f; }

/* Store / Tools hero gradient lives on the section itself in the light theme. */
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page,
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page > .market-topbar,
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page .market-hero {
  background-image: none !important;
}
html[data-theme="light"] body.user-view:not(.admin-view):not(.agent-view) .market-page .market-hero {
  background-color: #f3f8ff !important;
  border: 1px solid #dbe4ef;
}

/* Invite page in the light theme. */
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-hero.card,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-card.card,
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-rule.card {
  border-color: #dbe4ef;
  color: #182235;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-hero.card :is(h1, h2, h3, strong),
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-card.card :is(h1, h2, h3, strong),
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-rule.card :is(h1, h2, h3, strong) { color: #0f172a; }
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-hero.card :is(p, small, span),
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-card.card :is(p, small, span),
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .invite-rule.card :is(p, small, span) { color: #475569; }

/* Invite page header: back link sat in the middle of the bar, underlined. */
body.invite-page .invite-top { gap: 10px; }
body.invite-page .invite-top > a.btn {
  margin-left: auto;
}
body.invite-page .invite-top a.btn,
body.invite-page .invite-actions a.btn { text-decoration: none; }
html[data-theme="light"] body.invite-page .invite-top {
  border-bottom-color: #e2e8f0;
  background: rgba(255, 255, 255, .88);
}
/* Phones and tablets: one header row (brand | back | language) instead of three. */
@media (max-width: 1100px) {
  html body.invite-page:not(.admin-view):not(.agent-view) .top.invite-top {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  body.invite-page .invite-top .brand { flex: 1 1 auto; min-width: 0; }
  body.invite-page .invite-top > a.btn,
  body.invite-page .invite-top > .lang-toggle {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    height: 36px;
    margin: 0;
    padding: 0 10px;
    font-size: 13px;
  }
  body.invite-page .invite-top > a.btn { margin-left: auto; }
}
html[data-theme="light"] body.invite-page .invite-stock { color: #166534; border-color: #86efac; background: #f0fdf4; }
html[data-theme="light"] body.invite-page .invite-stock.low { color: #92400e; border-color: #fcd34d; background: #fffbeb; }
html[data-theme="light"] body.invite-page .invite-stock.empty,
html[data-theme="light"] body.invite-page .invite-stock.inactive { color: #b42318; border-color: #fda29b; background: #fef3f2; }
html[data-theme="light"] body.invite-page .invite-hero .label { color: #0369a1; }

/* ------------------------------------------------------------------ */
/* 26. Phones: no ellipsis on the brand name or the country names      */
/* ------------------------------------------------------------------ */

/* "NexSMS 接码平台" was cut to "NexSMS ..." next to the header controls.
   Let it break at the space into two short lines instead. */
@media (max-width: 480px) {
  html body:not(.admin-view):not(.agent-view) .top .brand > div {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    word-break: keep-all;
    line-height: 1.15;
  }
}

/* Public price directory: two price columns left ~120px for the name, so
   "美国（实体卡）" lost its ending. Allow two lines. */
@media (max-width: 760px) {
  html body .directory-country-head,
  html body .directory-country.directory-country--prices {
    grid-template-columns: 30px minmax(0, 1fr) 64px 64px;
  }
  html body .directory-country.directory-country--prices .directory-country-copy strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

/* ------------------------------------------------------------------ */
/* 27. Currency switch sizing, workbench rule cards                    */
/* ------------------------------------------------------------------ */

/* The switch was squeezed to 96px, so "¥RMB" touched the pill edge. */
html body .public-currency-picker.currency-seg {
  flex: 0 0 auto;
  width: max-content !important;
  max-width: none;
}
html body .currency-seg-buttons button { flex: 0 0 auto; }

/* Signed-in app: the selected currency uses the app accent (blue), like the nav tabs. */
html body.user-view:not(.admin-view):not(.agent-view) .currency-seg-buttons button.on {
  color: #fff;
  background: linear-gradient(135deg, #0a6fe0, #1a8fe8);
}

/* Workbench rule cards held one line of text in a 72px box. */
html body.user-view:not(.admin-view):not(.agent-view) .workbench-rules .rule-card {
  min-height: 0;
  padding: 8px 12px;
}
html body.user-view:not(.admin-view):not(.agent-view) .workbench-rules .rule-card strong { margin-bottom: 2px; }

/* ------------------------------------------------------------------ */
/* 28. Phones: shorter Orders and CDK screens                          */
/* ------------------------------------------------------------------ */

/* Link-styled buttons ("打开兑换页") kept the browser underline. */
html body:not(.admin-view):not(.agent-view) a.btn { text-decoration: none; }

@media (max-width: 760px) {
  /* Orders: search field on its own row, Search and Clear side by side. */
  html body.user-view:not(.admin-view):not(.agent-view) #order-search-form.order-search-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #order-search-form.order-search-row > .input { grid-column: 1 / -1; }

  /* CDK: five counters in one row instead of five stacked cards. */
  html body.user-view:not(.admin-view):not(.agent-view) .cdk-stat-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .cdk-stat-strip > div {
    min-width: 0;
    padding: 8px 4px;
    text-align: center;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .cdk-stat-strip span {
    overflow: hidden;
    font-size: 10.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .cdk-stat-strip strong { font-size: 17px; }
}

/* API Center below 1120px: the five doc tabs stacked into five full-width rows. */
@media (max-width: 1120px) {
  html body.user-view:not(.admin-view):not(.agent-view) .api-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  html body.user-view:not(.admin-view):not(.agent-view) .api-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .api-tabs button {
    min-height: 40px;
    padding: 0 6px;
    font-size: 13px;
  }
  /* "下载 NEXAPI-EN.MD" broke onto two lines. */
  html body.user-view:not(.admin-view):not(.agent-view) .api-doc-download { width: 100%; }
  html body.user-view:not(.admin-view):not(.agent-view) .api-doc-download-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .api-doc-download-buttons .btn {
    width: 100%;
    min-width: 0;
    padding-right: 8px;
    padding-left: 8px;
    font-size: 12.5px;
    white-space: nowrap;
  }
}

/* Settings on phones: account on its own row, the three numbers share one
   row, and all four tabs fit (the last tab was cut off at "说"). */
@media (max-width: 760px) {
  html body.user-view:not(.admin-view):not(.agent-view) .settings-account-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .settings-account-strip > span {
    min-width: 0;
    padding: 8px 10px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .settings-account-strip > span:first-child { grid-column: 1 / -1; }
  html body.user-view:not(.admin-view):not(.agent-view) .settings-account-strip > span strong {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
    font-size: 13.5px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .settings-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .settings-tabs button {
    min-width: 0;
    padding: 0 4px;
    font-size: 13px;
    white-space: nowrap;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .settings-content :is(h3, strong, .muted) { overflow-wrap: anywhere; }
}

/* ------------------------------------------------------------------ */
/* 29. Orders table (desktop): English labels fit their columns        */
/* ------------------------------------------------------------------ */

/* "Waiting for SMS" ran into the Service column; "Received" broke as
   "Receiv / ed"; the four action buttons wrapped 2 + 1 + 1. */
@media (min-width: 901px) {
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) th:nth-child(1),
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) td:nth-child(1) { width: 112px; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) th:nth-child(5),
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) td:nth-child(5) { width: 78px; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) th:nth-child(8),
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) td:nth-child(8) { width: 236px; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) th {
    overflow-wrap: normal;
    word-break: keep-all;
    letter-spacing: .02em;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) td:nth-child(1) .pill {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) td:nth-child(8) .table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) td:nth-child(8) .table-actions .btn {
    min-width: 0;
    width: 100%;
    padding-right: 6px;
    padding-left: 6px;
    white-space: nowrap;
  }
}

/* Phones/tablets, SMS workbench: .shell had overflow:auto, which made it a
   scroll container, so the sticky header scrolled away with the page.
   clip keeps the horizontal guard without creating a scroll container. */
@media (max-width: 900px) {
  html body.workbench-view:not(.admin-view):not(.agent-view) .shell {
    overflow: visible;
    overflow-x: clip;
  }
}

/* ------------------------------------------------------------------ */
/* 30. Orders on phones: a real card instead of a stacked table row     */
/*     status | price, service | received, number, code | time, actions */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "status price"
      "service received"
      "number number"
      "code time"
      "actions actions";
    gap: 8px 12px;
    align-items: start;
    padding: 12px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td {
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(1) { grid-area: status; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(2) { grid-area: service; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(3) {
    grid-area: number;
    padding: 8px 0;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(4) { grid-area: code; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(5) {
    grid-area: received;
    text-align: right;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(5)::before {
    content: "已收 ";
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  html[lang="en"] body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(5)::before { content: "Received "; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(6) {
    grid-area: time;
    text-align: right;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(7) {
    grid-area: price;
    align-self: center;
    font-weight: 700;
    text-align: right;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(8) { grid-area: actions; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(8) .table-actions { gap: 6px; }
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(8) .table-actions .btn {
    width: 100%;
    min-width: 0;
  }
}
@media (min-width: 561px) and (max-width: 900px) {
  html body.user-view:not(.admin-view):not(.agent-view) .orders-table:not(.cdk-table) tr.order-summary-row:not(.compact-summary) > td:nth-child(8) .table-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------------ */
/* 31. Phones: Guides/FAQ were wider than the screen                    */
/* ------------------------------------------------------------------ */

/* The 1fr column took the width of the TOC chip row (497-648px on a
   390px phone). minmax(0, 1fr) lets the chip row scroll inside instead. */
@media (max-width: 980px) {
  html body.doc-page .doc-layout { grid-template-columns: minmax(0, 1fr); }
  html body.doc-page .doc-layout > * { min-width: 0; max-width: 100%; }
  html body.doc-page .doc-toc nav { max-width: 100%; overflow-x: auto; }
  /* ".doc-toc nav" outranked the hide rule for the related-links block. */
  html body.doc-page .doc-toc nav.doc-toc-related { display: none; }
}

/* The Countries toggle was squeezed to 35px inside the scrolling nav row. */
html body .public-nav-main > *,
html body .seo-nav-main > * { flex: 0 0 auto; }
html body .public-country-toggle { white-space: nowrap; }

/* ================================================================== */
/* 32. One header for every page (uiux3)                               */
/*     Measured before: the brand sat at x=18 on the home page and the  */
/*     app, but at x=130 (1440px) / x=370 (1920px) on public and SEO    */
/*     pages, and the bar was 62 / 72 / 67px tall depending on page.    */
/*     Now every header is full width, 64px tall, 20px side padding,    */
/*     brand left, links centred, controls right.                       */
/* ================================================================== */

/* Public and SEO shells: header full width, page content keeps its column. */
html body .public-shell,
html body .seo-shell {
  width: 100%;
  max-width: none;
  margin: 0;
}
html body .public-shell > :not(.public-header),
html body .seo-shell > :not(.seo-top) {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}
@media (max-width: 820px) {
  html body .public-shell > :not(.public-header),
  html body .seo-shell > :not(.seo-top) { width: min(100% - 28px, 680px); }
}
@media (max-width: 520px) {
  html body .public-shell > :not(.public-header),
  html body .seo-shell > :not(.seo-top) { width: min(100% - 20px, 440px); }
}
html body .public-header::before,
html body .seo-top::before { inset: 0; }

/* Brand: same icon, type and spacing on every page. */
html body .top > .brand,
html body .public-header .public-brand,
html body .seo-top .seo-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
html body:not(.admin-view):not(.agent-view) .top > .brand > img.brand-icon,
html body:not(.admin-view):not(.agent-view) .top > .brand > img,
html body .public-header .public-brand > img,
html body .seo-top .seo-brand > img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
}
html body .top > .brand > div,
html body .public-header .public-brand > span,
html body .seo-top .seo-brand > span {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}
html body .top > .brand small,
html body .public-header .public-brand small,
html body .seo-top .seo-brand small { display: none; }
/* Narrow phones: break at the space ("NexSMS / 接码平台") instead of clipping. */
@media (max-width: 480px) {
  html body .top > .brand > div,
  html body .public-header .public-brand > span,
  html body .seo-top .seo-brand > span {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    word-break: keep-all;
    line-height: 1.15;
  }
}

@media (min-width: 761px) {
  html body.auth-view:not(.admin-view):not(.agent-view) .top,
  html body.invite-page:not(.admin-view):not(.agent-view) .top,
  html body .public-shell > .public-header,
  html body .seo-shell > .seo-top {
    box-sizing: border-box;
    width: 100%;
    min-height: 64px;
    margin: 0;
    padding: 0 20px;
  }
}
@media (min-width: 1101px) {
  html body.auth-view:not(.admin-view):not(.agent-view) .top,
  html body.invite-page:not(.admin-view):not(.agent-view) .top,
  html body .public-shell > .public-header,
  html body .seo-shell > .seo-top { height: 64px; }
}
/* Tablets: the same two rows everywhere (brand + controls, then links).
   seo.css switched at 820px and the other pages at 1060px, so SEO articles
   overlapped their links and controls between those widths. */
@media (min-width: 761px) and (max-width: 1100px) {
  html body.auth-view:not(.admin-view):not(.agent-view) .top,
  html body.invite-page:not(.admin-view):not(.agent-view) .top,
  html body .public-shell > .public-header,
  html body .seo-shell > .seo-top { height: auto; padding-top: 10px; padding-bottom: 10px; }
  html body.auth-view:not(.admin-view):not(.agent-view) .top,
  html body .public-shell > .public-header,
  html body .seo-shell > .seo-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 8px 12px;
  }
  html body.auth-view:not(.admin-view):not(.agent-view) .top > .brand,
  html body .public-header > .public-brand,
  html body .seo-top > .seo-brand { grid-column: 1; grid-row: 1; justify-self: start; }
  html body.auth-view:not(.admin-view):not(.agent-view) .top #top-actions { display: contents; }
  html body.auth-view:not(.admin-view):not(.agent-view) .top .auth-public-nav,
  html body .public-header .public-nav-main,
  html body .seo-top .seo-nav-main {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html body.auth-view:not(.admin-view):not(.agent-view) .top .auth-public-controls,
  html body .public-header .public-nav-controls,
  html body .seo-top .seo-nav-controls { grid-column: 2; grid-row: 1; justify-self: end; }
}
@media (max-width: 760px) {
  html body.auth-view:not(.admin-view):not(.agent-view) .top,
  html body.invite-page:not(.admin-view):not(.agent-view) .top,
  html body .public-shell > .public-header,
  html body .seo-shell > .seo-top {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    gap: 8px 6px;
  }
  /* Fixed row heights (controls 36, account 40, links 34): 146px on every page,
     before and after the script rebuilds the links. */
  html body.auth-view:not(.ui-scrolled):not(.admin-view):not(.agent-view) .top,
  html body:not(.ui-scrolled) .public-shell > .public-header,
  html body:not(.ui-scrolled) .seo-shell > .seo-top {
    grid-template-rows: 36px 40px 34px;
    align-content: start;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  html body.auth-view:not(.admin-view):not(.agent-view) .top,
  html body .public-shell > .public-header,
  html body .seo-shell > .seo-top {
    grid-template-rows: 36px 34px;
    align-content: start;
  }
}

/* ================================================================== */
/* 33. No header jump while the page loads                             */
/*     The static HTML header is replaced by script (app.js on the home */
/*     page, public-init.js on public / SEO pages). Keep the bar and    */
/*     brand painted and show the links once they are final; a 1.5s     */
/*     fallback reveals them if a script never runs.                    */
/* ================================================================== */
@keyframes nx-reveal { to { visibility: visible; } }

html body .public-nav:not([data-layout-normalized="true"]),
html body .seo-nav:not([data-layout-normalized="true"]),
html:not(.nx-ready) body.auth-view #top-actions {
  visibility: hidden;
  animation: nx-reveal 0s linear 1.5s forwards;
}
/* While hidden, the placeholder links sit below the brand row and the bar keeps
   its final height, so the brand and the page below do not move. */
@media (max-width: 1100px) {
  html body .public-header > .public-nav:not([data-layout-normalized="true"]),
  html body .seo-top > .seo-nav:not([data-layout-normalized="true"]) { grid-column: 1 / -1; grid-row: 2; }
}
@keyframes nx-release { to { height: auto; max-height: none; overflow: visible; } }
@media (max-width: 760px) {
  html body .public-header:has(> .public-nav:not([data-layout-normalized="true"])),
  html body .seo-top:has(> .seo-nav:not([data-layout-normalized="true"])),
  html:not(.nx-ready):not(.nx-auth) body.auth-view:not(.admin-view):not(.agent-view) .top {
    height: 147px;
    max-height: 147px;
    overflow: hidden;
    animation: nx-release 0s linear 1.5s forwards;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  html body .public-header:has(> .public-nav:not([data-layout-normalized="true"])),
  html body .seo-top:has(> .seo-nav:not([data-layout-normalized="true"])),
  html:not(.nx-ready):not(.nx-auth) body.auth-view:not(.admin-view):not(.agent-view) .top {
    height: 99px;
    max-height: 99px;
    overflow: hidden;
    animation: nx-release 0s linear 1.5s forwards;
  }
}

/* The currency control turns from a dropdown into the ¥ / $ switch after
   load; give both states the same box so nothing next to it moves.
   88px since usdt3 = the switch's own width with symbols only (section 27 sizes it
   to max-content; it was 112px for "¥ RMB / $ USD"). */
html body .public-currency-picker {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 88px !important;
  min-width: 88px;
}
html body .public-currency-picker.currency-seg .currency-seg-buttons button b { font-size: 14px; }
html body .public-currency-picker:not(.currency-seg) > * { visibility: hidden; }
html body .public-currency-picker.currency-seg .currency-seg-buttons { width: 100%; }
html body .public-currency-picker.currency-seg .currency-seg-buttons button {
  flex: 1 1 0;
  justify-content: center;
  padding: 0 6px;
}

/* Signed-in reload (html.nx-auth is set in <head> when a session token exists):
   hide the sign-in placeholder until app.js draws the signed-in layout. */
html.nx-auth:not(.nx-ready) body.auth-view #app,
html.nx-auth:not(.nx-ready) body.auth-view #support-widget,
html.nx-auth:not(.nx-ready) body.auth-view .top > .brand {
  visibility: hidden;
  animation: nx-reveal 0s linear 2.5s forwards;
}
@media (min-width: 1440px) {
  html.nx-auth:not(.nx-ready) body.auth-view .top { height: 64px; min-height: 64px; }
}
@media (min-width: 1181px) and (max-width: 1439px) {
  html.nx-auth:not(.nx-ready) body.auth-view .top { height: 117px; min-height: 117px; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  html.nx-auth:not(.nx-ready) body.auth-view .top { height: 161px; min-height: 161px; }
}
@media (max-width: 760px) {
  html.nx-auth:not(.nx-ready) body.auth-view .top { min-height: 235px; }
}

/* ================================================================== */
/* 34. Signed-in header: one row on desktop (>= 1440px)                */
/*     brand | sections | account, points, balance | log out, currency, */
/*     theme, language. Below 1440px the two-row layout stays.         */
/* ================================================================== */
@media (min-width: 1440px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    height: 64px;
    min-height: 64px;
    padding: 0 20px;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top > .brand { order: 0; flex: 0 0 auto; }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions { display: contents; }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    order: 1;
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    margin: 0 auto;
    padding: 3px;
    gap: 2px;
    justify-content: center;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group { order: 2; flex: 0 0 auto; }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-utility { order: 3; flex: 0 0 auto; }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn {
    height: 34px;
    min-height: 34px;
    padding: 0 11px;
    gap: 6px;
    white-space: nowrap;
  }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-pill { max-width: 190px; }
}
/* Same side padding as the signed-out header at every width. */
@media (min-width: 761px) and (max-width: 1439px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top { padding-left: 20px; padding-right: 20px; }
}
@media (max-width: 760px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top { padding-left: 14px; padding-right: 14px; }
}
/* 1440-1759px: section tabs drop their icons and the e-mail is shortened so
   everything fits on one line in both languages. */
@media (min-width: 1440px) and (max-width: 1759px) {
  html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn > svg { display: none; }
  html body.user-view:not(.admin-view):not(.agent-view) .nav-cluster .btn.secondary.navbtn { padding: 0 10px; }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-pill { max-width: 150px; }
}

/* ================================================================== */
/* 35. Workbench (desktop): the service / country column fills the     */
/*     height next to the trading panel. It was capped at 720px, which  */
/*     left 3 visible countries and empty space below on tall screens.  */
/*     Countries now get 3/5 of the space, services 2/5.                */
/* ================================================================== */
@media (min-width: 1121px) and (min-height: 781px) {
  html body.workbench-view:not(.admin-view):not(.agent-view) .selector-panel {
    align-self: stretch;
    height: auto;
    min-height: 480px;
    max-height: none;
    grid-template-rows: auto minmax(0, 2fr) minmax(0, 3fr);
  }
}
@media (min-width: 1121px) and (max-height: 780px) {
  html body.workbench-view:not(.admin-view):not(.agent-view) .selector-panel {
    height: max(440px, calc(100dvh - 96px));
    grid-template-rows: auto minmax(0, 2fr) minmax(0, 3fr);
  }
}

/* ================================================================== */
/* 36. Signed-in header: section tabs centred on the page              */
/*     Before: brand | tabs (margin:auto) | account | buttons. The tabs */
/*     were centred between a 170px brand and ~714px of right-hand      */
/*     controls, i.e. ~270px left of the page centre.                   */
/*     Now: brand + account on the left, tabs in a centre column,       */
/*     buttons on the right. Equal 1fr side columns keep the tabs at    */
/*     the exact centre whenever both sides fit; when the left side is  */
/*     wider than half the free space the tabs move only that much.     */
/* ================================================================== */
@media (min-width: 1440px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top {
    --nx-brand-w: 186px;
    display: grid;
    grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
    grid-template-rows: 64px;
    align-items: center;
    column-gap: 16px;
    row-gap: 0;
  }
  html[lang="en"] body.user-view:not(.admin-view):not(.agent-view) .top { --nx-brand-w: 124px; }
  html body.user-view:not(.admin-view):not(.agent-view) .top > .brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
  /* Same cell as the brand, offset past it, so both read as one left group. */
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin-left: var(--nx-brand-w);
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin: 0;
  }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-utility {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

/* Two-row desktop (1181-1439px): account next to the brand, tabs centred on row 2. */
@media (min-width: 1181px) and (max-width: 1439px) {
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .top-account-group { justify-self: start; }
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    justify-self: center;
    justify-content: center;
    width: auto;
  }
}

/* Tablets: the scrolling tab row is centred when it fits. */
@media (min-width: 761px) and (max-width: 1180px) {
  html body.user-view:not(.admin-view):not(.agent-view) #top-actions > .nav-cluster {
    justify-content: flex-start;
    justify-content: safe center;
  }
}
/* 1440-1599px: a narrower left group so the tabs can stay centred. The points
   and balance pills keep their labels; only the decorative icons go. */
@media (min-width: 1440px) and (max-width: 1599px) {
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-pill { max-width: 128px; }
  html body.user-view:not(.admin-view):not(.agent-view) .top-account-group .account-metric .metric-icon { display: none; }
  /* cdk-account.css sets min-width: 104px through .top .actions; match that path. */
  html body.user-view:not(.admin-view):not(.agent-view) .top .actions .top-account-group .account-metric {
    min-width: 0;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ================================================================== */
/* 37. FAQ / Guides: centred page header (title, intro, search, topics) */
/* ================================================================== */
html body.doc-page .doc-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
html body.doc-page .doc-hero h1,
html body.doc-page .doc-hero .lead {
  margin-left: auto;
  margin-right: auto;
}
html body.doc-page .doc-hero .doc-search {
  width: min(640px, 100%);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
html body.doc-page .doc-hero .doc-topics {
  justify-content: center;
}
html body.doc-page .doc-actions a,
html body.doc-page .doc-actions .public-button { text-decoration: none; }

/* ------------------------------------------------------------------ */
/* 38. Register: image code field (input + 150x50 image, click = new)  */
/* ------------------------------------------------------------------ */
body.auth-view .auth-card .auth-captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: stretch;
}
body.auth-view .auth-card .auth-captcha-row .input {
  min-width: 0;
  min-height: 50px;
  text-transform: uppercase;
  letter-spacing: .16em;
}
body.auth-view .auth-card .auth-captcha-row .input::placeholder {
  text-transform: none;
  letter-spacing: 0;
}
body.auth-view .auth-card .auth-captcha-image {
  position: relative;
  display: block;
  width: 150px;
  height: 50px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(184, 215, 211, .22);
  border-radius: 7px;
  background: #eef4f2;
  cursor: pointer;
}
body.auth-view .auth-card .auth-captcha-image img {
  display: block;
  width: 100%;
  height: 100%;
}
body.auth-view .auth-card .auth-captcha-image .auth-captcha-status {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #334155;
  background: #eef4f2;
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}
body.auth-view .auth-card .auth-captcha-image.is-loading .auth-captcha-status,
body.auth-view .auth-card .auth-captcha-image.is-error .auth-captcha-status { display: grid; }
body.auth-view .auth-card .auth-captcha-image.is-error .auth-captcha-status { color: #b42318; }
body.auth-view .auth-card .auth-captcha-image:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(115, 222, 205, .35);
}
html[data-theme="light"] body.auth-view .auth-card .auth-captcha-image { border-color: rgba(22, 63, 57, .17); }
@media (max-width: 380px) {
  body.auth-view .auth-card .auth-captcha-row { grid-template-columns: minmax(0, 1fr) 120px; }
  body.auth-view .auth-card .auth-captcha-image { width: 120px; height: 50px; }
}

/* ------------------------------------------------------------------ */
/* 39. Telemetry rail starts empty until app.js sets the live value     */
/*     (the CSP ignores style="" attributes, so no inline default).     */
/* ------------------------------------------------------------------ */
.auth-telemetry-rail { --telemetry-progress: 0; --telemetry-progress-pct: 0%; }
/* ------------------------------------------------------------------ */
/* 40. Home live metrics: own card under the login card (right column) */
/*     so the totals show without scrolling. The services directory    */
/*     keeps its place and spans both rows. On one-column layouts the  */
/*     order stays directory -> metrics -> login card, as before.      */
/* ------------------------------------------------------------------ */
body.auth-view .public-auth-stage > .auth-public-vitals {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(184, 215, 211, .16);
  border-radius: 20px;
  background: rgb(16, 22, 25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 20px 48px rgba(0, 0, 0, .42);
}
html[data-theme="light"] body.auth-view .public-auth-stage > .auth-public-vitals {
  border-color: #cbd6e0;
  background: #fff;
  box-shadow: 0 12px 30px rgba(30, 55, 80, .08);
}
@media (min-width: 901px) {
  body.auth-view .public-auth-stage { grid-template-rows: auto 1fr; }
  body.auth-view .public-auth-stage > .auth-public-directory { grid-column: 1; grid-row: 1 / span 2; }
  body.auth-view .public-auth-stage > .auth-card { grid-column: 2; grid-row: 1; position: static; }
  body.auth-view .public-auth-stage > .auth-public-vitals {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  body.auth-view .public-auth-stage > .auth-public-vitals .auth-telemetry {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  body.auth-view .public-auth-stage > .auth-public-vitals .auth-public-depth {
    min-height: 112px;
    transform: none;
  }
}
@media (max-width: 900px) {
  body.auth-view .public-auth-stage > .auth-public-directory { order: 1; }
  body.auth-view .public-auth-stage > .auth-public-vitals { order: 2; }
  body.auth-view .public-auth-stage > .auth-card { order: 3; }
}
/* ------------------------------------------------------------------ */
/* 41. Light theme: the buy-confirm summary boxes (模式 / 数量 / 单价 / */
/*     预计合计) kept the dark translucent fill from styles.css, so the  */
/*     labels were unreadable. Same light colors as the API Center.     */
/* ------------------------------------------------------------------ */
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .confirm-summary > div {
  border-color: #dbe4ef;
  color: #182235;
  background: #f6f9fc;
}
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .confirm-summary span { color: #526075; }
html[data-theme="light"] body:not(.admin-view):not(.agent-view) .confirm-summary strong { color: #182235; }
