/* 會員中心 phone layout (≤768px) mirroring the WarrantScope App §34–38. Desktop keeps dashboard.html's rules. */

.mm-member-header,
.mm-status-hero,
.mm-today-points,
.mm-settings-head,
.mm-settings-link,
.mm-theme-seg,
.mm-support,
.mm-logout,
.mm-pager,
.mm-donation-custom,
.mm-donation-label,
.mm-donation-note,
.mm-hidden-nav {
  display: none !important;
}

@media (max-width: 768px) {
  /* Same palette as the market page and the App. */
  body.dark-mode {
    --bg: #0a0e15;
    --panel: #10151f;
    --panel-soft: #0d1118;
    --line: rgba(132, 158, 190, 0.13);
    --divider: rgba(132, 158, 190, 0.1);
    --text: #f0f3f8;
    --muted: #8a96a8;
    --accent: #e8b654;
    --primary: #e8b654;
    --accent-soft: rgba(232, 182, 84, 0.1);
    --mm-line-soft: rgba(132, 158, 190, 0.08);
    --mm-faint: #5a6477;
    --mm-up: #f2566b;
    --mm-down: #3dbe8b;
    --mm-warn: #f1b458;
    --mm-ink: #0a0e15;
  }

  body:not(.dark-mode) {
    --bg: #eef3f9;
    --text: #10223d;
    --muted: #53657f;
    --accent: #0c7df2;
    --primary: #0c7df2;
    --accent-soft: rgba(12, 125, 242, 0.08);
    --mm-line-soft: rgba(16, 34, 61, 0.06);
    --mm-faint: #5a6d86;
    --mm-up: #d8485e;
    --mm-down: #149d77;
    --mm-warn: #b97112;
    --mm-ink: #ffffff;
  }

  body {
    --mm-gutter: 16px;
    background: var(--bg) !important;
  }

  .price-up {
    color: var(--mm-up) !important;
  }

  .price-down {
    color: var(--mm-down) !important;
  }

  /* Bell wiggles once for new important notices (App §39). */
  .notification-bell.has-unread[aria-expanded="false"] > i,
  .notification-bell.has-unread[aria-expanded="false"] > svg {
    animation: none !important;
  }

  .notification-bell.has-unread.is-nudging[aria-expanded="false"] > i,
  .notification-bell.has-unread.is-nudging[aria-expanded="false"] > svg {
    transform-origin: 50% 18%;
    animation: notification-bell-unread-nudge 0.9s ease-in-out 600ms 1 !important;
  }

  /* 小額斗內 bottom sheet (App §40, layout B). */
  #dashboardDonationModal {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  #dashboardDonationModal .donation-modal-card {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 24px var(--mm-gutter) calc(22px + env(safe-area-inset-bottom, 0px)) !important;
    border: 1px solid var(--line) !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: var(--panel) !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28) !important;
  }

  #dashboardDonationModal .donation-modal-card::before {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    content: "";
    transform: translateX(-50%);
  }

  #dashboardDonationModal .modal-copy .eyebrow,
  #dashboardDonationModal .donation-copy strong,
  #dashboardDonationModal .field > label,
  #dashboardDonationModal .hint-copy {
    display: none !important;
  }

  #dashboardDonationModal .modal-copy h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-right: 44px;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    line-height: 24px;
  }

  #dashboardDonationModal .modal-copy h3::before {
    width: 3px;
    height: 16px;
    background: var(--accent);
    content: "";
  }

  #dashboardDonationModal .donation-modal-card,
  #dashboardDonationModal .modal-copy {
    text-align: left !important;
  }

  #dashboardDonationModal .donation-copy {
    margin: 8px 0 16px;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  #dashboardDonationModal .donation-copy p,
  #dashboardDonationModal .donation-copy span {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 21px;
  }

  .mm-donation-custom {
    display: inline-grid !important;
    place-items: center;
  }

  .mm-donation-label,
  .mm-donation-note {
    display: block !important;
  }

  .mm-donation-label {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
  }

  #dashboardDonationModal .donation-choice-row {
    display: block !important;
  }

  #dashboardDonationModal .donation-presets {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  #dashboardDonationModal .donation-preset-button {
    height: 44px;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--text) !important;
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 14px;
    font-weight: 800;
    box-shadow: none !important;
  }

  #dashboardDonationModal .donation-preset-button.is-selected {
    border-color: color-mix(in srgb, var(--accent) 34%, transparent) !important;
    background: color-mix(in srgb, var(--accent) 10%, transparent) !important;
    color: var(--accent) !important;
  }

  /* The amount field only appears for 自訂, above the note and button. */
  #dashboardDonationModal .field {
    display: flex;
    flex-direction: column;
  }

  #dashboardDonationModal .field > input {
    order: 2;
    display: none;
    height: 44px;
    margin-top: 8px;
    font-size: 16px;
  }

  #dashboardDonationModal .mm-donation-form.is-custom .field > input {
    display: block;
  }

  #dashboardDonationModal .donation-choice-row {
    order: 1;
  }

  .mm-donation-note {
    margin: 12px 0;
    color: var(--mm-faint);
    font-size: 11.5px;
    line-height: 17px;
  }

  #dashboardDonationModal .donation-submit-button {
    width: 100%;
    height: 48px;
    margin: 0;
    border-radius: 8px;
  }

  /* ---------- Shell ---------- */
  .app-shell > .sidebar,
  .dashboard-section > .section-head,
  .page-tail-actions,
  .dashboard-footer {
    display: none !important;
  }

  .app-main {
    padding: 0 var(--mm-gutter) calc(132px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mm-member-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex !important;
    align-items: center;
    gap: 8px;
    height: 56px;
    margin: 0 calc(var(--mm-gutter) * -1);
    padding: 0 var(--mm-gutter);
    border-bottom: 1px solid var(--mm-line-soft);
    background: var(--bg);
  }

  .mm-member-mark,
  .mm-block-mark {
    flex: 0 0 auto;
    width: 3px;
    height: 20px;
    background: var(--accent);
  }

  .mm-block-mark {
    height: 16px;
  }

  .mm-member-title {
    flex: 1 1 auto;
    margin: 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    line-height: 28px;
  }

  .mm-member-back {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
  }

  .mm-member-back svg,
  .mm-support-row svg,
  .mm-settings-link svg,
  .mm-logout-button svg,
  .mm-member-sheet-card header svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* 個人資料 subpage uses the back toolbar (App §38). */
  .mm-member-header.is-toolbar {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    height: 52px;
    padding: 0 4px;
  }

  .mm-member-header.is-toolbar .mm-member-back {
    display: inline-grid;
  }

  .mm-member-header.is-toolbar .mm-member-mark {
    display: none;
  }

  .mm-member-header.is-toolbar .mm-member-title {
    font-size: 17px;
    line-height: 24px;
    text-align: center;
  }

  /* Bottom dock (App §38): near-black, neutral border. */
  body.dark-mode .mobile-bottom-nav {
    border-color: rgba(132, 158, 190, 0.12) !important;
    background: #060a10 !important;
  }

  /* Open sections: no cards, fine dividers. */
  .dashboard-section .ov-card,
  .dashboard-section .st-card,
  .dashboard-section .checkin-stats-card,
  .dashboard-section .points-redeem-card,
  .dashboard-section .points-history-card {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .dashboard-section .ov-stack {
    gap: 0 !important;
  }

  .mm-block-head,
  .mm-settings-head {
    display: flex !important;
    align-items: center;
    gap: 8px;
    height: 44px;
    margin-top: 16px;
  }

  .mm-block-head h2,
  .mm-settings-head h2,
  .dashboard-section .ov-row-title {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    line-height: 24px;
  }

  .dashboard-section .ov-row-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 16px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .dashboard-section .ov-row-head .ov-row-title::before {
    display: inline-block;
    width: 3px;
    height: 16px;
    margin-right: 8px;
    background: var(--accent);
    content: "";
    vertical-align: -2px;
  }

  .dashboard-section .ov-row-head > :last-child:not(:first-child) {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
  }

  .mm-help-dot {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0.8px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mm-help-dot::after {
    position: absolute;
    inset: -11px;
    content: "";
  }

  /* ---------- 會員總覽 (App §35) ---------- */
  [data-section="overview"] .ov-membership-hero,
  [data-section="overview"] #dailyCheckinPanel,
  [data-section="overview"] .ov-stack > .ov-row-head,
  [data-section="overview"] .ov-stack > .ov-metrics {
    display: none !important;
  }

  [data-section="overview"] .ov-console {
    display: block !important;
  }

  .mm-status-hero {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    margin: 0 calc(var(--mm-gutter) * -1);
    padding: 36px 24px 32px;
    border-bottom: 1px solid var(--mm-line-soft);
    text-align: center;
  }

  .mm-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1.4px;
    line-height: 18px;
  }

  .mm-plan-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
  }

  .mm-plan {
    color: var(--accent);
    font-size: 30px;
    font-weight: 800;
    line-height: 38px;
  }

  .mm-plan-chip {
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 12px;
    font-weight: 700;
  }

  .mm-plan-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 20px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 19px;
  }

  .mm-plan-meta b {
    color: var(--text);
    font-weight: 700;
  }

  .mm-plan-meta b.is-ok {
    color: var(--accent);
  }

  .mm-plan-meta b.is-warn {
    color: var(--mm-warn);
  }

  .mm-cta {
    display: flex;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    gap: 8px;
    height: 48px;
    margin: 24px 12px 0;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: var(--mm-ink);
  }

  .mm-cta b {
    font-size: 15px;
    font-weight: 800;
  }

  .mm-cta small {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.75;
  }

  .mm-text-link {
    min-height: 44px;
    margin-top: 12px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
  }

  .mm-today-points {
    display: block !important;
    margin-top: 16px;
  }

  .mm-today-points .mm-block-head {
    margin-top: 0;
  }

  .mm-balance-link {
    min-height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 13.5px;
    font-weight: 800;
  }

  .mm-point-intro,
  .mm-point-market {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 21px;
  }

  .mm-point-market {
    margin-bottom: 12px;
    color: var(--text);
    font-weight: 700;
  }

  .mm-point-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    border-top: 1px solid var(--mm-line-soft);
  }

  .mm-point-row.is-done {
    padding: 10px 0;
  }

  .mm-point-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
  }

  .mm-point-copy strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
  }

  .mm-point-copy small {
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
  }

  .mm-done-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
  }

  .mm-done-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
  }

  /* Low-saturation action pills: 10% fill, 22% border (App §35). */
  .mm-soft-pill {
    min-width: 88px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid;
    border-radius: 8px;
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 13.5px;
    font-weight: 800;
  }

  .mm-soft-pill small {
    font-family: "Noto Sans TC", sans-serif;
    font-size: 11px;
    font-weight: 500;
  }

  .mm-soft-pill.is-gold {
    border-color: color-mix(in srgb, var(--accent) 22%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    color: var(--accent);
  }

  .mm-soft-pill.is-up {
    border-color: color-mix(in srgb, var(--mm-up) 22%, transparent);
    background: color-mix(in srgb, var(--mm-up) 10%, transparent);
    color: var(--mm-up);
  }

  .mm-soft-pill.is-down {
    border-color: color-mix(in srgb, var(--mm-down) 22%, transparent);
    background: color-mix(in srgb, var(--mm-down) 10%, transparent);
    color: var(--mm-down);
  }

  .mm-soft-pill:disabled {
    opacity: 0.45;
  }

  .mm-point-latest {
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--mm-line-soft);
    color: var(--muted);
    font-size: 12.5px;
    line-height: 20px;
  }

  .mm-point-latest b {
    color: var(--text);
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-weight: 800;
  }

  /* 最新公告: open list with category colours (App §34). */
  [data-section="overview"] .ov-announce-item {
    padding: 15px 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--mm-line-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .announcement-tag {
    padding: 4px 10px !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-size: 12.5px !important;
    font-weight: 900 !important;
  }

  body.dark-mode .announcement-tag.system { background: rgba(159, 179, 204, 0.14) !important; color: #9fb3cc !important; }
  body.dark-mode .announcement-tag.data { background: rgba(111, 177, 255, 0.14) !important; color: #6fb1ff !important; }
  body.dark-mode .announcement-tag.billing { background: rgba(232, 182, 84, 0.14) !important; color: #e8b654 !important; }
  body.dark-mode .announcement-tag.maintenance { background: rgba(242, 161, 90, 0.14) !important; color: #f2a15a !important; }
  body.dark-mode .announcement-tag.event { background: rgba(184, 155, 255, 0.16) !important; color: #b89bff !important; }
  body:not(.dark-mode) .announcement-tag.system { background: rgba(91, 111, 138, 0.1) !important; color: #50647e !important; }
  body:not(.dark-mode) .announcement-tag.data { background: rgba(22, 114, 212, 0.1) !important; color: #1467c2 !important; }
  body:not(.dark-mode) .announcement-tag.billing { background: rgba(185, 113, 18, 0.12) !important; color: #865600 !important; }
  body:not(.dark-mode) .announcement-tag.maintenance { background: rgba(194, 87, 12, 0.1) !important; color: #a0460a !important; }
  body:not(.dark-mode) .announcement-tag.event { background: rgba(122, 79, 214, 0.1) !important; color: #6e45c8 !important; }

  /* ---------- 積分中心 (App §36) ---------- */
  [data-section="points"] .ov-stack {
    display: flex !important;
    flex-direction: column;
  }

  [data-section="points"] .ov-stack > .ov-metrics { order: 0; }
  [data-section="points"] .ov-stack > #pointsProRedeemCard { order: 1; }
  [data-section="points"] .ov-stack > .ov-card:not(.checkin-stats-card):not(.points-redeem-card):not(.points-history-card) { order: 2; }
  [data-section="points"] .ov-stack > .checkin-stats-card { order: 3; }
  [data-section="points"] .ov-stack > .points-history-card { order: 4; }

  [data-section="points"] .ov-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 calc(var(--mm-gutter) * -1);
    padding: 34px 8px 28px;
    border-bottom: 1px solid var(--mm-line-soft);
    gap: 0 !important;
  }

  [data-section="points"] .ov-metric {
    display: grid;
    justify-items: center;
    align-content: start;
    padding: 0 6px !important;
    border: 0 !important;
    border-left: 1px solid var(--mm-line-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center;
  }

  [data-section="points"] .ov-metric:first-child {
    grid-column: 1 / -1;
    margin-bottom: 22px;
    border-left: 0 !important;
  }

  [data-section="points"] .ov-metric:nth-child(2) {
    border-left: 0 !important;
  }

  [data-section="points"] .ov-metric .ov-label {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 17px;
  }

  [data-section="points"] .ov-metric strong {
    color: var(--text) !important;
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 16px !important;
    font-weight: 800;
    line-height: 22px;
  }

  [data-section="points"] .ov-metric:first-child .ov-label {
    font-size: 12px;
    letter-spacing: 1.4px;
  }

  [data-section="points"] .ov-metric:first-child strong {
    margin-top: 8px;
    font-size: 40px !important;
    line-height: 46px;
  }

  [data-section="points"] .ov-metric:first-child strong::after {
    color: var(--muted);
    font-family: "Noto Sans TC", sans-serif;
    font-size: 15px;
    font-weight: 700;
    content: " 點";
  }

  [data-section="points"] .ov-metric:last-child strong {
    color: var(--accent) !important;
  }

  /* 每日任務／Pro 兌換 as single open rows. */
  [data-section="points"] .ov-announce-item {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--mm-line-soft) !important;
    background: transparent !important;
  }

  [data-section="points"] .ov-announce-item .announcement-tag {
    display: none;
  }

  [data-section="points"] .ov-announce-item strong {
    flex: 1 1 auto;
    color: var(--text);
    font-size: 15px;
  }

  [data-section="points"] .pc-points {
    color: var(--accent);
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 15px;
    font-weight: 800;
  }

  #pointsProRedeemCard .points-redeem-layout {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    border-top: 1px solid var(--mm-line-soft);
  }

  #pointsProRedeemCard .points-redeem-copy .announcement-tag {
    display: none;
  }

  #pointsProRedeemCard .points-redeem-copy h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
  }

  #pointsProRedeemCard .points-redeem-copy p,
  #pointsProRedeemCard .points-redeem-balance-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
  }

  #pointsProRedeemCard .points-redeem-action {
    display: grid;
    justify-items: end;
    gap: 4px;
    margin-left: auto;
  }

  #pointsProRedeemCard .points-redeem-cost {
    display: none;
  }

  #pointsProRedeemCard #pointsProRedeemButton {
    min-width: 84px;
    height: 38px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent) !important;
    border-radius: 8px;
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
    box-shadow: none !important;
  }

  /* 猜盤戰績 */
  .checkin-stats-overview {
    display: block !important;
  }

  .checkin-stats-highlight {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 12px;
    padding: 12px 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--mm-line-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .checkin-stats-highlight > span {
    grid-row: 1 / 3;
    color: var(--muted);
    font-size: 13px;
    line-height: 21px;
  }

  .checkin-stats-highlight strong,
  .checkin-stats-highlight small {
    text-align: right;
  }

  .checkin-stats-highlight strong {
    color: var(--text);
    font-size: 14.5px;
    line-height: 21px;
  }

  .checkin-stats-highlight small {
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
  }

  .checkin-stats-metrics {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0 !important;
    border-top: 1px solid var(--mm-line-soft);
    border-bottom: 1px solid var(--mm-line-soft);
  }

  .checkin-stats-metric {
    display: grid !important;
    justify-items: center;
    padding: 12px 0 !important;
    border: 0 !important;
    border-left: 1px solid var(--mm-line-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .checkin-stats-metric:first-child {
    border-left: 0 !important;
  }

  .checkin-stats-metric span {
    color: var(--muted);
    font-size: 11.5px;
  }

  .checkin-stats-metric strong {
    color: var(--text);
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 17px;
    font-weight: 800;
  }

  .checkin-stats-head {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap;
  }

  .checkin-stats-row > * {
    grid-area: auto !important;
    grid-column: auto !important;
    grid-row: 1 !important;
  }

  .checkin-stats-head .checkin-stats-head-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }

  .checkin-stats-head .ov-row-title {
    text-align: left;
  }

  /* 最近紀錄: 目標日／方向／結果 columns (App §36-4). */
  .checkin-stats-list-head {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) 110px;
    align-items: center;
    min-height: 34px;
    margin-top: 16px;
    border-bottom: 1px solid var(--mm-line-soft);
    color: var(--muted);
    font-size: 11.5px;
  }

  .checkin-stats-list-head span:last-child {
    text-align: right;
  }

  .checkin-stats-row {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) 110px;
    align-items: center;
    min-height: 46px;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid var(--mm-line-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  .checkin-stats-row time {
    color: var(--muted);
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
  }

  .checkin-stats-row strong {
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
  }

  .checkin-stats-row .checkin-stats-result {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 700;
    text-align: right;
  }

  .checkin-stats-row .checkin-stats-result.is-won {
    color: var(--text);
  }

  /* 積分明細: open three-column table, no query form (App §36-5). */
  #pointsHistorySearchForm,
  #pointsHistorySearchSummary {
    display: none !important;
  }

  .mm-page-hidden {
    display: none !important;
  }

  .mm-pager:not([hidden]) {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
  }

  .mm-pager button {
    min-height: 44px;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 700;
  }

  .mm-pager button:disabled {
    color: var(--mm-faint);
  }

  .mm-pager span {
    color: var(--muted);
    font-family: "Manrope", "Noto Sans TC", sans-serif;
    font-size: 12.5px;
    font-weight: 700;
  }

  /* ---------- 設定 (App §38) ---------- */
  #settingsForm .st-card {
    display: flex !important;
    flex-direction: column;
  }

  .mm-settings-head {
    display: flex !important;
  }

  #settingsForm .st-row,
  .mm-settings-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    margin: 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--mm-line-soft) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text);
    text-align: left;
  }

  #settingsForm .st-icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--accent);
  }

  #settingsForm .st-icon svg {
    width: 22px !important;
    height: 22px !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }

  #settingsForm .st-copy {
    flex: 1 1 auto;
    min-width: 0;
  }

  #settingsForm .st-copy strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
  }

  #settingsForm .st-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
  }

  .mm-chevron {
    display: inline-grid;
    color: var(--mm-faint);
  }

  .mm-chevron svg {
    width: 18px !important;
    height: 18px !important;
  }

  #settingsForm .st-row {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
  }

  #settingsForm .st-row > .switch {
    flex: 0 0 auto;
    margin: 0 !important;
  }

  /* 顯示模式: 深色／淺色 segment instead of a switch. */
  .mm-theme-row .switch {
    display: none !important;
  }

  .mm-theme-row .st-copy p {
    font-size: 0 !important;
  }

  .mm-theme-row .st-copy p::after {
    font-size: 12px;
    content: attr(data-mm-short);
  }

  .mm-theme-seg {
    display: flex !important;
    flex: 0 0 132px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
  }

  .mm-theme-seg button {
    flex: 1 1 0;
    height: 32px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
  }

  .mm-theme-seg button.is-active {
    background: var(--accent);
    color: var(--mm-ink);
  }

  /* 支援 group and 登出 at the bottom of 設定. */
  body[data-mm-section="settings"] .mm-support,
  body[data-mm-section="settings"] .mm-logout {
    display: block !important;
  }

  .mm-support-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 8px 0;
    border: 0;
    border-top: 1px solid var(--mm-line-soft);
    background: transparent;
    color: var(--text);
    text-align: left;
    text-decoration: none;
  }

  .mm-support-row > svg:first-child {
    flex: 0 0 auto;
    color: var(--accent);
  }

  .mm-support-row > svg:last-child {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--mm-faint);
  }

  .mm-support-row span {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
  }

  .mm-support-row strong {
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
  }

  .mm-support-row small {
    color: var(--muted);
    font-size: 12px;
    line-height: 18px;
  }

  .mm-logout {
    margin-top: 28px;
    text-align: center;
  }

  .mm-logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
  }

  .mm-logout-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
  }

  /* Help bubble and policy sheet */
  .mm-member-help,
  .mm-member-sheet {
    position: fixed;
    inset: 0;
    z-index: 3000;
  }

  .mm-member-help-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
  }

  .mm-member-help .mm-member-help-backdrop {
    background: transparent;
  }

  .mm-member-help-card {
    position: absolute;
    right: 14px;
    left: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  }

  .mm-member-help-card h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 15px;
  }

  .mm-member-help-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 22px;
  }

  .mm-member-sheet-card {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 8px var(--mm-gutter) calc(20px + env(safe-area-inset-bottom, 0px));
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    background: var(--panel);
  }

  .mm-member-sheet-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
  }

  .mm-member-sheet-card header h2 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
  }

  .mm-member-sheet-card header button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-right: -12px;
    border: 0;
    background: transparent;
    color: var(--muted);
  }
}

/* 所有寬度：每日簽到確認／結果視窗跟隨淺色主題（原本兩種主題都是深色）。 */
/* Check-in confirm and result dialogs follow the light theme like the App (they were always dark). */
body:not(.dark-mode) .checkin-modal-card.is-game-result {
  border-color: rgba(12, 125, 242, 0.18);
  background:
    radial-gradient(circle at 82% 22%, rgba(12, 125, 242, 0.1), transparent 30%),
    linear-gradient(145deg, #ffffff 0%, #f4f8fc 100%);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(16, 34, 61, 0.18);
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .modal-close {
  background: rgba(16, 34, 61, 0.06);
  color: var(--text);
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-kicker,
body:not(.dark-mode) .checkin-result-accent {
  color: var(--accent);
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-kicker-icon {
  border-color: rgba(12, 125, 242, 0.18);
  background: rgba(12, 125, 242, 0.08);
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .modal-copy h3,
body:not(.dark-mode) .checkin-result-market,
body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-row strong {
  color: var(--text);
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-message,
body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-modal-detail,
body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-row {
  color: var(--muted);
}

body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-row {
  border-bottom-color: var(--mm-line-soft, rgba(16, 34, 61, 0.06));
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-reward {
  border-color: var(--line);
  background: rgba(16, 34, 61, 0.03);
  box-shadow: none;
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-modal-points {
  border-color: rgba(12, 125, 242, 0.45);
  background: radial-gradient(circle, rgba(12, 125, 242, 0.12) 0%, rgba(12, 125, 242, 0.03) 70%);
  color: var(--accent);
  box-shadow: none;
}

body:not(.dark-mode) .checkin-result-reward-points {
  color: var(--mm-down, #149d77);
}

body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-actions {
  border-top-color: var(--line);
  background: rgba(16, 34, 61, 0.03);
}

/* App §37: small-text primary buttons use the blue gradient with white text in light mode. */
body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-actions .primary-button,
body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-actions .primary-button:hover,
body:not(.dark-mode) .checkin-modal-card.is-game-result .checkin-result-actions .primary-button:focus-visible {
  background: linear-gradient(110deg, #0867c5 0%, #0d6bc8 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(12, 125, 242, 0.2);
}

body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-actions .secondary-button,
body:not(.dark-mode) #dailyCheckinModalResetButton {
  border-color: var(--line);
  background: #ffffff;
  color: var(--text);
}

body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-actions .secondary-button:hover,
body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-actions .secondary-button:focus-visible {
  border-color: rgba(12, 125, 242, 0.45);
  background: rgba(12, 125, 242, 0.06);
  color: var(--accent);
  outline-color: rgba(12, 125, 242, 0.25);
}

body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-row strong.is-trend-long {
  color: var(--mm-up, #d8485e);
}

body:not(.dark-mode) .checkin-modal-card.is-checkin-confirm .checkin-confirm-row strong.is-trend-short {
  color: var(--mm-down, #149d77);
}
