:root{
      color-scheme:light;
      --bg:#f5f0eb;--bg2:#ffffff;--bg3:#eeeae4;
      --card:#ffffff;--card2:#f5f0eb;
      --text:#1a1916;--sub:#6b6760;--hint:#9a9690;
      --border:#ddd9d2;--border2:#c8c4bc;
      --tint:#9e7c2e;
      --ok:#3b6d4a;--warn:#9e7c2e;--err:#9e3a3a;
      --blue:#185FA5;
      --fill-track:#ddd9d2;
      --cat-growth:#185FA5;--cat-etf:#0F6E56;

      --sticky-card-height:0px;
      --sticky-spacer-height:0px;
      --sticky-mask-height:0px;
      --desktop-sticky-top:12px;
      --mobile-sticky-top:max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
      --mobile-card-gap:14px;
      --desktop-mask-gap:2px;
      --mobile-mask-gap:2px;
      --desktop-sidebar-width:320px;
      --desktop-layout-gap:10px;
      /* 下方 .wrap 保留左右各 16px padding，內容卡片與上方固定塊同為 1240px。 */
      --desktop-content-max-width:1240px;
      --desktop-wrap-max-width:1272px;
    }

    *{
      box-sizing:border-box;
      -webkit-tap-highlight-color:transparent;
    }

    html, body{
      width:100%;
      overflow-x:hidden;
    }

    body{
      margin:0;
      padding:0;
      background:var(--bg);
      color:var(--text);
      font-family:var(--font-ui);
      -webkit-font-smoothing:antialiased;
      font-size:15px;
    }

    body::before{
      content:"";
      position:fixed;
      top:0;
      left:0;
      right:0;
      height:var(--sticky-mask-height);
      background:var(--bg);
      z-index:999;
      pointer-events:none;
    }

    .top-backdrop-mask{
      display:none;
    }

    .wrap{
      max-width:var(--desktop-wrap-max-width);
      margin:0 auto;
      padding:
        0
        16px
        calc(env(safe-area-inset-bottom, 0px) + 56px)
        16px;
      display:grid;
      gap:6px;
    }

    .card{
      background:var(--card);
      border:0.5px solid var(--border);
      border-radius:14px;
      padding:12px 18px;
      overflow:hidden;
    }

    .top-sticky{
      position:fixed;
      top:var(--desktop-sticky-top);
      left:50%;
      transform:translateX(-50%);
      width:min(var(--desktop-content-max-width), calc(100vw - 32px));
      z-index:3000;
      backdrop-filter:blur(10px);
      -webkit-backdrop-filter:blur(10px);
      background:var(--card);
      isolation:isolate;
      overflow:hidden;
      will-change:transform;
      box-shadow:0 10px 26px rgba(0,0,0,.08);
      background-clip:padding-box;
    }

    #topStickySpacer{
      height:var(--sticky-spacer-height);
      pointer-events:none;
    }

    /* M5-8: shared text utility base presentation is owned by public/ui/components.css. */

    button{
      appearance:none;
      border:0.5px solid var(--border);
      cursor:pointer;
      font-family:inherit;
      font-size:13px;
      font-weight:500;
      white-space:nowrap;
      flex-shrink:0;
      border-radius:999px;
      padding:5px 14px;
      background:transparent;
      color:var(--sub);
      transition:background .12s,color .12s,opacity .12s;
    }

    button:hover{
      background:var(--bg3);
      color:var(--text);
    }

    button.active{
      background:var(--tint);
      color:var(--bg);
      border-color:transparent;
      font-weight:600;
    }

    button.secondary{
      background:transparent;
      color:var(--sub);
    }

    button.secondary:hover{
      background:var(--bg3);
      color:var(--text);
    }

    button:disabled{
      opacity:.45;
      cursor:not-allowed;
    }

    .header-shell{
      display:grid;
      gap:8px;
    }

    .header-title-row{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
    }

    .header-title{
      font-size:17px;
      font-weight:500;
      color:var(--text);
      letter-spacing:-.2px;
      min-width:0;
    }

    .header-actions-row{
      display:flex;
      align-items:center;
      gap:8px;
      min-width:0;
    }

    .header-actions-scroll{
      overflow-x:auto;
      overflow-y:hidden;
      -webkit-overflow-scrolling:touch;
      overscroll-behavior-x:contain;
      scrollbar-width:none;
      padding-bottom:2px;
      flex:0 0 auto;
      max-width:55%;
      margin-left:auto;
    }

    .header-actions-scroll::-webkit-scrollbar{
      display:none;
    }

    .header-actions{
      display:flex;
      gap:10px;
      align-items:center;
      justify-content:flex-end;
      flex-wrap:nowrap;
      width:max-content;
    }

    .header-actions > *{
      flex:0 0 auto;
    }

    .status{
      font-size:12px;
      color:var(--hint);
      white-space:nowrap;
    }

    .status-inline{
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-height:32px;
      padding:0 10px;
      border-radius:999px;
      border:0.5px solid var(--border);
      background:var(--bg2);
      color:var(--hint);
      flex:0 0 auto;
    }

    .plan-scroll{
      display:flex;
      gap:6px;
      flex-wrap:nowrap;
      flex:1 1 auto;
      min-width:0;
      overflow-x:auto;
      overflow-y:hidden;
      -webkit-overflow-scrolling:touch;
      overscroll-behavior-x:contain;
      scrollbar-width:none;
      padding-bottom:2px;
    }

    .plan-scroll > *{
      flex:0 0 auto;
    }

    .plan-scroll::-webkit-scrollbar{
      display:none;
    }

    .bar{
      height:4px;
      background:var(--fill-track);
      border-radius:999px;
      overflow:hidden;
      width:100%;
    }

    .fill{
      height:100%;
      background:var(--tint);
      border-radius:999px;
      transition:width .5s cubic-bezier(.4,0,.2,1);
    }

    .fill.complete{background:var(--ok)}

    .fill2{
      height:100%;
      background:var(--blue);
      border-radius:999px;
      transition:width .5s cubic-bezier(.4,0,.2,1);
    }

    .fill2.complete{background:var(--ok)}

    .layout{
      display:grid;
      grid-template-columns:minmax(0, 1fr) var(--desktop-sidebar-width);
      gap:var(--desktop-layout-gap);
    }

    .col{
      display:grid;
      gap:10px;
      align-content:start;
      min-width:0;
    }

    .big{
      font-size:48px;
      font-weight:500;
      line-height:1;
      color:var(--text);
    }

    #totalGap{
      font-size:13px;
      font-weight:500;
      color:var(--warn);
      margin-top:2px;
    }

    #totalGap.ok{color:var(--ok)}

    #lastSyncTime{
      font-size:11px;
      color:var(--hint);
      margin-top:4px;
    }

    .dash-realized-block{
      margin-top:12px;
      padding-top:10px;
      border-top:0.5px solid var(--border);
    }

    .dash-realized-row{
      display:flex;
      justify-content:space-between;
      align-items:baseline;
      gap:12px;
    }

    .dash-realized-total{
      font-size:14px;
      font-weight:600;
      margin-bottom:6px;
    }

    .dash-realized-sub{
      padding-left:12px;
      font-size:12px;
      color:var(--sub);
      margin-top:3px;
    }

    .dash-realized-sub .gain,
    .dash-realized-sub .loss{
      font-weight:500;
    }

    .quote-data-time{
      font-size:11px;
      color:var(--sub);
      margin-top:6px;
      line-height:1.45;

    }

    .quote-data-time.is-partial{
      color:var(--warn);
    }

    .pill{
      display:inline-flex;
      border-radius:999px;
      padding:3px 10px;
      font-size:12px;
      font-weight:500;
      background:rgba(196,154,58,.12);
      color:var(--tint);
      border:0.5px solid rgba(196,154,58,.3);
    }

    [data-theme="light"] .pill{
      background:rgba(158,124,46,.10);
      color:var(--tint);
      border-color:rgba(158,124,46,.3);
    }

    .tag{
      font-size:12px;
      font-weight:500;
      padding:3px 10px;
      border-radius:999px;
      background:var(--bg3);
      color:var(--sub);
      border:0.5px solid var(--border);
    }


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

    .rank-item{
      padding:10px 0;
      border-bottom:0.5px solid var(--border);
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:10px;
    }

    .rank-item:last-child{border-bottom:0}

    .rank-num{
      width:22px;
      height:22px;
      border-radius:50%;
      display:flex;
      align-items:center;
      justify-content:center;
      background:rgba(196,154,58,.12);
      border:0.5px solid rgba(196,154,58,.3);
      color:var(--tint);
      font-size:11px;
      font-weight:600;
      flex-shrink:0;
    }

    .rank-mini-bar{
      height:3px;
      background:var(--fill-track);
      border-radius:999px;
      overflow:hidden;
      margin-top:4px;
      width:80px;
    }

    .rank-mini-fill{
      height:100%;
      background:var(--tint);
      border-radius:999px;
      transition:width .4s cubic-bezier(.4,0,.2,1);
    }


    .table-wrap{
      border-radius:10px;
      overflow:hidden;
      border:0.5px solid var(--border);
    }

    table{
      width:100%;
      border-collapse:collapse;
      table-layout:fixed;
    }

    col.c-name{width:24%}
    col.c-goal{width:12%}
    col.c-gap{width:20%}

    th,td{
      padding:11px 12px;
      border-bottom:0.5px solid var(--border);
      text-align:left;
      vertical-align:middle;
    }

    th{
      font-size:11px;
      font-weight:500;
      letter-spacing:.3px;
      color:var(--sub);
      background:var(--bg3);
      position:sticky;
      top:0;
    }

    td{background:var(--card)}

    tr:last-child td{border-bottom:0}

    tr:hover td{
      background:var(--bg3);
      transition:background .1s;
    }

    tr.row-over td{background:rgba(90,158,111,.06)}

    tr.row-over:hover td{background:rgba(90,158,111,.10)}

    [data-theme="light"] tr.row-over td{
      background:rgba(59,109,74,.04);
    }

    .tname{
      font-weight:500;
      font-size:14px;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
    }

    .tprog-fill{
      height:100%;
      border-radius:999px;
      transition:width .5s cubic-bezier(.4,0,.2,1);
    }

    .tprog-fill.growth{background:var(--cat-growth)}
    .tprog-fill.complete{background:var(--ok)}


    .sc{
      padding:14px 0;
      border-bottom:0.5px solid var(--border);
      min-width:0;
      overflow:hidden;
    }

    .sc:last-child{border-bottom:0}

    .sc.sc-over{
      background:rgba(90,158,111,.07);
      border-radius:10px;
      padding-left:10px;
      padding-right:10px;
    }

    [data-theme="light"] .sc.sc-over{
      background:rgba(59,109,74,.05);
    }

    .sc-top{
      display:flex;
      justify-content:space-between;
      align-items:baseline;
      gap:8px;
      margin-bottom:3px;
    }

    .sc-name{
      font-weight:500;
      font-size:16px;
      letter-spacing:-.2px;
      overflow:hidden;
      text-overflow:ellipsis;
      white-space:nowrap;
      flex:1;
      min-width:0;
    }

    @media (max-width:700px){
      body::before{
        display:none;
      }

      /* 手機版狀態列遮罩：
         只遮 iPhone 狀態列到卡片1上緣的區域，避免內容滑進狀態列；
         不遮卡片1下方，所以卡片2的上圓角不會被吃掉。 */
      .top-backdrop-mask{
        display:block;
        position:fixed;
        top:0;
        left:0;
        right:0;
        height:var(--mobile-sticky-top);
        background:var(--bg);
        z-index:2999;
        pointer-events:none;
      }

      .layout{grid-template-columns:1fr;gap:var(--mobile-card-gap)}
      .table-wrap{display:none}
      .col{display:contents}

      .wrap{
        padding:
          0
          16px
          calc(env(safe-area-inset-bottom, 0px) + 56px)
          16px;
        gap:var(--mobile-card-gap);
      }

      button{font-size:13px;padding:5px 12px}

      .big{font-size:40px}

      .top-sticky{
        position:fixed;
        top:var(--mobile-sticky-top);
        left:16px;
        right:16px;
        width:auto;
        transform:translateZ(0);
        z-index:3000;
        border-radius:18px;
        backdrop-filter:none;
        -webkit-backdrop-filter:none;
        background:var(--card);
        overflow:hidden;
        box-shadow:0 8px 22px rgba(0,0,0,.06);
        isolation:auto;
        will-change:auto;
      }

      #topStickySpacer{
        display:block;
        height:var(--sticky-spacer-height);
        min-height:calc(var(--sticky-card-height) + var(--mobile-sticky-top));
      }

      .card{
        border-radius:18px;
      }

      .header-shell{
        gap:10px;
      }

      .header-title-row{
        align-items:flex-start;
      }

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

      .status-inline{
        min-height:30px;
        padding:0 10px;
      }

      .header-actions-scroll,
      .plan-scroll{
        overflow-x:auto;
        overflow-y:hidden;
        -webkit-overflow-scrolling:touch;
        overscroll-behavior-x:contain;
        scrollbar-width:none;
      }

      .header-actions-scroll::-webkit-scrollbar,
      .plan-scroll::-webkit-scrollbar{
        display:none;
      }

      .header-actions{
        justify-content:flex-start;
        width:max-content;
        min-width:max-content;
        flex-wrap:nowrap;
      }

      .header-actions > *,
      .plan-scroll > *{
        flex:0 0 auto;
      }

      .plan-scroll{
        padding-bottom:2px;
      }

      .header-actions-row{
        min-width:0;
      }
    }


.toast-stack{
  position:fixed;
  right:16px;
  bottom:calc(env(safe-area-inset-bottom, 0px) + 16px);
  display:grid;
  gap:8px;
  z-index:3000;
  pointer-events:none;
  max-width:min(360px, calc(100vw - 32px));
}

.toast{
  opacity:0;
  transform:translateY(8px);
  transition:opacity .18s ease, transform .18s ease;
  border-radius:12px;
  padding:10px 12px;
  font-size:13px;
  line-height:1.45;
  color:#fff;
  background:rgba(17,17,17,.92);
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 28px rgba(0,0,0,.22);
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

.toast-info{
  background:rgba(36,35,32,.96);
}

.toast-success{
  background:rgba(41,86,56,.96);
}

.toast-warning{
  background:rgba(114,90,29,.96);
}

.toast-error{
  background:rgba(122,52,52,.96);
}

@media (max-width:700px){
  .toast-stack{
    left:16px;
    right:16px;
    bottom:calc(env(safe-area-inset-bottom, 0px) + 16px);
    max-width:none;
  }
}


/* === restore-fix1：最該先補卡片比例 + 輸入體驗修正 === */
.rank-item{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(88px,auto);
  align-items:center;
  gap:10px;
}

.rank-left{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.rank-main{
  min-width:0;
  flex:1;
}

.rank-title{
  font-weight:500;
  font-size:14px;
  line-height:1.25;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rank-right{
  text-align:right;
  min-width:88px;
  max-width:112px;
  overflow:hidden;
}

.rank-amount{
  font-size:14px;
  font-family:var(--font-numeric);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;

}

.rank-mini-bar{
  width:100%;
  max-width:86px;
  margin-top:5px;
}

@media(max-width:700px){
  .rank-item{
    grid-template-columns:minmax(0,1fr) minmax(96px,auto);
  }

  .rank-right{
    min-width:96px;
    max-width:118px;
  }
}


/* === restore-fix4：手機輸入不放大、卡片比例固定 === */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scrollbar-width:none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar{
  display:none;
}

body{
  scrollbar-width:none;
}

@media(max-width:700px){
  html,
  body{
    width:100%;
    max-width:100%;
    overflow-x:hidden;
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
  }

  body{
    touch-action:pan-x pan-y;
  }

  .wrap,
  .top-sticky,
  .card,
  .sc{
    max-width:100%;
  }

  .card,
  .sc{
    transform:none !important;
    zoom:1 !important;
  }

  .sc{
    contain:layout paint;
  }

  .sc-top{
    align-items:baseline;
  }

  .sc-name{
    font-size:16px;
    line-height:1.25;
    min-width:0;
  }

  input{
    font-size:16px !important;
  }

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



/* Market value v1 */
.gain{color:var(--err);font-weight:600}
.loss{color:var(--ok);font-weight:600}
.market-table th,
.market-table td{vertical-align:middle}
.market-table .tiny{font-size:10px;color:var(--hint);margin-top:2px}
.market-table .t-target,
.market-table .t-gap{text-align:right;white-space:nowrap}




/* ===== v2.1 desktop tab width fix =====
   目的：桌面版用分頁後，每頁只顯示必要欄位；同時隱藏 colgroup 欄位，
   避免 table-layout: fixed 仍把寬度分給已隱藏欄位。 */

/* 新版 colgroup 欄位寬度基準 */
.market-table col.c-name{width:24%}
.market-table col.c-goal{width:12%}
.market-table col.c-gap{width:15%}

/* table-layout: fixed + col 用 auto，讓欄寬穩定 */
.market-table { table-layout: fixed; }
.market-table col.c-name  { width: 155px; }
.market-table col.c-goal,
.market-table col.c-gap  { width: auto; }



/* 3. 進度條 in gap cell */
.row-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}

/* t-gap 欄位不允許折行，讓進度條獨占一行 */
.t-gap { white-space: normal; min-width: 120px; }


/* ===== 頁面切換器（investment vs trades，真正的整頁導覽，非站內 tab） ===== */
.page-switcher {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--bg3);
  border-radius: 10px;
  border: 0.5px solid var(--border);
  width: fit-content;
}

.page-switch-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 7px;
  padding: 6px 16px;
  background: transparent;
  color: var(--sub);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .12s, color .12s, box-shadow .12s;
}

.page-switch-btn:hover:not(.active) {
  background: var(--bg2, var(--card));
  color: var(--text);
}

.page-switch-btn.active {
  background: var(--card2, var(--card));
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
  border: 0.5px solid var(--border2);
}

@media (max-width: 700px) {
  .page-switcher { width: 100%; }
  .page-switch-btn { flex: 1; text-align: center; justify-content: center; }
}

.plan-scroll,
.header-actions-scroll{
  cursor:grab;
}

.plan-scroll.drag-scrolling,
.header-actions-scroll.drag-scrolling{
  cursor:grabbing;
  user-select:none;
}


/* ===== 7508：投資配置只保留「總覽」，回歸成本進度與進度條 ===== */

.progress-overview-table col.c-name { width: 25%; }
.progress-overview-table col.c-goal { width: 18%; }
.progress-overview-table col.c-gap  { width: 45%; }

.progress-overview-table .t-target {
  text-align: right;

}

.progress-overview-table .t-gap {
  min-width: 150px;
  white-space: normal;
}

.investment-progress-cell {
  display: grid;
  gap: 6px;
}

.investment-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.investment-progress-meta strong {
  font-family: var(--font-numeric);

  color: var(--text);
}


.progress-mobile-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--sub);
  font-size: 12px;
}

.progress-mobile-footer strong {
  text-align: right;
}


/* Rolling Number 結構排版由 numeric-spacing.css 管理；每一層都是完整連續文字，
   此處只保留 Y 軸 transition，不加入其他視覺轉場或水平幾何。 */
.rolling-number-layer {
  transform: translateY(0);
  will-change: transform;
  transition: transform var(--rolling-number-duration, 380ms) cubic-bezier(.22, .72, .18, 1);
}

.rolling-number-host.roll-up .rolling-number-incoming {
  transform: translateY(110%);
}

.rolling-number-host.roll-up.is-rolling .rolling-number-outgoing {
  transform: translateY(-110%);
}

.rolling-number-host.roll-up.is-rolling .rolling-number-incoming {
  transform: translateY(0);
}

.rolling-number-host.roll-down .rolling-number-incoming {
  transform: translateY(-110%);
}

.rolling-number-host.roll-down.is-rolling .rolling-number-outgoing {
  transform: translateY(110%);
}

.rolling-number-host.roll-down.is-rolling .rolling-number-incoming {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .rolling-number-layer {
    transition: none !important;
  }
}


/* v85：總覽／摘要保留顯示字體；數字寬度與字距統一交由自然排版規則處理。 */
#totalPct,
#dashMarketValue,
.daily-pnl-summary-value,
.daily-pnl-summary-rate,
#totalText .rolling-number-host,
#totalGap .rolling-number-host,
#dashMarketValue .rolling-number-host,
#dashSubText .rolling-number-host,
#dashGapText .rolling-number-host,
#dashRealizedBlock .rolling-number-host,
#dashCountList .rolling-number-host,
.daily-pnl-summary .rolling-number-host {
  font-family: var(--font-summary-numeric);


  font-optical-sizing: auto;
  font-kerning: normal;
}


/* v77.24：未取得快取／Lite／標準 Firestore 的可信資料前，不顯示 DEFAULT_STATE 假數字。 */
.allocation-data-gate {
  min-height: 190px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  padding: 32px 24px;
}
.allocation-data-gate[hidden],
#allocationDataContent[hidden] {
  display: none !important;
}
.allocation-data-gate-title {
  font-size: 18px;
  font-weight: 650;
}

/* v77.32：手機版整體閱讀層級再提高一級。保留主數字比例，
   以一致的字級、行距與觸控高度改善長時間閱讀。 */
@media (max-width: 700px) {
  body {
    font-size: 17px;
    line-height: 1.45;
  }

  .card {
    padding: 15px 16px;
  }

  .header-shell {
    gap: 12px;
  }

  .header-title {
    font-size: 19px;
    line-height: 1.3;
    letter-spacing: -0.25px;
  }

  button {
    min-height: 40px;
    padding: 7px 15px;
    font-size: 15px;
    line-height: 1.25;
  }

  .status {
    font-size: 14px;
  }

  .status-inline {
    min-height: 38px;
    padding-inline: 12px;
  }

  .page-switch-btn {
    min-height: 42px;
    padding: 8px 16px;
    font-size: 15px;
  }

  .small {
    font-size: 14px;
  }

  .tiny {
    font-size: 13px;
    line-height: 1.45;
  }

  .dash-realized-total {
    margin-bottom: 8px;
    font-size: 17px;
  }

  .dash-realized-sub {
    font-size: 14px;
    line-height: 1.5;
  }

  .quote-data-time {
    font-size: 13px;
    line-height: 1.55;
  }

  .pill,
  .tag,
  .progress-mobile-footer,
  .investment-progress-meta {
    font-size: 14px;
    line-height: 1.4;
  }

  .sc-name {
    font-size: 18px;
    line-height: 1.35;
  }


  .rank-title,
  .rank-amount {
    font-size: 15px;
  }

  .market-table .tiny {
    font-size: 12px;
  }

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

  .toast {
    font-size: 15px;
    line-height: 1.45;
  }
}

/* ── v77.59：行動版主介面恢復桌面比例，放大摘要卡片但不更換字體 ── */
@media (max-width: 700px) {
  /* 桌面版主摘要為 48px；手機不再額外縮成 40px。 */
  .big {
    font-size: clamp(44px, 12vw, 48px);
    line-height: 1;
  }

  /* 主內容卡片增加可讀留白；固定頂部卡片維持既有高度控制。 */
  .layout > .col > .card {
    padding: 18px;
  }

  #cardMarketValue > .small:first-child {
    margin-bottom: 7px !important;
    font-size: 15px;
    line-height: 1.35;
  }

  #dashSubText {
    margin: 7px 0 4px !important;
    line-height: 1.4;
  }

  #dashGapText {
    margin-bottom: 14px !important;
    font-size: 16px;
    line-height: 1.35;
  }

  #dashGapText .dash-unrealized-pct {
    font-size: 16px !important;
    line-height: 1.35;
  }

  #cardMarketValue .bar {
    height: 5px;
  }

  #cardMarketValue .dash-realized-block {
    margin-top: 15px;
    padding-top: 13px;
  }

  #cardMarketValue .dash-realized-total {
    margin-bottom: 9px;
    font-size: 19px;
    line-height: 1.35;
  }

  #cardMarketValue .dash-realized-sub {
    padding-left: 14px;
    margin-top: 5px;
    font-size: 15px;
    line-height: 1.45;
  }

  #cardMarketValue .quote-data-time {
    margin-top: 9px;
    font-size: 14px;
    line-height: 1.5;
  }
}

/* Mobile app viewport: preserve scrolling, disable browser pinch zoom. */
html,
body {
  touch-action: pan-x pan-y;
}
