:root {
      color-scheme: dark;
      --bg: #000000;
      --surface: #0b0c0e;
      --surface-2: #121417;
      --surface-3: #1e2228;
      --line: #2a2d34;
      --text: #f5f7fb;
      --muted: #8e949f;
      --soft: #c6cad2;
      --gold: #e3b84f;
      --gold-2: #f3cd6b;
      --accent: #2f8cff;
      --accent-soft: rgba(47, 140, 255, 0.18);
      --buy: #16b979;
      --sell: #ef454a;
      --price-up: #16b979;
      --price-down: #ef454a;
      --price-up-soft: rgba(22, 185, 121, 0.13);
      --price-down-soft: rgba(214, 91, 81, 0.14);
      --warn: #f5a742;
      --shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
      --app-bg: #000000;
      --top-bg: rgba(0, 0, 0, 0.96);
      --panel-bg: #08090b;
      --quote-box-bg: #090a0c;
      --control-bg: #111317;
      --icon-bg: #15171b;
      --metric-bg: #101216;
      --subtle-bg: rgba(255, 255, 255, 0.035);
      --row-line: rgba(255, 255, 255, 0.08);
      --weak-line: rgba(255, 255, 255, 0.06);
      --hairline: rgba(255, 255, 255, 0.04);
      --active-row-bg: rgba(47, 140, 255, 0.08);
      --button-active-text: #ffffff;
      --nav-bg: rgba(22, 23, 26, 0.94);
      --nav-active-bg: rgba(255, 255, 255, 0.11);
      --nav-icon: #ffffff;
      --nav-border: rgba(255, 255, 255, 0.15);
      --nav-highlight: rgba(255, 255, 255, 0.18);
      --nav-shadow-strong: rgba(0, 0, 0, 0.58);
      --nav-shadow-soft: rgba(0, 0, 0, 0.32);
      --chart-bg: #000000;
      --chart-grid: rgba(80, 94, 118, 0.26);
      --chart-text: rgba(245, 247, 251, 0.70);
      --chart-meta: rgba(244, 240, 229, 0.68);
      --toast-bg: rgba(32, 36, 31, 0.98);
      --toast-text: #ffffff;
      --sheet-backdrop: rgba(0, 0, 0, 0.55);
      --disabled-text: #9fa69d;
      --disabled-line: #454c43;
      --disabled-bg: #2f342f;
      --disabled-strong-bg: #343a34;
      --disabled-button-bg: #2b302b;
      --motion-fast: 130ms;
      --motion-med: 240ms;
      --motion-screen: 320ms;
      --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
      --ease-snap: cubic-bezier(0.2, 0.9, 0.18, 1);
    }

    html[data-theme="light"] {
      color-scheme: light;
      --bg: #eef2f7;
      --surface: #ffffff;
      --surface-2: #f5f7fb;
      --surface-3: #e8eef6;
      --line: #d7deea;
      --text: #111827;
      --muted: #667085;
      --soft: #334155;
      --gold: #b98511;
      --gold-2: #8a6110;
      --accent: #1769e0;
      --accent-soft: rgba(23, 105, 224, 0.12);
      --buy: #07865c;
      --sell: #d6373f;
      --price-up: #07865c;
      --price-down: #d6373f;
      --price-up-soft: rgba(8, 134, 92, 0.12);
      --price-down-soft: rgba(214, 55, 63, 0.10);
      --warn: #b7791f;
      --shadow: 0 18px 46px rgba(15, 23, 42, 0.14);
      --app-bg: #f7f9fc;
      --top-bg: rgba(255, 255, 255, 0.96);
      --panel-bg: #ffffff;
      --quote-box-bg: #f8fafc;
      --control-bg: #ffffff;
      --icon-bg: #f4f7fb;
      --metric-bg: #f7f9fc;
      --subtle-bg: rgba(15, 23, 42, 0.04);
      --row-line: rgba(15, 23, 42, 0.09);
      --weak-line: rgba(15, 23, 42, 0.08);
      --hairline: rgba(15, 23, 42, 0.06);
      --active-row-bg: rgba(23, 105, 224, 0.08);
      --button-active-text: #0f172a;
      --nav-bg: rgba(255, 255, 255, 0.94);
      --nav-active-bg: rgba(23, 105, 224, 0.10);
      --nav-icon: #475569;
      --nav-border: rgba(15, 23, 42, 0.10);
      --nav-highlight: rgba(255, 255, 255, 0.84);
      --nav-shadow-strong: rgba(15, 23, 42, 0.20);
      --nav-shadow-soft: rgba(15, 23, 42, 0.10);
      --chart-bg: #ffffff;
      --chart-grid: rgba(100, 116, 139, 0.22);
      --chart-text: rgba(15, 23, 42, 0.72);
      --chart-meta: rgba(51, 65, 85, 0.70);
      --toast-bg: rgba(15, 23, 42, 0.94);
      --toast-text: #ffffff;
      --sheet-backdrop: rgba(15, 23, 42, 0.34);
      --disabled-text: #8a94a6;
      --disabled-line: #cfd7e4;
      --disabled-bg: #eef2f7;
      --disabled-strong-bg: #e6ebf2;
      --disabled-button-bg: #edf1f6;
    }

    html[data-price-colors="cn"] {
      --price-up: var(--sell);
      --price-down: var(--buy);
      --price-up-soft: rgba(214, 91, 81, 0.14);
      --price-down-soft: rgba(22, 185, 121, 0.13);
    }

    html[data-theme="light"][data-price-colors="cn"] {
      --price-up-soft: rgba(214, 55, 63, 0.10);
      --price-down-soft: rgba(8, 134, 92, 0.12);
    }

    * {
      box-sizing: border-box;
    }

    html {
      background: var(--bg);
      scroll-behavior: smooth;
    }

    body {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      direction: ltr;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "PingFang TC", "Microsoft YaHei", sans-serif;
      letter-spacing: 0;
      overscroll-behavior-y: contain;
      -webkit-font-smoothing: antialiased;
    }

    button,
    input,
    select {
      font: inherit;
    }

    button {
      cursor: pointer;
      line-height: 1.2;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
    }

    button:focus-visible,
    input:focus-visible,
    select:focus-visible {
      outline: 2px solid rgba(47, 140, 255, 0.78);
      outline-offset: 2px;
    }

    .app,
    .screen,
    .panel,
    .login-state,
    .quote-card,
    .market-row,
    .metric,
    .status-chip,
    .position-card,
    .history-card,
    .fund-card,
    .sheet-card,
    .toast {
      min-width: 0;
    }

    .status-line,
    .sim-ribbon,
    .status-banner,
    .screen-caption,
    .risk-note,
    .fund-foot span,
    .panel-title span,
    .sheet-title span,
    .toast {
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .app {
      position: relative;
      direction: ltr;
      height: 100vh;
      min-height: 100vh;
      max-width: 480px;
      margin: 0 auto;
      padding-bottom: calc(104px + env(safe-area-inset-bottom));
      background: var(--app-bg);
      box-shadow: var(--shadow);
      overflow-x: hidden;
      overflow-y: auto;
      overscroll-behavior-y: contain;
      -webkit-overflow-scrolling: touch;
    }

    @supports (height: 100dvh) {
      .app {
        height: 100dvh;
        min-height: 100dvh;
      }
    }

    main {
      transform: translateX(var(--swipe-peek, 0));
      transition: transform var(--motion-med) var(--ease-snap);
      will-change: transform;
    }

    .app[data-swiping] main {
      transition: none;
    }

    .top {
      padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
      border-bottom: 1px solid var(--row-line);
      background: var(--top-bg);
    }

    .brand-row,
    .quote-row,
    .split-row,
    .position-head,
    .history-head,
    .ticket-line,
    .nav {
      display: flex;
      align-items: center;
    }

    .brand-row,
    .quote-row,
    .split-row,
    .position-head,
    .history-head,
    .ticket-line {
      justify-content: space-between;
      gap: 10px;
    }

    .simulate-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 30px;
      padding: 4px 10px 4px 7px;
      border: 1px solid rgba(216, 180, 93, 0.55);
      border-radius: 999px;
      color: var(--gold-2);
      background: rgba(227, 184, 79, 0.09);
      font-size: 11px;
      font-weight: 800;
      white-space: nowrap;
    }

    .brand-logo {
      width: 30px;
      height: 23px;
      flex: 0 0 auto;
      display: block;
      object-fit: contain;
    }

    .profile-brand {
      width: max-content;
      max-width: 100%;
      min-height: 30px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--weak-line);
      border-radius: 999px;
      padding: 4px 10px 4px 5px;
      color: var(--soft);
      background: var(--subtle-bg);
      font-size: 12px;
      font-weight: 900;
      letter-spacing: 0;
    }

    .profile-brand .brand-logo {
      width: 34px;
      height: 26px;
    }

    h1,
    h2,
    h3,
    p {
      margin: 0;
    }

    h1 {
      margin-top: 8px;
      font-size: 20px;
      line-height: 1.15;
    }

    .api-dot {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 11px;
      white-space: nowrap;
    }

    .api-dot::before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--warn);
      box-shadow: 0 0 0 3px rgba(240, 170, 85, 0.12);
    }

    .api-dot[data-mode="api"]::before {
      background: var(--buy);
      box-shadow: 0 0 0 3px rgba(33, 166, 111, 0.13);
    }

    .api-dot[data-mode="mock"]::before {
      background: var(--gold);
      box-shadow: 0 0 0 3px rgba(216, 180, 93, 0.13);
    }

    .api-dot[data-mode="hybrid"]::before {
      background: var(--warn);
      box-shadow: 0 0 0 3px rgba(240, 170, 85, 0.12);
    }

    .sim-ribbon {
      margin-top: 10px;
      padding: 7px 10px;
      border: 1px solid rgba(227, 184, 79, 0.26);
      border-radius: 8px;
      color: var(--gold-2);
      background: rgba(227, 184, 79, 0.07);
      font-size: 11px;
      font-weight: 820;
      line-height: 1.35;
    }

    .status-banner {
      margin-top: 8px;
      min-height: 38px;
      display: flex;
      align-items: center;
      border: 1px solid rgba(216, 180, 93, 0.3);
      border-radius: 8px;
      padding: 8px 10px;
      color: var(--soft);
      background: rgba(216, 180, 93, 0.07);
      font-size: 12px;
      font-weight: 760;
      line-height: 1.35;
    }

    .status-banner[data-state="ok"] {
      border-color: rgba(33, 166, 111, 0.28);
      color: #dff8ed;
      background: rgba(33, 166, 111, 0.08);
    }

    .status-banner[data-state="warn"],
    .status-banner[data-state="loading"] {
      border-color: rgba(240, 170, 85, 0.36);
      color: #f8d9ad;
      background: rgba(240, 170, 85, 0.09);
    }

    .status-banner[data-state="mock"],
    .status-banner[data-state="error"] {
      border-color: rgba(214, 91, 81, 0.34);
      color: #ffd8d3;
      background: rgba(214, 91, 81, 0.1);
    }

    html[data-theme="light"] .status-banner[data-state="ok"] {
      color: #076146;
      background: rgba(8, 134, 92, 0.08);
    }

    html[data-theme="light"] .status-banner[data-state="warn"],
    html[data-theme="light"] .status-banner[data-state="loading"] {
      color: #855b13;
      background: rgba(183, 121, 31, 0.09);
    }

    html[data-theme="light"] .status-banner[data-state="mock"],
    html[data-theme="light"] .status-banner[data-state="error"] {
      color: #9f2229;
      background: rgba(214, 55, 63, 0.08);
    }

    .refresh-btn,
    .ghost-btn,
    .mini-btn {
      border: 1px solid var(--line);
      color: var(--text);
      background: var(--surface-2);
    }

    button:not(:disabled),
    .market-pref span,
    .auth-choice,
    .quote-card,
    .market-row,
    .position-card,
    .history-card,
    .fund-card,
    .profile-hero,
    .profile-balance,
    .stock-bridge-card,
    .metric,
    .status-chip,
    .sheet-card {
      transition:
        transform var(--motion-fast) var(--ease-out),
        border-color var(--motion-med) ease,
        background-color var(--motion-med) ease,
        color var(--motion-med) ease,
        box-shadow var(--motion-med) ease,
        opacity var(--motion-med) ease;
    }

    button.is-pressed:not(:disabled),
    .quote-card.is-pressed,
    .market-row.is-pressed,
    .position-card.is-pressed,
    .history-card.is-pressed,
    .fund-card.is-pressed,
    .profile-balance.is-pressed,
    .stock-bridge-card.is-pressed,
    .metric.is-pressed,
    .status-chip.is-pressed {
      transform: scale(0.976);
    }

    .refresh-btn {
      flex: 0 0 auto;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      font-size: 17px;
      font-weight: 900;
    }

    .refresh-btn.is-loading {
      animation: spin 780ms linear infinite;
    }

    .quote-row {
      margin-top: 13px;
      align-items: flex-end;
    }

    .price {
      font-size: 42px;
      line-height: 0.95;
      font-weight: 900;
      font-variant-numeric: tabular-nums;
    }

    .price.up,
    .up {
      color: var(--price-up);
    }

    .price.down,
    .down {
      color: var(--price-down);
    }

    .change-pill {
      min-width: 96px;
      padding: 8px 10px;
      border-radius: 8px;
      background: var(--price-up-soft);
      color: var(--price-up);
      text-align: right;
      font-size: 13px;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
    }

    .change-pill.down {
      background: var(--price-down-soft);
      color: var(--price-down);
    }

    .bid-ask {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }

    .symbol-switch {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      margin-top: 10px;
    }

    .symbol-switch span {
      color: var(--muted);
      font-size: 11px;
      font-weight: 760;
      overflow-wrap: anywhere;
    }

    .quote-box,
    .panel,
    .login-state {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--surface);
    }

    .quote-box {
      padding: 9px 10px;
      background: var(--quote-box-bg);
    }

    .label {
      min-width: 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.3;
      overflow-wrap: anywhere;
      unicode-bidi: plaintext;
    }

    .value {
      min-width: 0;
      margin-top: 4px;
      color: var(--text);
      font-size: 16px;
      font-weight: 800;
      font-variant-numeric: tabular-nums;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .bid-ask .value {
      color: var(--accent);
      font-size: 18px;
      font-weight: 900;
    }

    .price-with-unit,
    .money-with-unit {
      display: inline-flex;
      max-width: 100%;
      align-items: baseline;
      justify-content: inherit;
      gap: 4px;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }

    .price-with-unit .unit,
    .money-with-unit .unit {
      color: var(--muted);
      font-size: 0.58em;
      font-weight: 900;
      letter-spacing: 0;
    }

    .quote-row .price-with-unit .unit {
      font-size: 14px;
    }

    .bid-ask .price-with-unit,
    .trade-price-band .price-with-unit {
      justify-content: flex-start;
    }

    .quote-numbers .price-with-unit,
    .market-price .price-with-unit {
      justify-content: flex-end;
    }

    main {
      padding: 12px 12px 0;
    }

    .app[data-screen="chart"] .top,
    .app[data-screen="trade"] .top,
    .app[data-screen="history"] .top,
    .app[data-screen="profile"] .top {
      display: none;
    }

    .app[data-screen="chart"] main,
    .app[data-screen="trade"] main,
    .app[data-screen="history"] main,
    .app[data-screen="profile"] main {
      padding-top: calc(14px + env(safe-area-inset-top));
    }

    .screen {
      display: none;
      transform-origin: center top;
    }

    .screen[hidden],
    .screen:not(.active) {
      display: none !important;
    }

    .screen.active {
      display: block;
      animation: screen-rise var(--motion-screen) var(--ease-snap) both;
    }

    .app[data-motion="forward"] .screen.active {
      animation-name: screen-forward;
    }

    .app[data-motion="back"] .screen.active {
      animation-name: screen-back;
    }

    .app[data-motion="none"] .screen.active {
      animation-name: screen-rise;
    }

    .screen-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
    }

    .screen-title {
      flex: 1 1 auto;
      min-width: 0;
    }

    .screen-title .screen-caption {
      display: block;
      margin-top: 2px;
      text-align: left;
    }

    .screen-head h2 {
      font-size: 18px;
      line-height: 1.2;
    }

    .screen-actions {
      display: inline-flex;
      flex: 0 0 auto;
      gap: 8px;
      align-items: center;
    }

    .icon-btn {
      width: 38px;
      height: 38px;
      display: inline-grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 50%;
      color: var(--text);
      background: var(--icon-bg);
      font-size: 22px;
      font-weight: 760;
    }

    .icon-btn.primary {
      border-color: rgba(47, 140, 255, 0.34);
      color: var(--button-active-text);
      background: var(--accent-soft);
    }

    .screen-caption {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.3;
      text-align: right;
    }

    .symbol-action-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 76px;
      gap: 8px;
      align-items: center;
      margin: -2px 0 10px;
    }

    .symbol-action-row select {
      min-height: 40px;
      border-radius: 999px;
      padding: 8px 12px;
      color: var(--text);
      background: var(--control-bg);
      font-size: 13px;
      font-weight: 900;
    }

    .symbol-action-btn {
      min-height: 40px;
      border: 1px solid rgba(47, 140, 255, 0.38);
      border-radius: 999px;
      color: var(--button-active-text);
      background: var(--accent-soft);
      font-size: 13px;
      font-weight: 900;
      white-space: nowrap;
    }

    .trade-symbol-row {
      margin-top: -4px;
      margin-bottom: 8px;
    }

    .quote-list,
    .market-list {
      display: grid;
      gap: 0;
    }

    .quote-card,
    .market-row {
      border: 0;
      border-bottom: 1px solid var(--row-line);
      border-radius: 0;
      background: transparent;
    }

    .quote-card.active,
    .market-row.active {
      background: var(--active-row-bg);
      box-shadow: inset 3px 0 0 var(--accent);
    }

    .quote-card {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 42px;
      align-items: stretch;
      overflow: hidden;
    }

    .quote-select,
    .market-select {
      min-width: 0;
      min-height: 64px;
      border: 0;
      color: inherit;
      background: transparent;
      text-align: left;
    }

    .quote-select {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(72px, 0.65fr) minmax(72px, 0.65fr);
      gap: 10px;
      align-items: center;
      padding: 10px 6px 10px 8px;
    }

    .quote-symbol strong,
    .market-symbol strong {
      display: block;
      overflow: hidden;
      color: var(--text);
      font-size: 15px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .quote-symbol span,
    .market-symbol span,
    .market-extra {
      display: block;
      margin-top: 4px;
      overflow: hidden;
      color: var(--muted);
      font-size: 11px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .quote-numbers {
      text-align: right;
      font-variant-numeric: tabular-nums;
    }

    .quote-numbers strong {
      display: block;
      color: var(--accent);
      font-size: 18px;
      line-height: 1.05;
    }

    .quote-numbers span {
      display: block;
      margin-top: 4px;
      font-size: 11px;
    }

    .quote-numbers em {
      display: block;
      color: var(--muted);
      font-size: 10px;
      font-style: normal;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .quote-remove,
    .market-action {
      border: 0;
      border-left: 1px solid var(--weak-line);
      color: var(--accent);
      background: var(--subtle-bg);
      font-size: 11px;
      font-weight: 900;
    }

    .market-action[aria-pressed="true"] {
      color: var(--soft);
    }

    .quote-remove {
      width: 42px;
      font-size: 20px;
    }

    .market-tools {
      display: grid;
      gap: 8px;
      margin-bottom: 10px;
    }

    .category-tabs {
      display: flex;
      gap: 6px;
      overflow-x: auto;
      padding-bottom: 2px;
      scrollbar-width: none;
      scroll-behavior: smooth;
      scroll-padding-inline: 10px;
      scroll-snap-type: x proximity;
      overscroll-behavior-x: contain;
      -webkit-overflow-scrolling: touch;
    }

    .category-tabs::-webkit-scrollbar {
      display: none;
    }

    .category-tabs button {
      flex: 0 0 auto;
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 0 10px;
      color: var(--soft);
      background: var(--control-bg);
      font-size: 12px;
      font-weight: 850;
      white-space: nowrap;
      scroll-snap-align: center;
    }

    .category-tabs button.active {
      border-color: rgba(47, 140, 255, 0.65);
      color: var(--button-active-text);
      background: var(--accent-soft);
    }

    .market-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 76px;
      align-items: stretch;
      overflow: hidden;
    }

    .market-select {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      padding: 10px;
    }

    .market-price {
      min-width: 92px;
      text-align: right;
      font-variant-numeric: tabular-nums;
    }

    .market-price strong {
      display: block;
      color: var(--accent);
      font-size: 14px;
    }

    .market-price span {
      display: block;
      margin-top: 4px;
      color: var(--muted);
      font-size: 11px;
    }

    .login-state {
      min-height: calc(100dvh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
      place-items: center;
      border: 0;
      border-radius: 0;
      margin-bottom: 0;
      padding: 8px 0 18px;
      background: transparent;
    }

    .auth-card {
      width: min(430px, 100%);
      display: grid;
      gap: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 18px;
      background: var(--panel-bg);
      box-shadow:
        0 22px 56px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 var(--nav-highlight);
    }

    .auth-brand {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      color: var(--soft);
      font-size: 12px;
      font-weight: 920;
      letter-spacing: 0;
    }

    .auth-brand img {
      width: 24px;
      height: 24px;
      object-fit: contain;
    }

    .login-summary {
      display: grid;
      justify-items: center;
      gap: 7px;
      text-align: center;
    }

    .auth-entry {
      display: grid;
      gap: 10px;
    }

    .auth-choice {
      min-height: 66px;
      display: grid;
      gap: 5px;
      align-content: center;
      justify-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      color: var(--text);
      background: var(--surface-2);
      text-align: center;
      box-shadow: inset 0 1px 0 var(--nav-highlight);
    }

    .auth-choice.primary {
      border-color: rgba(47, 140, 255, 0.58);
      background: var(--accent-soft);
    }

    .auth-choice strong,
    .auth-choice small {
      min-width: 0;
      max-width: 100%;
      overflow-wrap: anywhere;
      unicode-bidi: plaintext;
    }

    .auth-choice strong {
      font-size: 15px;
      font-weight: 900;
      line-height: 1.2;
    }

    .auth-choice small {
      color: var(--muted);
      font-size: 12px;
      font-weight: 760;
      line-height: 1.35;
    }

    .auth-back-btn {
      justify-self: start;
      width: fit-content;
      min-height: 34px;
      padding: 0 13px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 850;
    }

    .user-name {
      overflow: hidden;
      color: var(--text);
      font-size: 15px;
      font-weight: 850;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .status-line {
      margin-top: 4px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }

    .login-form,
    .register-form {
      display: grid;
      gap: 10px;
    }

    .login-form {
      grid-template-columns: 1fr;
    }

    .auth-form-head {
      display: grid;
      justify-items: center;
      gap: 5px;
      margin-bottom: 2px;
      text-align: center;
    }

    .auth-form-head strong {
      color: var(--text);
      font-size: 18px;
      font-weight: 920;
      line-height: 1.15;
    }

    .auth-form-head span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 760;
      line-height: 1.35;
    }

    .register-progress {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
      margin: 2px 0 4px;
    }

    .register-progress span {
      min-width: 0;
      min-height: 34px;
      display: grid;
      place-items: center;
      border: 1px solid var(--weak-line);
      border-radius: 999px;
      padding: 0 7px;
      color: var(--muted);
      background: var(--control-bg);
      font-size: 11px;
      font-weight: 850;
      line-height: 1.1;
      text-align: center;
      white-space: nowrap;
    }

    .register-progress span.active,
    .register-progress span.done {
      border-color: rgba(47, 140, 255, 0.58);
      color: var(--button-active-text);
      background: var(--accent-soft);
    }

    .register-step {
      display: grid;
      gap: 8px;
    }

    .register-actions {
      display: grid;
      grid-template-columns: minmax(94px, auto) minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      margin-top: 2px;
    }

    .register-actions.is-single {
      grid-template-columns: 1fr;
    }

    .auth-tabs {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .auth-tabs button {
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--soft);
      background: var(--control-bg);
      font-size: 13px;
      font-weight: 850;
    }

    .auth-tabs button.active {
      border-color: rgba(47, 140, 255, 0.62);
      color: var(--button-active-text);
      background: var(--accent-soft);
    }

    .setting-stack {
      display: grid;
      gap: 10px;
    }

    .setting-block {
      display: grid;
      gap: 7px;
    }

    .setting-label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 820;
      line-height: 1.3;
    }

    .theme-control,
    .price-color-control {
      display: grid;
      gap: 6px;
      min-height: 42px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--surface-2);
    }

    .theme-control {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .price-color-control {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .theme-control button,
    .price-color-control button {
      min-width: 0;
      min-height: 34px;
      border: 0;
      border-radius: 999px;
      color: var(--muted);
      background: transparent;
      font-size: 12px;
      font-weight: 900;
      white-space: nowrap;
    }

    .theme-control button.active,
    .price-color-control button.active {
      color: var(--button-active-text);
      background: var(--accent-soft);
      box-shadow: inset 0 0 0 1px rgba(47, 140, 255, 0.28);
    }

    .price-color-example {
      display: grid;
      gap: 0;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--metric-bg);
    }

    .price-example-chart {
      padding: 11px 12px 12px;
      border-bottom: 1px solid var(--weak-line);
      background: linear-gradient(180deg, var(--subtle-bg), transparent);
    }

    .price-example-chart-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 9px;
      font-variant-numeric: tabular-nums;
    }

    .price-example-chart-top span {
      overflow: hidden;
      color: var(--muted);
      font-size: 11px;
      font-weight: 850;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .price-example-chart-top strong {
      color: var(--price-up);
      font-size: 13px;
      font-weight: 920;
      line-height: 1;
      white-space: nowrap;
    }

    .price-example-kline {
      position: relative;
      min-height: 82px;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 6px;
      overflow: hidden;
      padding: 7px 7px 8px;
      border: 1px solid var(--weak-line);
      border-radius: 7px;
      background:
        repeating-linear-gradient(to bottom, transparent 0 19px, var(--hairline) 19px 20px),
        repeating-linear-gradient(to right, transparent 0 36px, var(--hairline) 36px 37px),
        var(--quote-box-bg);
    }

    .price-example-candle {
      --body: 24px;
      --body-bottom: 12px;
      --wick: 52px;
      --wick-bottom: 4px;
      position: relative;
      z-index: 1;
      flex: 0 0 9px;
      height: 66px;
      color: var(--price-up);
    }

    .price-example-candle.down {
      color: var(--price-down);
    }

    .price-example-candle::before,
    .price-example-candle::after {
      content: "";
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      background: currentColor;
    }

    .price-example-candle::before {
      bottom: var(--wick-bottom);
      width: 2px;
      height: var(--wick);
      border-radius: 999px;
      opacity: 0.86;
    }

    .price-example-candle::after {
      bottom: var(--body-bottom);
      width: 9px;
      height: var(--body);
      min-height: 5px;
      border-radius: 2px;
      box-shadow: 0 0 0 1px currentColor;
    }

    .price-example-row {
      min-height: 54px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 10px 12px;
    }

    .price-example-row + .price-example-row {
      border-top: 1px solid var(--weak-line);
    }

    .price-example-symbol {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .price-example-symbol strong,
    .price-example-value strong {
      font-size: 14px;
      font-weight: 920;
      line-height: 1.1;
      letter-spacing: 0;
    }

    .price-example-symbol span,
    .price-example-value span {
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      line-height: 1.1;
    }

    .price-example-value {
      display: grid;
      gap: 3px;
      justify-items: end;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .price-example-row.up .price-example-value strong,
    .price-example-row.up .price-example-value span {
      color: var(--price-up);
    }

    .price-example-row.down .price-example-value strong,
    .price-example-row.down .price-example-value span {
      color: var(--price-down);
    }

    .register-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .register-grid .wide {
      grid-column: 1 / -1;
    }

	    .register-code-row {
	      grid-column: 1 / -1;
	      display: grid;
	      grid-template-columns: minmax(82px, 0.56fr) minmax(86px, 0.58fr) minmax(0, 1fr) minmax(78px, auto);
	      gap: 8px;
	      align-items: center;
	    }

	    .register-code-row[data-contact-type="email"] {
	      grid-template-columns: minmax(94px, 0.72fr) minmax(0, 1fr) minmax(78px, auto);
	    }

    .register-code-row .ghost-btn {
      min-height: 42px;
      white-space: nowrap;
    }

    .register-code-row.compact {
      grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
    }

    .profile-contact-code {
      grid-template-columns: minmax(0, 1fr) minmax(94px, auto) minmax(92px, auto);
    }

    .profile-contact-code[hidden] {
      display: none;
    }

    .verify-status {
      min-height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      padding: 0 9px;
      color: var(--soft);
      background: var(--metric-bg);
      font-size: 11px;
      font-weight: 850;
      line-height: 1.2;
      text-align: center;
      white-space: nowrap;
    }

    .register-market-prefs {
      grid-column: 1 / -1;
      display: grid;
      gap: 7px;
    }

    .market-pref-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 6px;
    }

    .market-pref {
      min-width: 0;
      display: block;
      position: relative;
    }

    .market-pref input {
      position: absolute;
      inset: 0;
      width: 100%;
      min-height: 1px;
      padding: 0;
      border: 0;
      opacity: 0;
    }

    .market-pref span {
      min-height: 34px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--soft);
      background: var(--control-bg);
      font-size: 12px;
      font-weight: 850;
      white-space: nowrap;
    }

    .market-pref input:checked + span {
      border-color: rgba(47, 140, 255, 0.62);
      color: var(--button-active-text);
      background: var(--accent-soft);
    }

    .register-form .primary-btn {
      width: 100%;
    }

    .auth-entry[hidden],
    .auth-back-btn[hidden],
    .login-form[hidden],
    .register-form[hidden],
    .register-step[hidden],
    .register-actions button[hidden],
    .auth-tabs[hidden],
    .hide {
      display: none;
    }

    input,
    select {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 9px 10px;
      color: var(--text);
      background: var(--control-bg);
      outline: none;
      font-size: 14px;
      min-width: 0;
    }

    input:focus,
    select:focus {
      border-color: rgba(47, 140, 255, 0.78);
      box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.16);
    }

    .language-dropdown {
      position: relative;
      z-index: 2;
      display: grid;
      gap: 8px;
    }

    .language-trigger {
      width: 100%;
      min-height: 50px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto 16px;
      align-items: center;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 12px;
      color: var(--text);
      background: linear-gradient(180deg, var(--control-bg), var(--surface-2));
      text-align: start;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    }

    html[data-theme="light"] .language-trigger {
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }

    .language-trigger::after {
      content: "";
      width: 7px;
      height: 7px;
      border-right: 2px solid var(--muted);
      border-bottom: 2px solid var(--muted);
      transform: rotate(45deg);
      transition: transform var(--motion-fast) var(--ease-out), border-color var(--motion-med) ease;
    }

    .language-dropdown[data-open="true"] .language-trigger {
      border-color: rgba(47, 140, 255, 0.62);
      box-shadow: 0 0 0 3px rgba(47, 140, 255, 0.12);
    }

    .language-dropdown[data-open="true"] .language-trigger::after {
      border-color: var(--accent);
      transform: translateY(3px) rotate(225deg);
    }

    .language-current,
    .language-option-main {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 9px;
    }

    .language-current-flag,
    .language-option-flag {
      width: 30px;
      height: 30px;
      flex: 0 0 auto;
      display: grid;
      place-items: center;
      border: 1px solid var(--hairline);
      border-radius: 50%;
      background: var(--subtle-bg);
      font-size: 17px;
    }

    .language-current-text,
    .language-option-label {
      min-width: 0;
      overflow: hidden;
      font-size: 14px;
      font-weight: 900;
      line-height: 1.2;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .language-current-code,
    .language-option-code {
      min-height: 22px;
      display: inline-flex;
      align-items: center;
      border: 1px solid var(--hairline);
      border-radius: 999px;
      padding: 0 7px;
      color: var(--muted);
      background: var(--surface-2);
      font-size: 10px;
      font-weight: 900;
      line-height: 1;
      text-transform: uppercase;
      white-space: nowrap;
    }

    .language-menu {
      display: grid;
      gap: 4px;
      max-height: min(330px, calc(100dvh - 250px));
      overflow-y: auto;
      overscroll-behavior: contain;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 5px;
      background: var(--control-bg);
      box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
      -webkit-overflow-scrolling: touch;
    }

    .language-menu[hidden] {
      display: none;
    }

    html[data-theme="light"] .language-menu {
      box-shadow: 0 18px 42px rgba(15, 23, 42, 0.13);
    }

    .language-option {
      min-height: 44px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto 22px;
      align-items: center;
      gap: 10px;
      border: 1px solid transparent;
      border-radius: 8px;
      padding: 7px 9px;
      color: var(--text);
      background: transparent;
      text-align: start;
    }

    .language-option:hover,
    .language-option:focus-visible {
      border-color: var(--weak-line);
      background: var(--subtle-bg);
    }

    .language-option.active {
      border-color: rgba(47, 140, 255, 0.58);
      color: var(--button-active-text);
      background: var(--accent-soft);
    }

    .language-option-check {
      width: 22px;
      height: 22px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: transparent;
      font-size: 14px;
      font-weight: 950;
    }

    .language-option.active .language-option-check {
      color: var(--accent);
      background: rgba(47, 140, 255, 0.14);
    }

    .primary-btn,
    .trade-btn,
    .close-btn {
      border: 0;
      border-radius: 8px;
      color: #fff;
      font-weight: 900;
    }

    .primary-btn {
      min-width: 64px;
      min-height: 42px;
      padding: 0 12px;
      background: var(--accent);
      color: #ffffff;
    }

    .ghost-btn,
    .mini-btn {
      min-height: 34px;
      border-radius: 8px;
      padding: 0 10px;
      font-size: 12px;
      font-weight: 800;
    }

    .panel {
      margin-bottom: 10px;
      padding: 12px;
      background: var(--panel-bg);
    }

    .panel-title {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
    }

    .panel-title h2 {
      font-size: 16px;
      line-height: 1.2;
    }

    .panel-title span {
      color: var(--muted);
      font-size: 11px;
    }

    .account-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .risk-grid,
    .risk-strip {
      display: grid;
      gap: 8px;
    }

    .risk-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      margin-top: 10px;
    }

    .risk-strip {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .risk-note {
      grid-column: 1 / -1;
      min-height: 32px;
      display: flex;
      align-items: center;
      border: 1px solid rgba(216, 180, 93, 0.18);
      border-radius: 8px;
      padding: 7px 9px;
      color: var(--soft);
      background: rgba(216, 180, 93, 0.06);
      font-size: 12px;
      line-height: 1.35;
    }

    .status-chip {
      min-height: 46px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px;
      background: var(--surface-2);
    }

    .status-chip strong {
      display: block;
      margin-top: 3px;
      font-size: 13px;
      font-variant-numeric: tabular-nums;
    }

    .status-chip[data-state="ok"] {
      border-color: rgba(33, 166, 111, 0.34);
      background: rgba(33, 166, 111, 0.1);
    }

    .status-chip[data-state="warn"] {
      border-color: rgba(240, 170, 85, 0.38);
      background: rgba(240, 170, 85, 0.1);
    }

    .status-chip[data-state="blocked"] {
      border-color: rgba(214, 91, 81, 0.42);
      background: rgba(214, 91, 81, 0.12);
    }

    .metric {
      min-height: 66px;
      padding: 10px;
      border-radius: 8px;
      background: var(--metric-bg);
      border: 1px solid var(--hairline);
    }

    .metric .value {
      font-size: 15px;
    }

    .chart-statbar {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
      margin-bottom: 8px;
    }

    .chart-statbar span {
      min-height: 34px;
      display: grid;
      align-content: center;
      border: 1px solid var(--hairline);
      border-radius: 8px;
      padding: 5px 7px;
      color: var(--muted);
      background: var(--metric-bg);
      font-size: 10px;
      font-weight: 850;
      line-height: 1.15;
      text-transform: uppercase;
    }

    .chart-statbar strong {
      display: block;
      margin-top: 2px;
      overflow: hidden;
      color: var(--text);
      font-size: 12px;
      font-variant-numeric: tabular-nums;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .chart-wrap {
      position: relative;
      min-height: 362px;
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      overflow: hidden;
      background: var(--chart-bg);
    }

    canvas {
      display: block;
      width: 100%;
      height: 362px;
      image-rendering: auto;
      cursor: crosshair;
      touch-action: none;
      user-select: none;
    }

    .app[data-screen="chart"] .chart-wrap {
      min-height: min(560px, calc(100vh - 220px - env(safe-area-inset-bottom)));
    }

    .app[data-screen="chart"] canvas {
      height: min(560px, calc(100vh - 220px - env(safe-area-inset-bottom)));
    }

    .chart-meta {
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 8px;
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: var(--chart-meta);
      font-size: 11px;
      pointer-events: none;
    }

    .chart-tools {
      display: grid;
      grid-template-columns: 36px minmax(0, 1fr) 36px 48px;
      gap: 6px;
      align-items: center;
      margin-top: 8px;
    }

    .chart-tools button {
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--text);
      background: var(--control-bg);
      font-size: 12px;
      font-weight: 900;
    }

    .chart-tools button[data-chart-zoom] {
      font-size: 18px;
      line-height: 1;
    }

    .chart-tools button:disabled {
      cursor: default;
      opacity: 0.42;
    }

    .chart-tools span {
      min-width: 0;
      overflow: hidden;
      border: 1px solid var(--hairline);
      border-radius: 8px;
      padding: 8px 9px;
      color: var(--soft);
      background: var(--metric-bg);
      font-size: 11px;
      font-weight: 850;
      text-align: center;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .timeframes {
      display: grid;
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 6px;
      margin-top: 10px;
    }

    .timeframes button,
    .volume-chip {
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--soft);
      background: var(--control-bg);
      font-size: 12px;
      font-weight: 800;
    }

    .timeframes button.active,
    .volume-chip.active {
      border-color: rgba(47, 140, 255, 0.68);
      color: var(--button-active-text);
      background: var(--accent-soft);
    }

    .ticket {
      display: grid;
      gap: 10px;
    }

    #trade.screen.active {
      display: grid;
      gap: 10px;
      padding-bottom: 18px;
    }

    #trade .panel-title {
      align-items: center;
      margin-bottom: 8px;
    }

    #trade .panel-title h2 {
      font-size: 17px;
      letter-spacing: 0;
    }

    #trade .panel-title span {
      flex: 0 1 auto;
      min-height: 24px;
      display: inline-flex;
      align-items: center;
      justify-content: flex-end;
      border-radius: 999px;
      padding: 3px 8px;
      color: var(--soft);
      background: var(--subtle-bg);
      font-size: 10.5px;
      font-weight: 850;
      white-space: nowrap;
    }

    #trade .risk-strip {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 7px;
      margin-bottom: 0;
    }

    #trade .status-chip {
      min-height: 42px;
      display: grid;
      align-content: center;
      padding: 8px 10px;
    }

    #trade .status-chip .label {
      font-size: 10.5px;
      font-weight: 820;
    }

    #trade .status-chip strong {
      margin-top: 2px;
      font-size: 13px;
      line-height: 1.2;
    }

    .contract-spec-card {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      overflow: hidden;
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      background: var(--metric-bg);
    }

    .contract-spec-item {
      min-width: 0;
      min-height: 54px;
      display: grid;
      align-content: center;
      gap: 4px;
      padding: 9px 10px;
      border-bottom: 1px solid var(--weak-line);
    }

    .contract-spec-item:nth-child(2n) {
      border-left: 1px solid var(--weak-line);
    }

    .contract-spec-item:nth-last-child(-n+2) {
      border-bottom: 0;
    }

    .contract-spec-item span {
      overflow: hidden;
      color: var(--muted);
      font-size: 10.5px;
      font-weight: 820;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .contract-spec-item strong {
      min-width: 0;
      overflow: visible;
      color: var(--text);
      font-size: 12.5px;
      line-height: 1.18;
      font-weight: 920;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .contract-note {
      border: 1px dashed var(--weak-line);
      border-radius: 8px;
      padding: 9px 10px;
      color: var(--soft);
      background: var(--subtle-bg);
      font-size: 11px;
      line-height: 1.45;
    }

    .trade-price-band {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .trade-price-band div {
      min-height: 86px;
      display: grid;
      align-content: space-between;
      gap: 8px;
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      padding: 12px 14px;
      background: var(--metric-bg);
      font-variant-numeric: tabular-nums;
    }

    .trade-price-band .quote-sell {
      border-color: rgba(239, 69, 74, 0.26);
      background: linear-gradient(180deg, rgba(239, 69, 74, 0.12), var(--metric-bg));
    }

    .trade-price-band .quote-buy {
      border-color: rgba(47, 140, 255, 0.30);
      background: linear-gradient(180deg, rgba(47, 140, 255, 0.13), var(--metric-bg));
    }

    .trade-price-band span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

    .trade-price-band strong {
      overflow: hidden;
      font-size: 30px;
      line-height: 1.05;
      font-weight: 950;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .trade-price-band .quote-sell strong {
      color: var(--sell);
    }

    .trade-price-band .quote-buy strong {
      color: var(--accent);
    }

    .trade-form {
      display: grid;
      gap: 9px;
    }

    .order-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
      gap: 8px;
    }

    #trade .order-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #trade .order-lot {
      grid-template-columns: minmax(104px, 0.75fr) minmax(0, 1fr);
      align-items: end;
    }

    #trade label,
    #trade .quick-volume {
      display: grid;
      gap: 6px;
      min-width: 0;
    }

    #trade input {
      min-height: 46px;
      padding: 10px 12px;
      font-size: 16px;
      font-weight: 780;
      font-variant-numeric: tabular-nums;
    }

    .volume-chips {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
    }

    #trade .volume-chip {
      min-height: 44px;
      display: grid;
      align-content: center;
      gap: 2px;
      padding: 5px 6px;
      border-radius: 8px;
      font-size: 12px;
      line-height: 1.1;
      font-weight: 900;
    }

    #trade .volume-chip-main,
    #trade .volume-chip-sub {
      min-width: 0;
      overflow: visible;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    #trade .volume-chip-sub {
      color: var(--muted);
      font-size: 10px;
      font-weight: 820;
    }

    #trade .volume-chip.active .volume-chip-sub {
      color: var(--accent);
    }

    .order-preview {
      overflow: hidden;
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      background: var(--metric-bg);
    }

    .order-preview-head {
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 9px 12px;
      border-bottom: 1px solid var(--weak-line);
    }

    .order-preview-head span {
      color: var(--muted);
      font-size: 11px;
      font-weight: 850;
    }

    .order-preview-head strong {
      min-width: 0;
      overflow: hidden;
      color: var(--text);
      font-size: 12px;
      font-weight: 930;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .order-preview-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-preview-item {
      min-width: 0;
      min-height: 56px;
      display: grid;
      align-content: center;
      gap: 4px;
      padding: 9px 12px;
      border-bottom: 1px solid var(--weak-line);
    }

    .order-preview-item:nth-child(2n) {
      border-left: 1px solid var(--weak-line);
    }

    .order-preview-item:nth-last-child(-n+2) {
      border-bottom: 0;
    }

    .order-preview-item span {
      overflow: hidden;
      color: var(--muted);
      font-size: 10.5px;
      font-weight: 820;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .order-preview-item strong {
      overflow: hidden;
      color: var(--text);
      font-size: 13px;
      line-height: 1.15;
      font-weight: 930;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }

    .trade-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 2px;
    }

    .trade-btn {
      min-height: 56px;
      padding: 8px 10px;
      font-size: 16px;
      white-space: normal;
    }

    .buy-btn {
      background: #1473d2;
    }

    .sell-btn {
      background: var(--sell);
    }

    button:disabled,
    input:disabled,
    select:disabled {
      cursor: not-allowed;
      opacity: 1;
      color: var(--disabled-text);
      border-color: var(--disabled-line);
      background: var(--disabled-bg);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
      filter: grayscale(0.28);
    }

    .primary-btn:disabled,
    .trade-btn:disabled,
    .close-btn:disabled {
      color: var(--disabled-text);
      border: 1px solid var(--disabled-line);
      background: var(--disabled-strong-bg);
      text-shadow: none;
    }

    .buy-btn:disabled,
    .sell-btn:disabled {
      color: var(--disabled-text);
      background: var(--disabled-strong-bg);
    }

    .volume-chip:disabled,
    .timeframes button:disabled,
    .ghost-btn:disabled,
    .mini-btn:disabled {
      color: var(--disabled-text);
      background: var(--disabled-button-bg);
    }

    .estimate-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    #trade .estimate-grid {
      gap: 0;
      overflow: hidden;
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      background: var(--metric-bg);
    }

    .estimate {
      min-height: 48px;
      padding: 8px 10px;
      border-radius: 8px;
      background: var(--subtle-bg);
    }

    #trade .estimate {
      min-height: 56px;
      display: grid;
      align-content: center;
      border-radius: 0;
      padding: 10px 12px;
      border-bottom: 1px solid var(--weak-line);
      background: transparent;
    }

    #trade .estimate:nth-child(2n) {
      border-left: 1px solid var(--weak-line);
    }

    #trade .estimate:nth-last-child(-n+2) {
      border-bottom: 0;
    }

    #trade .estimate .value {
      margin-top: 4px;
      font-size: 18px;
      line-height: 1.15;
    }

    .list {
      display: grid;
      gap: 8px;
    }

    .position-card,
    .history-card {
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      padding: 10px;
      background: var(--surface-2);
    }

    .position-head,
    .history-head {
      margin-bottom: 8px;
    }

    .position-actions {
      display: flex;
      flex: 0 0 auto;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      justify-content: flex-end;
      min-width: 0;
    }

    .side {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 900;
    }

    .side.buy {
      color: #def7ec;
      background: rgba(33, 166, 111, 0.2);
    }

    .side.sell {
      color: #ffe5e2;
      background: rgba(214, 91, 81, 0.22);
    }

    html[data-theme="light"] .side.buy {
      color: #06724f;
      background: rgba(8, 134, 92, 0.12);
    }

    html[data-theme="light"] .side.sell {
      color: #a3262d;
      background: rgba(214, 55, 63, 0.10);
    }

    .card-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .card-grid .label {
      margin-bottom: 3px;
    }

    .card-grid strong {
      display: block;
      min-width: 0;
      overflow: visible;
      font-size: 13px;
      font-variant-numeric: tabular-nums;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .local-badge {
      display: inline-flex;
      margin-left: 4px;
      padding: 1px 5px;
      border-radius: 999px;
      color: #17120b;
      background: var(--gold);
      font-size: 10px;
      font-weight: 900;
      vertical-align: 1px;
    }

    .close-btn {
      min-height: 34px;
      padding: 0 12px;
      background: var(--surface-3);
      border: 1px solid var(--line);
    }

    .fund-card {
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      padding: 10px;
      background: var(--surface-2);
    }

    .fund-head,
    .fund-foot {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .fund-head strong,
    .fund-foot span,
    .history-head strong,
    .position-head .side {
      min-width: 0;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .fund-head strong {
      font-size: 14px;
    }

    .fund-amount {
      font-size: 15px;
      font-weight: 900;
      font-variant-numeric: tabular-nums;
    }

    .fund-foot {
      flex-wrap: wrap;
      margin-top: 7px;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.35;
    }

    .empty {
      min-height: 72px;
      display: grid;
      place-items: center;
      border: 1px dashed var(--line);
      border-radius: 8px;
      color: var(--muted);
      background: var(--subtle-bg);
      font-size: 13px;
      text-align: center;
    }

    .profile-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .profile-hero {
      display: grid;
      gap: 10px;
      margin-bottom: 10px;
      padding: 14px 14px 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel-bg);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .profile-hero.screen:not(.active) {
      display: none;
    }

    .profile-id {
      display: grid;
      grid-template-columns: 54px minmax(0, 1fr);
      gap: 12px;
      align-items: start;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--weak-line);
    }

    .profile-avatar {
      width: 54px;
      height: 54px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      color: var(--button-active-text);
      background: var(--accent-soft);
      box-shadow: inset 0 0 0 1px rgba(47, 140, 255, 0.28);
      font-size: 18px;
      font-weight: 950;
    }

    .profile-copy {
      min-width: 0;
      display: grid;
      gap: 5px;
      align-content: start;
    }

    .profile-id h2 {
      overflow: hidden;
      font-size: 20px;
      line-height: 1.15;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-id span {
      display: block;
      overflow: hidden;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.3;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-tags,
    .profile-actions {
      display: grid;
      gap: 6px;
    }

    .profile-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      min-width: 0;
      padding-top: 2px;
    }

    .profile-tag {
      min-width: 0;
      min-height: 25px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--weak-line);
      border-radius: 999px;
      padding: 0 8px;
      color: var(--soft);
      background: var(--subtle-bg);
      font-size: 10.5px;
      font-weight: 850;
      text-align: center;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      unicode-bidi: plaintext;
    }

    .profile-balance-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr);
      gap: 7px;
    }

    .profile-balance {
      min-height: 58px;
      padding: 8px;
      border-radius: 8px;
      background: var(--metric-bg);
      border: 1px solid var(--hairline);
    }

    .profile-balance .label,
    .metric .label,
    .card-grid .label,
    .estimate .label,
    .status-chip .label {
      display: -webkit-box;
      overflow: hidden;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }

    .profile-balance strong {
      display: block;
      margin-top: 4px;
      overflow: hidden;
      color: var(--text);
      font-size: 15px;
      font-variant-numeric: tabular-nums;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-actions {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 7px;
    }

    .profile-actions button {
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: 8px;
      color: var(--text);
      background: var(--surface-2);
      font-size: 11.5px;
      font-weight: 850;
      line-height: 1.15;
      overflow: hidden;
      overflow-wrap: anywhere;
    }

    .profile-subview {
      display: none;
    }

    .app .screen.profile-subview.active {
      display: none;
    }

    .app[data-profile-view="home"] #appearanceSettings.screen.active,
    .app[data-profile-view="home"] #profileDetails.screen.active,
    .app[data-profile-view="home"] #accountOverview.screen.active {
      display: none;
    }

    .app[data-profile-view="appearance"] [data-profile-root],
    .app[data-profile-view="avatar"] [data-profile-root],
    .app[data-profile-view="details"] [data-profile-root],
    .app[data-profile-view="security"] [data-profile-root] {
      display: none;
    }

    .app[data-profile-view="appearance"] .profile-subview[data-profile-view="appearance"],
    .app[data-profile-view="avatar"] .profile-subview[data-profile-view="avatar"],
    .app[data-profile-view="details"] .profile-subview[data-profile-view="details"],
    .app[data-profile-view="security"] .profile-subview[data-profile-view="security"] {
      display: block;
      animation: profile-push var(--motion-screen) var(--ease-snap) both;
    }

    .app[data-profile-motion="switch"] .profile-subview[data-profile-view] {
      animation-name: screen-rise;
    }

    .app[data-profile-motion="pop"][data-profile-view="home"] [data-profile-root].active {
      animation-name: profile-pop;
    }

    .app[data-screen="profile"][data-signed-in="false"] [data-auth-required].screen.active,
    .app[data-screen="profile"][data-signed-in="false"] .profile-subview.screen.active {
      display: none;
    }

    .app[data-screen="profile"][data-signed-in="false"] #profile.screen.active {
      display: grid;
    }

    .app[data-screen="profile"][data-signed-in="true"] #profile.screen.active {
      display: none;
    }

    .app[data-screen="quotes"] .screen[data-screen]:not([data-screen="quotes"]),
    .app[data-screen="browse"] .screen[data-screen]:not([data-screen="browse"]),
    .app[data-screen="chart"] .screen[data-screen]:not([data-screen="chart"]),
    .app[data-screen="trade"] .screen[data-screen]:not([data-screen="trade"]),
    .app[data-screen="history"] .screen[data-screen]:not([data-screen="history"]),
    .app[data-screen="profile"] .screen[data-screen]:not([data-screen="profile"]) {
      display: none !important;
    }

    .subview-head {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 42px;
      gap: 8px;
      align-items: center;
      margin-bottom: 12px;
    }

    .back-btn {
      width: 42px;
      height: 42px;
      border: 1px solid var(--line);
      border-radius: 50%;
      color: var(--text);
      background: var(--surface-2);
      font-size: 22px;
      font-weight: 900;
    }

    .subview-title {
      min-width: 0;
      text-align: center;
    }

    .subview-title h2 {
      font-size: 18px;
      line-height: 1.2;
    }

    .subview-title span {
      display: -webkit-box;
      margin-top: 3px;
      overflow: hidden;
      color: var(--muted);
      font-size: 11px;
      text-overflow: ellipsis;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      unicode-bidi: plaintext;
    }

    .settings-menu {
      display: grid;
      gap: 0;
    }

    .settings-entry {
      min-height: 58px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(44px, auto) 18px;
      gap: 10px;
      align-items: center;
      border: 0;
      border-bottom: 1px solid var(--row-line);
      border-radius: 0;
      padding: 0;
      color: var(--text);
      background: transparent;
      text-align: left;
    }

    .settings-entry > div {
      min-width: 0;
    }

    .settings-entry.is-pressed,
    .settings-entry:hover {
      background: var(--subtle-bg);
    }

    .settings-entry:last-child {
      border-bottom: 0;
    }

    .settings-entry strong {
      display: block;
      min-width: 0;
      overflow: hidden;
      font-size: 14px;
      text-overflow: ellipsis;
      white-space: nowrap;
      unicode-bidi: plaintext;
    }

    .settings-entry small {
      display: -webkit-box;
      margin-top: 4px;
      overflow: hidden;
      color: var(--muted);
      font-size: 11px;
      text-overflow: ellipsis;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      unicode-bidi: plaintext;
    }

    .settings-entry > span {
      color: var(--muted);
      font-size: 12px;
      text-align: right;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 130px;
      unicode-bidi: plaintext;
    }

    .settings-entry::after {
      content: "›";
      color: var(--muted);
      font-size: 22px;
      line-height: 1;
    }

    .profile-avatar[data-avatar="gold"],
    .avatar-choice[data-avatar="gold"] {
      color: #17120a;
      background: linear-gradient(135deg, var(--gold), var(--gold-2));
      box-shadow: inset 0 0 0 1px rgba(227, 184, 79, 0.46);
    }

    .profile-avatar[data-avatar="blue"],
    .avatar-choice[data-avatar="blue"] {
      color: #ffffff;
      background: linear-gradient(135deg, #1769e0, #38bdf8);
      box-shadow: inset 0 0 0 1px rgba(47, 140, 255, 0.42);
    }

    .profile-avatar[data-avatar="green"],
    .avatar-choice[data-avatar="green"] {
      color: #ffffff;
      background: linear-gradient(135deg, #07865c, #36c783);
      box-shadow: inset 0 0 0 1px rgba(54, 199, 131, 0.42);
    }

    .profile-avatar[data-avatar="red"],
    .avatar-choice[data-avatar="red"] {
      color: #ffffff;
      background: linear-gradient(135deg, #c93c36, #ef5d55);
      box-shadow: inset 0 0 0 1px rgba(239, 93, 85, 0.42);
    }

    .profile-avatar[data-avatar="onyx"],
    .avatar-choice[data-avatar="onyx"] {
      color: #ffffff;
      background: linear-gradient(135deg, #111827, #475569);
      box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.34);
    }

    .account-settings {
      display: grid;
      gap: 14px;
    }

    .settings-block {
      display: grid;
      gap: 10px;
      padding-top: 12px;
      border-top: 1px solid var(--row-line);
    }

    .settings-block:first-child {
      padding-top: 0;
      border-top: 0;
    }

    .settings-block-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .settings-block-head strong {
      font-size: 14px;
    }

    .settings-block-head span,
    .form-status {
      color: var(--muted);
      font-size: 11px;
      line-height: 1.35;
      text-align: right;
    }

    .avatar-editor {
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr);
      gap: 12px;
      align-items: center;
    }

    .avatar-editor .profile-avatar {
      width: 58px;
      height: 58px;
      font-size: 20px;
    }

    .avatar-choice-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
    }

    .avatar-choice {
      width: 40px;
      height: 40px;
      display: grid;
      place-items: center;
      justify-self: center;
      border: 1px solid var(--line);
      border-radius: 50%;
      color: var(--text);
      background: var(--surface-2);
      font-size: 13px;
      font-weight: 950;
    }

    .avatar-choice.active {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .account-form,
    .security-form {
      display: grid;
      gap: 10px;
    }

    .subview-section {
      display: grid;
      gap: 8px;
      margin-bottom: 10px;
    }

    .subview-section-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 850;
    }

    .info-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .info-line {
      min-height: 48px;
      display: grid;
      align-content: center;
      gap: 3px;
      border: 1px solid var(--weak-line);
      border-radius: 8px;
      padding: 8px;
      background: var(--metric-bg);
    }

    .info-line.wide {
      grid-column: 1 / -1;
    }

    .info-line span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 820;
    }

    .info-line strong {
      min-width: 0;
      display: -webkit-box;
      overflow: hidden;
      color: var(--text);
      font-size: 13px;
      font-weight: 900;
      line-height: 1.25;
      text-overflow: ellipsis;
      white-space: normal;
      overflow-wrap: anywhere;
      unicode-bidi: plaintext;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }

    .note-list {
      display: grid;
      gap: 6px;
      margin: 0;
      padding: 8px 10px;
      border: 1px solid rgba(47, 140, 255, 0.18);
      border-radius: 8px;
      color: var(--soft);
      background: rgba(47, 140, 255, 0.07);
      font-size: 11px;
      line-height: 1.35;
      list-style: none;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .form-field {
      display: grid;
      gap: 5px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 780;
    }

    .form-field.wide {
      grid-column: 1 / -1;
    }

    .form-field input,
    .form-field select {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 0 10px;
      color: var(--text);
      background: var(--control-bg);
      font-size: 14px;
      font-weight: 780;
    }

    .form-field input:disabled,
    .form-field select:disabled,
    .profile-contact-code input:disabled {
      color: var(--disabled-text);
      background: var(--disabled-bg);
      border-color: var(--disabled-line);
    }

    .form-actions-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 116px;
      gap: 8px;
      align-items: center;
    }

    .stock-bridge {
      display: grid;
      gap: 10px;
    }

    .stock-bridge-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .stock-bridge-card {
      min-height: 62px;
      padding: 9px;
      border: 1px solid var(--hairline);
      border-radius: 8px;
      background: var(--metric-bg);
    }

    .stock-bridge-card strong {
      display: block;
      margin-top: 4px;
      overflow: hidden;
      color: var(--text);
      font-size: 15px;
      font-variant-numeric: tabular-nums;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .stock-bridge-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 116px;
      gap: 8px;
      align-items: center;
    }

    .stock-bridge-form input {
      width: 100%;
      min-height: 44px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 0 11px;
      color: var(--text);
      background: var(--control-bg);
      font-size: 15px;
      font-weight: 850;
      font-variant-numeric: tabular-nums;
    }

    .profile-list {
      display: grid;
      gap: 0;
    }

    .profile-line {
      min-height: 46px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      border-bottom: 1px solid var(--row-line);
    }

    .profile-line:last-child {
      border-bottom: 0;
    }

    .profile-line strong,
    .profile-line span {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-line strong {
      font-size: 13px;
    }

    .profile-line span {
      color: var(--muted);
      font-size: 12px;
      text-align: right;
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: calc(96px + env(safe-area-inset-bottom));
      z-index: 60;
      width: min(440px, calc(100vw - 24px));
      min-height: 42px;
      display: grid;
      align-items: center;
      transform: translateX(-50%) translateY(18px);
      padding: 10px 12px;
      border: 1px solid rgba(216, 180, 93, 0.38);
      border-radius: 8px;
      color: var(--toast-text);
      background: var(--toast-bg);
      box-shadow: var(--shadow);
      opacity: 0;
      pointer-events: none;
      transition: opacity 160ms ease, transform 160ms ease;
      font-size: 13px;
      font-weight: 760;
      line-height: 1.35;
      text-align: center;
      text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
    }

    .toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .sheet {
      position: fixed;
      inset: 0;
      z-index: 70;
      display: grid;
      align-items: end;
      justify-items: center;
      padding: 12px;
      background: var(--sheet-backdrop);
    }

    .sheet[hidden] {
      display: none;
    }

    .sheet:not([hidden]) {
      animation: sheet-fade var(--motion-med) ease both;
    }

    .sheet-card {
      width: min(456px, 100%);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      background: var(--surface);
      box-shadow: var(--shadow);
    }

    .sheet:not([hidden]) .sheet-card {
      animation: sheet-rise var(--motion-screen) var(--ease-snap) both;
    }

    .sheet-title {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
    }

    .sheet-title h2 {
      font-size: 16px;
    }

    .sheet-title span {
      overflow: hidden;
      color: var(--muted);
      font-size: 11px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .sheet-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 10px;
    }

    .nav {
      position: fixed;
      left: 50%;
      bottom: calc(12px + env(safe-area-inset-bottom));
      z-index: 55;
      --nav-offset: 0px;
      --nav-gap: 2px;
      --nav-pad: 5px;
      --nav-item-size: calc((100% - (var(--nav-pad) * 2) - (var(--nav-gap) * 4)) / 5);
      width: min(430px, calc(100vw - 28px));
      transform: translateX(-50%);
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: var(--nav-gap);
      min-height: 70px;
      padding: var(--nav-pad);
      border: 1px solid var(--nav-border);
      border-radius: 999px;
      background: var(--nav-bg);
      box-shadow:
        0 22px 52px var(--nav-shadow-strong),
        0 7px 18px var(--nav-shadow-soft),
        inset 0 1px 0 var(--nav-highlight),
        inset 0 -1px 0 rgba(0, 0, 0, 0.18);
      backdrop-filter: blur(20px) saturate(1.18);
      isolation: isolate;
      overflow: hidden;
    }

    .nav::before {
      content: "";
      position: absolute;
      z-index: 0;
      top: var(--nav-pad);
      bottom: var(--nav-pad);
      left: var(--nav-pad);
      width: var(--nav-item-size);
      border-radius: 999px;
      background: var(--nav-active-bg);
      box-shadow:
        inset 0 1px 0 var(--nav-highlight),
        0 8px 18px var(--nav-shadow-soft);
      transform: translateX(var(--nav-offset));
      transition:
        transform var(--motion-screen) var(--ease-snap),
        width var(--motion-screen) var(--ease-snap),
        background-color var(--motion-med) ease,
        box-shadow var(--motion-med) ease;
    }

    .nav::after {
      content: "";
      position: absolute;
      inset: 1px;
      z-index: 2;
      pointer-events: none;
      border-radius: inherit;
      box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        inset 0 14px 18px rgba(255, 255, 255, 0.035);
    }

    .nav button {
      position: relative;
      z-index: 3;
      min-height: 58px;
      display: grid;
      place-items: center;
      align-content: center;
      gap: 4px;
      border: 0;
      color: var(--muted);
      border-radius: 999px;
      background: transparent;
      font-size: 11px;
      font-weight: 800;
      overflow: hidden;
      padding: 0 2px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .nav button span:not(.nav-icon) {
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      unicode-bidi: plaintext;
    }

    .nav button.active {
      color: var(--accent);
      background: transparent;
    }

    .nav-icon {
      width: 24px;
      height: 24px;
      display: grid;
      place-items: center;
      color: var(--nav-icon);
      line-height: 1;
      opacity: 0.88;
      filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.22));
    }

    .nav-icon svg {
      width: 23px;
      height: 23px;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 2.2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .nav button.active .nav-icon {
      color: var(--accent);
      opacity: 1;
    }

    /* Device bands: Pro Max / large Android. */
    @media (min-width: 431px) {
      .app {
        max-width: 480px;
      }

      main {
        padding-left: 14px;
        padding-right: 14px;
      }

      .top {
        padding-left: 16px;
        padding-right: 16px;
      }

      .price {
        font-size: 44px;
      }

      .quote-select {
        grid-template-columns: minmax(0, 1fr) minmax(78px, 0.68fr) minmax(78px, 0.68fr);
      }

      .chart-wrap,
      canvas {
        min-height: 390px;
        height: 390px;
      }

      .app[data-screen="chart"] .chart-wrap,
      .app[data-screen="chart"] canvas {
        min-height: min(620px, calc(100vh - 218px - env(safe-area-inset-bottom)));
        height: min(620px, calc(100vh - 218px - env(safe-area-inset-bottom)));
      }

      .nav {
        width: min(450px, calc(100vw - 32px));
      }
    }

    /* Device band: Pixel/Samsung/iPhone Plus widths. */
    @media (min-width: 391px) and (max-width: 430px) {
      .price {
        font-size: 40px;
      }

      .chart-wrap,
      canvas {
        min-height: 374px;
        height: 374px;
      }

      .app[data-screen="chart"] .chart-wrap,
      .app[data-screen="chart"] canvas {
        min-height: min(590px, calc(100vh - 212px - env(safe-area-inset-bottom)));
        height: min(590px, calc(100vh - 212px - env(safe-area-inset-bottom)));
      }

      .nav {
        width: min(430px, calc(100vw - 24px));
      }
    }

    @media (max-width: 390px) {
      .price {
        font-size: 36px;
      }

      .quote-select {
        grid-template-columns: minmax(0, 1fr) minmax(64px, 0.62fr) minmax(64px, 0.62fr);
        gap: 7px;
      }

      .quote-numbers strong {
        font-size: 16px;
      }

      .login-form {
        grid-template-columns: 1fr;
      }

      .register-grid {
        grid-template-columns: 1fr;
      }

      .register-code-row,
      .register-code-row.compact {
        grid-template-columns: 1fr;
      }

      .form-grid,
      .avatar-editor,
      .form-actions-row {
        grid-template-columns: 1fr;
      }

      .account-grid,
      .card-grid,
      .risk-grid,
      .risk-strip,
      .stock-bridge-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .profile-hero {
        padding: 12px;
      }

      .profile-id {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 10px;
        padding-bottom: 9px;
      }

      .profile-avatar {
        width: 48px;
        height: 48px;
      }

      .profile-id h2 {
        font-size: 18px;
      }

      .profile-tag {
        min-height: 24px;
        padding: 0 7px;
        font-size: 10px;
      }

      .profile-balance-grid,
      .profile-actions {
        gap: 6px;
      }

      .profile-balance {
        min-height: 58px;
        padding: 8px 7px;
      }

      .profile-balance .label {
        font-size: 10px;
      }

      .profile-balance strong {
        font-size: 14px;
      }

      .profile-actions button {
        min-height: 42px;
        padding: 0 6px;
        font-size: 11px;
      }

      .market-pref-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .timeframes {
        gap: 4px;
      }

      .timeframes button {
        padding: 0;
        font-size: 11px;
      }

      #trade .panel-title {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
      }

      #trade .panel-title span {
        justify-content: flex-start;
      }
    }

    /* Device band: iPhone SE / compact Android. */
    @media (max-width: 375px) {
      .chart-statbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .chart-wrap,
      canvas {
        min-height: 330px;
        height: 330px;
      }

      .app[data-screen="chart"] .chart-wrap,
      .app[data-screen="chart"] canvas {
        min-height: min(500px, calc(100vh - 198px - env(safe-area-inset-bottom)));
        height: min(500px, calc(100vh - 198px - env(safe-area-inset-bottom)));
      }

      .trade-price-band strong {
        font-size: 26px;
      }

      .subview-head {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
      }

      .back-btn {
        width: 38px;
        height: 38px;
      }

      .nav {
        width: min(420px, calc(100vw - 18px));
        min-height: 66px;
      }

      .nav button {
        min-height: 54px;
      }
    }

    @media (max-width: 360px) {
      .profile-id {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 9px;
      }

      .profile-avatar {
        width: 44px;
        height: 44px;
        font-size: 16px;
      }

      .settings-entry {
        grid-template-columns: minmax(0, 1fr) minmax(56px, auto) 16px;
        gap: 7px;
      }

      .settings-entry > span {
        max-width: 88px;
      }

      .stock-bridge-grid,
      .account-grid {
        grid-template-columns: 1fr;
      }

      .profile-balance {
        padding: 7px 5px;
      }

      .profile-balance strong {
        font-size: 13px;
      }

      .profile-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 350px) {
      .top {
        padding-left: 10px;
        padding-right: 10px;
      }

      main {
        padding-left: 10px;
        padding-right: 10px;
      }

      .price {
        font-size: 32px;
      }

      .quote-card {
        grid-template-columns: minmax(0, 1fr) 34px;
      }

      .quote-select {
        grid-template-columns: minmax(0, 1fr) minmax(58px, 0.58fr) minmax(58px, 0.58fr);
        gap: 5px;
      }

      .quote-remove {
        width: 34px;
      }

      .quote-row {
        align-items: flex-start;
        flex-direction: column;
      }

      .change-pill {
        width: 100%;
        min-width: 0;
        text-align: left;
      }

      .order-grid,
      .estimate-grid,
      .stock-bridge-form {
        grid-template-columns: 1fr;
      }

      #trade .order-lot,
      #trade .order-grid {
        grid-template-columns: 1fr;
      }

      .trade-btn {
        min-height: 52px;
        font-size: 15px;
      }

      .nav button {
        min-height: 54px;
        font-size: 10px;
      }

      .nav-icon {
        width: 22px;
        height: 22px;
      }

      .nav-icon svg {
        width: 21px;
        height: 21px;
      }
    }

    @media (max-height: 720px) {
      .app[data-screen="chart"] .chart-wrap,
      .app[data-screen="chart"] canvas {
        min-height: min(440px, calc(100vh - 184px - env(safe-area-inset-bottom)));
        height: min(440px, calc(100vh - 184px - env(safe-area-inset-bottom)));
      }

      .nav {
        min-height: 64px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      html {
        scroll-behavior: auto;
      }

      *,
      *::before,
      *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
      }

      .refresh-btn.is-loading {
        animation: none;
      }
    }

    @keyframes screen-rise {
      from {
        opacity: 0;
        transform: translateY(10px) scale(0.992);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes screen-forward {
      from {
        opacity: 0;
        transform: translateX(22px) scale(0.992);
      }
      to {
        opacity: 1;
        transform: translateX(0) scale(1);
      }
    }

    @keyframes screen-back {
      from {
        opacity: 0;
        transform: translateX(-22px) scale(0.992);
      }
      to {
        opacity: 1;
        transform: translateX(0) scale(1);
      }
    }

    @keyframes profile-push {
      from {
        opacity: 0;
        transform: translateX(26px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    @keyframes profile-pop {
      from {
        opacity: 0;
        transform: translateX(-16px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    @keyframes sheet-fade {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }

    @keyframes sheet-rise {
      from {
        opacity: 0;
        transform: translateY(26px) scale(0.985);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    /* MT-style mobile trading terminal skin. Functionality stays on the existing DOM/JS. */
    :root {
      color-scheme: dark;
      --bg: #000000;
      --surface: #000000;
      --surface-2: #151517;
      --surface-3: #262629;
      --line: rgba(255, 255, 255, 0.14);
      --text: #f4f4f5;
      --muted: #8c8c92;
      --soft: #c5c5ca;
      --accent: #2f8cff;
      --accent-soft: rgba(47, 140, 255, 0.18);
      --buy: #2f8cff;
      --sell: #e34f41;
      --price-up: #2f8cff;
      --price-down: #e34f41;
      --price-up-soft: rgba(47, 140, 255, 0.12);
      --price-down-soft: rgba(227, 79, 65, 0.12);
      --app-bg: #000000;
      --top-bg: #000000;
      --panel-bg: #000000;
      --quote-box-bg: #000000;
      --control-bg: #18181a;
      --icon-bg: #1b1b1d;
      --metric-bg: #151517;
      --subtle-bg: rgba(255, 255, 255, 0.06);
      --row-line: rgba(255, 255, 255, 0.10);
      --weak-line: rgba(255, 255, 255, 0.08);
      --hairline: rgba(255, 255, 255, 0.045);
      --active-row-bg: rgba(255, 255, 255, 0.055);
      --nav-bg: rgba(24, 24, 25, 0.97);
      --nav-active-bg: rgba(255, 255, 255, 0.13);
      --nav-icon: #f4f4f5;
      --nav-border: rgba(255, 255, 255, 0.16);
      --nav-highlight: rgba(255, 255, 255, 0.14);
      --chart-bg: #000000;
      --chart-grid: rgba(70, 88, 117, 0.34);
      --chart-text: rgba(238, 238, 242, 0.72);
      --chart-meta: rgba(205, 205, 210, 0.76);
      --toast-bg: rgba(28, 28, 30, 0.98);
    }

    html,
    body {
      background: #000000;
    }

    .app {
      max-width: 480px;
      padding-bottom: calc(90px + env(safe-area-inset-bottom));
      background: #000000;
      box-shadow: none;
    }

    .top {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      padding: 0;
      border: 0;
      opacity: 0;
      pointer-events: none;
    }

    main,
    .app[data-screen="chart"] main,
    .app[data-screen="trade"] main,
    .app[data-screen="history"] main,
    .app[data-screen="profile"] main {
      padding: calc(18px + env(safe-area-inset-top)) 0 0;
    }

    .panel,
    .profile-hero,
    .login-state,
    .auth-card,
    .sheet-card {
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .screen.active {
      animation: none;
    }

    .screen {
      padding: 0 20px;
    }

    .screen-head,
    .panel-title,
    .subview-head {
      min-height: 64px;
      margin: 0 0 14px;
      padding: 0;
      align-items: center;
    }

    .screen-head {
      display: grid;
      grid-template-columns: 52px minmax(0, 1fr) auto;
      gap: 10px;
    }

    #quotes .screen-head::before {
      content: "";
      width: 46px;
      height: 46px;
      display: block;
      border: 1px solid var(--line);
      border-radius: 50%;
      background:
        linear-gradient(#f4f4f5, #f4f4f5) 50% 35% / 18px 3px no-repeat,
        linear-gradient(#f4f4f5, #f4f4f5) 50% 50% / 18px 3px no-repeat,
        linear-gradient(#f4f4f5, #f4f4f5) 50% 65% / 18px 3px no-repeat,
        #1b1b1d;
    }

    .screen-title {
      justify-self: center;
      text-align: center;
    }

    .screen-title .screen-caption {
      display: none;
    }

    .screen-head h2,
    .panel-title h2,
    .subview-title h2 {
      color: #f6f6f7;
      font-size: 22px;
      font-weight: 850;
      line-height: 1.1;
      text-align: center;
    }

    .screen-actions {
      gap: 10px;
    }

    .icon-btn,
    .refresh-btn,
    .back-btn {
      width: 46px;
      height: 46px;
      border: 1px solid var(--line);
      border-radius: 50%;
      color: #f6f6f7;
      background: #1b1b1d;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 10px 20px rgba(0, 0, 0, 0.28);
      font-size: 27px;
      font-weight: 760;
    }

    .icon-btn.primary {
      border-color: var(--line);
      color: #f6f6f7;
      background: #1b1b1d;
    }

    .quote-list,
    .market-list,
    .list {
      gap: 0;
    }

    .quote-table-head {
      display: grid;
      grid-template-columns: minmax(110px, 1fr) minmax(78px, 0.74fr) minmax(78px, 0.74fr) minmax(56px, 0.5fr);
      gap: 9px;
      padding: 0 0 11px;
      color: #f2f2f4;
      font-size: 17px;
      font-weight: 650;
      line-height: 1.1;
    }

    .quote-table-head span:not(:first-child) {
      text-align: right;
    }

    .quote-card,
    .market-row,
    .position-card,
    .history-card,
    .fund-card {
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .quote-card {
      grid-template-columns: minmax(0, 1fr);
      min-height: 76px;
    }

    .quote-card.active,
    .market-row.active {
      background: transparent;
      box-shadow: none;
    }

    .quote-select {
      min-height: 76px;
      grid-template-columns: minmax(110px, 1fr) minmax(78px, 0.74fr) minmax(78px, 0.74fr) minmax(56px, 0.5fr);
      gap: 9px;
      padding: 5px 0;
    }

    .quote-symbol strong,
    .market-symbol strong {
      color: #f6f6f7;
      font-size: 20px;
      font-weight: 900;
      letter-spacing: 0;
    }

    .quote-symbol span:first-of-type {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.2;
    }

    .quote-symbol span + span {
      display: none;
    }

    .quote-numbers {
      align-self: center;
      text-align: right;
    }

    .quote-numbers em {
      display: none;
    }

    .quote-select > .quote-numbers:nth-child(2) strong,
    .quote-select > .quote-numbers:nth-child(2) .price-with-unit {
      color: var(--sell);
    }

    .quote-select > .quote-numbers:nth-child(3) strong,
    .quote-select > .quote-numbers:nth-child(3) .price-with-unit {
      color: var(--accent);
    }

    .quote-numbers strong {
      color: var(--accent);
      font-size: 30px;
      line-height: 0.94;
      font-weight: 900;
    }

    .quote-numbers span {
      margin-top: 5px;
      color: #a5a5ab;
      font-size: 12px;
      line-height: 1.2;
    }

    .quote-change-cell {
      align-self: center;
      color: var(--accent);
      font-size: 18px;
      font-weight: 760;
      line-height: 1;
      text-align: right;
      white-space: nowrap;
    }

    .quote-change-cell.down {
      color: var(--sell);
    }

    .price-with-unit .unit,
    .money-with-unit .unit {
      color: currentColor;
      font-size: 0.48em;
      vertical-align: super;
    }

    .terminal-price {
      display: inline-flex;
      align-items: flex-start;
      justify-content: flex-end;
      color: inherit;
      font-variant-numeric: tabular-nums;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .terminal-price sup {
      margin-left: 1px;
      font-size: 0.46em;
      line-height: 1;
      transform: translateY(-0.02em);
    }

    .quote-remove {
      display: none;
    }

    #marketBrowser .screen-head {
      grid-template-columns: 52px minmax(0, 1fr) 52px;
    }

    .market-tools {
      gap: 14px;
      margin-bottom: 18px;
    }

    input,
    select,
    #marketSearch,
    .form-field input,
    .form-field select,
    .stock-bridge-form input {
      border: 1px solid rgba(255, 255, 255, 0.11);
      border-radius: 999px;
      color: #f6f6f7;
      background: #1b1b1d;
    }

    #marketSearch {
      min-height: 50px;
      padding: 0 18px;
      font-size: 17px;
      font-weight: 650;
    }

    .category-tabs {
      gap: 8px;
    }

    .category-tabs button {
      min-height: 36px;
      border-color: rgba(255, 255, 255, 0.12);
      color: #d9d9de;
      background: #171719;
    }

    .category-tabs button.active {
      border-color: rgba(47, 140, 255, 0.8);
      color: #2f8cff;
      background: rgba(47, 140, 255, 0.13);
    }

    .market-row {
      grid-template-columns: minmax(0, 1fr) 74px;
      min-height: 72px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    }

    .market-select {
      min-height: 72px;
      padding: 10px 0;
    }

    .market-price strong {
      font-size: 18px;
      color: var(--accent);
    }

    .market-action {
      border: 0;
      color: #2f8cff;
      background: transparent;
      font-size: 12px;
    }

    #chartSection.screen.active,
    #trade.screen.active {
      padding-left: 0;
      padding-right: 0;
    }

    #chartSection .panel-title,
    #trade .panel-title {
      min-height: 58px;
      display: grid;
      grid-template-columns: 64px minmax(0, 1fr) 64px;
      padding: 0 16px;
      border-bottom: 1px solid var(--row-line);
    }

    #chartSection .panel-title h2,
    #trade .panel-title h2 {
      grid-column: 2;
      grid-row: 1;
      overflow: hidden;
      font-size: 18px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #chartSection .panel-title span,
    #trade .panel-title span {
      grid-column: 3;
      grid-row: 1;
      justify-self: end;
      color: #a5a5ab;
      background: transparent;
      font-size: 11px;
      white-space: nowrap;
    }

    .symbol-action-row {
      margin: 0;
      padding: 8px 8px;
      border-bottom: 1px solid var(--row-line);
      grid-template-columns: minmax(0, 1fr) 86px;
    }

    .symbol-action-row select {
      min-height: 38px;
      border-radius: 0;
      border-color: transparent;
      background: #000000;
      font-size: 15px;
    }

    .symbol-action-btn {
      min-height: 36px;
      border-color: rgba(47, 140, 255, 0.7);
      border-radius: 999px;
      color: #2f8cff;
      background: transparent;
      font-size: 13px;
    }

    .chart-statbar {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 0;
      margin: 0;
      border-bottom: 1px solid var(--row-line);
    }

    .chart-statbar span {
      min-height: 42px;
      border: 0;
      border-right: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 0;
      background: #000000;
    }

    .chart-statbar span:last-child {
      border-right: 0;
    }

    .chart-wrap {
      border: 0;
      border-radius: 0;
      border-bottom: 1px solid var(--row-line);
      background: #000000;
    }

    .app[data-screen="chart"] .chart-wrap,
    .app[data-screen="chart"] canvas {
      min-height: min(670px, calc(100dvh - 260px - env(safe-area-inset-bottom)));
      height: min(670px, calc(100dvh - 260px - env(safe-area-inset-bottom)));
    }

    .chart-meta {
      left: 8px;
      right: 8px;
      bottom: 7px;
      color: rgba(220, 220, 224, 0.72);
      font-size: 12px;
    }

    .chart-tools {
      grid-template-columns: 42px minmax(0, 1fr) 42px 54px;
      gap: 6px;
      margin: 8px 10px 0;
    }

    .chart-tools button,
    .chart-tools span,
    .timeframes button,
    .volume-chip {
      border-color: rgba(255, 255, 255, 0.12);
      border-radius: 999px;
      color: #f4f4f5;
      background: #171719;
    }

    .timeframes {
      gap: 5px;
      margin: 8px 10px 0;
    }

    .timeframes button {
      min-height: 32px;
      font-weight: 850;
      text-transform: uppercase;
    }

    .timeframes button.active,
    .volume-chip.active {
      color: #2f8cff;
      background: rgba(47, 140, 255, 0.16);
    }

    #trade .risk-strip,
    .contract-spec-card,
    .contract-note {
      display: none;
    }

    .ticket {
      gap: 0;
    }

    .trade-price-band {
      gap: 0;
    }

    .trade-price-band div {
      min-height: 88px;
      border: 0;
      border-radius: 0;
      padding: 12px 18px;
      background: #111113;
      text-align: center;
    }

    .trade-price-band .quote-sell {
      background: #e34f41;
    }

    .trade-price-band .quote-buy {
      background: #1474d4;
    }

    .trade-price-band span,
    .trade-price-band strong,
    .trade-price-band .quote-sell strong,
    .trade-price-band .quote-buy strong {
      color: #ffffff;
    }

    .trade-price-band span {
      font-size: 14px;
      text-align: left;
      text-transform: uppercase;
    }

    .trade-price-band strong {
      font-size: 36px;
      line-height: 0.95;
    }

    .trade-form {
      gap: 0;
      padding: 16px 22px 0;
    }

    #trade .order-lot,
    #trade .order-grid {
      grid-template-columns: 1fr;
      gap: 12px;
    }

    #trade label,
    #trade .quick-volume,
    .order-preview,
    #trade .estimate-grid {
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 12px;
    }

    #trade input {
      min-height: 48px;
      border-radius: 999px;
      text-align: center;
      font-size: 20px;
      font-weight: 850;
    }

    .volume-chips {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    #trade .volume-chip {
      min-height: 42px;
      border-radius: 999px;
      background: #171719;
    }

    #trade .estimate-grid,
    .order-preview {
      margin: 0 22px;
      border: 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 0;
      background: transparent;
    }

    #trade .estimate {
      min-height: 46px;
      padding: 8px 0;
      border-color: rgba(255, 255, 255, 0.06);
    }

    .order-preview-head,
    .order-preview-item {
      padding-left: 0;
      padding-right: 0;
    }

    .trade-actions {
      gap: 0;
      margin-top: 16px;
    }

    .trade-btn {
      min-height: 58px;
      border-radius: 0;
      border: 0;
      font-size: 18px;
      font-weight: 850;
    }

    .buy-btn {
      background: #1474d4;
    }

    .sell-btn {
      background: #e1372d;
    }

    .app[data-screen="history"] main {
      padding-left: 0;
      padding-right: 0;
    }

    #history,
    #funds {
      padding-left: 16px;
      padding-right: 16px;
    }

    #history .panel-title,
    #funds .panel-title {
      min-height: 56px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      margin-bottom: 8px;
    }

    #history .panel-title h2,
    #funds .panel-title h2 {
      text-align: left;
    }

    .position-card,
    .history-card,
    .fund-card {
      padding: 13px 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .card-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px 16px;
    }

    .empty {
      min-height: 52vh;
      border: 0;
      border-radius: 0;
      color: #77777d;
      background: transparent;
      font-size: 15px;
    }

    .profile-hero.screen.active,
    .account-center-panel.screen.active,
    .profile-subview.screen.active,
    #profileDetails.screen.active,
    #accountOverview.screen.active,
    .login-state.screen.active {
      padding-left: 22px;
      padding-right: 22px;
    }

    .profile-brand {
      display: none;
    }

    .profile-id,
    .settings-menu,
    .subview-section,
    .auth-card,
    .price-color-example {
      border: 0;
      border-radius: 18px;
      background: #1c1c1f;
      padding: 16px;
    }

    .profile-id {
      grid-template-columns: 58px minmax(0, 1fr);
      border-bottom: 0;
    }

    .profile-balance-grid,
    .account-grid,
    .risk-grid {
      grid-template-columns: 1fr;
      gap: 0;
      overflow: hidden;
      border-radius: 18px;
      background: #1c1c1f;
    }

    .profile-balance,
    .metric,
    .status-chip,
    .info-line,
    .stock-bridge-card {
      border: 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 0;
      background: transparent;
    }

    .profile-actions {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .profile-actions button,
    .auth-choice,
    .primary-btn,
    .ghost-btn,
    .mini-btn,
    .close-btn {
      border-radius: 999px;
      border-color: rgba(255, 255, 255, 0.12);
      background: #1c1c1f;
    }

    .settings-entry {
      min-height: 66px;
      padding: 0;
      border-bottom-color: rgba(255, 255, 255, 0.10);
    }

    .settings-entry strong {
      font-size: 18px;
      font-weight: 760;
    }

    .settings-entry small,
    .settings-entry > span {
      color: #8c8c92;
      font-size: 14px;
    }

    .subview-head {
      grid-template-columns: 52px minmax(0, 1fr) 52px;
    }

    .nav {
      bottom: calc(12px + env(safe-area-inset-bottom));
      width: min(438px, calc(100vw - 28px));
      min-height: 66px;
      border-radius: 999px;
      background: rgba(24, 24, 25, 0.98);
      backdrop-filter: blur(18px) saturate(1.2);
    }

    .nav button {
      min-height: 56px;
      font-size: 12px;
      font-weight: 760;
    }

    .nav-icon {
      width: 25px;
      height: 25px;
    }

    .nav-icon svg {
      width: 25px;
      height: 25px;
      stroke-width: 2.35;
    }

    .toast {
      border-radius: 999px;
      border-color: rgba(255, 255, 255, 0.12);
      background: rgba(30, 30, 32, 0.98);
    }

    .auth-terminal-head {
      min-height: 72px;
      display: grid;
      grid-template-columns: 52px minmax(0, 1fr) 52px;
      gap: 10px;
      align-items: center;
      width: 100%;
      margin: 0 0 18px;
    }

    .login-state.screen.active {
      min-height: calc(100dvh - 88px - env(safe-area-inset-bottom));
      align-content: start;
      justify-items: stretch;
      padding-top: 0;
      padding-bottom: 108px;
    }

    #profile .auth-card {
      width: 100%;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      gap: 18px;
    }

    #profile .auth-brand {
      min-height: 84px;
      justify-content: flex-start;
      gap: 14px;
      border-radius: 18px;
      padding: 16px;
      color: #f4f4f5;
      background: #1c1c1f;
      font-size: 20px;
      font-weight: 760;
      box-shadow: none;
    }

    #profile .auth-brand img {
      width: 48px;
      height: 48px;
    }

    #profile .login-summary {
      justify-items: stretch;
      gap: 6px;
      border-radius: 18px;
      padding: 16px;
      background: #1c1c1f;
      text-align: left;
    }

    #profile .user-name {
      color: #f4f4f5;
      font-size: 21px;
      font-weight: 780;
    }

    #profile .status-line {
      color: #929299;
      font-size: 15px;
    }

    #profile .api-dot {
      width: max-content;
      margin-top: 8px;
      color: #929299;
      font-size: 13px;
    }

    #profile .auth-entry {
      overflow: hidden;
      gap: 0;
      border-radius: 18px;
      background: #1c1c1f;
    }

    #profile .auth-choice {
      position: relative;
      min-height: 74px;
      justify-items: start;
      align-content: center;
      gap: 4px;
      border: 0;
      border-bottom: 1px solid rgba(255, 255, 255, 0.10);
      border-radius: 0;
      padding: 14px 44px 14px 16px;
      background: transparent;
      text-align: left;
      box-shadow: none;
    }

    #profile .auth-choice:last-child {
      border-bottom: 0;
    }

    #profile .auth-choice::after {
      content: "›";
      position: absolute;
      right: 16px;
      top: 50%;
      transform: translateY(-50%);
      color: #74747b;
      font-size: 30px;
      line-height: 1;
    }

    #profile .auth-choice.primary {
      background: transparent;
    }

    #profile .auth-choice strong {
      color: #f4f4f5;
      font-size: 20px;
      font-weight: 760;
      line-height: 1.2;
    }

    #profile .auth-choice small {
      color: #929299;
      font-size: 15px;
      font-weight: 500;
      line-height: 1.32;
    }

    #profile .auth-back-btn {
      width: 46px;
      min-height: 46px;
      justify-self: start;
      padding: 0;
      border-radius: 50%;
      color: transparent;
      background: #1b1b1d;
    }

    #profile .auth-back-btn::before {
      content: "‹";
      color: #f6f6f7;
      font-size: 28px;
      line-height: 1;
    }

    #profile .auth-tabs {
      min-height: 54px;
      gap: 0;
      border-radius: 999px;
      padding: 4px;
      background: #1c1c1f;
    }

    #profile .auth-tabs button {
      min-height: 46px;
      border: 0;
      color: #f4f4f5;
      background: transparent;
      font-size: 17px;
      font-weight: 760;
    }

    #profile .auth-tabs button.active {
      color: #f4f4f5;
      background: rgba(255, 255, 255, 0.14);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    #profile .login-form,
    #profile .register-form {
      gap: 14px;
      border-radius: 18px;
      padding: 16px;
      background: #1c1c1f;
    }

    #profile .auth-form-head {
      justify-items: start;
      margin-bottom: 4px;
      text-align: left;
    }

    #profile .auth-form-head strong {
      color: #f4f4f5;
      font-size: 22px;
      font-weight: 780;
    }

    #profile .auth-form-head span {
      color: #929299;
      font-size: 15px;
      font-weight: 500;
    }

    #profile .login-form input,
    #profile .register-form input,
    #profile .register-form select {
      min-height: 54px;
      border: 0;
      border-radius: 14px;
      padding: 0 16px;
      color: #f4f4f5;
      background: #2b2b2e;
      font-size: 17px;
      font-weight: 620;
    }

    #profile .login-form input::placeholder,
    #profile .register-form input::placeholder {
      color: #85858c;
    }

    #profile .primary-btn,
    #profile .ghost-btn {
      min-height: 52px;
      border: 0;
      border-radius: 999px;
      color: #ffffff;
      background: #1474d4;
      font-size: 17px;
      font-weight: 760;
    }

    #profile .ghost-btn {
      color: #2f8cff;
      background: rgba(47, 140, 255, 0.12);
    }

    #profile .register-progress {
      gap: 0;
      overflow: hidden;
      min-height: 46px;
      margin: 0;
      border-radius: 999px;
      padding: 4px;
      background: #111113;
    }

    #profile .register-progress span {
      min-height: 38px;
      border: 0;
      border-radius: 999px;
      color: #929299;
      background: transparent;
      font-size: 13px;
      font-weight: 760;
    }

    #profile .register-progress span.active,
    #profile .register-progress span.done {
      color: #f4f4f5;
      background: rgba(255, 255, 255, 0.14);
    }

    #profile .register-code-row,
    #profile .register-code-row.compact,
    #profile .register-grid {
      gap: 10px;
    }

    #profile .market-pref-grid {
      gap: 8px;
    }

    #profile .market-pref span {
      border-radius: 999px;
      border-color: rgba(255, 255, 255, 0.12);
      background: #2b2b2e;
    }

    #profile .market-pref input:checked + span {
      color: #2f8cff;
      background: rgba(47, 140, 255, 0.14);
      border-color: rgba(47, 140, 255, 0.48);
    }

    #profile .verify-status {
      color: #929299;
      font-size: 13px;
    }

    @media (max-width: 390px) {
      .screen {
        padding-left: 16px;
        padding-right: 16px;
      }

      .quote-select {
        grid-template-columns: minmax(96px, 1fr) minmax(72px, 0.7fr) minmax(72px, 0.7fr);
      }

      .quote-numbers strong {
        font-size: 24px;
      }

      .trade-price-band strong {
        font-size: 30px;
      }

      #profile .auth-brand,
      #profile .login-summary,
      #profile .login-form,
      #profile .register-form {
        border-radius: 16px;
        padding: 14px;
      }
    }

    html[data-theme="light"] {
      color-scheme: light;
      --bg: #ffffff;
      --surface: #ffffff;
      --surface-2: #f2f2f4;
      --surface-3: #e4e5e8;
      --line: rgba(0, 0, 0, 0.14);
      --text: #111113;
      --muted: #73737a;
      --soft: #3e3e46;
      --accent: #1474d4;
      --accent-soft: rgba(20, 116, 212, 0.12);
      --buy: #1474d4;
      --sell: #d84e42;
      --price-up: #1474d4;
      --price-down: #d84e42;
      --price-up-soft: rgba(20, 116, 212, 0.10);
      --price-down-soft: rgba(216, 78, 66, 0.10);
      --app-bg: #ffffff;
      --top-bg: #ffffff;
      --panel-bg: #ffffff;
      --quote-box-bg: #ffffff;
      --control-bg: #f1f1f3;
      --icon-bg: #f1f1f3;
      --metric-bg: #f4f4f6;
      --subtle-bg: rgba(0, 0, 0, 0.045);
      --row-line: rgba(0, 0, 0, 0.10);
      --weak-line: rgba(0, 0, 0, 0.08);
      --hairline: rgba(0, 0, 0, 0.045);
      --active-row-bg: rgba(0, 0, 0, 0.045);
      --nav-bg: rgba(244, 244, 246, 0.98);
      --nav-active-bg: rgba(0, 0, 0, 0.08);
      --nav-icon: #161618;
      --nav-border: rgba(0, 0, 0, 0.14);
      --nav-highlight: rgba(255, 255, 255, 0.74);
      --chart-bg: #ffffff;
      --chart-grid: rgba(85, 100, 125, 0.24);
      --chart-text: rgba(17, 17, 19, 0.70);
      --chart-meta: rgba(17, 17, 19, 0.62);
      --toast-bg: rgba(28, 28, 30, 0.94);
    }

    html[data-theme="light"],
    html[data-theme="light"] body,
    html[data-theme="light"] .app,
    html[data-theme="light"] .symbol-action-row select,
    html[data-theme="light"] .chart-statbar span,
    html[data-theme="light"] .chart-wrap {
      background: #ffffff;
    }

    html[data-theme="light"] #quotes .screen-head::before {
      border-color: rgba(0, 0, 0, 0.14);
      background:
        linear-gradient(#151518, #151518) 50% 35% / 18px 3px no-repeat,
        linear-gradient(#151518, #151518) 50% 50% / 18px 3px no-repeat,
        linear-gradient(#151518, #151518) 50% 65% / 18px 3px no-repeat,
        #f1f1f3;
    }

    html[data-theme="light"] .screen-head h2,
    html[data-theme="light"] .panel-title h2,
    html[data-theme="light"] .subview-title h2,
    html[data-theme="light"] .quote-symbol strong,
    html[data-theme="light"] .market-symbol strong,
    html[data-theme="light"] .icon-btn,
    html[data-theme="light"] .refresh-btn,
    html[data-theme="light"] .back-btn,
    html[data-theme="light"] .chart-tools button,
    html[data-theme="light"] .chart-tools span,
    html[data-theme="light"] .timeframes button,
    html[data-theme="light"] .volume-chip {
      color: #111113;
    }

    html[data-theme="light"] .icon-btn,
    html[data-theme="light"] .refresh-btn,
    html[data-theme="light"] .back-btn,
    html[data-theme="light"] input,
    html[data-theme="light"] select,
    html[data-theme="light"] #marketSearch,
    html[data-theme="light"] .form-field input,
    html[data-theme="light"] .form-field select,
    html[data-theme="light"] .stock-bridge-form input,
    html[data-theme="light"] .chart-tools button,
    html[data-theme="light"] .chart-tools span,
    html[data-theme="light"] .timeframes button,
    html[data-theme="light"] .volume-chip,
    html[data-theme="light"] #trade .volume-chip {
      border-color: rgba(0, 0, 0, 0.12);
      background: #f1f1f3;
    }

    html[data-theme="light"] input,
    html[data-theme="light"] select,
    html[data-theme="light"] #marketSearch,
    html[data-theme="light"] .form-field input,
    html[data-theme="light"] .form-field select,
    html[data-theme="light"] .stock-bridge-form input {
      color: #111113;
    }

    html[data-theme="light"] .category-tabs button {
      border-color: rgba(0, 0, 0, 0.12);
      color: #37373d;
      background: #f1f1f3;
    }

    html[data-theme="light"] .category-tabs button.active,
    html[data-theme="light"] .timeframes button.active,
    html[data-theme="light"] .volume-chip.active {
      color: #1474d4;
      background: rgba(20, 116, 212, 0.12);
    }

    html[data-theme="light"] .quote-numbers span,
    html[data-theme="light"] #chartSection .panel-title span,
    html[data-theme="light"] #trade .panel-title span,
    html[data-theme="light"] .settings-entry small,
    html[data-theme="light"] .settings-entry > span,
    html[data-theme="light"] .empty {
      color: #73737a;
    }

    html[data-theme="light"] .market-row,
    html[data-theme="light"] #trade label,
    html[data-theme="light"] #trade .quick-volume,
    html[data-theme="light"] .order-preview,
    html[data-theme="light"] #trade .estimate-grid,
    html[data-theme="light"] .position-card,
    html[data-theme="light"] .history-card,
    html[data-theme="light"] .fund-card,
    html[data-theme="light"] .profile-balance,
    html[data-theme="light"] .metric,
    html[data-theme="light"] .status-chip,
    html[data-theme="light"] .info-line,
    html[data-theme="light"] .stock-bridge-card {
      border-bottom-color: rgba(0, 0, 0, 0.08);
    }

    html[data-theme="light"] .chart-statbar span {
      border-right-color: rgba(0, 0, 0, 0.06);
    }

    html[data-theme="light"] .chart-meta {
      color: rgba(17, 17, 19, 0.62);
    }

    html[data-theme="light"] .profile-id,
    html[data-theme="light"] .settings-menu,
    html[data-theme="light"] .subview-section,
    html[data-theme="light"] .auth-card,
    html[data-theme="light"] .price-color-example,
    html[data-theme="light"] .profile-balance-grid,
    html[data-theme="light"] .account-grid,
    html[data-theme="light"] .risk-grid,
    html[data-theme="light"] .profile-actions button,
    html[data-theme="light"] .auth-choice,
    html[data-theme="light"] .primary-btn,
    html[data-theme="light"] .ghost-btn,
    html[data-theme="light"] .mini-btn,
    html[data-theme="light"] .close-btn {
      background: #f1f1f3;
    }

    html[data-theme="light"] .settings-entry {
      border-bottom-color: rgba(0, 0, 0, 0.10);
    }

    html[data-theme="light"] .nav {
      background: rgba(244, 244, 246, 0.98);
      box-shadow:
        0 16px 34px rgba(0, 0, 0, 0.16),
        0 5px 14px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    }

    html[data-theme="light"] .toast {
      border-color: rgba(0, 0, 0, 0.10);
      color: #ffffff;
      background: rgba(30, 30, 32, 0.94);
    }

    html[data-theme="light"] #profile .auth-brand,
    html[data-theme="light"] #profile .login-summary,
    html[data-theme="light"] #profile .auth-entry,
    html[data-theme="light"] #profile .login-form,
    html[data-theme="light"] #profile .register-form {
      background: #f1f1f3;
    }

    html[data-theme="light"] #profile .auth-brand,
    html[data-theme="light"] #profile .user-name,
    html[data-theme="light"] #profile .auth-choice strong,
    html[data-theme="light"] #profile .auth-form-head strong,
    html[data-theme="light"] #profile .auth-tabs button,
    html[data-theme="light"] #profile .register-progress span.active,
    html[data-theme="light"] #profile .register-progress span.done {
      color: #111113;
    }

    html[data-theme="light"] #profile .status-line,
    html[data-theme="light"] #profile .api-dot,
    html[data-theme="light"] #profile .auth-choice small,
    html[data-theme="light"] #profile .auth-form-head span,
    html[data-theme="light"] #profile .verify-status {
      color: #73737a;
    }

    html[data-theme="light"] #profile .auth-choice {
      border-bottom-color: rgba(0, 0, 0, 0.10);
    }

    html[data-theme="light"] #profile .auth-tabs,
    html[data-theme="light"] #profile .register-progress {
      background: #ffffff;
    }

    html[data-theme="light"] #profile .auth-tabs button.active,
    html[data-theme="light"] #profile .register-progress span.active,
    html[data-theme="light"] #profile .register-progress span.done {
      background: rgba(0, 0, 0, 0.08);
    }

    html[data-theme="light"] #profile .login-form input,
    html[data-theme="light"] #profile .register-form input,
    html[data-theme="light"] #profile .register-form select,
    html[data-theme="light"] #profile .market-pref span {
      color: #111113;
      background: #ffffff;
      border: 1px solid rgba(0, 0, 0, 0.08);
    }

    html[data-theme="light"] #profile .login-form input::placeholder,
    html[data-theme="light"] #profile .register-form input::placeholder {
      color: #8a8a92;
    }

    html[data-theme="light"] #profile .auth-back-btn {
      background: #f1f1f3;
    }

    html[data-theme="light"] #profile .auth-back-btn::before {
      color: #111113;
    }

    /* MT reference pass: tighter iOS terminal proportions. */
    main,
    .app[data-screen="chart"] main,
    .app[data-screen="trade"] main,
    .app[data-screen="history"] main,
    .app[data-screen="profile"] main {
      padding-top: calc(42px + env(safe-area-inset-top));
    }

    .screen {
      padding-left: 18px;
      padding-right: 18px;
    }

    .screen-head,
    .panel-title,
    .subview-head {
      min-height: 76px;
      margin-bottom: 14px;
    }

    .screen-head h2,
    .panel-title h2,
    .subview-title h2 {
      font-size: 24px;
      font-weight: 780;
    }

    .icon-btn,
    .refresh-btn,
    .back-btn,
    #quotes .screen-head::before {
      width: 58px;
      height: 58px;
      border-color: rgba(255, 255, 255, 0.12);
      background-color: #1b1b1d;
      box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 1px 0 rgba(255, 255, 255, 0.02);
    }

    .icon-btn {
      font-size: 32px;
      font-weight: 520;
    }

    .screen-actions {
      gap: 14px;
    }

    .quote-table-head {
      grid-template-columns: minmax(118px, 1fr) minmax(82px, 0.78fr) minmax(82px, 0.78fr) minmax(58px, 0.5fr);
      gap: 10px;
      padding: 2px 0 12px;
      font-size: 20px;
      font-weight: 430;
    }

    .quote-card {
      min-height: 76px;
    }

    .quote-select {
      min-height: 76px;
      grid-template-columns: minmax(118px, 1fr) minmax(82px, 0.78fr) minmax(82px, 0.78fr) minmax(58px, 0.5fr);
      gap: 10px;
      padding: 7px 0;
    }

    .quote-symbol {
      align-self: center;
    }

    .quote-symbol strong,
    .market-symbol strong {
      font-size: 21px;
      font-weight: 780;
    }

    .quote-symbol span {
      display: none !important;
    }

    .quote-numbers strong {
      font-size: 26px;
      font-weight: 560;
      letter-spacing: 0;
    }

    .quote-numbers span {
      display: none;
    }

    .quote-change-cell {
      font-size: 19px;
      font-weight: 430;
    }

    .nav {
      bottom: calc(14px + env(safe-area-inset-bottom));
      width: min(432px, calc(100vw - 38px));
      min-height: 76px;
      padding: 5px;
      border-radius: 999px;
      border-color: rgba(255, 255, 255, 0.13);
      background: rgba(24, 24, 25, 0.985);
    }

    .nav button {
      min-height: 66px;
      border-radius: 999px;
      font-size: 15px;
      font-weight: 500;
    }

    .nav button.active {
      background: #3a3a3c;
    }

    .nav-icon,
    .nav-icon svg {
      width: 28px;
      height: 28px;
    }

    .nav button.active .nav-icon,
    .nav button.active span:last-child {
      color: #2f8cff;
    }

    #chartSection .panel-title,
    #trade .panel-title {
      min-height: 62px;
      border-bottom-color: rgba(255, 255, 255, 0.18);
    }

    #chartSection .panel-title h2,
    #trade .panel-title h2 {
      font-size: 21px;
      font-weight: 760;
    }

    .trade-price-band strong {
      font-size: 44px;
      font-weight: 560;
      letter-spacing: 0;
    }

    .trade-price-band span {
      font-size: 17px;
      font-weight: 420;
    }

    #trade input {
      font-size: 24px;
      font-weight: 520;
    }

    #history .panel-title,
    #funds .panel-title {
      justify-items: center;
      grid-template-columns: 58px minmax(0, 1fr) 58px;
    }

    #history .panel-title h2,
    #funds .panel-title h2 {
      grid-column: 2;
      text-align: center;
    }

    #history .panel-title span,
    #funds .panel-title span {
      display: none;
    }

    html[data-theme="light"] .icon-btn,
    html[data-theme="light"] .refresh-btn,
    html[data-theme="light"] .back-btn,
    html[data-theme="light"] #quotes .screen-head::before {
      border-color: rgba(0, 0, 0, 0.10);
      background-color: #f1f1f3;
    }

    html[data-theme="light"] .nav button.active {
      background: rgba(0, 0, 0, 0.09);
    }

    @media (max-width: 390px) {
      .quote-table-head,
      .quote-select {
        grid-template-columns: minmax(104px, 1fr) minmax(72px, 0.74fr) minmax(72px, 0.74fr) minmax(50px, 0.48fr);
        gap: 8px;
      }

      .quote-table-head {
        font-size: 18px;
      }

      .quote-symbol strong {
        font-size: 20px;
      }

      .quote-numbers strong {
        font-size: 23px;
      }

      .quote-change-cell {
        font-size: 17px;
      }
    }

    /* MT-style quotes: detail/table/edit states. */
    #quotes .screen-head {
      grid-template-columns: 62px minmax(0, 1fr) auto;
      margin-bottom: 18px;
    }

    #quotes .screen-head::before {
      display: none;
    }

    .quote-mode-btn {
      grid-column: 1;
      grid-row: 1;
    }

    #quotes .screen-title {
      grid-column: 2;
      grid-row: 1;
      align-self: center;
    }

    #quotes .screen-actions {
      grid-column: 3;
      grid-row: 1;
    }

    .quote-mode-btn,
    #refreshBtn {
      font-size: 28px;
      font-weight: 700;
    }

    .app[data-quote-mode="detail"] .quote-list,
    .app[data-quote-mode="edit"] .quote-list {
      display: grid;
      gap: 0;
    }

    .quote-card-detail {
      min-height: 102px;
    }

    .quote-detail-select {
      min-height: 102px;
      display: grid;
      grid-template-columns: minmax(130px, 1.18fr) minmax(94px, 0.88fr) minmax(94px, 0.88fr);
      gap: 10px;
      padding: 3px 0 9px;
      align-items: center;
    }

    .quote-detail-symbol {
      display: grid;
      align-content: center;
      gap: 3px;
      min-width: 0;
      color: var(--text);
      text-align: left;
    }

    .quote-detail-symbol strong {
      color: var(--text);
      font-size: 22px;
      font-weight: 850;
      letter-spacing: 0;
      line-height: 1.02;
    }

    .quote-delta,
    .quote-time {
      color: var(--muted);
      font-size: 17px;
      font-weight: 430;
      line-height: 1.08;
      white-space: nowrap;
    }

    .quote-delta.up {
      color: var(--accent);
    }

    .quote-delta.down {
      color: var(--sell);
    }

    .quote-detail-price {
      display: grid;
      gap: 5px;
      align-content: center;
      justify-items: end;
      min-width: 0;
      text-align: right;
    }

    .quote-detail-price strong {
      color: currentColor;
      font-size: 43px;
      font-weight: 760;
      letter-spacing: 0;
      line-height: 0.86;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }

    .quote-detail-price span {
      color: var(--muted);
      font-size: 18px;
      font-weight: 420;
      line-height: 1;
      white-space: nowrap;
    }

    .quote-detail-price.up {
      color: var(--accent);
    }

    .quote-detail-price.down {
      color: var(--sell);
    }

    .quote-detail-price .terminal-price sup {
      font-size: 0.42em;
      transform: translateY(-0.08em);
    }

    .app[data-quote-mode="table"] .quote-card {
      min-height: 68px;
    }

    .app[data-quote-mode="table"] .quote-select {
      min-height: 68px;
      padding: 5px 0;
    }

    .app[data-quote-mode="table"] .quote-symbol strong {
      font-size: 21px;
      line-height: 1;
    }

    .app[data-quote-mode="table"] .quote-numbers strong {
      font-size: 22px;
      font-weight: 430;
    }

    .quote-edit-list {
      display: grid;
      gap: 0;
      padding-top: 8px;
    }

    .quote-edit-row {
      display: grid;
      grid-template-columns: 46px minmax(0, 1fr) 48px;
      align-items: center;
      min-height: 73px;
      user-select: none;
    }

    .quote-edit-row.dragging {
      opacity: 0.44;
    }

    .quote-edit-remove {
      width: 27px;
      height: 27px;
      border: 2px solid var(--line);
      border-radius: 50%;
      background: transparent;
      justify-self: start;
    }

    .quote-edit-symbol {
      min-height: 56px;
      border: 0;
      color: var(--text);
      background: transparent;
      text-align: left;
      font-size: 22px;
      font-weight: 850;
      letter-spacing: 0;
    }

    .quote-drag-handle {
      justify-self: end;
      color: var(--muted);
      font-size: 27px;
      line-height: 1;
      cursor: grab;
    }

    .quote-table-head {
      align-items: end;
    }

    .quote-table-head span:first-child {
      text-align: left;
    }

    .app[data-quote-mode="edit"] .quote-table-head,
    .app[data-quote-mode="detail"] .quote-table-head {
      display: none;
    }

    html[data-theme="light"] #quotes .screen-head h2,
    html[data-theme="light"] .quote-detail-symbol strong,
    html[data-theme="light"] .quote-edit-symbol,
    html[data-theme="light"] .quote-table-head,
    html[data-theme="light"] .quote-symbol strong {
      color: #000000;
    }

    html[data-theme="light"] .quote-edit-remove {
      border-color: #c9c9cc;
    }

    html[data-theme="light"] .quote-drag-handle {
      color: #b7b7bc;
    }

    /* MT-style chart screen. */
    #chartSection.screen.active {
      padding-top: 0;
    }

    #chartSection .panel-title {
      min-height: 62px;
      grid-template-columns: 74px minmax(0, 1fr) 92px;
      margin: 0;
      padding: 0 14px;
      border-bottom: 1px solid var(--row-line);
    }

    #chartSection .panel-title h2 {
      grid-column: 1;
      justify-self: start;
      color: var(--text);
      font-size: 22px;
      font-weight: 760;
    }

    #chartSection .panel-title span {
      display: block;
      grid-column: 2 / 4;
      justify-self: stretch;
      color: transparent;
      font-size: 0;
      text-align: center;
    }

    #chartSection .panel-title span::before {
      content: "+   ƒ   ◰";
      color: var(--muted);
      font-size: 29px;
      letter-spacing: 24px;
      white-space: nowrap;
    }

    #chartSection .panel-title::after {
      content: "◔  ▣";
      grid-column: 3;
      justify-self: end;
      color: #d86457;
      font-size: 27px;
      letter-spacing: 10px;
    }

    .chart-quick-trade {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 1.34fr minmax(0, 1fr);
      min-height: 49px;
      border-bottom: 1px solid var(--row-line);
      background: var(--bg);
    }

    .chart-quote-action {
      display: grid;
      align-content: center;
      justify-items: start;
      min-height: 49px;
      border: 0;
      border-radius: 0;
      padding: 2px 14px 4px;
      color: #ffffff;
      text-align: left;
    }

    .chart-quote-action.sell {
      background: #d94a3d;
    }

    .chart-quote-action.buy {
      background: #d94a3d;
    }

    .chart-quote-action span {
      font-size: 14px;
      font-weight: 520;
      line-height: 1;
    }

    .chart-quote-action strong {
      color: #ffffff;
      font-size: 31px;
      font-weight: 760;
      line-height: 0.86;
      font-variant-numeric: tabular-nums;
    }

    .chart-lot-control {
      display: grid;
      grid-template-columns: 44px minmax(0, 1fr) 44px;
      align-items: center;
      border-left: 1px solid var(--row-line);
      border-right: 1px solid var(--row-line);
      background: var(--bg);
      color: var(--text);
      text-align: center;
      font-size: 21px;
      font-weight: 640;
    }

    .chart-lot-control button {
      min-height: 49px;
      border: 0;
      color: var(--text);
      background: transparent;
      font-size: 26px;
      line-height: 1;
    }

    .chart-symbol-row,
    .chart-statbar,
    .chart-tools,
    .timeframes {
      display: none;
    }

    .app[data-screen="chart"] .chart-wrap {
      min-height: calc(100dvh - 192px - env(safe-area-inset-bottom));
      height: calc(100dvh - 192px - env(safe-area-inset-bottom));
      border-top: 0;
      border-bottom: 1px solid var(--row-line);
      background: var(--chart-bg);
    }

    .app[data-screen="chart"] canvas {
      min-height: calc(100dvh - 192px - env(safe-area-inset-bottom));
      height: calc(100dvh - 192px - env(safe-area-inset-bottom));
    }

    .app[data-screen="chart"] .chart-meta {
      display: none;
    }

    html[data-theme="light"] #chartSection .panel-title,
    html[data-theme="light"] .chart-quick-trade,
    html[data-theme="light"] .chart-lot-control {
      border-color: rgba(0, 0, 0, 0.16);
      background: #ffffff;
    }

/* Utility classes generated from former inline style attributes. */
.u-inline-80fb56f710 { --body: 18px; --body-bottom: 32px; --wick: 42px; --wick-bottom: 22px; }
.u-inline-f7ba92fbf7 { --body: 24px; --body-bottom: 25px; --wick: 54px; --wick-bottom: 13px; }
.u-inline-ed6e334db4 { --body: 15px; --body-bottom: 37px; --wick: 48px; --wick-bottom: 18px; }
.u-inline-118b355659 { --body: 21px; --body-bottom: 29px; --wick: 46px; --wick-bottom: 17px; }
.u-inline-16b5bef3cd { --body: 28px; --body-bottom: 20px; --wick: 58px; --wick-bottom: 8px; }
.u-inline-fa8f8b0319 { --body: 13px; --body-bottom: 31px; --wick: 42px; --wick-bottom: 18px; }
.u-inline-29761cf3a8 { --body: 30px; --body-bottom: 24px; --wick: 62px; --wick-bottom: 4px; }
.u-inline-941ddceecd { --body: 19px; --body-bottom: 35px; --wick: 50px; --wick-bottom: 12px; }
.u-inline-d06169d2a6 { --body: 17px; --body-bottom: 27px; --wick: 44px; --wick-bottom: 16px; }
.u-inline-f31cd6577a { --body: 26px; --body-bottom: 30px; --wick: 60px; --wick-bottom: 4px; }
.u-inline-95197f77b3 { --body: 20px; --body-bottom: 38px; --wick: 48px; --wick-bottom: 14px; }

/* MT-style reference lock: keep business logic, force the mobile UI toward the supplied reference. */
:root {
  --mt-page-bg: #000000;
  --mt-panel: #111111;
  --mt-card: #1c1c1e;
  --mt-text: #f5f5f7;
  --mt-muted: #8f8f95;
  --mt-blue: #2f8cff;
  --mt-red: #df4b3f;
  --mt-grid: rgba(90, 112, 142, 0.26);
  --mt-row: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] {
  --mt-page-bg: #ffffff;
  --mt-panel: #f3f3f6;
  --mt-card: #ffffff;
  --mt-text: #000000;
  --mt-muted: #777b83;
  --mt-blue: #2f7fec;
  --mt-red: #d94a3d;
  --mt-grid: rgba(209, 224, 240, 0.56);
  --mt-row: rgba(0, 0, 0, 0.08);
  --bg: #ffffff;
  --app-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f6;
  --chart-bg: #ffffff;
  --chart-grid: rgba(209, 224, 240, 0.56);
  --chart-text: #5f636d;
  --muted: #6b6f78;
  --text: #000000;
  --accent: #2f7fec;
  --sell: #d94a3d;
  --price-up: #62b9ad;
  --price-down: #ef8a83;
  color-scheme: light;
}

html,
body {
  background: var(--mt-page-bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang TC", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
}

.app {
  max-width: 480px;
  background: var(--mt-page-bg);
  color: var(--mt-text);
  box-shadow: none;
  padding-bottom: calc(98px + env(safe-area-inset-bottom));
}

main,
.app[data-screen="chart"] main,
.app[data-screen="trade"] main,
.app[data-screen="history"] main,
.app[data-screen="profile"] main {
  padding-top: calc(46px + env(safe-area-inset-top));
}

.screen {
  padding: 0 18px;
}

.screen-head {
  grid-template-columns: 58px 1fr auto;
  min-height: 74px;
  margin: 0 0 12px;
}

.screen-title {
  justify-self: center;
}

.screen-head h2 {
  color: var(--mt-text);
  font-size: 24px;
  font-weight: 760;
  letter-spacing: 0;
}

.screen-actions {
  gap: 12px;
}

.icon-btn,
.refresh-btn,
.back-btn {
  width: 58px;
  height: 58px;
  min-width: 58px;
  min-height: 58px;
  border: 0;
  border-radius: 50%;
  background: #1b1b1d;
  color: #ffffff;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  font-size: 30px;
  font-weight: 600;
}

html[data-theme="light"] .icon-btn,
html[data-theme="light"] .refresh-btn,
html[data-theme="light"] .back-btn {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 14px 38px rgba(20, 24, 35, 0.10);
}

.app[data-screen="quotes"] main {
  padding-top: calc(42px + env(safe-area-inset-top));
}

#quotes {
  background: var(--mt-page-bg);
}

#quotes .screen-head {
  margin-bottom: 8px;
}

#quotes .screen-head::before,
#quotes .screen-title span,
#quotes .screen-title .eyebrow,
#watchlistMeta {
  display: none;
}

#quotes .quote-mode-btn,
#refreshBtn,
#searchBtn {
  font-size: 30px;
  line-height: 1;
}

.quote-table-head,
.quote-card,
.quote-card-detail,
.quote-select,
.quote-edit-row {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app[data-quote-mode="table"] .quote-table-head {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr 0.55fr;
  gap: 10px;
  padding: 0 0 20px;
  color: var(--mt-text);
  font-size: 20px;
  font-weight: 430;
}

.app[data-quote-mode="table"] .quote-card,
.app[data-quote-mode="table"] .quote-select {
  min-height: 70px;
}

.app[data-quote-mode="table"] .quote-select {
  grid-template-columns: 1.25fr 0.9fr 0.9fr 0.55fr;
  gap: 10px;
  padding: 0;
}

.app[data-quote-mode="table"] .quote-symbol strong {
  color: var(--mt-text);
  font-size: 21px;
  font-weight: 780;
  line-height: 1;
}

.app[data-quote-mode="table"] .quote-symbol span,
.app[data-quote-mode="table"] .quote-numbers em,
.app[data-quote-mode="table"] .quote-numbers span,
.quote-remove {
  display: none;
}

.app[data-quote-mode="table"] .quote-numbers strong {
  color: var(--mt-blue);
  font-size: 24px;
  font-weight: 430;
  line-height: 1;
}

.app[data-quote-mode="table"] .quote-change-cell {
  font-size: 19px;
  font-weight: 430;
}

.quote-card-detail {
  min-height: 94px;
}

.quote-detail-select {
  grid-template-columns: 1.25fr 0.96fr 0.96fr;
  gap: 8px;
  min-height: 94px;
  padding: 0;
}

.quote-detail-symbol {
  gap: 4px;
}

.quote-detail-symbol strong {
  color: var(--mt-text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.quote-delta,
.quote-time {
  color: var(--mt-muted);
  font-size: 18px;
  font-weight: 430;
  line-height: 1;
}

.quote-delta.up,
.quote-detail-price.up,
.quote-numbers.up,
.quote-change-cell.up {
  color: var(--mt-blue);
}

.quote-delta.down,
.quote-detail-price.down,
.quote-numbers.down,
.quote-change-cell.down {
  color: var(--mt-red);
}

.quote-detail-price {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 7px;
  text-align: right;
}

.quote-detail-price strong {
  color: currentColor;
  font-size: 43px;
  font-weight: 690;
  line-height: 0.86;
  white-space: nowrap;
}

.quote-detail-price span {
  color: var(--mt-muted);
  font-size: 18px;
  font-weight: 420;
  line-height: 1;
}

.terminal-price {
  display: inline-flex;
  align-items: flex-start;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.terminal-price sup {
  font-size: 0.42em;
  line-height: 1;
  transform: translateY(-0.06em);
}

.quote-edit-list {
  gap: 0;
  padding-top: 2px;
}

.quote-edit-row {
  grid-template-columns: 50px 1fr 48px;
  min-height: 82px;
  padding: 0;
}

.quote-edit-symbol {
  color: var(--mt-text);
  font-size: 23px;
  font-weight: 780;
  letter-spacing: 0;
}

.quote-edit-remove {
  width: 26px;
  height: 26px;
  border: 2px solid #cfd0d4;
  border-radius: 50%;
  background: transparent;
}

.quote-drag-handle {
  color: #bfc1c5;
  font-size: 28px;
}

#marketBrowser {
  padding: 0 22px;
}

#marketBrowser .screen-head {
  display: none;
}

.market-tools {
  margin-top: 10px;
}

#marketSearch {
  height: 58px;
  border: 0;
  border-radius: 29px;
  padding: 0 58px 0 54px;
  background: var(--mt-card);
  color: var(--mt-text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.10);
  font-size: 22px;
}

.category-tabs {
  display: none;
}

.market-list {
  padding-top: 24px;
}

.market-row {
  min-height: 70px;
  border: 0;
}

.market-select {
  min-height: 70px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.market-select::before {
  content: "▭";
  color: #e8ae26;
  font-size: 28px;
  line-height: 1;
}

.market-symbol strong {
  color: var(--mt-text);
  font-size: 24px;
  font-weight: 430;
}

.market-symbol span,
.market-price,
.market-action {
  display: none;
}

.app[data-screen="chart"] main {
  padding-top: calc(40px + env(safe-area-inset-top));
}

#chartSection.screen.active {
  padding: 0;
}

#chartSection .panel-title {
  display: grid;
  grid-template-columns: 68px 1fr 96px;
  align-items: center;
  min-height: 70px;
  margin: 0;
  padding: 0 15px;
  border-bottom: 1px solid var(--mt-row);
  background: var(--mt-page-bg);
}

#chartSection .panel-title h2 {
  grid-column: 1;
  justify-self: start;
  color: var(--mt-text);
  font-size: 22px;
  font-weight: 760;
}

#chartSection .panel-title span {
  display: none;
}

#chartSection .panel-title::before {
  content: "+   ƒ   ◰";
  grid-column: 2;
  justify-self: center;
  color: var(--mt-muted);
  font-size: 30px;
  letter-spacing: 22px;
  white-space: nowrap;
}

#chartSection .panel-title::after {
  content: "◔  ▣";
  grid-column: 3;
  justify-self: end;
  color: #d86655;
  font-size: 28px;
  letter-spacing: 11px;
  white-space: nowrap;
}

.chart-quick-trade {
  grid-template-columns: 1fr 1.34fr 1fr;
  min-height: 49px;
  height: 49px;
  border-bottom: 1px solid var(--mt-row);
}

.chart-quote-action {
  min-height: 49px;
  padding: 3px 14px 4px;
  background: var(--mt-red) !important;
}

.chart-quote-action span {
  font-size: 14px;
  font-weight: 520;
}

.chart-quote-action strong {
  font-size: 33px;
  font-weight: 720;
  line-height: 0.86;
}

.chart-lot-control {
  min-height: 49px;
  border-left: 1px solid var(--mt-row);
  border-right: 1px solid var(--mt-row);
  background: var(--mt-page-bg);
  color: var(--mt-text);
  font-size: 21px;
  font-weight: 600;
}

.chart-symbol-row,
.chart-statbar,
.chart-tools,
.timeframes,
.chart-meta {
  display: none !important;
}

.app[data-screen="chart"] .chart-wrap,
.app[data-screen="chart"] canvas {
  min-height: calc(100dvh - 195px - env(safe-area-inset-bottom));
  height: calc(100dvh - 195px - env(safe-area-inset-bottom));
  background: var(--chart-bg);
}

.app[data-screen="chart"] .chart-wrap {
  border-top: 0;
  border-bottom: 1px solid var(--mt-row);
}

#trade.screen.active {
  min-height: calc(100dvh - 98px);
  padding: 0;
  background: var(--mt-panel);
}

#trade .panel-title {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  min-height: 116px;
  margin: 0;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--mt-row);
  background: var(--mt-panel);
}

#trade .panel-title::before {
  content: "‹";
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--mt-card);
  color: var(--mt-text);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
  font-size: 48px;
  line-height: 1;
}

#trade .panel-title h2 {
  grid-column: 2;
  align-self: end;
  color: var(--mt-text);
  font-size: 22px;
  font-weight: 780;
}

#trade .panel-title span {
  grid-column: 2;
  align-self: start;
  display: block;
  color: var(--mt-muted);
  text-align: center;
  font-size: 15px;
  font-weight: 420;
}

.trade-symbol-row,
.risk-strip,
.contract-spec-card,
.contract-note,
.estimate-grid,
.order-preview {
  display: none !important;
}

.ticket {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--mt-panel);
  box-shadow: none;
}

.ticket::before {
  content: "市場執行⌄";
  display: block;
  height: 62px;
  padding: 0 22px;
  border-bottom: 1px solid var(--mt-row);
  color: var(--mt-text);
  font-size: 25px;
  font-weight: 430;
  line-height: 62px;
}

.trade-form {
  display: grid;
  gap: 0;
  order: 1;
}

#trade .order-lot {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  min-height: 72px;
  padding: 0 22px;
  border-bottom: 1px solid var(--mt-row);
}

#trade .order-lot::before {
  content: "-0.5";
  grid-column: 1;
  color: var(--mt-blue);
  font-size: 22px;
  font-weight: 620;
}

#trade .order-lot::after {
  content: "+0.5";
  grid-column: 5;
  justify-self: end;
  color: var(--mt-blue);
  font-size: 22px;
  font-weight: 620;
}

#trade .order-lot label {
  grid-column: 2 / 5;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
}

#trade .order-lot label::before {
  content: "-0.1";
  justify-self: center;
  color: var(--mt-blue);
  font-size: 22px;
  font-weight: 620;
}

#trade .order-lot label::after {
  content: "+0.1";
  justify-self: center;
  color: var(--mt-blue);
  font-size: 22px;
  font-weight: 620;
}

#trade .order-lot label .label,
#trade .quick-volume {
  display: none;
}

#trade #volume {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mt-text);
  box-shadow: none;
  text-align: center;
  font-size: 24px;
  font-weight: 520;
}

.protection-grid {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) 120px minmax(52px, 1fr);
  grid-template-rows: 56px 56px;
  align-items: center;
  min-height: 112px;
  padding: 0 22px;
  border-bottom: 1px solid var(--mt-row);
}

.protection-grid label {
  display: contents;
}

.protection-grid label .label {
  align-self: center;
  color: var(--mt-muted);
  font-size: 24px;
  font-weight: 420;
}

.protection-grid label:nth-child(1) .label {
  grid-column: 1;
  grid-row: 1;
}

.protection-grid label:nth-child(2) .label {
  grid-column: 1;
  grid-row: 2;
}

.protection-grid input {
  border: 0 !important;
  background: transparent !important;
  color: var(--mt-muted) !important;
  box-shadow: none !important;
  text-align: center !important;
  font-size: 22px !important;
}

.protection-grid label:nth-child(1) input {
  grid-column: 2;
  grid-row: 1;
}

.protection-grid label:nth-child(2) input {
  grid-column: 2;
  grid-row: 2;
}

.protection-grid input::placeholder {
  color: var(--mt-muted);
}

.protection-grid label::after {
  content: "+";
  justify-self: end;
  align-self: center;
  color: var(--mt-blue);
  font-size: 38px;
}

.protection-grid label:nth-child(1)::after {
  grid-column: 3;
  grid-row: 1;
}

.protection-grid label:nth-child(2)::after {
  grid-column: 3;
  grid-row: 2;
}

.trade-price-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  order: 2;
  min-height: 82px;
  background: rgba(128, 128, 128, 0.08);
}

.trade-price-band div {
  display: grid;
  place-items: center;
}

.trade-price-band span {
  display: none;
}

.trade-price-band strong {
  color: var(--mt-red);
  font-size: 41px;
  font-weight: 650;
  line-height: 0.9;
}

.trade-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  order: 3;
  margin: 0;
}

.trade-btn {
  min-height: 62px;
  border: 0;
  border-radius: 0;
  color: #ffffff;
  font-size: 23px;
  font-weight: 520;
}

.sell-btn {
  background: #c86358;
}

.buy-btn {
  background: #5d93e7;
}

.nav {
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(432px, calc(100vw - 38px));
  min-height: 76px;
  padding: 5px;
  border: 1px solid var(--mt-row);
  border-radius: 999px;
  background: rgba(24, 24, 25, 0.96);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 44px rgba(20, 24, 35, 0.10);
}

.nav button {
  min-height: 66px;
  border-radius: 999px;
  color: var(--mt-text);
  font-size: 15px;
  font-weight: 500;
}

.nav button.active {
  background: rgba(128, 128, 128, 0.22);
}

.nav-icon,
.nav-icon svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 390px) {
  .screen {
    padding-right: 16px;
    padding-left: 16px;
  }

  .quote-detail-select {
    grid-template-columns: 1.14fr 0.86fr 0.86fr;
    gap: 6px;
  }

  .quote-detail-price strong {
    font-size: 38px;
  }

  .app[data-quote-mode="table"] .quote-numbers strong {
    font-size: 22px;
  }

  .chart-quote-action strong {
    font-size: 30px;
  }
}

/* Page 1 lock: quotes screen only, matched tighter to the provided MT reference. */
.app[data-screen="quotes"] {
  padding-bottom: 0;
}

.app[data-screen="quotes"] main {
  height: 100dvh;
  padding-top: calc(34px + env(safe-area-inset-top));
  overflow: hidden;
}

#quotes.screen.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 18px;
}

#quotes .screen-head {
  flex: 0 0 auto;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  min-height: 70px;
  margin: 0 0 2px;
}

#quotes .screen-head h2 {
  font-size: 22px;
  font-weight: 760;
}

#quotes .screen-actions {
  gap: 10px;
}

#quotes .icon-btn,
#quotes .refresh-btn {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  font-size: 27px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

#quotes .quote-mode-btn,
#refreshBtn,
#quotes [data-jump-screen="browse"] {
  font-size: 27px;
  font-weight: 680;
}

#watchlistList {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

#watchlistList::-webkit-scrollbar {
  display: none;
}

.app[data-quote-mode="detail"] #watchlistList,
.app[data-quote-mode="edit"] #watchlistList {
  display: grid;
  align-content: start;
  gap: 0;
}

.quote-card-detail {
  min-height: 82px;
}

.quote-detail-select {
  grid-template-columns: minmax(118px, 1.1fr) minmax(82px, 0.84fr) minmax(82px, 0.84fr);
  gap: 6px;
  min-height: 82px;
  padding: 0;
}

.quote-detail-symbol {
  gap: 4px;
}

.quote-detail-symbol strong {
  font-size: 20px;
  font-weight: 820;
}

.quote-delta,
.quote-time {
  font-size: 15px;
  line-height: 1.08;
}

.quote-detail-price {
  gap: 5px;
}

.quote-detail-price strong {
  font-size: 34px;
  font-weight: 670;
  line-height: 0.88;
}

.quote-detail-price span {
  font-size: 15px;
  line-height: 1;
}

.quote-placeholder-price {
  color: var(--mt-blue) !important;
  font-size: 23px !important;
  font-weight: 760 !important;
  letter-spacing: 0.5px;
}

.app[data-quote-mode="table"] .quote-table-head {
  grid-template-columns: 1.32fr 0.86fr 0.86fr 0.54fr;
  gap: 8px;
  padding: 0 0 16px;
  font-size: 18px;
}

.app[data-quote-mode="table"] .quote-card,
.app[data-quote-mode="table"] .quote-select {
  min-height: 58px;
}

.app[data-quote-mode="table"] .quote-select {
  grid-template-columns: 1.32fr 0.86fr 0.86fr 0.54fr;
  gap: 8px;
}

.app[data-quote-mode="table"] .quote-symbol strong {
  font-size: 19px;
  font-weight: 800;
}

.app[data-quote-mode="table"] .quote-numbers strong {
  font-size: 20px;
  font-weight: 430;
}

.app[data-quote-mode="table"] .quote-change-cell {
  font-size: 17px;
}

.quote-edit-row {
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  min-height: 74px;
}

.quote-edit-symbol {
  font-size: 21px;
  font-weight: 820;
}

.quote-edit-remove {
  width: 25px;
  height: 25px;
}

.quote-drag-handle {
  font-size: 25px;
}

.app[data-screen="quotes"] .nav {
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(418px, calc(100vw - 36px));
  min-height: 72px;
  padding: 5px;
}

.app[data-screen="quotes"] .nav button {
  min-height: 62px;
  font-size: 14px;
}

.app[data-screen="quotes"] .nav-icon,
.app[data-screen="quotes"] .nav-icon svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 390px) {
  #quotes.screen.active {
    padding-right: 16px;
    padding-left: 16px;
  }

  .quote-detail-select {
    grid-template-columns: minmax(108px, 1.06fr) minmax(76px, 0.8fr) minmax(76px, 0.8fr);
  }

  .quote-detail-price strong {
    font-size: 31px;
  }

  .quote-detail-symbol strong {
    font-size: 19px;
  }

  .quote-delta,
  .quote-time,
  .quote-detail-price span {
    font-size: 14px;
  }
}

/* Page 1 lock: market browser/search follows the provided MT reference. */
.app[data-screen="browse"] {
  padding-bottom: 0;
}

.app[data-screen="browse"] main {
  height: 100dvh;
  padding-top: calc(38px + env(safe-area-inset-top));
  overflow: hidden;
}

#marketBrowser.screen.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0 20px;
}

#marketBrowser .screen-head,
#marketBrowser .screen-title,
#marketBrowser .screen-caption,
#marketBrowser .category-tabs {
  display: none !important;
}

#marketBrowser .market-tools {
  position: relative;
  flex: 0 0 auto;
  display: block;
  margin: 0 0 18px;
}

#marketBrowser .market-tools::before {
  content: "⌕";
  position: absolute;
  left: 22px;
  top: 50%;
  z-index: 1;
  color: var(--mt-text);
  font-size: 28px;
  line-height: 1;
  transform: translateY(-52%);
  pointer-events: none;
}

#marketBrowser .market-tools::after {
  content: "×";
  position: absolute;
  right: 22px;
  top: 50%;
  z-index: 1;
  color: var(--mt-text);
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-53%);
  pointer-events: none;
}

#marketSearch {
  display: block;
  width: 100%;
  height: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 24px;
  padding: 0 54px;
  color: var(--mt-text);
  background: var(--mt-card);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
  font-size: 18px;
  font-weight: 650;
  line-height: 48px;
  text-align: left;
  appearance: none;
}

#marketSearch::placeholder {
  color: color-mix(in srgb, var(--mt-text) 46%, transparent);
  opacity: 1;
}

#marketBrowser .market-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 0 calc(94px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

#marketBrowser .market-list::-webkit-scrollbar {
  display: none;
}

.market-folder-list {
  display: grid;
  gap: 0;
}

.market-folder-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 18px;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  border: 0;
  color: var(--mt-text);
  background: transparent;
  text-align: left;
}

.market-folder-icon {
  position: relative;
  width: 24px;
  height: 18px;
  border: 2px solid #e5ad27;
  border-radius: 3px;
}

.market-folder-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -7px;
  width: 12px;
  height: 7px;
  border: 2px solid #e5ad27;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.market-folder-name {
  overflow: hidden;
  font-size: 22px;
  font-weight: 440;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-folder-count {
  color: color-mix(in srgb, var(--mt-text) 48%, transparent);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.market-folder-chevron {
  color: color-mix(in srgb, var(--mt-text) 28%, transparent);
  font-size: 38px;
  font-weight: 280;
  line-height: 1;
}

#marketBrowser .market-row {
  display: block;
  min-height: 60px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--mt-text) 10%, transparent);
  background: transparent;
  box-shadow: none;
}

#marketBrowser .market-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 60px;
  padding: 0;
  border: 0;
  color: var(--mt-text);
  background: transparent;
}

#marketBrowser .market-select::before {
  display: none;
}

#marketBrowser .market-symbol strong {
  color: var(--mt-text);
  font-size: 21px;
  font-weight: 430;
  line-height: 1;
  letter-spacing: 0;
}

#marketBrowser .market-symbol span {
  display: none;
}

#marketBrowser .market-check {
  justify-self: end;
  color: var(--mt-blue);
  font-size: 26px;
  font-weight: 420;
  line-height: 1;
}

#marketBrowser .market-price,
#marketBrowser .market-action {
  display: none;
}

.app[data-screen="browse"] .nav {
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(418px, calc(100vw - 36px));
  min-height: 72px;
  padding: 5px;
}

.app[data-screen="browse"] .nav button {
  min-height: 62px;
  font-size: 14px;
}

.app[data-screen="browse"] .nav-icon,
.app[data-screen="browse"] .nav-icon svg {
  width: 26px;
  height: 26px;
}

html[data-theme="light"] #marketSearch {
  color: #111113;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(20, 24, 35, 0.08);
}

html[data-theme="light"] #marketBrowser .market-tools::before,
html[data-theme="light"] #marketBrowser .market-tools::after,
html[data-theme="light"] .market-folder-row,
html[data-theme="light"] #marketBrowser .market-select,
html[data-theme="light"] #marketBrowser .market-symbol strong {
  color: #111113;
}

@media (max-width: 390px) {
  #marketBrowser.screen.active {
    padding-right: 18px;
    padding-left: 18px;
  }

  #marketSearch {
    height: 46px;
    min-height: 46px;
    border-radius: 23px;
    font-size: 17px;
    line-height: 46px;
  }

  .market-folder-row {
    min-height: 68px;
  }

  .market-folder-name {
    font-size: 21px;
  }

  .market-folder-count {
    font-size: 19px;
  }
}

/* Page 1 refinement: search spacing and selectable-symbol list. */
.app[data-screen="browse"] main {
  padding-top: calc(36px + env(safe-area-inset-top));
}

#marketBrowser.screen.active {
  padding-right: 36px;
  padding-left: 36px;
}

#marketBrowser .market-tools {
  margin-bottom: 16px;
}

#marketBrowser .market-tools::before {
  left: 19px;
  font-size: 25px;
  transform: translateY(-52%);
}

#marketBrowser .market-tools::after {
  right: 19px;
  font-size: 31px;
  transform: translateY(-53%);
}

#marketSearch {
  height: 44px;
  min-height: 44px;
  border-radius: 22px;
  padding-right: 48px;
  padding-left: 48px;
  font-size: 16px;
  font-weight: 620;
  line-height: 44px;
}

#marketBrowser .market-list {
  padding-top: 8px;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.market-folder-row {
  grid-template-columns: 30px minmax(0, 1fr) auto 13px;
  gap: 12px;
  min-height: 64px;
}

.market-folder-icon {
  width: 21px;
  height: 16px;
  border-width: 1.5px;
  border-radius: 2.5px;
}

.market-folder-icon::before {
  left: 2px;
  top: -6px;
  width: 10px;
  height: 6px;
  border-width: 1.5px;
  border-bottom: 0;
}

.market-folder-name {
  font-size: 20px;
  font-weight: 420;
}

.market-folder-count {
  font-size: 18px;
}

.market-folder-chevron {
  font-size: 32px;
}

#marketBrowser .market-row {
  min-height: 56px;
}

#marketBrowser .market-select {
  grid-template-columns: minmax(0, 1fr) 28px;
  min-height: 56px;
}

#marketBrowser .market-symbol strong {
  font-size: 20px;
  font-weight: 430;
}

#marketBrowser .market-check {
  font-size: 24px;
}

#marketBrowser .empty {
  padding-top: 22px;
  color: color-mix(in srgb, var(--mt-text) 46%, transparent);
  font-size: 16px;
  font-weight: 430;
  text-align: center;
}

.app[data-screen="browse"] .nav {
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(374px, calc(100vw - 42px));
  min-height: 66px;
  padding: 4px;
}

.app[data-screen="browse"] .nav button {
  min-height: 58px;
  font-size: 13px;
}

.app[data-screen="browse"] .nav-icon,
.app[data-screen="browse"] .nav-icon svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 390px) {
  #marketBrowser.screen.active {
    padding-right: 32px;
    padding-left: 32px;
  }

  #marketSearch {
    height: 42px;
    min-height: 42px;
    border-radius: 21px;
    font-size: 15.5px;
    line-height: 42px;
  }

  .market-folder-row {
    min-height: 62px;
  }

  .market-folder-name {
    font-size: 19px;
  }

  .market-folder-count {
    font-size: 17px;
  }
}

/* Search/add-symbol final lock. Only this browse screen is affected. */
.app[data-screen="browse"] main {
  padding-top: calc(42px + env(safe-area-inset-top));
}

#marketBrowser.screen.active {
  height: 100%;
  padding-right: 22px;
  padding-left: 22px;
}

#marketBrowser .market-tools {
  margin-bottom: 18px;
}

#marketBrowser .market-tools::before {
  content: "";
  left: 20px;
  width: 18px;
  height: 18px;
  border: 3px solid var(--mt-text);
  border-radius: 50%;
  font-size: 0;
  transform: translateY(-55%);
}

#marketBrowser .market-tools::before {
  box-shadow: 10px 10px 0 -7px var(--mt-text);
}

#marketBrowser .market-tools::after {
  right: 20px;
  font-size: 34px;
  font-weight: 260;
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""])::before {
  content: "⌕";
  left: 26px;
  width: 40px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: color-mix(in srgb, var(--mt-blue) 48%, #7b8793);
  box-shadow: none;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
  transform: translateY(-50%);
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""]) #marketSearch {
  color: transparent;
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""]) {
  position: relative;
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""])::after {
  content: "×";
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""]) .category-tabs::before {
  content: attr(data-category-label);
}

#marketSearch {
  height: 50px;
  min-height: 50px;
  border-radius: 25px;
  padding: 0 56px;
  font-size: 18px;
  font-weight: 430;
  line-height: 50px;
}

#marketSearch::placeholder {
  font-weight: 430;
}

#marketBrowser .market-list {
  display: block !important;
  padding-top: 0;
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

#marketBrowser[data-browser-view="folders"] .market-list {
  padding-top: 6px;
}

#marketBrowser[data-browser-view="folders"] .market-folder-list {
  display: grid;
  gap: 0;
  align-content: start;
}

#marketBrowser[data-browser-view="folders"] .market-folder-row {
  grid-template-columns: 34px minmax(0, 1fr) auto 18px;
  gap: 14px;
  min-height: 72px;
}

#marketBrowser[data-browser-view="folders"] .market-folder-icon {
  width: 20px;
  height: 15px;
  border-width: 1.6px;
}

#marketBrowser[data-browser-view="folders"] .market-folder-icon::before {
  top: -6px;
  width: 10px;
  height: 6px;
  border-width: 1.6px;
}

#marketBrowser[data-browser-view="folders"] .market-folder-name {
  font-size: 20px;
  font-weight: 430;
}

#marketBrowser[data-browser-view="folders"] .market-folder-count {
  font-size: 19px;
  font-weight: 400;
}

#marketBrowser[data-browser-view="folders"] .market-folder-chevron {
  font-size: 31px;
}

#marketBrowser[data-browser-view="symbols"] .market-list {
  padding-top: 0;
}

#marketBrowser[data-browser-view="symbols"] .market-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 34px;
  column-gap: 12px;
  align-items: center;
  min-height: 76px;
  border: 0;
  background: transparent;
}

#marketBrowser[data-browser-view="symbols"] .market-pick,
#marketBrowser[data-browser-view="symbols"] .market-info {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  appearance: none;
}

#marketBrowser[data-browser-view="symbols"] .market-pick {
  width: 28px;
  height: 28px;
  padding: 0;
}

#marketBrowser[data-browser-view="symbols"] .market-pick span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--mt-blue);
  border-radius: 50%;
  color: #ffffff;
  font-size: 15px;
  font-weight: 620;
  line-height: 1;
}

#marketBrowser[data-browser-view="symbols"] .market-row.selected .market-pick span {
  background: var(--mt-blue);
}

#marketBrowser[data-browser-view="symbols"] .market-select {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 0;
  color: var(--mt-text);
  text-align: left;
}

#marketBrowser[data-browser-view="symbols"] .market-symbol strong {
  display: block;
  color: var(--mt-text);
  font-size: 20px;
  font-weight: 430;
  line-height: 1.12;
}

#marketBrowser[data-browser-view="symbols"] .market-symbol span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--mt-text);
  font-size: 16px;
  font-weight: 390;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#marketBrowser[data-browser-view="symbols"] .market-info {
  width: 30px;
  height: 30px;
  border: 2px solid color-mix(in srgb, var(--mt-text) 48%, transparent);
  border-radius: 50%;
  color: color-mix(in srgb, var(--mt-text) 55%, transparent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

#marketBrowser[data-browser-view="symbols"] .market-action,
#marketBrowser[data-browser-view="symbols"] .market-check {
  display: none !important;
}

.app[data-screen="browse"] .nav {
  width: min(374px, calc(100vw - 44px));
  min-height: 66px;
}

html[data-theme="light"] #marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""])::before {
  color: #ffffff;
}

@media (max-width: 390px) {
  #marketBrowser.screen.active {
    padding-right: 20px;
    padding-left: 20px;
  }

  #marketSearch {
    height: 48px;
    min-height: 48px;
    border-radius: 24px;
    font-size: 17px;
    line-height: 48px;
  }

  #marketBrowser[data-browser-view="folders"] .market-folder-row {
    min-height: 70px;
  }

  #marketBrowser[data-browser-view="symbols"] .market-row {
    min-height: 74px;
  }
}

/* Page 1 real search/select lock: quotes browser only. */
.app[data-screen="browse"] main {
  height: 100dvh;
  padding-top: calc(42px + env(safe-area-inset-top)) !important;
  overflow: hidden !important;
}

#marketBrowser.screen.active {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  padding: 0 34px !important;
  background: var(--mt-page-bg) !important;
}

#marketBrowser .screen-head,
#marketBrowser .screen-title,
#marketBrowser .screen-caption,
#marketBrowser .category-tabs {
  display: none !important;
}

#marketBrowser .market-tools {
  position: relative !important;
  display: block !important;
  flex: 0 0 auto !important;
  height: 48px !important;
  margin: 0 0 38px !important;
}

#marketBrowser .market-tools::before,
#marketBrowser .market-tools::after {
  content: none !important;
  display: none !important;
}

#marketSearch {
  display: block !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  border: 0 !important;
  border-radius: 24px !important;
  padding: 0 58px !important;
  color: var(--mt-text) !important;
  background: var(--mt-card) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16) !important;
  font-size: 18px !important;
  font-weight: 430 !important;
  letter-spacing: 0 !important;
  line-height: 48px !important;
  text-align: left !important;
  appearance: none !important;
}

#marketSearch::placeholder {
  color: color-mix(in srgb, var(--mt-text) 44%, transparent) !important;
  font-size: 18px !important;
  font-weight: 430 !important;
  opacity: 1 !important;
}

#marketBrowser .market-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  z-index: 2;
  width: 18px;
  height: 18px;
  border: 3px solid var(--mt-text);
  border-radius: 50%;
  transform: translateY(-56%);
  pointer-events: none;
}

#marketBrowser .market-search-icon::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -7px;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  background: var(--mt-text);
  transform: rotate(45deg);
}

#marketBrowser .market-search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  z-index: 3;
  width: 30px;
  height: 30px;
  border: 0;
  padding: 0;
  color: var(--mt-text);
  background: transparent;
  font-size: 34px;
  font-weight: 260;
  line-height: 27px;
  transform: translateY(-50%);
  appearance: none;
}

#marketBrowser .market-search-chip {
  position: absolute;
  left: 76px;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 36px;
  max-width: calc(100% - 132px);
  padding: 0 14px;
  border-radius: 10px;
  color: #ffffff;
  background: color-mix(in srgb, var(--mt-blue) 44%, #7f8c99);
  font-size: 19px;
  font-weight: 430;
  line-height: 36px;
  transform: translateY(-50%);
  pointer-events: none;
}

#marketBrowser .market-search-chip[hidden] {
  display: none !important;
}

#marketBrowser .market-tools:focus-within .market-search-chip {
  display: none !important;
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""]):focus-within #marketSearch {
  color: var(--mt-text) !important;
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""]) #marketSearch:not(:focus) {
  color: transparent !important;
}

#marketBrowser .market-tools[data-browser-view="symbols"][data-category-label]:not([data-category-label=""]) #marketSearch:not(:focus)::placeholder {
  color: transparent !important;
}

#marketBrowser .market-list {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 0 0 calc(96px + env(safe-area-inset-bottom)) !important;
  scrollbar-width: none !important;
}

#marketBrowser .market-list::-webkit-scrollbar {
  display: none !important;
}

#marketBrowser[data-browser-view="folders"] .market-folder-list {
  display: block !important;
}

#marketBrowser[data-browser-view="folders"] .market-folder-row {
  display: grid !important;
  grid-template-columns: 36px minmax(0, 1fr) auto 16px !important;
  column-gap: 12px !important;
  align-items: center !important;
  width: 100% !important;
  min-height: 82px !important;
  border: 0 !important;
  padding: 0 !important;
  color: var(--mt-text) !important;
  background: transparent !important;
  text-align: left !important;
  appearance: none !important;
}

#marketBrowser[data-browser-view="folders"] .market-folder-icon {
  position: relative !important;
  width: 20px !important;
  height: 15px !important;
  border: 2px solid #f0b82f !important;
  border-radius: 3px !important;
}

#marketBrowser[data-browser-view="folders"] .market-folder-icon::before {
  content: "" !important;
  position: absolute !important;
  left: 2px !important;
  top: -7px !important;
  width: 10px !important;
  height: 7px !important;
  border: 2px solid #f0b82f !important;
  border-bottom: 0 !important;
  border-radius: 3px 3px 0 0 !important;
}

#marketBrowser[data-browser-view="folders"] .market-folder-name {
  overflow: hidden !important;
  color: var(--mt-text) !important;
  font-size: 22px !important;
  font-weight: 430 !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#marketBrowser[data-browser-view="folders"] .market-folder-count {
  color: color-mix(in srgb, var(--mt-text) 48%, transparent) !important;
  font-size: 20px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  font-variant-numeric: tabular-nums !important;
}

#marketBrowser[data-browser-view="folders"] .market-folder-chevron {
  color: color-mix(in srgb, var(--mt-text) 28%, transparent) !important;
  font-size: 34px !important;
  font-weight: 280 !important;
  line-height: 1 !important;
}

#marketBrowser[data-browser-view="symbols"] .market-row {
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) 34px !important;
  column-gap: 14px !important;
  align-items: center !important;
  min-height: 72px !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#marketBrowser[data-browser-view="symbols"] .market-pick,
#marketBrowser[data-browser-view="symbols"] .market-info {
  display: inline-grid !important;
  place-items: center !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  appearance: none !important;
}

#marketBrowser[data-browser-view="symbols"] .market-pick {
  width: 30px !important;
  height: 30px !important;
}

#marketBrowser[data-browser-view="symbols"] .market-pick span {
  display: grid !important;
  place-items: center !important;
  width: 26px !important;
  height: 26px !important;
  border: 2px solid color-mix(in srgb, var(--mt-text) 26%, transparent) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  font-size: 17px !important;
  font-weight: 620 !important;
  line-height: 1 !important;
}

#marketBrowser[data-browser-view="symbols"] .market-row.selected .market-pick span {
  border-color: var(--mt-blue) !important;
  background: var(--mt-blue) !important;
}

#marketBrowser[data-browser-view="symbols"] .market-select {
  display: flex !important;
  align-items: center !important;
  min-height: 72px !important;
  border: 0 !important;
  padding: 0 !important;
  color: var(--mt-text) !important;
  background: transparent !important;
  text-align: left !important;
}

#marketBrowser[data-browser-view="symbols"] .market-select::before {
  display: none !important;
}

#marketBrowser[data-browser-view="symbols"] .market-symbol {
  min-width: 0 !important;
}

#marketBrowser[data-browser-view="symbols"] .market-symbol strong {
  display: block !important;
  color: var(--mt-text) !important;
  font-size: 23px !important;
  font-weight: 430 !important;
  line-height: 1.04 !important;
  letter-spacing: 0 !important;
}

#marketBrowser[data-browser-view="symbols"] .market-symbol span {
  display: block !important;
  margin-top: 2px !important;
  overflow: hidden !important;
  color: var(--mt-text) !important;
  font-size: 17px !important;
  font-weight: 390 !important;
  line-height: 1.12 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#marketBrowser[data-browser-view="symbols"] .market-info {
  width: 28px !important;
  height: 28px !important;
  border: 2px solid color-mix(in srgb, var(--mt-text) 44%, transparent) !important;
  border-radius: 50% !important;
  color: color-mix(in srgb, var(--mt-text) 54%, transparent) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 19px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

#marketBrowser[data-browser-view="symbols"] .market-action,
#marketBrowser[data-browser-view="symbols"] .market-check,
#marketBrowser[data-browser-view="symbols"] .market-price {
  display: none !important;
}

#marketBrowser .empty {
  padding-top: 18px !important;
  color: color-mix(in srgb, var(--mt-text) 44%, transparent) !important;
  font-size: 16px !important;
  font-weight: 430 !important;
  text-align: center !important;
}

.app[data-screen="browse"] .nav {
  bottom: calc(10px + env(safe-area-inset-bottom)) !important;
  width: min(374px, calc(100vw - 42px)) !important;
  min-height: 66px !important;
  padding: 4px !important;
}

.app[data-screen="browse"] .nav button {
  min-height: 58px !important;
  font-size: 13px !important;
}

.app[data-screen="browse"] .nav-icon,
.app[data-screen="browse"] .nav-icon svg {
  width: 24px !important;
  height: 24px !important;
}

html[data-theme="light"] #marketSearch {
  color: #111113 !important;
  background: #ffffff !important;
  box-shadow: 0 18px 34px rgba(20, 24, 35, 0.08) !important;
}

html[data-theme="light"] #marketBrowser .market-search-icon {
  border-color: #111113 !important;
}

html[data-theme="light"] #marketBrowser .market-search-icon::after {
  background: #111113 !important;
}

html[data-theme="light"] #marketBrowser .market-search-clear,
html[data-theme="light"] #marketBrowser[data-browser-view="folders"] .market-folder-row,
html[data-theme="light"] #marketBrowser[data-browser-view="folders"] .market-folder-name,
html[data-theme="light"] #marketBrowser[data-browser-view="symbols"] .market-select,
html[data-theme="light"] #marketBrowser[data-browser-view="symbols"] .market-symbol strong,
html[data-theme="light"] #marketBrowser[data-browser-view="symbols"] .market-symbol span {
  color: #111113 !important;
}

@media (max-width: 390px) {
  #marketBrowser.screen.active {
    padding-right: 28px !important;
    padding-left: 28px !important;
  }

  #marketBrowser .market-tools {
    height: 46px !important;
    margin-bottom: 34px !important;
  }

  #marketSearch {
    height: 46px !important;
    min-height: 46px !important;
    border-radius: 23px !important;
    font-size: 17px !important;
    line-height: 46px !important;
  }

  #marketSearch::placeholder {
    font-size: 17px !important;
  }

  #marketBrowser[data-browser-view="folders"] .market-folder-row {
    min-height: 78px !important;
  }

  #marketBrowser[data-browser-view="symbols"] .market-row,
  #marketBrowser[data-browser-view="symbols"] .market-select {
    min-height: 70px !important;
  }

  #marketBrowser[data-browser-view="symbols"] .market-symbol strong {
    font-size: 22px !important;
  }
}
/* Vantage MT5 layout audit: final responsive ownership layer. */
:root {
  --mt5-space-1: 4px;
  --mt5-space-2: 8px;
  --mt5-space-3: 12px;
  --mt5-space-4: 16px;
  --mt5-space-5: 20px;
  --mt5-space-6: 24px;
  --mt5-shell-max: 1180px;
  --mt5-content-max: 1040px;
  --mt5-ticket-max: 860px;
  --mt5-focus: #5ca7ff;
}
html,
body {
  width: 100%;
  min-width: 320px;
  overflow-x: hidden;
}
body { background: var(--mt-page-bg); }
.app {
  width: 100%;
  max-width: var(--mt5-shell-max);
  min-height: 100dvh;
  margin-inline: auto;
  box-shadow: none;
  overflow-x: clip;
}
main {
  width: 100%;
  max-width: var(--mt5-content-max);
  margin-inline: auto;
}
.screen { width: 100%; min-width: 0; }
.screen-head,
.panel-title,
.subview-head { min-width: 0; }
.screen-title,
.screen-title h2,
.panel-title h2,
.subview-title,
.subview-title h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#trade .ticket {
  width: 100%;
  max-width: var(--mt5-ticket-max);
  margin-inline: auto;
}
#trade .order-lot {
  grid-template-columns: minmax(58px, 1fr) minmax(128px, 1.5fr) minmax(58px, 1fr);
  align-items: center;
  column-gap: var(--mt5-space-2);
  padding-inline: clamp(18px, 4vw, 40px);
}
#trade .order-lot::before {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
#trade .order-lot::after {
  grid-column: 3;
  justify-self: end;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
#trade .order-lot label {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  grid-template-columns: minmax(38px, 1fr) minmax(58px, 1.2fr) minmax(38px, 1fr);
  gap: var(--mt5-space-1);
}
#trade .order-lot label::before,
#trade .order-lot label::after {
  min-width: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#trade .order-lot label::before { grid-column: 1; justify-self: center; }
#trade .order-lot label::after { grid-column: 3; justify-self: center; }
#trade #volume {
  grid-column: 2;
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
#trade .protection-grid {
  grid-template-columns: minmax(76px, 1fr) minmax(116px, 1.2fr) minmax(40px, 0.55fr);
  column-gap: var(--mt5-space-2);
  padding-inline: clamp(18px, 4vw, 40px);
}
#trade .protection-grid label .label,
#trade .protection-grid input,
#trade .protection-grid label::after { min-width: 0; }
#trade .protection-grid input {
  width: 100%;
  font-variant-numeric: tabular-nums;
}
#trade .trade-price-band,
#trade .trade-actions { width: 100%; }
#trade .trade-price-band div,
#trade .trade-actions .trade-btn { min-width: 0; }
#trade .trade-price-band strong,
#trade .trade-btn { font-variant-numeric: tabular-nums; }
.nav { max-width: calc(100% - 28px); }
button:focus-visible,
input:focus-visible,
select:focus-visible { outline-color: var(--mt5-focus); }
@media (min-width: 600px) {
  body { background: #1a1b1d; }
  .app { min-height: 100dvh; background: var(--mt-page-bg); }
  main { padding-inline: clamp(24px, 4vw, 56px); }
  #quotes.screen.active,
  #marketBrowser.screen.active,
  #history,
  #funds,
  .profile-hero.screen.active,
  .account-center-panel.screen.active,
  .profile-subview.screen.active,
  #profile.screen.active { max-width: var(--mt5-content-max); margin-inline: auto; }
  #trade.screen.active,
  #chartSection.screen.active { padding-inline: clamp(24px, 4vw, 56px); }
  #trade .panel-title,
  #chartSection .panel-title { max-width: var(--mt5-ticket-max); margin-inline: auto; }
  #trade .ticket { max-width: var(--mt5-ticket-max); }
  .nav { width: min(680px, calc(100% - 48px)); }
}
@media (min-width: 960px) {
  .app { border-inline: 1px solid rgba(255, 255, 255, 0.06); }
  main { padding-inline: 40px; }
  #trade .order-lot,
  #trade .protection-grid { padding-inline: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
/* History is a two-panel screen; reserve the navigation rail and keep both
 * empty states in the scroll flow instead of letting the fixed rail cover them. */
.app[data-screen="history"] main {
  padding-bottom: calc(118px + env(safe-area-inset-bottom));
}
.app[data-screen="history"] #history,
.app[data-screen="history"] #funds {
  min-height: 0;
}
.app[data-screen="history"] #history .empty,
.app[data-screen="history"] #funds .empty {
  min-height: clamp(150px, 24dvh, 220px);
}

/* Empty history states share the viewport instead of pushing the second
 * panel beneath the fixed navigation rail. Data-backed lists keep their
 * natural row layout. */
.app[data-screen="history"] #history .empty,
.app[data-screen="history"] #funds .empty {
  min-height: 0;
  margin: 0;
  padding: 28px 0;
}

.app[data-screen="history"] #history .list:has(> .empty),
.app[data-screen="history"] #funds .list:has(> .empty) {
  min-height: clamp(116px, 16dvh, 150px);
  display: grid;
  place-items: center;
}
