/* v86：行動版字體在目前實際層級上再放大一級。
   本檔由兩頁在既有 page CSS 與 numeric-spacing.css 之後載入；僅作用於 <=700px。
   桌面版、固定數字字寬與 Rolling Number 動畫幾何完全不變。 */

@media (max-width: 700px) {
  /* 行動版使用固定視覺比例；主摘要不再依 viewport 寬度自動縮放。 */
  .big {
    font-size: 49px;
  }

  input,
  input:focus {
    font-size: 17px !important;
  }

  /* 投資配置頁：依 v77.70 的最終手機字級逐項 +1px。 */
  .allocation-page {
    font-size: 17px;
  }

  .allocation-page .header-title {
    font-size: 19px;
  }

  .allocation-page .status {
    font-size: 14px;
  }

  .allocation-page button,
  .allocation-page .page-switch-btn {
    font-size: 15px;
  }

  .allocation-page .small {
    font-size: 14px;
  }

  .allocation-page .tiny {
    font-size: 13px;
  }

  .allocation-page .pill,
  .allocation-page .tag {
    font-size: 14px;
  }

  .allocation-page #totalGap {
    font-size: 14px;
  }

  .allocation-page #lastSyncTime {
    font-size: 12px;
  }

  .allocation-page .quote-data-time {
    font-size: 14px;
  }

  .allocation-page .allocation-card-title {
    font-size: 18px;
  }

  .allocation-page .pool-stat > span {
    font-size: 14px;
  }

  .allocation-page .pool-stat > strong {
    font-size: 17px;
  }

  .allocation-page .pool-gap {
    font-size: 14px;
  }

  .allocation-page .allocation-wealth-mobile-card .sc-name {
    font-size: 18px;
  }

  .allocation-page .allocation-mobile-metrics span,
  .allocation-page .allocation-mobile-market {
    font-size: 14px;
  }

  .allocation-page .allocation-mobile-metrics strong {
    font-size: 17px;
  }

  .allocation-page .progress-mobile-footer,
  .allocation-page .investment-progress-meta {
    font-size: 15px;
  }

  .allocation-page .income-holding-main > strong {
    font-size: 16px;
  }

  .allocation-page .income-holding-shares {
    font-size: 13px;
  }

  .allocation-page .income-holding-market {
    font-size: 16px;
  }

  .allocation-page .cashflow-target-head label {
    font-size: 14px;
  }

  .allocation-page .cashflow-target-head strong {
    font-size: 15px;
  }

  .allocation-page .cashflow-target-input-wrap > span {
    font-size: 15px;
  }

  .allocation-page .cashflow-target-input-wrap input {
    font-size: 17px !important;
  }

  .allocation-page .cashflow-section-title {
    font-size: 14px;
  }

  .allocation-page .cashflow-forecast-item span {
    font-size: 13px;
  }

  .allocation-page .cashflow-forecast-item strong {
    font-size: 14px;
  }

  .allocation-page .cashflow-market-summary span,
  .allocation-page .income-holding-values > span {
    font-size: 13px;
  }

  .allocation-page .rank-title,
  .allocation-page .rank-amount {
    font-size: 16px;
  }

  .allocation-page .allocation-data-gate-title {
    font-size: 20px;
  }

  /* 個股追蹤頁：依目前最終手機層級逐項 +1px。 */
  .trades-page {
    font-size: 18px;
  }

  .trades-page .header-title {
    font-size: 20px;
  }

  .trades-page .status {
    font-size: 15px;
  }

  .trades-page button,
  .trades-page .page-switch-btn {
    font-size: 16px;
  }

  .trades-page .small {
    font-size: 15px;
  }

  .trades-page .tiny {
    font-size: 14px;
  }

  .trades-page .pill,
  .trades-page .tag {
    font-size: 15px;
  }

  .trades-page .rank-title,
  .trades-page .rank-amount {
    font-size: 16px;
  }

  .trades-page .toast {
    font-size: 16px;
  }

  /* 交易頁主要卡片標題統一為 18px。 */
  .trades-page .trade-toolbar > div:first-child,
  .trades-page #cardMarketValue > .small:first-child,
  .trades-page #cashAccountCard .cash-account-title,
  .trades-page #cardAssetChange > div:first-child > div:first-child,
  .trades-page .daily-pnl-title-row > div:first-child,
  .trades-page .card:has(#dividendMonthChart) > div:first-child > div:first-child,
  .trades-page .card:has(#dashCountList) > div:first-child > div:first-child {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
  }

  /* V2 為比例數字保留同格式穩定寬度；股票市值在手機版改從左側排，
     讓保留寬度落在數字右邊，不在 $ 前形成肉眼可見的空白。 */
  .trades-page #dashMarketValue .dynamic-number-v2-line {
    justify-content: flex-start !important;
  }

  .trades-page #dashGapText,
  .trades-page #dashGapText .dash-unrealized-pct {
    font-size: 17px !important;
  }

  .trades-page #cardMarketValue .dash-realized-total {
    font-size: 20px;
  }

  .trades-page #cardMarketValue .dash-realized-sub {
    font-size: 16px;
  }

  .trades-page #cardMarketValue .quote-data-time {
    font-size: 15px;
  }

  .trades-page .trade-form-grid input,
  .trades-page .trade-form-grid select,
  .trades-page .trade-form-grid button.primary {
    font-size: 17px;
  }

  .trades-page .trade-empty {
    font-size: 16px;
  }

  .trades-page .tc-stock-name {
    font-size: 17px;
  }

  .trades-page .tc-stock-code {
    font-size: 14px;
  }

  .trades-page .tc-market {
    font-size: 19px;
  }

  .trades-page .tc-price {
    font-size: 17px;
  }

  .trades-page .tc-change {
    font-size: 15px;
  }

  .trades-page .tc-meta,
  .trades-page .tc-cost {
    font-size: 14px;
  }

  .trades-page .tc-return-label,
  .trades-page .tc-return-rate,
  .trades-page .tc-hist-count,
  .trades-page .trade-card .tc-quote-pending {
    font-size: 14px;
  }

  .trades-page .tc-return-value {
    font-size: 16px;
  }

  .trades-page #cardAssetChange .chart-legend {
    font-size: 16px;
  }

  .trades-page #cardAssetChange .asset-granularity-btn {
    font-size: 16px;
  }

  .trades-page #txnModalBackdrop .txn-entry-grid input,
  .trades-page #txnModalBackdrop .txn-entry-grid #txnModalDate {
    font-size: 17px !important;
  }

  .trades-page #txnModalBackdrop .modal-fee-display {
    font-size: 13px;
  }

  /* 費用摘要改成三個語意列，而不是讓一整串 inline 文字自行擠壓換行。
     手續費／券商規則／成本各自成列，Dynamic Number 仍維持原數值動畫。 */
  .trades-page #txnModalBackdrop #txnModalFeeDisplay {
    line-height: 1.55;
    text-align: left;
    word-break: keep-all;
    overflow-wrap: normal;
    line-break: strict;
  }

  .trades-page #txnModalBackdrop #txnModalFeeDisplay .txn-fee-summary-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
    width: 100%;
    min-width: 0;
    font-size: 13px;
    line-height: 1.45;
  }

  .trades-page #txnModalBackdrop #txnModalFeeDisplay .txn-fee-primary,
  .trades-page #txnModalBackdrop #txnModalFeeDisplay .txn-fee-note,
  .trades-page #txnModalBackdrop #txnModalFeeDisplay .txn-fee-cost {
    display: block;
    min-width: 0;
    word-break: keep-all;
    overflow-wrap: normal;
    line-break: strict;
  }

  .trades-page #txnModalBackdrop #txnModalFeeDisplay .txn-fee-note {
    color: var(--sub);
    font-size: 12px;
  }

  .trades-page #txnModalBackdrop #txnModalFeeDisplay .txn-fee-punct {
    display: none;
  }

  .trades-page #txnModalBackdrop #txnModalFeeDisplay .mixed-dynamic-number-v2,
  .trades-page #txnModalBackdrop #txnModalFeeDisplay .dynamic-number-v2-line {
    white-space: nowrap;
  }

  .trades-page #txnModalBackdrop .txn-row {
    font-size: 15px;
  }

  .trades-page #txnModalBackdrop .txn-tag {
    font-size: 15px;
  }

  .trades-page #txnModalBackdrop .txn-date {
    font-size: 16px;
  }

  .trades-page #txnModalBackdrop .txn-metric-label,
  .trades-page #txnModalBackdrop .txn-fee-label {
    font-size: 14px;
  }

  .trades-page #txnModalBackdrop .txn-shares,
  .trades-page #txnModalBackdrop .txn-price,
  .trades-page #txnModalBackdrop .txn-cost,
  .trades-page #txnModalBackdrop .txn-metric-value,
  .trades-page #txnModalBackdrop .txn-fee-value {
    font-size: 17px;
  }

  .trades-page #txnModalBackdrop .txn-realized-gain {
    font-size: 15px;
  }

  .trades-page .modal-header {
    font-size: 18px;
  }

  .trades-page #txnModalBackdrop .modal-tab-btn {
    font-size: 14px;
  }

  .trades-page .modal-field label,
  .trades-page .modal-section-title,
  .trades-page .modal-fee-display,
  .trades-page .modal-fee-hint2 {
    font-size: 14px;
  }

  .trades-page .dividend-auto-title,
  .trades-page .dividend-manual-submit {
    font-size: 16px;
  }

  .trades-page #txnModalBackdrop.add-mode .txn-type-option {
    font-size: 15px;
  }

  .trades-page #txnModalBackdrop.add-mode .modal-footer button {
    font-size: 14px;
  }

  .trades-page .daily-pnl-week-head span {
    font-size: 12px;
  }

  .trades-page .daily-pnl-date {
    font-size: 11px;
  }

  .trades-page .daily-pnl-day strong {
    font-size: 10px;
  }

  .trades-page .daily-pnl-day small {
    font-size: 8.5px;
  }

  .trades-page .daily-pnl-stat strong {
    font-size: 15px;
  }

  .trades-page .daily-pnl-stat small {
    font-size: 11px;
  }

  .trades-page .daily-pnl-composition-row,
  .trades-page .daily-pnl-week-row-line {
    font-size: 14px;
  }

  .trades-page .historical-stocks-title {
    font-size: 15px;
  }

  .trades-page .monthly-dividend-title,
  .trades-page .monthly-dividend-name {
    font-size: 16px;
  }

  .trades-page .monthly-dividend-title strong,
  .trades-page .monthly-dividend-amount {
    font-size: 18px;
  }

  .trades-page .monthly-dividend-date,
  .trades-page .monthly-dividend-financials {
    font-size: 14px;
  }

  .trades-page .stock-lookup-market,
  .trades-page .stock-lookup-status {
    font-size: 14px;
  }

  .trades-page .backup-section-title {
    font-size: 16px;
  }

  .trades-page .backup-preview-meta,
  .trades-page .backup-report-row,
  .trades-page .backup-warning-banner {
    font-size: 14.5px;
  }

  .trades-page .dividend-estimate-empty {
    font-size: 15px;
  }

  .trades-page .dividend-estimate-status {
    font-size: 13px;
  }

  .trades-page .dividend-estimate-dates span,
  .trades-page .dividend-estimate-calc span {
    font-size: 13.5px;
  }

  .trades-page .dividend-estimate-dates b {
    font-size: 15px;
  }

  .trades-page .dividend-estimate-calc strong {
    font-size: 15.5px;
  }

  /* v92：交易頁行動版固定視覺比例。保留單指水平與垂直捲動，
     並固定文字縮放為 100%；輸入框維持 >=16px，避免 iOS focus 自動放大。 */
  .trades-page {
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* iOS Safari 下買進/賣出按鈕不再依原生 button baseline 排版，
     一律用 flex 在固定高度內水平、垂直置中，避免 active 狀態文字跑位。 */
  .trades-page #txnModalBackdrop .txn-type-option {
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    line-height: 1 !important;
    transform: none !important;
  }

  .trades-page #txnModalBackdrop,
  .trades-page #txnModalBackdrop button,
  .trades-page #txnModalBackdrop input,
  .trades-page #txnModalBackdrop select {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
}
