/* Shared components and responsive behavior for all three entry points. */
@media (max-width:767px) {
  .login-shell { padding:16px max(12px,env(safe-area-inset-left)) calc(16px + env(safe-area-inset-bottom)); }
  .login-card { max-width:100%; }
  .agent-header .header-right { flex-wrap:wrap; }
  .agent-main input, .agent-main select, .agent-main textarea { font-size:16px; }
  .agent-main .hosting-actions { flex-wrap:wrap; }
}
html { overflow-x: hidden; overflow-x: clip; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: var(--font-ui); font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
main, section, article, form, .agent-main, .panel-card, .fold-body, .kpi-card { min-width: 0; }
button, input, select, textarea { font-family: inherit; }
a, button, summary, select, input, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, .button { min-height: 44px; font-weight: 500; }
button:disabled { opacity: 1; color: #55555c; background: var(--bg); }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
header, .agent-header { min-height: 64px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: rgba(255,255,255,.97); }
footer { padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px)); }
header, .agent-header, footer, .agent-main { padding-left: max(5%, env(safe-area-inset-left, 0px)); padding-right: max(5%, env(safe-area-inset-right, 0px)); }
.tabs, .panel-tabs { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-pill); }
.tabs button, .panel-tabs button { box-shadow: none; transform: none; }
.tabs button.active, .panel-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
dialog { width: min(540px, calc(100% - 24px)); border-radius: var(--radius-lg); padding: 30px; padding-top: max(30px, env(safe-area-inset-top, 0px)); padding-bottom: max(30px, env(safe-area-inset-bottom, 0px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
dialog::backdrop { background: rgba(0,0,0,.36); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.close, .close-btn { width: 44px; height: 44px; flex-shrink: 0; }
#toast, #agent-toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); width: max-content; max-width: calc(100% - 32px); padding: 12px 24px; background: #1d1d1f; color: #fff; border-radius: var(--radius-pill); box-shadow: var(--shadow-lg); text-align: center; overflow-wrap: anywhere; z-index: 50; }
.login-shell { min-height: 100vh; min-height: 100dvh; }
.table-wrap, .chart-scroll { max-width: 100%; }
.income-chart svg { width: 100%; height: auto; min-width: 0; min-height: 0; }
.mobile-menu > div, #language-menu { background: #ffffff; z-index: 60; box-shadow: 0 16px 40px rgba(0,0,0,0.16); }
@media (min-width: 1025px) {
  .agent-main table { width: 100%; min-width: 0; }
  .agent-main th, .agent-main td { padding: 12px 10px; }
}
@media (max-width: 1024px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .agent-main table { min-width: 1080px; }
}
.target-number { background: none; color: #fff; }
.plan.plan-unavailable .price, #plan-cards > .plan > button:disabled { color: #55555c; }
.province-head-direct { grid-template-columns: minmax(0,1fr) auto; }
@media (max-width: 1150px) {
  .mobile-menu { position: static; }
  .mobile-menu > div { top: 100%; right: max(12px, env(safe-area-inset-right, 0px)); max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; }
}
@media (max-width: 1024px) {
  .ledger-items { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ledger-items article:last-child { grid-column: 1 / -1; }
  .steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .plans { gap: 14px; }
  .plan { padding: 24px 18px; }
  .hero, .invest-grid { gap: 24px; }
  input, select, textarea, .field input, .field select, .field textarea, .filters input, .filters select, .inline-select { font-size: 16px; min-width: 0; max-width: 100%; }
  a.button, button, nav a, .primary-links a, .mobile-menu a, .mobile-menu summary, #language-toggle, #language-menu button, .header-right a, .back-link, summary { min-height: 44px; }
  .primary-links a, .header-right a, .back-link { display: inline-flex; align-items: center; }
  .panel-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; width: 100%; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-behavior: smooth; }
  .panel-tabs::-webkit-scrollbar { display: none; }
  .panel-tabs button { white-space: nowrap; flex-shrink: 0; }
}
@media (max-width: 760px) {
  header { gap: 4px; padding-inline: max(12px, env(safe-area-inset-left, 0px)); }
  header .primary-links { padding-top: 0; gap: 18px; }
  .brand { gap: 6px; }
  .brand-text strong { font-size: 18px; }
  #language-toggle { gap: 4px; padding-inline: 8px; }
  #language-menu { max-width: calc(100vw - 32px); }
  .hero .visual { display: grid; grid-template-columns: minmax(0,1fr); height: auto; gap: 12px; margin-top: 12px; }
  .visual .product-photo { position: static; grid-row: 2; }
  .visual .product-photo img { width: 100%; max-width: 340px; }
  .visual .float { position: static; width: fit-content; max-width: 100%; padding: 10px 14px; }
  .visual .float.status { grid-row: 1; justify-self: end; }
  .visual .float.location { grid-row: 3; }
  .features p, .steps p, details p, .section-head p, #plan-cards > .plan > p { font-size: 15px; }
  .ledger-bar span { padding-inline: 6px; }
  .ledger-items { gap: 12px; }
  .ledger-items article { padding: 18px 14px; }
  .result-row { flex-wrap: wrap; gap: 4px 12px; }
  .result-row b { overflow-wrap: anywhere; }
  .calc-results .result-number { font-size: clamp(28px,7vw,40px); overflow-wrap: anywhere; }
  .steps { grid-template-columns: 1fr; }
  .auth { margin: 24px auto 48px; width: calc(100% - 32px); padding: 24px 20px; }
  .page-heading, .order-head { flex-wrap: wrap; }
  .order { padding: 20px 16px; overflow-wrap: anywhere; }
  .check { min-height: 44px; align-items: center; }
  .check input { width: 24px; height: 24px; }
  footer a:not(.brand) { min-height: 44px; display: flex; align-items: center; margin-top: 0; }
  dialog { padding: 24px 20px; padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 680px) {
  .agent-header { gap: 10px; }
  .header-left, .header-right { width: 100%; gap: 8px 12px; min-width: 0; }
  .agent-meta { flex: 1 1 100%; overflow-wrap: anywhere; }
  .agent-main { padding: 20px 12px calc(48px + env(safe-area-inset-bottom, 0px)); }
  .kpi-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .kpi-card { padding: 14px 12px; }
  .kpi-card.dark:first-child { grid-column: 1 / -1; }
  .kpi-value { font-size: clamp(20px,5.5vw,24px); overflow-wrap: anywhere; }
  .province-summary, .city-summary { flex-wrap: wrap; padding: 14px 12px; }
  .province-head, .city-detail-bar, .sub-item-row { grid-template-columns: minmax(0,1fr); padding: 14px 12px; }
  .province-head > *, .city-detail-bar > *, .sub-item-row > *, .fold-left { min-width: 0; overflow-wrap: anywhere; }
  .fold-body, .city-sales-fold > .fold-body { padding: 0 10px 12px; }
  .hierarchy-fold > summary { padding-inline: 12px; }
  .fold-left { flex-wrap: wrap; }
  .fold-arrow { flex-shrink: 0; }
  .filters { width: 100%; }
  .filters input, .filters select { width: 100%; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
/* Narrow tablets retain readable plan titles and full-width form controls. */
@media (min-width: 761px) and (max-width: 1024px) {
  .invest-grid, .invest-join { grid-template-columns: minmax(0,1fr); }
  .hero { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .hero-title-line { white-space: normal; }
}
body { overflow-x: hidden; overflow-x: clip; }
.badge, .invest-tag, .role-pill.city, .tag.blue, .fold-count { color: #0066cc; }
.field textarea { display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
@media (max-width: 1024px) {
  input:not([type='checkbox']):not([type='radio']), select, textarea { min-height: 44px; }
}
@media (min-width: 761px) and (max-width: 1150px) {
  header { flex-wrap: nowrap; gap: 16px; }
  header .brand { order: 0; }
  header .primary-links { order: 1; margin-left: auto; }
  header .nav-end { order: 2; }
  header .mobile-menu { order: 3; }
  .mobile-menu a[href="/#plans"], .mobile-menu a[href="/invest"], .mobile-menu a[href="/account"] { display: none; }
}
@media (max-width: 960px) {
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-strip b, .spec-strip span { white-space: nowrap; }
  .plans { grid-template-columns: minmax(0, 560px); justify-content: center; }
}

/* Unified Horizontal Collapsible Workspace (Admin, Agent, and Account Hosting). */
:root {
  --accent: #29292c;
  --accent-hover: #414145;
  --accent-soft: #f0f0f2;
  --accent-ring: rgba(80, 80, 85, 0.14);
  --blue: #0066cc;
  --muted: #58585e;
  --subtle: #58585e;
}

*, *::before, *::after { box-sizing: border-box; }
body { background: #fff; color: #1d1d1f; }
main, section, article, details, .page, .agent-main, .panel-card, .fold-body, .city-card, .province-card {
  min-width: 0;
  max-width: 100%;
}
input, select, textarea { min-width: 0; max-width: 100%; font: inherit; }
textarea { width: 100%; min-height: 88px; border: 1px solid #d4d4d7; border-radius: 12px; padding: 12px; resize: vertical; }
dialog { max-width: calc(100vw - 24px); max-height: 90dvh; overflow: auto; }
dialog .check { display: flex; align-items: center; gap: 10px; }
dialog input[type="checkbox"] { width: auto; }
dialog .field { display: grid; gap: 8px; margin: 14px 0; }
dialog .close { float: right; }
.error { color: #a02020; }
.panel-card #payout-form { max-width: 600px; }
[hidden] { display: none !important; }

/* Compact horizontal top workspace chrome */
.agent-main { padding: 20px max(4%, 20px) 56px; }
.welcome-bar { margin-bottom: 14px; }
.welcome-bar h1 { font-size: 24px; }
.kpi-grid { gap: 10px; margin-bottom: 14px; }
.kpi-card { padding: 14px 16px; border-radius: 14px; }
.kpi-value { font-size: 22px; margin: 4px 0 2px; }
.panel-card { padding: 18px 20px; }
.toolbar { margin-bottom: 14px; }

.panel-tabs, .page > .tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.panel-tabs button, .page > .tabs button {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 13px;
  min-height: 36px;
}

/* Horizontal summary strip (Queue & Owner Hosting) */
.hosting-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.hosting-summary > div {
  border: 1px solid #e3e3e6;
  background: #f8f8fa;
  border-radius: 12px;
  padding: 11px 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.hosting-summary span { font-size: 12px; color: #58585e; white-space: normal; overflow-wrap: anywhere; }
.hosting-summary strong { font-size: 20px; color: #1d1d1f; margin: 0; white-space: nowrap; }
body:has(dialog[open]) { overflow: hidden; }

/* Horizontal Collapsible Lists (.h-list / .h-row) */
.h-list { display: flex; flex-direction: column; gap: 8px; }
.h-list-compact { gap: 6px; padding: 8px; }
#workspace-hosting > .h-row { margin-top: 8px; }

.h-list-head {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 2px 16px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #636369;
  border-bottom: 1px solid #ececf0;
  margin-bottom: 8px;
}

.h-row {
  border: 1px solid #e2e2e7;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.h-row:hover { border-color: #c8c8d0; }
.h-row[open] {
  border-color: #b4b4be;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.h-row-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  min-height: 52px;
  user-select: none;
  transition: background-color 150ms ease;
}
.h-row-summary::-webkit-details-marker { display: none; }
.h-row-summary::marker { content: ''; }
.h-row-summary:hover { background: #fafafc; }
.h-row-summary:focus-visible { outline: 2px solid #0066cc; outline-offset: -2px; }
.h-row[open] > .h-row-summary {
  background: #f6f6f9;
  border-bottom: 1px solid #e6e6ec;
}

.h-arrow {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid #6e6e75;
  border-bottom: 1.8px solid #6e6e75;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
  margin-right: 2px;
}
.h-row[open] > .h-row-summary .h-arrow,
.hosting-owners[open] > summary .h-arrow,
.hosting-owner[open] > summary .h-arrow {
  transform: rotate(45deg);
}

.h-cell {
  min-width: 0;
  font-size: 13px;
  color: #1d1d1f;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.h-cell-lead { flex-direction: row; align-items: center; gap: 10px; }
.h-lead-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.h-lead-text strong, .h-lead-text small, .h-code-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h-lead-text strong { font-size: 13.5px; font-weight: 600; color: #1d1d1f; }
.h-lead-text small, .h-sub { font-size: 11.5px; color: #58585e; }
.h-cell-end { flex-direction: row; align-items: center; justify-content: flex-end; gap: 6px; }
.h-toggle-hint { font-size: 12px; font-weight: 500; color: #58585e; white-space: nowrap; }
.h-row[open] > .h-row-summary .h-toggle-hint { color: #1d1d1f; }

/* Desktop Horizontal Column Grids */
.h-cols-asset { grid-template-columns: minmax(210px, 1.6fr) minmax(135px, 1.05fr) minmax(135px, 1.05fr) minmax(135px, 1fr) 48px; }
.h-cols-investor { grid-template-columns: minmax(185px, 1.45fr) minmax(125px, 0.95fr) minmax(150px, 1.15fr) minmax(125px, 0.95fr) minmax(125px, 0.95fr) 48px; }
.h-cols-sales { grid-template-columns: minmax(175px, 1.35fr) minmax(135px, 1fr) minmax(175px, 1.35fr) minmax(125px, 0.95fr) 82px; }
.h-cols-user { grid-template-columns: minmax(210px, 1.6fr) minmax(135px, 1.05fr) minmax(105px, 0.8fr) minmax(145px, 1.1fr) 48px; }
.h-cols-order { grid-template-columns: minmax(195px, 1.45fr) minmax(150px, 1.1fr) minmax(110px, 0.85fr) minmax(125px, 0.95fr) 48px; }
.h-cols-promo { grid-template-columns: minmax(165px, 1.25fr) minmax(175px, 1.35fr) minmax(105px, 0.8fr) minmax(90px, 0.7fr) 48px; }
.h-cols-lead { grid-template-columns: minmax(175px, 1.3fr) minmax(145px, 1.1fr) minmax(155px, 1.2fr) minmax(135px, 1fr) 48px; }

/* Expanded Detail Drawer */
.h-row-detail { padding: 14px 16px 16px; background: #f8f8fb; }
.h-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.h-detail-block {
  background: #ffffff;
  border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.h-detail-title { font-size: 11.5px; font-weight: 600; color: #58585e; margin-bottom: 2px; }
.h-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e6e6ec;
}
.h-detail-actions .hosting-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.h-detail-actions button.small { min-height: 36px; padding: 6px 14px; }
.h-detail-nested { margin-top: 12px; }
.h-progress-row { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.h-inline-link { color: #005bb9; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }

/* Semantic Pills & Tones */
.h-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.h-pill.ok { background: #eaf6ee; color: #156a37; }
.h-pill.info { background: #eaf3ff; color: #0058b3; }
.h-pill.warn { background: #fff4e2; color: #8c4d00; }
.h-pill.danger { background: #ffecee; color: #b81422; }
.h-pill.neutral { background: #f1f1f4; color: #3c3c42; }
.tone-danger { color: #b81422 !important; }
.tone-warn { color: #8c4d00 !important; }

/* Compliance Pills, Bank Card, Timing, Owner Groups */
.hosting-timing { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #3c3c42; }
.hosting-timing b { color: #1d1d1f; font-size: 13px; }
.hosting-timing small { color: #58585e; }

.compliance-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; font-size: 11.5px; }
.compliance-pills > * {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f1f4;
  color: #38383c;
  line-height: 1.4;
}
.compliance-pills > .done { background: #eaf6ee; color: #156a37; }
.compliance-pills > .missing { background: #fff4e2; color: #8c4d00; }
.compliance-pills a {
  background: #eaf3ff;
  color: #0058b3;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.bank-card {
  padding: 10px 12px;
  background: #f5f5f7;
  border-radius: 10px;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.bank-card b { display: block; color: #1d1d1f; }
.bank-card div { letter-spacing: 0.03em; margin: 4px 0; font-weight: 600; color: #1d1d1f; }
.bank-card small { color: #58585e; }

/* Flat Nested Hierarchy: Eliminate Box-in-Box Border Stacking */
.province-card .fold-body,
.city-card .fold-body,
.city-sales-fold > .fold-body {
  padding: 0;
  gap: 0;
}
.fold-empty { padding: 12px 18px; }

.province-card .city-card {
  border: 0;
  border-top: 1px solid #e6e6ec;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
}
.province-card .city-card:first-child { border-top: 0; }
.province-card .city-card[open] { box-shadow: inset 3px 0 0 #0066cc; }
.province-list > .city-card {
  border: 1px solid #e2e2e7;
  border-radius: 14px;
}

.fold-body .h-list,
.hosting-owners .h-list {
  gap: 0;
}

.fold-body .h-row,
.hosting-owners .h-row,
.h-detail-nested .h-row {
  border: 0;
  border-top: 1px solid #ececf1;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.fold-body .h-row:first-child,
.hosting-owners .h-row:first-child,
.h-detail-nested .h-row:first-child {
  border-top: 0;
}
.fold-body .h-row[open],
.hosting-owners .h-row[open],
.h-detail-nested .h-row[open] {
  box-shadow: none;
}
.fold-body .h-row[open] > .h-row-summary,
.hosting-owners .h-row[open] > .h-row-summary {
  background: #f6f6f9;
  border-bottom: 1px solid #ececf1;
}
.fold-body .h-row > .h-row-detail,
.hosting-owners .h-row > .h-row-detail {
  background: #ffffff;
  padding: 12px 16px 14px;
}
.fold-body .h-row > .h-row-detail .h-detail-block,
.hosting-owners .h-row > .h-row-detail .h-detail-block {
  background: #f5f5f7;
  border: 0;
  box-shadow: none;
}

.hosting-owners {
  min-width: 0;
  max-width: 100%;
  margin: 10px 0 0;
  border: 0;
  border-top: 1px solid #e8e8ee;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.hosting-owners > summary,
.hosting-owner > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  min-height: 42px;
  cursor: pointer;
  padding: 9px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #1d1d1f;
  transition: background-color 150ms ease;
}
.hosting-owners > summary::-webkit-details-marker,
.hosting-owner > summary::-webkit-details-marker { display: none; }
.hosting-owners > summary::marker,
.hosting-owner > summary::marker { content: ''; }
.hosting-owners > summary:hover,
.hosting-owner > summary:hover { background: rgba(0, 0, 0, 0.025); }
.hosting-owners-body { padding: 0; display: flex; flex-direction: column; gap: 0; }

.hosting-owner {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid #eeeef3;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.hosting-owner > summary { padding: 9px 6px 9px 16px; }
.hosting-owner[open] > summary { border-bottom: 1px solid #eeeef3; background: #f8f8fb; }
.hosting-owner > .h-list-compact {
  padding: 0 0 4px 12px;
  margin-left: 16px;
  border-left: 2px solid #e4e4ec;
  gap: 0;
}

.city-nested-wraps { padding: 0 16px 10px; background: #ffffff; }
.hierarchy-owners-pad { padding: 6px 22px 12px; }
.province-summary, .city-summary { flex-wrap: wrap; }

/* Tablet breakpoint (768px - 1024px) */
@media (max-width: 1024px) {
  .panel-tabs button, .page > .tabs button { min-height: 44px; }
  .h-list-head, .h-row-summary { gap: 8px; padding: 10px 12px; }
  .h-cols-asset { grid-template-columns: minmax(150px, 1.4fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(110px, 0.95fr) 42px; }
  .h-cols-investor { grid-template-columns: minmax(140px, 1.3fr) minmax(105px, 0.9fr) minmax(120px, 1fr) minmax(105px, 0.9fr) minmax(105px, 0.9fr) 42px; }
  .h-cols-sales { grid-template-columns: minmax(130px, 1.2fr) minmax(105px, 0.95fr) minmax(130px, 1.15fr) minmax(105px, 0.95fr) 74px; }
  .h-cols-user { grid-template-columns: minmax(150px, 1.4fr) minmax(110px, 1fr) minmax(90px, 0.75fr) minmax(120px, 1fr) 42px; }
  .h-cols-order { grid-template-columns: minmax(145px, 1.35fr) minmax(115px, 1fr) minmax(95px, 0.85fr) minmax(105px, 0.95fr) 42px; }
  .h-cols-promo { grid-template-columns: minmax(125px, 1.15fr) minmax(135px, 1.25fr) minmax(85px, 0.75fr) minmax(78px, 0.7fr) 42px; }
  .h-cols-lead { grid-template-columns: minmax(130px, 1.2fr) minmax(110px, 1fr) minmax(125px, 1.1fr) minmax(110px, 0.95fr) 42px; }
  .h-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Mobile breakpoint (<= 767px, including 360px & 390px) */
@media (max-width: 767px) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
  .panel-tabs, .page > .tabs { scrollbar-width: none; }
  .panel-tabs::-webkit-scrollbar, .page > .tabs::-webkit-scrollbar { display: none; }
  .page, .agent-main { padding-left: 12px; padding-right: 12px; }
  .panel-card { border: 0; border-radius: 0; padding: 6px 0; background: transparent; box-shadow: none; }
  .panel-tabs { padding-bottom: 6px; }
  .hosting-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hosting-summary > div { flex-direction: column; align-items: flex-start; gap: 4px; padding: 11px 12px; }
  .hosting-summary strong { font-size: 18px; }
  .h-list-head { display: none; }
  .h-row-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px 10px;
    padding: 12px;
    min-height: 56px;
  }
  .h-row-summary > .h-cell { min-width: 0; overflow-wrap: anywhere; }
  .h-row-summary > .h-cell .money { white-space: normal; }
  .h-row-summary > .h-cell-lead { grid-column: 1 / -1; }
  .h-lead-text strong, .h-lead-text small, .h-code-line { white-space: normal; overflow-wrap: anywhere; }
  .h-row-summary > .h-cell-end { grid-column: 2; justify-self: end; }
  .h-row-detail { padding: 12px; }
  .h-detail-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .h-detail-actions { justify-content: stretch; }
  .h-detail-actions .hosting-actions { width: 100%; }
  .h-detail-actions button.small { flex: 1 1 130px; min-height: 44px; white-space: normal; }
  .compliance-pills a { display: inline-flex; align-items: center; min-height: 36px; }
  .bank-card { padding: 9px 10px; }
  .province-summary, .city-summary, .hierarchy-fold > summary { padding: 12px; }
  .fold-body, .city-sales-fold > .fold-body { padding: 0 !important; }
  .fold-empty { padding: 10px 12px; }
  .fold-body .h-row > .h-row-summary { padding: 11px 12px; }
  .fold-body .h-row > .h-row-detail { padding: 10px 12px 12px; }
  .hosting-owners > summary { padding: 9px 2px; }
  .hosting-owner > summary { padding: 9px 2px 9px 10px; }
  .hosting-owner > .h-list-compact { margin-left: 8px; padding: 0 0 4px 8px; }
  .hosting-owner .h-row-summary { padding: 10px 4px; }
  .hosting-owner .h-row-detail { padding: 8px 4px 10px; }
  .city-detail-bar { display: flex; flex-wrap: wrap; gap: 10px; }
  .city-detail-bar > * { flex: 1 1 130px; min-width: 0; }
}

@media (max-width: 420px) {
  .kpi-value { font-size: clamp(16px, 4.6vw, 20px); }
}

@media (prefers-reduced-motion: reduce) {
  .h-row, .h-row-summary, .h-arrow, .hosting-owners > summary, .hosting-owner > summary { transition: none; }
}

/* Phone typography and compact rental cards; desktop sizing stays unchanged. */
@media (max-width: 760px) {
  .hero h1, html:not([lang='zh-CN']) .hero h1 {
    font-size: clamp(28px, 7vw, 32px);
    line-height: 1.22;
    margin: 12px 0 16px;
  }
  #app section h2, #app .section-head h2 { font-size: 24px; line-height: 1.3; margin: 10px 0 14px; }
  #app .invest-hero h1 { font-size: clamp(28px, 7vw, 32px); line-height: 1.25; }
  #app .features h3, #app .steps h3 { font-size: 18px; }
  #plans { padding: 36px 16px; }
  #plans .section-head { margin-bottom: 20px; }
  #plans .section-head p { font-size: 14px; line-height: 1.6; }
  #plan-cards { gap: 12px; margin-top: 20px; }
  #plan-cards > .plan { padding: 20px 18px; border-radius: 18px; }
  #plan-cards > .plan > h3 { font-size: 18px; line-height: 1.4; margin: 0 0 6px; padding-right: 0; }
  #plan-cards > .plan:has(.badge) > h3 { padding-right: 78px; }
  #plan-cards > .plan > p { font-size: 13px; line-height: 1.65; min-height: 0; margin-bottom: 8px; }
  #plan-cards .badge { top: 19px; right: 18px; font-size: 11px; padding: 3px 8px; }
  #plan-cards .price { font-size: 28px; line-height: 1.25; margin: 10px 0 4px; letter-spacing: -.025em; }
  #plan-cards .price sup { font-size: 14px; }
  #plan-cards .price small { font-size: 12px; }
  #plan-cards > .plan > ul { margin: 14px 0 14px; padding: 14px 0 0; }
  #plan-cards .plan li { font-size: 13px; line-height: 1.6; margin-bottom: 8px; }
  #plan-cards .plan li:last-child { margin-bottom: 0; }
  #plan-cards > .plan > button { min-height: 44px; padding: 10px 14px; font-size: 14px; }
}
