/* Unified public mobile layout. Kept separate from admin/agent workspaces. */
#dialog .payment-clock { padding:14px; border-radius:12px; background:#eef7f1; margin:12px 0; }
#dialog .payment-clock strong { font-size:20px; color:#216342; }
#dialog .payment-clock p { margin:6px 0 0; font-size:12px; }
#dialog .payment-contract { overflow-wrap:anywhere; }
#dialog #chain-status { font-size:13px; color:#216342; }
#dialog .payment-total { font-size:26px; font-weight:700; margin:16px 0; }
#dialog .bsc-qr { width:min(100%,260px); aspect-ratio:1; margin:18px auto; background:#fff; border:1px solid #d9e4dd; border-radius:14px; padding:10px; display:flex; align-items:center; justify-content:center; }
#dialog .bsc-qr svg { width:100%; height:100%; display:block; }
#dialog #payment-address { font-size:12px; padding:12px; width:100%; }
#dialog .alipay-box { margin:18px auto; width:min(100%,280px); padding:18px; border:1px solid #b8daef; border-radius:16px; background:#f4fbff; display:grid; justify-items:center; gap:10px; color:#095d94; text-align:center; }
#dialog .alipay-box img { width:200px; height:200px; object-fit:contain; background:#fff; border-radius:10px; padding:6px; border:1px solid #d6ebf7; }
#dialog #usage-other textarea { min-height:120px; line-height:1.7; resize:vertical; }
#dialog .identity-upload { border:0; padding:0; margin:20px 0; min-width:0; }
#dialog .identity-upload legend { font-weight:600; margin-bottom:10px; }
#dialog .identity-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#dialog .identity-tile { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; min-height:150px; padding:14px 8px; border:1px dashed #9baea3; border-radius:14px; background:#f6faf7; text-align:center; cursor:pointer; font-size:13px; overflow-wrap:anywhere; }
#dialog .identity-tile input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
#dialog .identity-tile:focus-within { outline:2px solid #247a57; outline-offset:2px; }
#dialog .identity-tile img { width:100%; height:90px; object-fit:contain; }
#dialog .identity-tile img[hidden] { display:none; }
#dialog .identity-upload small { display:block; margin-top:10px; color:#666; line-height:1.6; }
#dialog {
  background:#fff;
  color:#1d1d1f;
  opacity:1;
  border:1px solid #e5e5e8;
  box-shadow:0 20px 60px #0003;
  isolation:isolate;
}
#dialog::backdrop {
  background:rgba(0,0,0,.4);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
body:has(#dialog[open]) { overflow:hidden; }
#dialog .field input, #dialog .field select, #dialog .field textarea {
  background:#fff;
  color:#1d1d1f;
  border:1px solid #d4d4d7;
}
#dialog .check input { width:20px; min-height:20px; flex:0 0 20px; }
@media(max-width:760px) {
  #dialog { margin:auto; max-height:calc(100dvh - 24px); padding:24px 18px; }
  #dialog h2 { font-size:24px !important; padding-right:30px; }
  #dialog .field input, #dialog .field select { min-height:46px; padding:10px 12px; border-radius:10px; }
  #dialog .summary { padding:16px; gap:12px; flex-wrap:wrap; }
  #dialog .summary strong { font-size:26px; }
  #dialog .check { align-items:flex-start; }
}
/* Rental purchase buttons share the same green treatment on every screen. */
#plan-cards > .plan > button[data-buy]:not(:disabled) {
  background:#247a57;
  border-color:#247a57;
  color:#fff;
}
#plan-cards > .plan > button[data-buy]:not(:disabled):hover,
#plan-cards > .plan > button[data-buy]:not(:disabled):active {
  background:#1b6245;
  border-color:#1b6245;
  color:#fff;
}
#plan-cards > .plan > button[data-buy]:focus-visible {
  outline:2px solid #247a57;
  outline-offset:3px;
}
.plan-mobile-bar, .plan-mobile-dots { display:none; }

@media (max-width:760px) {
  html { scroll-padding-top:100px; scrollbar-width:none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display:none; }
  body { --mobile-gap:16px; }
  .announcement { position:static; white-space:normal; padding:6px 12px; font-size:12px; letter-spacing:.02em; }
  body > header { position:sticky; top:0; align-items:center; padding:2px 16px 0; gap:0 8px; min-height:0; box-shadow:0 3px 16px #00000005; }
  header .brand, footer .brand { display:inline-flex; align-items:center; min-height:44px; }
  header .brand-mark { width:28px; height:28px; }
  header .brand-text strong { font-size:17px; }
  header .brand-text > span { display:none; }
  header .primary-links { justify-content:flex-start; gap:clamp(6px, 4vw, 24px); padding:0; margin-top:0; }
  header .primary-links a { display:inline-flex; align-items:center; padding:0 4px; font-size:12px; min-height:44px; }
  .mobile-menu a[href="/#plans"], .mobile-menu a[href="/invest"], .mobile-menu a[data-account-nav] { display:none; }
  #language-toggle { border:0; background:transparent; min-height:44px; padding:4px; }
  .mobile-menu summary { width:44px; display:grid; place-items:center; padding:0; }
  #app { background:#fff; }
  #app .eyebrow { color:#4d515b; font-size:11px; letter-spacing:.14em; line-height:1.6; }
  #app section.content, #app #plans { padding:34px 16px; }
  #app section.content + section.content { border-top:1px solid #eeeef1; }
  #app h2, #app section h2, #app .section-head h2 { font-size:22px; line-height:1.35; letter-spacing:-.025em; margin:8px 0 16px; text-wrap:balance; }
  #app p { font-size:14px; line-height:1.75; }
  #app .hero { display:grid; grid-template-columns:minmax(0,1fr); padding:28px 20px 20px; gap:18px; }
  #app .hero h1, html:not([lang='zh-CN']) #app .hero h1 { font-size:30px; line-height:1.23; margin:12px 0 14px; }
  #app .hero > div > p { font-size:14px; line-height:1.75; margin-bottom:18px; }
  .hero-actions { display:grid; grid-template-columns:auto minmax(0,1fr); gap:16px; align-items:center; margin-top:18px; }
  .hero-actions .button { padding:12px 20px; font-size:14px; min-height:46px; }
  .hero-price { font-size:11px; }
  .hero-price strong { font-size:23px; }
  .hero-foot { display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:18px; font-size:12px; }
  #app .hero .visual { position:relative; display:block; height:220px; margin:0; border-radius:20px; overflow:hidden; background:#f7f7f9; }
  #app .visual .product-photo { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
  #app .visual .product-photo img { width:230px; height:230px; max-width:none; object-fit:contain; mix-blend-mode:multiply; }
  #app .visual .float { position:absolute; z-index:1; padding:7px 10px; border:1px solid #e4e4e9; background:#ffffffed; border-radius:13px; box-shadow:0 4px 14px #242b391a; font-size:10.5px; }
  #app .visual .float b { font-size:11.5px; margin-top:2px; }
  #app .visual .status { top:12px; right:12px; }
  #app .visual .location { bottom:12px; left:12px; }
  #app .spec-strip { margin:0 16px 16px; padding:14px; gap:14px; border:1px solid #e8e8ed; border-radius:16px; background:#fafafb; }
  .spec-strip > div { padding:0; gap:3px; }
  .spec-strip b { font-size:15px; }
  .spec-strip span { font-size:11px; }
  #app .features { display:grid; grid-template-columns:1fr; gap:10px; margin-top:20px; }
  #app .features article { padding:16px; border:1px solid #e8e8ed; border-radius:16px; background:#fafafb; }
  #app .features h3, #app .steps h3 { font-size:16px; margin:0 0 6px; }
  #app .features p, #app .steps p { font-size:13px; margin:0; line-height:1.7; }
  #app .section-head { text-align:left; margin-bottom:18px; }
  #plans .tabs { display:flex; border-radius:12px; padding:4px; margin:0; }
  #plans .tabs button { border-radius:9px; min-height:44px; font-size:12px; white-space:normal; }
  #plan-cards { margin-top:16px; gap:14px; }
  #plan-cards > .plan { background:#fff; padding:20px 18px; border-radius:18px; box-shadow:0 3px 12px #00000004; }
  #plan-cards > .plan.plan-unavailable { background:#fafafb; }
  #plan-cards > .plan > h3 { font-size:18px; }
  #app #plan-cards > .plan > p { font-size:13.5px; }
  #plan-cards .price { font-size:28px; margin:12px 0 0; white-space:nowrap; }
  #plan-cards > .plan > ul { margin:14px 0 16px; padding-top:14px; }
  #app #plan-cards > .plan > button { border-radius:12px; width:100%; min-height:46px; }
  .plan-mobile-bar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-top:14px; }
  .plan-mobile-bar button { display:grid; place-content:center; gap:2px; min-height:48px; padding:5px 2px; border:1px solid #dedfe6; border-radius:14px; background:#fff; color:#343842; font-size:12px; line-height:1.25; }
  .plan-mobile-bar button:hover:not(:disabled) { background:#f4f6fa; border-color:#c2c9d6; color:#1d1d1f; transform:none; box-shadow:none; }
  .plan-mobile-bar button[aria-selected="true"] { border-color:#0071e3; background:#edf5ff; color:#004b9a; }
  .plan-mobile-bar button[aria-selected="true"]:hover:not(:disabled) { border-color:#0071e3; background:#e1efff; color:#004b9a; transform:none; box-shadow:none; }
  .plan-mobile-bar button span { font-size:11px; }
  #plans #plan-cards.plan-carousel {
    display:grid;
    grid-template-columns: repeat(3, min(100%, clamp(240px, 82%, 344px)));
    justify-content:start;
    gap:12px;
    margin-top:8px;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-snap-type:x mandatory;
    scroll-padding-inline:16px;
    padding:4px 16px 12px;
    scrollbar-width:none;
  }
  #plan-cards.plan-carousel::-webkit-scrollbar { display:none; }
  #plan-cards.plan-carousel > .plan { scroll-snap-align:center; }
  #plans #plan-cards:has(> .plan:only-child) { grid-template-columns:minmax(0,1fr); }
  .plan-mobile-dots { display:flex; justify-content:center; gap:6px; margin-top:2px; }
  .plan-mobile-dots span { width:6px; height:6px; border-radius:8px; background:#c6c9d1; }
  .plan-mobile-dots .active { width:16px; background:#0071e3; }
  #app .note { font-size:11px; line-height:1.7; margin-top:16px; }
  #app .steps { gap:0; counter-reset:mobile-step; margin-top:20px; }
  #app .steps article { position:relative; padding:4px 0 22px 42px; border:0; border-radius:0; background:transparent; }
  #app .steps article::before { counter-increment:mobile-step; content:counter(mobile-step,decimal-leading-zero); position:absolute; left:0; top:2px; width:28px; height:28px; display:grid; place-items:center; background:#f1f1f4; border-radius:9px; font-size:11px; font-weight:600; }
  #app details:not(.h-row):not(.hosting-owner):not(.hosting-owners) { padding:0; border:1px solid #e6e6eb; border-radius:12px; background:#fff; margin:10px 0; }
  #app details > summary { padding:14px; font-size:14px; line-height:1.5; min-height:48px; }
  #app details > p { padding:0 14px 14px; margin:0; font-size:13px; }
  #app .invest-hero { padding:28px 20px; }
  #app .invest-grid { grid-template-columns:1fr; margin-top:16px; gap:20px; }
  #app .invest-hero h1 { font-size:28px; margin:14px 0; }
  #app .invest-tag { font-size:11px; padding:5px 10px; }
  #app .invest-hero .button { display:flex; justify-content:center; border-radius:12px; margin:18px 0 0; min-height:46px; }
  #app .invest-link { display:flex; justify-content:center; min-height:44px; margin:4px 0 8px; font-size:13px; }
  #app .invest-disclaimer { font-size:11px; line-height:1.75; padding-left:10px; border-left:2px solid #c6c6cc; margin:12px 0 0; }
  #app .target-poster { transform:none; padding:20px; border-radius:18px; box-shadow:none; }
  #app .target-number { font-size:48px; margin:10px 0; line-height:1.1; }
  #app .target-number span { font-size:16px; }
  #app .target-poster h2 { font-size:19px; }
  #app .target-poster p, #app .target-poster > div:first-child { font-size:12px; }
  #app .poster-line { margin:16px 0; }
  #app .ledger-items { gap:8px; margin:16px 0; }
  #app .ledger-items article { padding:14px; border-radius:12px; }
  #app .ledger-items b { font-size:21px; }
  #app .ledger-items p { font-size:12px; margin:4px 0 0; }
  #app .ledger-bar { height:auto; min-height:34px; border-radius:9px; font-size:11px; }
  #app .agreement-grid { gap:12px; margin-top:18px; }
  #app .agreement-grid .plan { padding:18px; border-radius:16px; }
  #app .agreement-grid h3 { font-size:17px; line-height:1.45; }
  #app .agreement-grid .price { font-size:30px; margin:12px 0; }
  #app .agreement-grid p { font-size:13px; margin-bottom:0; }
  #app .summary { flex-direction:column; align-items:flex-start; gap:12px; padding:18px; border-radius:14px; font-size:13px; }
  #app .summary strong { font-size:26px; }
  #app .calc-grid { gap:14px; margin-top:20px; }
  #app #investment-calculator, #app .calc-results, #app .invest-join form { padding:18px; border-radius:16px; }
  #app .field { font-size:13px; margin:0 0 16px; gap:7px; }
  #app .field input, #app .field select, #app .field textarea { font-size:16px; min-height:46px; border-radius:10px; padding:11px 12px; }
  #app .quick-options { display:flex; gap:8px; margin:-4px 0 20px; }
  #app .quick-options button { flex:1; min-height:44px; padding:8px; font-size:12px; border-radius:10px; }
  #app .calc-results h3, #app .income-chart h3 { font-size:17px; }
  #app .calc-results .result-number { font-size:30px; }
  #app .result-row { padding:12px 0; font-size:12px; gap:6px; }
  #app .result-row b { font-size:15px; }
  #app .income-chart { border-radius:16px; padding:16px 10px; margin-top:14px; }
  #app .invest-join { gap:20px; }
  #app .check { align-items:flex-start; font-size:12px; line-height:1.7; gap:10px; }
  #app .check input { width:20px; height:20px; min-height:20px; margin-top:2px; flex-shrink:0; }
  #app .page { padding:28px 16px 40px; }
  #app .page h1, #app .auth h1 { font-size:26px; line-height:1.3; margin:10px 0 16px; }
  #app .page h2 { font-size:19px; margin-top:24px; }
  #app .terms p { font-size:14px; }
  #app .notice { padding:14px; font-size:12px; border-radius:12px; }
  #app .auth { width:calc(100% - 32px); margin:24px 16px 36px; padding:22px 18px; border-radius:18px; }
  #app .order { padding:16px; border-radius:16px; }
  #app .order h3 { font-size:16px; }
  #app .order-details { display:grid; grid-template-columns:1fr; gap:8px; }
  #app .order-actions { display:flex; flex-wrap:wrap; gap:8px; }
  #app .order-actions button { flex:1; min-height:44px; }
  body > footer { padding:28px 20px; gap:20px 16px; background:#f7f7f9; }
  footer > div:first-child { grid-column:1/-1; padding-bottom:14px; border-bottom:1px solid #e5e5ea; }
  footer p, footer a:not(.brand) { font-size:12px; line-height:1.7; }
  footer b { font-size:13px; }
  footer small { font-size:12px; line-height:1.7; }
  dialog { border-radius:20px; padding:22px 18px; }
  dialog h2 { font-size:22px; }
  dialog .field { margin:12px 0; }
}

/* Fluid phone sizing, including compact screens and display cutouts. */
@media (max-width:760px) {
  body { --phone-gutter:clamp(12px,4vw,24px); }
  body > header { padding-left:max(var(--phone-gutter),env(safe-area-inset-left)); padding-right:max(var(--phone-gutter),env(safe-area-inset-right)); padding-top:env(safe-area-inset-top,0px); }
  #app .hero, #app .invest-hero, #app section.content, #app #plans, #app .page {
    padding-left:max(var(--phone-gutter),env(safe-area-inset-left));
    padding-right:max(var(--phone-gutter),env(safe-area-inset-right));
  }
  #app .hero h1, html:not([lang='zh-CN']) #app .hero h1 { font-size:clamp(26px,7vw,34px); overflow-wrap:anywhere; }
  #app .invest-hero h1 { font-size:clamp(25px,6.8vw,32px); overflow-wrap:anywhere; }
  #app .hero-actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #app .hero-actions > *, #app .invest-grid > *, #app .calc-grid > *, #app .invest-join > * { min-width:0; }
  #app .hero-actions .button { padding-inline:10px; text-align:center; }
  #app .hero-price strong { font-size:clamp(20px,5.6vw,26px); }
  #app .field, #app form, #app .check { min-width:0; }
  #app .field input, #app .field select, #app .field textarea, dialog input, dialog select, dialog textarea { width:100%; max-width:100%; font-size:16px; }
  #app .check input { width:20px; flex:0 0 20px; }
  #app .quick-options { flex-wrap:wrap; }
  #app .ledger-items b, #app .summary strong { overflow-wrap:anywhere; }
  #app .income-chart { overflow:hidden; }
  #app .order-actions button { flex:1 1 120px; white-space:normal; }
  body > footer { padding-left:max(var(--phone-gutter),env(safe-area-inset-left)); padding-right:max(var(--phone-gutter),env(safe-area-inset-right)); padding-bottom:calc(24px + env(safe-area-inset-bottom)); }
  dialog { width:calc(100% - 24px); max-height:calc(100dvh - 24px); }
}
@media (max-width:359px) {
  #app .hero-actions { grid-template-columns:minmax(0,1fr); gap:10px; }
  #app .ledger-items { grid-template-columns:minmax(0,1fr); }
  #plan-cards > .plan:has(.badge) > h3 { padding-right:0; padding-top:24px; }
  #app .auth { padding-inline:14px; }
}
@media (orientation:landscape) and (max-height:500px) and (max-width:1024px) {
  body > header { position:relative; }
  #app .hero, #app .invest-hero { padding-top:24px; padding-bottom:24px; }
  dialog { max-height:calc(100dvh - 16px); margin:8px auto; }
}
@media (max-width:374px) {
  #app .hero h1, html:not([lang='zh-CN']) #app .hero h1 { font-size:27px; }
  header .primary-links { gap:16px; }
  .hero-actions { gap:10px; }
  .hero-actions .button { padding-inline:14px; }
  #app section.content, #app #plans { padding-inline:12px; }
}

/* Isolated customer portals keep translated navigation within phone widths. */
@media (max-width:760px) {
  html[data-site] header .primary-links { gap:8px; width:100%; min-width:0; }
  html[data-site] header .primary-links a { flex:1 1 0; min-width:0; justify-content:center; text-align:center; white-space:normal; overflow-wrap:anywhere; font-size:11px; line-height:1.4; padding:7px 0; }
}

/* Purchase dialogs share the same shell across the homepage and order history. */
@media (min-width: 800px) {
  #dialog:has(:is(#checkout,#account-checkout,#renew-form,#payment-instructions)) {
    width:min(960px,calc(100vw - 64px));
    max-height:calc(100dvh - 48px);
    padding:28px clamp(24px,3vw,48px);
    box-sizing:border-box;
  }
  #dialog:has(:is(#account-checkout,#renew-form)) {width:min(760px,calc(100vw - 64px))}
  #dialog :is(#checkout,#account-checkout,#renew-form) {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 24px;align-items:start;
  }
  #dialog :is(#checkout,#account-checkout,#renew-form) > * {min-width:0;margin:0}
  #dialog :is(#checkout,#account-checkout,#renew-form) > :not(.field) {grid-column:1/-1}
  #dialog #account-checkout > .summary {grid-column:auto;align-self:stretch}
  #dialog :is(#checkout,#account-checkout,#renew-form) .summary {display:flex;align-items:center;justify-content:space-between;gap:16px}
  #dialog :is(#checkout,#account-checkout,#renew-form) > .error:empty {display:none}
  #dialog :is(#checkout,#account-checkout,#renew-form) > .full {justify-self:end;width:auto;min-width:200px}
  #dialog #payment-instructions:not([hidden]) {display:grid;grid-template-columns:minmax(200px,.8fr) minmax(0,1.4fr);gap:12px 28px;align-items:start}
  #dialog #payment-instructions > * {min-width:0;margin:0;grid-column:2}
  #dialog #payment-instructions > :is(.bsc-qr,.alipay-box) {grid-column:1;grid-row:1/span 6;justify-self:center}
  #dialog #payment-instructions > :only-child {grid-column:1/-1}
  #dialog #report-payment {display:block;width:auto;min-width:200px;margin:20px 0 0 auto}
  #dialog #chain-status,#dialog .payment-total {overflow-wrap:anywhere}
}
