/* =====================================================================
   FROZEN DESIGN CONTRACT — v4.8.19.8
   Baseline visual design: v4.8.19.7

   IMPORTANT:
   These values are deliberate and user-approved.
   Do not change them unless the user explicitly asks to change that
   specific visual property. Functional/strategy/data work must preserve
   this layer by default.
   ===================================================================== */

:root{
  /* Geometry */
  --freeze-page-width:760px;
  --freeze-main-padding-desktop:0 18px 36px;
  --freeze-main-padding-mobile:0 12px 28px;

  /* Typography */
  --freeze-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC",sans-serif;

  /* Core palette */
  --freeze-canvas:#f5f7fb;
  --freeze-surface:#ffffff;
  --freeze-ink:#0f172a;
  --freeze-body:#475569;
  --freeze-sub:#64748b;
  --freeze-muted:#94a3b8;
  --freeze-line:#e2e8f0;
  --freeze-line-strong:#cbd5e1;
  --freeze-action:#2563eb;

  /* Status palette */
  --freeze-full:#15803d;
  --freeze-full-soft:#ecfdf3;
  --freeze-defense:#ef4444;
  --freeze-defense-soft:#fff1f2;
  --freeze-warning:#f97316;
  --freeze-warning-soft:#fff7ed;

  /* Navigation */
  --freeze-nav-height:54px;
  --freeze-nav-height-mobile:48px;
  --freeze-nav-font:14px;
  --freeze-nav-font-mobile:12px;

  /* Shared cards / status */
  --freeze-detail-card-padding:16px;
  --freeze-detail-card-padding-mobile:14px;
  --freeze-status-card-min-height:96px;
  --freeze-status-card-padding:11px;
  --freeze-status-card-radius:12px;
  --freeze-status-label-font:11.5px;
  --freeze-status-main-font:26px;
  --freeze-status-band-height:48px;
  --freeze-status-band-font:24px;
  --freeze-status-band-radius:9px;

  /* Shared refresh button */
  --freeze-refresh-min-width:132px;
  --freeze-refresh-height:42px;
  --freeze-refresh-radius:12px;
  --freeze-refresh-font:13px;
}

/* Global invariants */
html,body{
  font-family:var(--freeze-font-family)!important;
}
body{
  background:var(--freeze-canvas)!important;
  color:var(--freeze-ink)!important;
}
main{
  width:100%!important;
  max-width:var(--freeze-page-width)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding:var(--freeze-main-padding-desktop)!important;
}

/* Keep the approved shared color semantics stable. */
:root{
  --layout-width:var(--freeze-page-width);
  --layout-line:var(--freeze-line);
  --layout-surface:var(--freeze-surface);
  --layout-canvas:var(--freeze-canvas);

  --ss-bg:var(--freeze-canvas);
  --ss-surface:var(--freeze-surface);
  --ss-ink:var(--freeze-ink);
  --ss-body:var(--freeze-body);
  --ss-sub:var(--freeze-sub);
  --ss-muted:var(--freeze-muted);
  --ss-line:var(--freeze-line);
  --ss-line-strong:var(--freeze-line-strong);
  --ss-full:var(--freeze-full);
  --ss-full-soft:var(--freeze-full-soft);
  --ss-defense:var(--freeze-defense);
  --ss-defense-soft:var(--freeze-defense-soft);
  --ss-warning:var(--freeze-warning);
  --ss-warning-soft:var(--freeze-warning-soft);
}

/* Navigation geometry */
.tabs.dashboard-tabs{
  height:var(--freeze-nav-height)!important;
  min-height:var(--freeze-nav-height)!important;
}
.dashboard-tabs .tab-btn{
  height:var(--freeze-nav-height)!important;
  min-height:var(--freeze-nav-height)!important;
  font-size:var(--freeze-nav-font)!important;
}

/* Shared refresh button geometry */
#dashboardPage .dashboard-refresh,
#swingPage #swingRefreshBtn,
#fundPage #fundRefreshBtn{
  min-width:var(--freeze-refresh-min-width)!important;
  height:var(--freeze-refresh-height)!important;
  min-height:var(--freeze-refresh-height)!important;
  border-radius:var(--freeze-refresh-radius)!important;
  font-size:var(--freeze-refresh-font)!important;
}

/* Detail-page status geometry — identical on 正二 and 安聯. */
#swingPage .simple-status-metrics .strategy-status-metric,
#fundPage .simple-status-metrics .strategy-status-metric{
  min-height:var(--freeze-status-card-min-height)!important;
  padding:var(--freeze-status-card-padding)!important;
  border-radius:var(--freeze-status-card-radius)!important;
}
#swingPage .simple-status-metrics .strategy-status-metric>label,
#swingPage .simple-status-metrics .next-trigger>small,
#fundPage .simple-status-metrics .strategy-status-metric>label,
#fundPage .simple-status-metrics .next-trigger>small{
  font-size:var(--freeze-status-label-font)!important;
}
#swingPage .simple-status-metrics .strategy-status-metric:first-child>strong,
#fundPage .simple-status-metrics .strategy-status-metric:first-child>strong{
  font-size:var(--freeze-status-main-font)!important;
}
#swingPage #swingAdviceSignal,
#swingPage .simple-status-metrics .next-trigger>strong,
#fundPage #fundAdviceAllocation,
#fundPage .simple-status-metrics .next-trigger>strong{
  height:var(--freeze-status-band-height)!important;
  min-height:var(--freeze-status-band-height)!important;
  max-height:var(--freeze-status-band-height)!important;
  border-radius:var(--freeze-status-band-radius)!important;
  font-size:var(--freeze-status-band-font)!important;
}

/* Approved status colors */
.dashboard-state-badge.normal,
#swingPage .detail-state-badge.normal,
#fundPage .detail-state-badge.normal{
  color:var(--freeze-full)!important;
  background:var(--freeze-full-soft)!important;
}
.dashboard-state-badge.defense,
#swingPage .detail-state-badge.defense,
#fundPage .detail-state-badge.defense{
  color:var(--freeze-defense)!important;
  background:var(--freeze-defense-soft)!important;
}
.dashboard-state-badge.warning,
#swingPage .detail-state-badge.warning,
#fundPage .detail-state-badge.warning{
  color:var(--freeze-warning)!important;
  background:var(--freeze-warning-soft)!important;
}

@media(max-width:700px){
  main{padding:var(--freeze-main-padding-mobile)!important}
  .tabs.dashboard-tabs{
    height:var(--freeze-nav-height-mobile)!important;
    min-height:var(--freeze-nav-height-mobile)!important;
  }
  .dashboard-tabs .tab-btn{
    height:var(--freeze-nav-height-mobile)!important;
    min-height:var(--freeze-nav-height-mobile)!important;
    font-size:var(--freeze-nav-font-mobile)!important;
  }
  #swingPage .simple-status-metrics .strategy-status-metric,
  #fundPage .simple-status-metrics .strategy-status-metric{
    min-height:0!important;
    padding:12px!important;
  }
  #swingPage #swingAdviceSignal,
  #swingPage .simple-status-metrics .next-trigger>strong,
  #fundPage #fundAdviceAllocation,
  #fundPage .simple-status-metrics .next-trigger>strong{
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
    font-size:23px!important;
  }
}
