/* The agent phone palette mirrors the member phone palette. Desktop is untouched. */
:root[data-agent-theme] {
  --agent-theme-header: #142e4c;
  --agent-theme-primary: #1765ad;
  --agent-theme-accent: #23aeaa;
  --agent-theme-light: #e3edf7;
  --agent-theme-bg: #edf2f7;
  --agent-theme-ink: #24496c;
  --agent-theme-line: #d6e1eb;
  --agent-theme-wallet: #167a85;
}
:root[data-agent-theme="jade"] { --agent-theme-header:#164b45;--agent-theme-primary:#21796a;--agent-theme-accent:#83c6ac;--agent-theme-light:#e3f1ea;--agent-theme-bg:#f0f6f2;--agent-theme-ink:#28574c;--agent-theme-line:#d1e4db;--agent-theme-wallet:#21796a }
:root[data-agent-theme="violet"] { --agent-theme-header:#393052;--agent-theme-primary:#7155a3;--agent-theme-accent:#b6a1df;--agent-theme-light:#eee8f7;--agent-theme-bg:#f5f2f8;--agent-theme-ink:#55416f;--agent-theme-line:#ded5eb;--agent-theme-wallet:#7155a3 }
:root[data-agent-theme="amber"] { --agent-theme-header:#51422e;--agent-theme-primary:#97703a;--agent-theme-accent:#dcba78;--agent-theme-light:#f5eddf;--agent-theme-bg:#f9f5ed;--agent-theme-ink:#6b5133;--agent-theme-line:#e5d9c5;--agent-theme-wallet:#88652e }
:root[data-agent-theme="slate"] { --agent-theme-header:#303f4c;--agent-theme-primary:#526b80;--agent-theme-accent:#a3bfcc;--agent-theme-light:#e8eef2;--agent-theme-bg:#f1f4f6;--agent-theme-ink:#3d5365;--agent-theme-line:#d5dfe5;--agent-theme-wallet:#426c7a }
:root[data-agent-theme="night"] { --agent-theme-header:#101b2a;--agent-theme-primary:#86b5f2;--agent-theme-accent:#66c6bb;--agent-theme-light:#263b55;--agent-theme-bg:#101925;--agent-theme-ink:#d8e5f5;--agent-theme-line:#304259;--agent-theme-wallet:#7dd3bf }

.agent-mobile-theme-setting { display:none }
@media (max-width:720px) {
  body.agent-mobile-agent {
    --phone-blue: var(--agent-theme-primary);
    --phone-ink: var(--agent-theme-ink);
    --phone-muted: color-mix(in srgb, var(--agent-theme-ink) 58%, white);
    --phone-line: var(--agent-theme-line);
    background: var(--agent-theme-bg);
    color: var(--agent-theme-ink);
  }
  body.agent-mobile-agent .mobile-console-bar { background: color-mix(in srgb, var(--agent-theme-bg) 94%, white); border-bottom-color: var(--agent-theme-line); }
  body.agent-mobile-agent .main-pane>.card,
  body.agent-mobile-agent #workspace>.card:first-child,
  body.agent-mobile-agent .agent-phone-more-group { border-color: var(--agent-theme-line) !important; }
  body.agent-mobile-agent h2,
  body.agent-mobile-agent h3,
  body.agent-mobile-agent .mobile-console-bar strong { color: var(--agent-theme-ink); }
  body.agent-mobile-agent .mobile-console-bar button,
  body.agent-mobile-agent #refreshAgentWallet,
  body.agent-mobile-agent .agent-phone-asset-toggle { color: var(--agent-theme-primary); border-color: var(--agent-theme-line); background: var(--agent-theme-light); }
  body.agent-mobile-agent .main-pane form button:not(.secondary) { background:var(--agent-theme-primary);color:#fff; }
  body.agent-mobile-agent .agent-top-categories button.active,
  body.agent-mobile-agent #betsPanel #loadBets,
  body.agent-mobile-agent .mobile-console-drawer .side button.active { background: var(--agent-theme-primary) !important; border-color: var(--agent-theme-primary) !important; color: #fff !important; }
  body.agent-mobile-agent .agent-top-links button.active { background: var(--agent-theme-light) !important; border-color: var(--agent-theme-line) !important; color: var(--agent-theme-primary) !important; }
  body.agent-mobile-agent .agent-phone-nav { border-top-color: var(--agent-theme-line); background: color-mix(in srgb, var(--agent-theme-bg) 92%, white); }
  body.agent-mobile-agent .agent-phone-nav button.active { color: var(--agent-theme-primary); background: var(--agent-theme-light) !important; }
  body.agent-mobile-agent .agent-phone-account { color: var(--agent-theme-ink); }
  body.agent-mobile-agent .agent-phone-account .agent-phone-copy { color: var(--agent-theme-primary); }
  body.agent-mobile-agent .agent-header-assets strong { color: var(--agent-theme-wallet); }
  body.agent-mobile-agent #agentWalletPanel #agentEarnings { color: var(--agent-theme-ink); background: var(--agent-theme-light); }
  body.agent-mobile-agent #agentWalletPanel .agent-earnings-stat strong { color: var(--agent-theme-wallet); }
  body.agent-mobile-agent .agent-phone-more-toggle,
  body.agent-mobile-agent .agent-phone-finance-heading { color: var(--agent-theme-ink); background: var(--agent-theme-light); }
  body.agent-mobile-agent .agent-phone-finance-group { border-color: var(--agent-theme-line); background: linear-gradient(180deg, color-mix(in srgb, var(--agent-theme-light) 76%, white), #fff); }
  body.agent-mobile-agent .agent-phone-finance-group .agent-phone-more-links button svg { background: var(--agent-theme-light); stroke: var(--agent-theme-primary); }
  body.agent-mobile-agent .agent-phone-more-links button { border-color: var(--agent-theme-line); color: var(--agent-theme-ink); }
  body.agent-mobile-agent .agent-mobile-theme-setting { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:2px;padding:10px 11px;border:1px solid var(--agent-theme-line);border-radius:9px;background:var(--agent-theme-light);color:var(--agent-theme-ink);font-size:12px; }
  body.agent-mobile-agent .agent-mobile-theme-setting span { font-weight:600; }
  body.agent-mobile-agent .agent-mobile-theme-setting select { width:112px;min-height:32px;padding:5px 7px;border-color:var(--agent-theme-line) !important;background:#fff;color:var(--agent-theme-ink);font-size:12px !important; }
  /* Independent mobile portals: no large outer frame or repeated account strip. */
  body.agent-mobile-agent #agentPhoneMorePanel,
  body.agent-mobile-agent #agentPhoneWalletPanel { padding:0 !important;margin:4px 0 12px !important;border:0 !important;border-radius:0 !important;background:transparent;box-shadow:none; }
  body.agent-mobile-agent:is([data-mobile-panel="agentPhoneMorePanel"],[data-mobile-panel="agentPhoneWalletPanel"]) #workspace>.card:first-child { padding:0 !important;margin:0 !important;border:0 !important;background:transparent;box-shadow:none; }
  body.agent-mobile-agent:is([data-mobile-panel="agentPhoneMorePanel"],[data-mobile-panel="agentPhoneWalletPanel"]) #workspace>.card:first-child>.agent-phone-account,
  body.agent-mobile-agent:is([data-mobile-panel="agentPhoneMorePanel"],[data-mobile-panel="agentPhoneWalletPanel"]) #workspace>.card:first-child>#refresh,
  body.agent-mobile-agent:is([data-mobile-panel="agentPhoneMorePanel"],[data-mobile-panel="agentPhoneWalletPanel"]) #workspace>.card:first-child>#logout { display:none; }
  body.agent-mobile-agent #agentPhoneMorePanel>h2 { display:none; }
  /* Wallet uses the original home navigation shell; member wallet content stays intact. */
  /* My only: compact account card and two quiet, grouped menus. */
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-identity { display:flex;align-items:center;gap:10px;margin:4px 0 12px;padding:12px;background:#fff;border:1px solid var(--agent-theme-line);border-radius:11px; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-identity>svg { box-sizing:content-box;width:22px;height:22px;padding:10px;background:var(--agent-theme-light);border-radius:50%;fill:none;stroke:var(--agent-theme-primary);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-identity>div { display:grid;gap:3px;flex:1;min-width:0; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-identity small { font-size:10px;color:var(--phone-muted); }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-identity strong { font-size:18px;font-weight:600;color:var(--agent-theme-ink);overflow-wrap:anywhere; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-code { padding:0;min-height:22px;background:transparent;border:0;color:var(--agent-theme-primary);font-size:11px;text-align:left;overflow-wrap:anywhere; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-profile-link { min-height:30px;padding:5px 7px;background:var(--agent-theme-light);border:0;border-radius:6px;color:var(--agent-theme-primary);font-size:11px;white-space:nowrap; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-groups { display:grid;gap:0;background:transparent;border:0;border-radius:0;overflow:visible; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-section-heading { margin:10px 4px 6px;font-size:11px;font-weight:400;line-height:1.4;color:var(--phone-muted); }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-group { border:1px solid var(--agent-theme-line)!important;border-bottom:0!important;border-radius:0;background:#fff; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-group[data-mine-section-start="true"] { border-radius:10px 10px 0 0; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-group[data-mine-section-end="true"] { border-bottom:1px solid var(--agent-theme-line)!important;border-radius:0 0 10px 10px; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-group[data-mine-section-start="true"][data-mine-section-end="true"] { border-radius:10px; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-toggle { background:#fff;min-height:54px;padding:10px 12px;gap:10px;font-size:13px;font-weight:500; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-toggle small { color:var(--phone-muted);font-size:10px;white-space:nowrap; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-toggle:after { transform:none;content:'›';color:var(--phone-muted);font-size:20px; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-toggle[aria-expanded="true"]:after { transform:rotate(90deg); }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-icon { box-sizing:content-box;width:18px;height:18px;padding:6px;flex:none;fill:none;stroke:var(--agent-theme-primary);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;background:var(--agent-theme-light);border-radius:7px; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-links:not([hidden]) { gap:6px;padding:0 12px 12px;border:0;background:#fff; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-links button { min-height:38px;padding:8px 5px;border:0;border-radius:7px;background:var(--agent-theme-light);color:var(--agent-theme-ink);font-size:12px; }
  /* 个人管理收成一张紧凑卡片，四项仍可用但不再撑满菜单。 */
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-group:has([data-more-target="agentPersonalManagementPanel"]) .agent-phone-more-links:not([hidden]){grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:7px 8px}
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-more-group:has([data-more-target="agentPersonalManagementPanel"]) .agent-phone-more-links button{min-height:44px;padding:5px 2px;font-size:10px;line-height:1.25;word-break:break-all}
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-funds-group>.agent-phone-more-toggle { display:none; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-funds-group .agent-phone-more-links:not([hidden]) { display:block;padding:0;border:0; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-funds-group .agent-phone-more-links button { display:flex;align-items:center;gap:10px;width:100%;min-height:54px;padding:10px 12px;border:0;border-radius:0;background:#fff;font-size:13px;text-align:left; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-funds-group .agent-phone-more-links button>span { flex:1; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-funds-group .agent-phone-more-links button:after { content:'›';font-size:20px;color:var(--phone-muted); }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-mobile-theme-setting { margin:12px 0 0;padding:9px 12px;border-radius:10px;background:#fff; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-mobile-theme-setting select { min-height:34px;background:var(--agent-theme-light);border:0!important; }
  body.agent-mobile-agent #agentPhoneMorePanel .agent-phone-mine-logout { width:100%;min-height:40px;margin-top:10px;border:1px solid #e8d6d6;border-radius:10px;background:#fff;color:#a66060;font-size:12px; }
  body.agent-mobile-agent .agent-top-links,
  body.agent-mobile-agent .mobile-console-drawer,
  body.agent-mobile-agent .mobile-console-drawer-head { background:var(--agent-theme-bg) !important; }
  body.agent-mobile-agent .notice,
  body.agent-mobile-agent .metric,
  body.agent-mobile-agent .mobile-console-drawer .side .group-label,
  body.agent-mobile-agent #agentDashboardPanel .agent-dashboard-metrics>div,
  body.agent-mobile-agent #agentDashboardPanel .agent-dashboard-funds { background:var(--agent-theme-light);border-color:var(--agent-theme-line);color:var(--agent-theme-ink); }
  body.agent-mobile-agent #agentDashboardPanel .agent-network-grid strong,
  body.agent-mobile-agent #agentDashboardPanel .agent-dashboard-metrics strong { color:var(--agent-theme-wallet); }
  body.agent-mobile-agent .main-pane th { background:var(--agent-theme-light);color:var(--agent-theme-ink); }
  body.agent-mobile-agent input:focus,
  body.agent-mobile-agent select:focus,
  body.agent-mobile-agent textarea:focus,
  body.agent-mobile-agent button:focus-visible { outline-color:var(--agent-theme-accent); }
}
