/* Shared semantic palette. Trading mode never selects a theme. */
#phone {
  --cp-bg:#fff;--cp-card:#fff;--cp-soft:#f5f7f8;--cp-border:#d6e0e3;
  --cp-text:#172e34;--cp-muted:#53666d;--cp-accent:#087585;--cp-tint:#eaf8fa;
  --cp-up:#087354;--cp-down:#b92e50;--cp-edge:#73858c;--cp-warning:#845700;
  --cp-warning-bg:#fff5dd;--cp-cta:#68d8eb;--cp-cta-ink:#102128;
  --primary:var(--cp-accent);--primary-light:var(--cp-tint);--ink:var(--cp-text);
  --muted:var(--cp-muted);--surface:var(--cp-soft);--line:var(--cp-border);
  --green:var(--cp-up);--red:var(--cp-down);
  background:var(--cp-bg);border-color:var(--cp-bg);color:var(--cp-text);
}
#phone[data-theme="dark"] {
  --cp-bg:#10171f;--cp-card:#151e28;--cp-soft:#1b2834;--cp-border:#405461;
  --cp-text:#e1edf0;--cp-muted:#a0b2bb;--cp-accent:#68d8eb;--cp-tint:#15333f;
  --cp-up:#4bc89f;--cp-down:#fb7695;--cp-edge:#78939f;--cp-warning:#f0c46a;
  --cp-warning-bg:#352d1b;
}
#phone .screen,#phone .statusbar,#phone .nav {background:var(--cp-bg);color:var(--cp-text)}
#phone .nav button{color:var(--cp-muted)}
#phone .nav button.active{background:var(--cp-tint);color:var(--cp-accent)}
#phone .demo-strip{background:var(--cp-soft);color:var(--cp-muted);font-size:11px;line-height:1.5}
#phone .battery{background:var(--cp-text);color:var(--cp-bg)}
#phone .sheet{background:var(--cp-card);color:var(--cp-text);padding-bottom:calc(24px + env(safe-area-inset-bottom));scroll-padding-block:16px 32px}
#phone .sheet-head{gap:12px}
#phone .sheet p{color:var(--cp-muted)}
#phone .toast{z-index:80;background:var(--cp-text);color:var(--cp-bg);font-size:14px;line-height:1.5}
#phone .home-indicator{background:var(--cp-text)}
#phone .primary,#phone .cp-primary,#phone .cp-modal .cp-button {background:var(--cp-cta);color:var(--cp-cta-ink)!important}
#phone .cp-primary{background:var(--cp-cta)!important;border-color:var(--cp-cta)!important}
#phone .cp-modal .cp-button.cp-secondary{background:var(--cp-soft);color:var(--cp-text)!important}
#phone .primary:disabled,#phone .cp-modal .cp-button:disabled {background:var(--cp-soft);color:var(--cp-muted)!important;cursor:not-allowed}
#phone .cp-long,#phone .primary.green{background:var(--cp-up);color:#fff}
#phone .cp-short,#phone .cp-modal .cp-button.cp-danger{background:var(--cp-down);color:#fff!important}
#phone[data-theme="dark"] .cp-long,#phone[data-theme="dark"] .cp-short,#phone[data-theme="dark"] .primary.green,#phone[data-theme="dark"] .cp-modal .cp-button.cp-danger {color:#102128!important}
#phone .cp-modal.is-pro {color-scheme:inherit}
#phone :is(button,a,input,select,textarea,summary):focus-visible {outline:3px solid var(--cp-accent);outline-offset:3px}
#phone :is(input,select,textarea){color:var(--cp-text);accent-color:var(--cp-accent)}
#phone input::placeholder,#phone textarea::placeholder{color:var(--cp-muted);opacity:1}
#phone :is(.text-field,.search,.inline-select,.field-wrap){border-color:var(--cp-edge)}
#phone .cp-input-wrap{border-color:var(--cp-edge)}
#phone :is(.cp-mode button,.cp-chart-periods button,.cp-fund-ranges button,.cp-link,.cp-icon-button){min-height:44px;min-width:44px}
#phone .cp-mode{width:112px;height:50px;flex-shrink:0}
#phone .cp-mode button{width:52px;padding:0}
#phone .cp-mode i{height:44px;width:52px}
#phone .cp-mode i.right{transform:translateX(52px)}
#phone .cp-topbar{gap:6px}
#phone .cp-asset-select{min-width:0;font-size:17px;gap:4px}
#phone .cp-ai-entry{padding-inline:7px;white-space:nowrap;min-height:44px}
#phone .cp-modal:focus{outline-offset:-4px}
.v4-contract-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 14px}
.v4-contract-tools>div{display:flex;flex-direction:column;gap:5px;min-width:0}
.v4-section-label{font-size:14px;font-weight:600}
.v4-contract-tools .cp-account{display:flex;align-items:center;justify-content:flex-start;gap:5px;max-width:none;font-size:12px;color:var(--cp-muted)}
.v4-contract-tools .cp-account strong{flex-basis:auto;text-align:left;color:var(--cp-text);font-variant-numeric:tabular-nums}
.v4-settings{display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid var(--cp-edge);border-radius:12px;min-height:44px;padding:0 10px;background:var(--cp-card);font-size:14px}
.v4-settings-content{font-size:16px;line-height:1.65}
#phone .v4-settings-content p{font-size:14px;line-height:1.7}
.v4-settings-intro{margin-bottom:20px}
.v4-appearance{border:0;padding:0;margin:0;min-width:0}
.v4-appearance legend{font-size:16px;font-weight:600;margin-bottom:12px}
.v4-theme-choice{display:flex;align-items:center;gap:12px;padding:14px 12px;margin-bottom:10px;border:1px solid var(--cp-edge);border-radius:16px;cursor:pointer;min-height:76px}
.v4-theme-choice:has(input:checked){background:var(--cp-tint);border-color:var(--cp-accent);box-shadow:inset 0 0 0 1px var(--cp-accent)}
.v4-theme-choice input{width:20px;height:20px;flex-shrink:0;margin:0}
.v4-theme-choice>span:nth-child(2){flex:1;min-width:0}
.v4-theme-choice strong{font-size:16px;font-weight:600;display:block}
.v4-theme-choice small{font-size:14px;line-height:1.5;color:var(--cp-muted);display:block;margin-top:4px}
.v4-theme-preview{width:26px;height:32px;border:1px solid var(--cp-edge);border-radius:6px;flex-shrink:0}
.v4-preview-light{background:#fff}.v4-preview-dark{background:#10171f}
.v4-preview-system,.v4-preview-schedule{background:linear-gradient(90deg,#fff 50%,#10171f 50%)}
.v4-setting-status{min-height:48px;margin:12px 0;color:var(--cp-muted)}
.v4-setting-divider{height:1px;background:var(--cp-border);margin:20px 0}
.v4-settings-content h3{font-size:16px;margin-bottom:8px}
.v4-settings-done{margin-top:24px;min-height:48px}
#phone .tabs button.active{background:var(--cp-card)}
#phone .card .muted{color:var(--cp-muted)}
#phone .guide{background:var(--cp-tint);border-color:var(--cp-border)}
#phone .guide small,#phone .strategy small{color:var(--cp-muted)}
#phone .strategy.active{background:var(--cp-tint)}
#phone .sticky-action{background:var(--cp-bg)}
#phone .badge{background:var(--cp-soft);color:var(--cp-muted)}
#phone .badge.green{color:var(--cp-up)}
#phone .badge.orange{color:var(--cp-warning);background:var(--cp-warning-bg)}
#phone .selection-caption{color:var(--cp-accent)}
@media(max-width:740px){#phone{height:var(--copen-viewport-height,100dvh)}#phone .sheet-wrap{inset:0}#phone .sheet{max-height:95%}}
@media(max-width:360px){#phone .screen{padding-inline:14px}#phone .cp-asset-select{font-size:15px}#phone .cp-ai-entry{font-size:11px;padding-inline:4px}#phone .cp-topbar{gap:4px}.v4-theme-choice{gap:8px}.v4-theme-preview{display:none}}
@media(prefers-reduced-motion:no-preference){#phone,#phone .nav,#phone .screen,#phone .sheet{transition:background-color .18s ease,color .18s ease,border-color .18s ease}}
@media(prefers-reduced-motion:reduce){#phone *,#phone *::before,#phone *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
