/*
 * Quiet Aurora — mobile foundation
 *
 * This file is intentionally an override layer. It keeps the existing DOM and
 * behaviour intact while replacing the visual foundation on phones and
 * touch-first tablets, including modern landscape iPad widths.
 * Content surfaces are opaque and calm; translucency is reserved for fixed
 * navigation and modal backdrops/sheets.
 */

.topbar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.topbar-actions .notification-bell {
  width: 36px;
  height: 36px;
  margin-top: 0;
}

html[data-theme^="glass-"] .bottom-tabs {
  grid-template-columns: repeat(2, minmax(120px, 220px));
}

html[data-theme^="glass-"] body.community-feature-disabled .bottom-tabs {
  display: none;
}

.topbar-icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.topbar-icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1024px), (max-width: 1366px) and (any-pointer: coarse) {
  html[data-theme^="glass-"] {
    color-scheme: light;
    --bg: #f4f7fa;
    --surface: #fbfcfd;
    --ink: #10202d;
    --muted: #647481;
    --line: #dde6eb;
    --primary: #267a8c;
    --primary-strong: #185f70;
    --coral: #cb769f;
    --gain-soft: #c8738d;
    --loss-soft: #4c99aa;
    --safe-bg: #f4f7fa;
    --shadow: 0 16px 44px rgba(28, 54, 68, 0.08);
    --glass-fill: rgba(250, 253, 255, 0.86);
    --glass-fill-strong: rgba(252, 254, 255, 0.94);
    --glass-stroke: rgba(108, 143, 158, 0.2);
    --glass-shadow: 0 18px 48px rgba(25, 48, 62, 0.14);
    --glass-shadow-soft: 0 10px 28px rgba(25, 48, 62, 0.09);

    --mobile-canvas: #f4f7fa;
    --mobile-surface: rgba(252, 253, 254, 0.96);
    --mobile-surface-solid: #fcfdfe;
    --mobile-surface-raised: #ffffff;
    --mobile-surface-subtle: #eef3f6;
    --mobile-control: #f2f6f8;
    --mobile-control-pressed: #e7eff2;
    --mobile-ink: #10202d;
    --mobile-ink-soft: #344956;
    --mobile-muted: #6a7a86;
    --mobile-faint: #8d9ba5;
    --mobile-line: #dde6eb;
    --mobile-line-strong: #ccd9df;
    --mobile-primary: #267a8c;
    --mobile-primary-strong: #185f70;
    --mobile-primary-soft: #e4f2f5;
    --mobile-primary-wash: rgba(78, 171, 190, 0.12);
    --mobile-rose: #c8739c;
    --mobile-rose-soft: #f7eaf0;
    --mobile-danger: #b84f5d;
    --mobile-danger-soft: #fbecee;
    --mobile-success: #357d6f;
    --mobile-success-soft: #e8f4f0;
    --mobile-warning: #9a6a26;
    --mobile-warning-soft: #fbf1dc;
    --mobile-overlay: rgba(7, 17, 25, 0.48);
    --mobile-shadow-card: 0 8px 28px rgba(24, 49, 63, 0.065), 0 1px 2px rgba(24, 49, 63, 0.04);
    --mobile-shadow-raised: 0 18px 52px rgba(16, 36, 49, 0.16), 0 2px 8px rgba(16, 36, 49, 0.06);
    --mobile-shadow-nav: 0 16px 44px rgba(13, 32, 44, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.82);
    --mobile-radius-sm: 12px;
    --mobile-radius-control: 14px;
    --mobile-radius-card: 20px;
    --mobile-radius-panel: 26px;
    --mobile-radius-sheet: 28px;
    --mobile-page-inline: clamp(14px, 4.2vw, 18px);
    --mobile-safe-top: max(12px, env(safe-area-inset-top, 0px));
    --mobile-safe-right: env(safe-area-inset-right, 0px);
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
    --mobile-safe-left: env(safe-area-inset-left, 0px);
    --mobile-nav-height: 66px;
    --bottom-tabs-height: var(--mobile-nav-height);
    --bottom-tabs-total-height: calc(var(--mobile-nav-height) + 16px + var(--mobile-safe-bottom));
    --bottom-tabs-rendered-height: var(--bottom-tabs-total-height);
    --content-top-gap: var(--mobile-safe-top);
    --content-bottom-gap: calc(28px + var(--mobile-safe-bottom));
    --modal-edge-gap: 0px;
    --modal-safe-top-gap: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
    --modal-safe-right-gap: env(safe-area-inset-right, 0px);
    --modal-safe-bottom-gap: env(safe-area-inset-bottom, 0px);
    --modal-safe-left-gap: env(safe-area-inset-left, 0px);
    --page-bg:
      radial-gradient(74% 30% at 2% 0%, rgba(211, 133, 173, 0.15) 0%, rgba(211, 133, 173, 0) 68%),
      radial-gradient(78% 34% at 100% 2%, rgba(81, 171, 193, 0.18) 0%, rgba(81, 171, 193, 0) 68%),
      linear-gradient(180deg, #f5f8fa 0%, #f2f6f8 32%, #f4f7fa 100%);
  }

  html[data-theme^="glass-"],
  html[data-theme^="glass-"] body {
    min-width: 320px;
    background-color: var(--mobile-canvas);
    color: var(--mobile-ink);
  }

  html[data-theme^="glass-"] {
    background-image: var(--page-bg);
    background-attachment: scroll;
  }

  html[data-theme^="glass-"] body {
    overflow-x: clip;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
  }

  html[data-theme^="glass-"] body::after {
    position: fixed;
    z-index: -1;
    inset: 0;
    background:
      radial-gradient(44% 22% at 18% 9%, rgba(218, 137, 177, 0.07), transparent 72%),
      radial-gradient(52% 25% at 88% 13%, rgba(86, 177, 198, 0.08), transparent 74%);
    content: "";
    pointer-events: none;
  }

  html[data-theme^="glass-"] .app-shell {
    width: 100%;
    max-width: none;
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0;
    padding:
      var(--content-top-gap)
      max(var(--mobile-page-inline), var(--mobile-safe-right))
      var(--content-bottom-gap)
      max(var(--mobile-page-inline), var(--mobile-safe-left));
  }

  html[data-theme^="glass-"] body.has-bottom-tabs .app-shell {
    padding-bottom: calc(104px + var(--mobile-safe-bottom));
  }

  html[data-theme^="glass-"] .dashboard,
  html[data-theme^="glass-"] .community-view,
  html[data-theme^="glass-"] .settings-view,
  html[data-theme^="glass-"] .capture-view {
    width: 100%;
    min-width: 0;
  }

  html[data-theme^="glass-"] .dashboard {
    gap: 18px;
  }

  html[data-theme^="glass-"] .community-view,
  html[data-theme^="glass-"] .capture-view {
    gap: 16px;
  }

  html[data-theme^="glass-"] .settings-view {
    gap: 20px;
  }

  /* Type hierarchy */
  html[data-theme^="glass-"] .eyebrow,
  html[data-theme^="glass-"] .settings-kicker,
  html[data-theme^="glass-"] .community-ranking-kicker,
  html[data-theme^="glass-"] .danger-kicker {
    margin-bottom: 5px;
    color: var(--mobile-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.35;
  }

  html[data-theme^="glass-"] .danger-kicker {
    color: var(--mobile-danger);
  }

  html[data-theme^="glass-"] .section-heading h2,
  html[data-theme^="glass-"] .settings-group h2,
  html[data-theme^="glass-"] .community-ranking h2 {
    color: var(--mobile-ink);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    text-shadow: none;
  }

  html[data-theme^="glass-"] .section-heading span,
  html[data-theme^="glass-"] .lead,
  html[data-theme^="glass-"] .form-message {
    color: var(--mobile-muted);
  }

  /* Compact application header */
  html[data-theme^="glass-"] .topbar,
  html[data-theme^="glass-"] .topbar.topbar-with-notification {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    gap: 12px;
    padding: 4px 2px 2px;
  }

  html[data-theme^="glass-"] .topbar > div,
  html[data-theme^="glass-"] .topbar-with-notification > div {
    min-width: 0;
  }

  html[data-theme^="glass-"] .topbar > div:first-child,
  html[data-theme^="glass-"] .topbar-with-notification > div:first-child {
    flex: 1 1 auto;
  }

  html[data-theme^="glass-"] .topbar .topbar-actions {
    flex: 0 0 auto;
    gap: 1px;
  }

  html[data-theme^="glass-"] .topbar h1,
  html[data-theme^="glass-"] .topbar .profile-title-row h1 {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--mobile-ink);
    font-size: clamp(25px, 7.4vw, 30px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -0.035em;
    text-overflow: ellipsis;
    text-shadow: none;
    white-space: nowrap;
  }

  html[data-theme^="glass-"] .topbar .eyebrow {
    margin-bottom: 2px;
  }

  html[data-theme^="glass-"] .profile-title-row {
    gap: 9px;
  }

  html[data-theme^="glass-"] .profile-avatar {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(74, 131, 149, 0.16);
    background: var(--mobile-primary-soft);
    box-shadow: none;
    color: var(--mobile-primary-strong);
    font-size: 15px;
  }

  html[data-theme^="glass-"] .topbar .topbar-icon-button,
  html[data-theme^="glass-"] .topbar .topbar-icon-button:hover:not(:disabled),
  html[data-theme^="glass-"] .topbar .topbar-icon-button:focus-visible,
  html[data-theme^="glass-"] .topbar .topbar-icon-button:active:not(:disabled),
  html[data-theme^="glass-"] .topbar .notification-bell,
  html[data-theme^="glass-"] .topbar .notification-bell:hover:not(:disabled),
  html[data-theme^="glass-"] .topbar .notification-bell:focus-visible,
  html[data-theme^="glass-"] .topbar .notification-bell:active:not(:disabled) {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    display: inline-grid;
    place-items: center;
    margin: 0;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: transparent;
    color: var(--mobile-ink-soft);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: none;
  }

  html[data-theme^="glass-"] .topbar .topbar-icon-button:active:not(:disabled),
  html[data-theme^="glass-"] .topbar .notification-bell:active:not(:disabled) {
    background: transparent;
    opacity: 0.62;
    transform: scale(0.96);
  }

  html[data-theme^="glass-"] .topbar .topbar-icon-button svg,
  html[data-theme^="glass-"] .topbar .notification-bell svg {
    width: 22px;
    height: 22px;
  }

  html[data-theme^="glass-"] .notification-bell-dot {
    top: 8px;
    right: 7px;
    border-color: var(--mobile-surface-solid);
  }

  /* Matte content surfaces */
  html[data-theme^="glass-"] .login-panel,
  html[data-theme^="glass-"] .history-section,
  html[data-theme^="glass-"] .community-share-panel,
  html[data-theme^="glass-"] .community-card,
  html[data-theme^="glass-"] .ranking-item,
  html[data-theme^="glass-"] .account-management-entry,
  html[data-theme^="glass-"] .account-profile-card,
  html[data-theme^="glass-"] .account-binding-card,
  html[data-theme^="glass-"] .passkey-card,
  html[data-theme^="glass-"] .native-health-card,
  html[data-theme^="glass-"] .chart-card,
  html[data-theme^="glass-"] .calendar-card,
  html[data-theme^="glass-"] .timeline-card,
  html[data-theme^="glass-"] .record-card,
  html[data-theme^="glass-"] .food-history-card,
  html[data-theme^="glass-"] .capture-panel,
  html[data-theme^="glass-"] .weight-calendar,
  html[data-theme^="glass-"] .weight-goal-chart {
    border: 1px solid var(--mobile-line);
    border-radius: var(--mobile-radius-card);
    background: var(--mobile-surface);
    color: var(--mobile-ink);
    box-shadow: var(--mobile-shadow-card);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] .weight-chart,
  html[data-theme^="glass-"] .calendar-grid,
  html[data-theme^="glass-"] .native-health-grid,
  html[data-theme^="glass-"] .ai-summary-output,
  html[data-theme^="glass-"] .account-overview-fields > span,
  html[data-theme^="glass-"] .account-profile-readonly,
  html[data-theme^="glass-"] .privacy-audit-summary,
  html[data-theme^="glass-"] .food-selection-item,
  html[data-theme^="glass-"] .food-selection-summary {
    border-color: var(--mobile-line);
    background: var(--mobile-surface-subtle);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] .chart-section,
  html[data-theme^="glass-"] .food-record-panel {
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] .community-content-tabs,
  html[data-theme^="glass-"] .ranking-periods {
    border: 1px solid var(--mobile-line);
    border-radius: 15px;
    background: var(--mobile-control);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] .community-content-tab.is-active,
  html[data-theme^="glass-"] .community-content-tab.is-active:hover:not(:disabled),
  html[data-theme^="glass-"] .community-content-tab.is-active:focus-visible,
  html[data-theme^="glass-"] .ranking-period.is-active,
  html[data-theme^="glass-"] .ranking-period.is-active:hover:not(:disabled),
  html[data-theme^="glass-"] .ranking-period.is-active:focus-visible {
    border-color: var(--mobile-line-strong);
    border-radius: 11px;
    background: var(--mobile-surface-raised);
    color: var(--mobile-primary-strong);
    box-shadow: 0 3px 10px rgba(23, 47, 60, 0.07);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* Buttons and fields */
  html[data-theme^="glass-"] body button {
    min-height: 46px;
    border: 1px solid rgba(18, 92, 108, 0.12);
    border-radius: var(--mobile-radius-control);
    padding: 0 16px;
    background: var(--mobile-primary);
    color: #ffffff;
    box-shadow: 0 7px 18px rgba(38, 122, 140, 0.16);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-weight: 650;
    transition: background-color 170ms ease, border-color 170ms ease, color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
  }

  html[data-theme^="glass-"] body button:hover:not(:disabled),
  html[data-theme^="glass-"] body button:focus-visible {
    border-color: rgba(18, 92, 108, 0.18);
    background: var(--mobile-primary-strong);
    color: #ffffff;
    box-shadow: 0 9px 22px rgba(38, 122, 140, 0.2);
    transform: none;
  }

  html[data-theme^="glass-"] body button:active:not(:disabled) {
    background: #155565;
    box-shadow: 0 4px 12px rgba(38, 122, 140, 0.14);
    transform: scale(0.975);
  }

  html[data-theme^="glass-"] body button:disabled {
    opacity: 0.44;
    box-shadow: none;
  }

  html[data-theme^="glass-"] .record-entry-button,
  html[data-theme^="glass-"] .ai-advice-button,
  html[data-theme^="glass-"] .replay-launch-button,
  html[data-theme^="glass-"] .settings-option-button {
    border-color: var(--mobile-line);
    background: var(--mobile-surface-raised);
    color: var(--mobile-ink);
    box-shadow: var(--mobile-shadow-card);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] .record-entry-button:hover:not(:disabled),
  html[data-theme^="glass-"] .record-entry-button:focus-visible,
  html[data-theme^="glass-"] .ai-advice-button:hover:not(:disabled),
  html[data-theme^="glass-"] .ai-advice-button:focus-visible,
  html[data-theme^="glass-"] .replay-launch-button:hover:not(:disabled),
  html[data-theme^="glass-"] .replay-launch-button:focus-visible,
  html[data-theme^="glass-"] .settings-option-button:hover:not(:disabled),
  html[data-theme^="glass-"] .settings-option-button:focus-visible {
    border-color: var(--mobile-line-strong);
    background: var(--mobile-control);
    color: var(--mobile-ink);
    box-shadow: var(--mobile-shadow-card);
    transform: none;
  }

  html[data-theme^="glass-"] .record-entry-button:active:not(:disabled),
  html[data-theme^="glass-"] .ai-advice-button:active:not(:disabled),
  html[data-theme^="glass-"] .replay-launch-button:active:not(:disabled),
  html[data-theme^="glass-"] .settings-option-button:active:not(:disabled) {
    background: var(--mobile-control-pressed);
    box-shadow: none;
    transform: scale(0.985);
  }

  html[data-theme^="glass-"] .secondary-button,
  html[data-theme^="glass-"] .ghost-button,
  html[data-theme^="glass-"] .profile-action-button,
  html[data-theme^="glass-"] .history-toggle-button,
  html[data-theme^="glass-"] .settings-back-button,
  html[data-theme^="glass-"] .settings-logout-button,
  html[data-theme^="glass-"] .food-selection-manual-button,
  html[data-theme^="glass-"] .modal-icon-button,
  html[data-theme^="glass-"] .notification-mark-read,
  html[data-theme^="glass-"] .notification-close,
  html[data-theme^="glass-"] .community-detail-close,
  html[data-theme^="glass-"] .community-comments-close,
  html[data-theme^="glass-"] .ai-summary-close,
  html[data-theme^="glass-"] .image-preview-close {
    border-color: var(--mobile-line);
    background: var(--mobile-control);
    color: var(--mobile-ink-soft);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] .secondary-button:hover:not(:disabled),
  html[data-theme^="glass-"] .ghost-button:hover:not(:disabled),
  html[data-theme^="glass-"] .profile-action-button:hover:not(:disabled),
  html[data-theme^="glass-"] .history-toggle-button:hover:not(:disabled),
  html[data-theme^="glass-"] .settings-back-button:hover:not(:disabled),
  html[data-theme^="glass-"] .settings-logout-button:hover:not(:disabled),
  html[data-theme^="glass-"] .food-selection-manual-button:hover:not(:disabled),
  html[data-theme^="glass-"] .modal-icon-button:hover:not(:disabled),
  html[data-theme^="glass-"] .notification-mark-read:hover:not(:disabled),
  html[data-theme^="glass-"] .notification-close:hover:not(:disabled),
  html[data-theme^="glass-"] .community-detail-close:hover:not(:disabled),
  html[data-theme^="glass-"] .community-comments-close:hover:not(:disabled),
  html[data-theme^="glass-"] .ai-summary-close:hover:not(:disabled),
  html[data-theme^="glass-"] .image-preview-close:hover:not(:disabled) {
    border-color: var(--mobile-line-strong);
    background: var(--mobile-control-pressed);
    color: var(--mobile-ink);
    box-shadow: none;
  }

  html[data-theme^="glass-"] .danger-confirm-button,
  html[data-theme^="glass-"] .withdraw-button,
  html[data-theme^="glass-"] .account-delete-button {
    border-color: rgba(184, 79, 93, 0.18);
    background: var(--mobile-danger-soft);
    color: var(--mobile-danger);
    box-shadow: none;
  }

  html[data-theme^="glass-"] .danger-confirm-button:hover:not(:disabled),
  html[data-theme^="glass-"] .withdraw-button:hover:not(:disabled),
  html[data-theme^="glass-"] .account-delete-button:hover:not(:disabled) {
    border-color: rgba(184, 79, 93, 0.26);
    background: #f7dfe3;
    color: #9f3f4c;
    box-shadow: none;
  }

  html[data-theme^="glass-"] .footer-policy-link,
  html[data-theme^="glass-"] .footer-policy-link:hover:not(:disabled),
  html[data-theme^="glass-"] .footer-policy-link:focus-visible,
  html[data-theme^="glass-"] .footer-policy-link:active:not(:disabled),
  html[data-theme^="glass-"] .consent-document-row button,
  html[data-theme^="glass-"] .consent-document-row button:hover:not(:disabled),
  html[data-theme^="glass-"] .consent-document-row button:focus-visible,
  html[data-theme^="glass-"] .consent-document-row button:active:not(:disabled),
  html[data-theme^="glass-"] .copy-phrase-button {
    border: 0;
    background: transparent;
    color: var(--mobile-primary);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  html[data-theme^="glass-"] select,
  html[data-theme^="glass-"] textarea {
    min-height: 48px;
    border: 1px solid var(--mobile-line-strong);
    border-radius: var(--mobile-radius-control);
    padding-inline: 14px;
    background: var(--mobile-surface-raised);
    color: var(--mobile-ink);
    box-shadow: 0 1px 2px rgba(24, 49, 63, 0.035);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-size: 16px;
  }

  html[data-theme^="glass-"] textarea {
    min-height: 112px;
    padding-block: 12px;
  }

  html[data-theme^="glass-"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"])::placeholder,
  html[data-theme^="glass-"] textarea::placeholder {
    color: var(--mobile-faint);
    opacity: 1;
  }

  html[data-theme^="glass-"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
  html[data-theme^="glass-"] select:focus,
  html[data-theme^="glass-"] textarea:focus {
    border-color: rgba(38, 122, 140, 0.58);
    background: var(--mobile-surface-raised);
    box-shadow: 0 0 0 3px rgba(38, 122, 140, 0.12);
  }

  /* Login */
  html[data-theme^="glass-"] .login-view {
    width: 100%;
    min-height: calc(100dvh - var(--mobile-safe-top) - 118px);
    display: grid;
    align-content: center;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 22px;
    padding: clamp(18px, 6vh, 52px) 0 12px;
  }

  html[data-theme^="glass-"] .login-copy {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  html[data-theme^="glass-"] .login-copy::before {
    width: 66px;
    height: 66px;
    display: block;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 22px;
    background: url("../icon-192.png") center / cover no-repeat;
    box-shadow: 0 18px 38px rgba(72, 128, 147, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.68);
    content: "";
    transform: none;
  }

  html[data-theme^="glass-"] .login-copy .eyebrow {
    margin-bottom: 7px;
    color: var(--mobile-primary);
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  html[data-theme^="glass-"] .login-copy h1 {
    margin: 0;
    color: var(--mobile-ink);
    font-size: clamp(36px, 11vw, 46px);
    font-weight: 720;
    line-height: 1.08;
    letter-spacing: -0.055em;
    text-shadow: none;
  }

  html[data-theme^="glass-"] .login-panel,
  html[data-theme^="glass-"] .qq-only-login-panel {
    width: 100%;
    max-width: 430px;
    min-height: 0;
    justify-self: center;
    border-color: rgba(205, 219, 226, 0.9);
    border-radius: var(--mobile-radius-panel);
    padding: 14px;
    background: rgba(252, 253, 254, 0.96);
    box-shadow: var(--mobile-shadow-raised);
  }

  html[data-theme^="glass-"] .login-options {
    gap: 9px;
  }

  html[data-theme^="glass-"] .login-options .apple-login-entry,
  html[data-theme^="glass-"] .login-options .huawei-login-entry,
  html[data-theme^="glass-"] .login-options .qq-login-entry,
  html[data-theme^="glass-"] .login-options .passkey-login-entry,
  html[data-theme^="glass-"] .login-options .test-login-entry {
    min-height: 52px;
    border-radius: 16px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 650;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  html[data-theme^="glass-"] .login-options .apple-login-entry,
  html[data-theme^="glass-"] .login-options .apple-login-entry:visited,
  html[data-theme^="glass-"] .login-options .apple-login-entry:focus,
  html[data-theme^="glass-"] .login-options .apple-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .apple-login-entry:hover:not(:disabled) {
    border-color: #101820;
    background: #101820;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(16, 24, 32, 0.14);
  }

  html[data-theme^="glass-"] .login-options .qq-login-entry,
  html[data-theme^="glass-"] .login-options .qq-login-entry:visited,
  html[data-theme^="glass-"] .login-options .qq-login-entry:focus,
  html[data-theme^="glass-"] .login-options .qq-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .qq-login-entry:hover {
    border-color: #dce6eb;
    background: #ffffff;
    color: #2779a9;
    box-shadow: none;
  }

  html[data-theme^="glass-"] .login-options .huawei-login-entry,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:focus,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:hover:not(:disabled) {
    border-color: #f0d9dd;
    background: #fffafb;
    color: #bd2035;
    box-shadow: none;
  }

  html[data-theme^="glass-"] .login-options .passkey-login-entry,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:focus,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:hover:not(:disabled),
  html[data-theme^="glass-"] .login-options .passkey-login-entry[aria-busy="true"] {
    border-color: #cfe2e7;
    background: var(--mobile-primary-soft);
    color: var(--mobile-primary-strong);
    box-shadow: none;
  }

  html[data-theme^="glass-"] #loginMessage {
    grid-column: 1;
    width: min(100%, 420px);
    min-height: 22px;
    justify-self: center;
    margin: -8px 0 0;
    font-size: 13px;
    line-height: 1.5;
  }

  html[data-theme^="glass-"] .site-footer {
    gap: 3px 10px;
    border-top-color: rgba(110, 139, 153, 0.14);
    padding: 16px 4px max(4px, var(--mobile-safe-bottom));
    color: var(--mobile-faint);
    font-size: 11px;
  }

  /* Floating glass navigation — the intentional glass surface */
  html[data-theme^="glass-"] .bottom-tabs {
    z-index: 1100;
    right: max(10px, var(--mobile-safe-right));
    bottom: max(8px, var(--mobile-safe-bottom));
    left: max(10px, var(--mobile-safe-left));
    width: auto;
    height: var(--mobile-nav-height);
    min-height: var(--mobile-nav-height);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 3px;
    border: 1px solid rgba(139, 165, 177, 0.24);
    border-radius: 22px;
    padding: 5px;
    background: rgba(248, 252, 253, 0.82);
    box-shadow: var(--mobile-shadow-nav);
    -webkit-backdrop-filter: blur(24px) saturate(1.22);
    backdrop-filter: blur(24px) saturate(1.22);
    contain: layout paint;
  }

  html[data-theme^="glass-"] .bottom-tabs::before {
    display: none;
  }

  html[data-theme^="glass-"] body.community-feature-disabled .bottom-tabs {
    display: none;
  }

  html[data-theme^="glass-"] .bottom-tab,
  html[data-theme^="glass-"] .bottom-tab:hover:not(:disabled),
  html[data-theme^="glass-"] .bottom-tab:focus-visible,
  html[data-theme^="glass-"] .bottom-tab:active:not(:disabled),
  html[data-theme^="glass-"] .bottom-tab.is-active,
  html[data-theme^="glass-"] .bottom-tab.is-active:hover:not(:disabled),
  html[data-theme^="glass-"] .bottom-tab.is-active:focus-visible {
    width: 100%;
    height: 56px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    border: 0;
    border-radius: 17px;
    padding: 4px 8px;
    background: transparent;
    color: var(--mobile-muted);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    transform: none;
  }

  html[data-theme^="glass-"] .bottom-tab.is-active,
  html[data-theme^="glass-"] .bottom-tab.is-active:hover:not(:disabled),
  html[data-theme^="glass-"] .bottom-tab.is-active:focus-visible {
    background: rgba(67, 151, 170, 0.12);
    color: var(--mobile-primary-strong);
  }

  html[data-theme^="glass-"] .bottom-tab:active:not(:disabled) {
    background: rgba(67, 151, 170, 0.09);
    transform: scale(0.96);
  }

  html[data-theme^="glass-"] .bottom-tab.is-active::before {
    display: none;
  }

  html[data-theme^="glass-"] .bottom-tab svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.75;
  }

  /* Unified mobile modal / bottom sheet */
  html[data-theme^="glass-"] .consent-backdrop,
  html[data-theme^="glass-"] .policy-backdrop,
  html[data-theme^="glass-"] .notification-backdrop,
  html[data-theme^="glass-"] .ai-summary-backdrop,
  html[data-theme^="glass-"] .community-detail-backdrop,
  html[data-theme^="glass-"] .community-comments-backdrop {
    align-items: flex-end;
    justify-content: center;
    padding: var(--modal-safe-top-gap) 0 0;
  }

  html[data-theme^="glass-"] .consent-backdrop.is-open,
  html[data-theme^="glass-"] .policy-backdrop.is-open,
  html[data-theme^="glass-"] .notification-backdrop.is-open,
  html[data-theme^="glass-"] .ai-summary-backdrop.is-open,
  html[data-theme^="glass-"] .community-detail-backdrop.is-open,
  html[data-theme^="glass-"] .community-comments-backdrop.is-open {
    background: var(--mobile-overlay);
    -webkit-backdrop-filter: blur(9px) saturate(0.9);
    backdrop-filter: blur(9px) saturate(0.9);
  }

  html[data-theme^="glass-"] .consent-dialog,
  html[data-theme^="glass-"] .profile-edit-dialog,
  html[data-theme^="glass-"] .confirmation-dialog,
  html[data-theme^="glass-"] .action-confirm-dialog,
  html[data-theme^="glass-"] .feedback-dialog,
  html[data-theme^="glass-"] .food-selection-dialog,
  html[data-theme^="glass-"] .manual-food-dialog,
  html[data-theme^="glass-"] .quick-weight-dialog,
  html[data-theme^="glass-"] .policy-panel,
  html[data-theme^="glass-"] .notification-panel,
  html[data-theme^="glass-"] .ai-summary-panel,
  html[data-theme^="glass-"] .community-detail-panel,
  html[data-theme^="glass-"] .community-comments-panel {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - var(--modal-safe-top-gap));
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-bottom: 0;
    border-radius: var(--mobile-radius-sheet) var(--mobile-radius-sheet) 0 0;
    background: rgba(250, 252, 253, 0.965);
    color: var(--mobile-ink);
    box-shadow: 0 -18px 60px rgba(5, 20, 29, 0.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.12);
    backdrop-filter: blur(24px) saturate(1.12);
  }

  html[data-theme^="glass-"] .consent-dialog,
  html[data-theme^="glass-"] .profile-edit-dialog,
  html[data-theme^="glass-"] .confirmation-dialog,
  html[data-theme^="glass-"] .action-confirm-dialog,
  html[data-theme^="glass-"] .feedback-dialog,
  html[data-theme^="glass-"] .food-selection-dialog,
  html[data-theme^="glass-"] .manual-food-dialog,
  html[data-theme^="glass-"] .quick-weight-dialog {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 30px var(--mobile-page-inline) calc(20px + var(--mobile-safe-bottom));
  }

  html[data-theme^="glass-"] .consent-dialog::before,
  html[data-theme^="glass-"] .profile-edit-dialog::before,
  html[data-theme^="glass-"] .confirmation-dialog::before,
  html[data-theme^="glass-"] .action-confirm-dialog::before,
  html[data-theme^="glass-"] .feedback-dialog::before,
  html[data-theme^="glass-"] .food-selection-dialog::before,
  html[data-theme^="glass-"] .manual-food-dialog::before,
  html[data-theme^="glass-"] .quick-weight-dialog::before,
  html[data-theme^="glass-"] .policy-panel::before,
  html[data-theme^="glass-"] .notification-panel::before,
  html[data-theme^="glass-"] .ai-summary-panel::before,
  html[data-theme^="glass-"] .community-detail-panel::before,
  html[data-theme^="glass-"] .community-comments-panel::before {
    position: absolute;
    z-index: 3;
    top: 9px;
    left: 50%;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: rgba(88, 112, 124, 0.28);
    content: "";
    pointer-events: none;
    transform: translateX(-50%);
  }

  html[data-theme^="glass-"] .policy-panel,
  html[data-theme^="glass-"] .notification-panel,
  html[data-theme^="glass-"] .ai-summary-panel,
  html[data-theme^="glass-"] .community-detail-panel,
  html[data-theme^="glass-"] .community-comments-panel {
    height: min(88dvh, 760px);
    min-height: 0;
    overflow: hidden;
  }

  html[data-theme^="glass-"] .community-comments-panel {
    height: calc(100dvh - var(--modal-safe-top-gap));
  }

  html[data-theme^="glass-"] .policy-header,
  html[data-theme^="glass-"] .notification-header,
  html[data-theme^="glass-"] .ai-summary-header,
  html[data-theme^="glass-"] .community-detail-header,
  html[data-theme^="glass-"] .community-comments-modal-header {
    min-height: 76px;
    padding: 25px var(--mobile-page-inline) 12px;
    border-bottom: 1px solid var(--mobile-line);
    background: rgba(250, 252, 253, 0.94);
  }

  html[data-theme^="glass-"] .policy-header h2,
  html[data-theme^="glass-"] .notification-header h2,
  html[data-theme^="glass-"] .ai-summary-header h2,
  html[data-theme^="glass-"] .community-detail-header h2,
  html[data-theme^="glass-"] .community-comments-modal-header h2 {
    color: var(--mobile-ink);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  html[data-theme^="glass-"] .policy-content,
  html[data-theme^="glass-"] .notification-content,
  html[data-theme^="glass-"] .ai-summary-content,
  html[data-theme^="glass-"] .community-detail-content,
  html[data-theme^="glass-"] .community-comments-content {
    background: transparent;
  }

  html[data-theme^="glass-"] .consent-actions {
    gap: 9px;
  }

  html[data-theme^="glass-"] .consent-actions > * {
    min-width: 0;
  }

}

@media (max-width: 360px) {
  html[data-theme^="glass-"] {
    --mobile-page-inline: 14px;
    --mobile-radius-card: 18px;
    --mobile-radius-panel: 22px;
  }

  html[data-theme^="glass-"] .topbar h1,
  html[data-theme^="glass-"] .topbar .profile-title-row h1 {
    font-size: 24px;
  }

  html[data-theme^="glass-"] .login-copy::before {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 19px;
  }

  html[data-theme^="glass-"] .login-copy h1 {
    font-size: 34px;
  }

  html[data-theme^="glass-"] .login-view {
    gap: 18px;
    padding-top: 14px;
  }

  html[data-theme^="glass-"] .login-panel,
  html[data-theme^="glass-"] .qq-only-login-panel {
    padding: 11px;
  }

  html[data-theme^="glass-"] .bottom-tabs {
    right: max(7px, var(--mobile-safe-right));
    left: max(7px, var(--mobile-safe-left));
  }
}

@media (max-width: 1024px) and (prefers-color-scheme: dark),
  (max-width: 1366px) and (any-pointer: coarse) and (prefers-color-scheme: dark) {
  html[data-theme^="glass-"] {
    color-scheme: dark;
    --bg: #09131c;
    --surface: #111d27;
    --ink: #eef5f7;
    --muted: #9bacb7;
    --line: #263641;
    --primary: #6bc3d4;
    --primary-strong: #9adce8;
    --coral: #de94b7;
    --safe-bg: #09131c;
    --shadow: 0 18px 52px rgba(0, 0, 0, 0.28);

    --mobile-canvas: #09131c;
    --mobile-surface: rgba(17, 29, 39, 0.97);
    --mobile-surface-solid: #111d27;
    --mobile-surface-raised: #162530;
    --mobile-surface-subtle: #0d1922;
    --mobile-control: #172630;
    --mobile-control-pressed: #20333f;
    --mobile-ink: #eef5f7;
    --mobile-ink-soft: #d3e0e5;
    --mobile-muted: #9bacb7;
    --mobile-faint: #738793;
    --mobile-line: #263641;
    --mobile-line-strong: #344853;
    --mobile-primary: #6bc3d4;
    --mobile-primary-strong: #9adce8;
    --mobile-primary-soft: #15323b;
    --mobile-primary-wash: rgba(107, 195, 212, 0.13);
    --mobile-rose: #df95b8;
    --mobile-rose-soft: #32232f;
    --mobile-danger: #ff9ba9;
    --mobile-danger-soft: #321f26;
    --mobile-success: #83c8b7;
    --mobile-success-soft: #153027;
    --mobile-warning: #e2b96f;
    --mobile-warning-soft: #302918;
    --mobile-overlay: rgba(0, 6, 10, 0.7);
    --mobile-shadow-card: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    --mobile-shadow-raised: 0 20px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    --mobile-shadow-nav: 0 20px 52px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.09);
    --glass-fill: rgba(17, 29, 39, 0.88);
    --glass-fill-strong: rgba(20, 34, 45, 0.94);
    --glass-stroke: rgba(255, 255, 255, 0.1);
    --page-bg:
      radial-gradient(78% 32% at 0% 0%, rgba(157, 74, 118, 0.16) 0%, rgba(157, 74, 118, 0) 70%),
      radial-gradient(82% 36% at 100% 2%, rgba(42, 132, 153, 0.18) 0%, rgba(42, 132, 153, 0) 72%),
      linear-gradient(180deg, #0b1620 0%, #09131c 42%, #08121a 100%);
  }

  html[data-theme^="glass-"],
  html[data-theme^="glass-"] body {
    background-color: var(--mobile-canvas);
  }

  html[data-theme^="glass-"] body::after {
    background:
      radial-gradient(44% 22% at 18% 9%, rgba(216, 120, 167, 0.05), transparent 72%),
      radial-gradient(52% 25% at 88% 13%, rgba(87, 188, 210, 0.06), transparent 74%);
  }

  html[data-theme^="glass-"] .login-panel,
  html[data-theme^="glass-"] .history-section,
  html[data-theme^="glass-"] .community-share-panel,
  html[data-theme^="glass-"] .community-card,
  html[data-theme^="glass-"] .ranking-item,
  html[data-theme^="glass-"] .account-management-entry,
  html[data-theme^="glass-"] .account-profile-card,
  html[data-theme^="glass-"] .account-binding-card,
  html[data-theme^="glass-"] .passkey-card,
  html[data-theme^="glass-"] .native-health-card,
  html[data-theme^="glass-"] .chart-card,
  html[data-theme^="glass-"] .calendar-card,
  html[data-theme^="glass-"] .timeline-card,
  html[data-theme^="glass-"] .record-card,
  html[data-theme^="glass-"] .food-history-card,
  html[data-theme^="glass-"] .capture-panel,
  html[data-theme^="glass-"] .weight-calendar,
  html[data-theme^="glass-"] .weight-goal-chart {
    border-color: var(--mobile-line);
    background: var(--mobile-surface);
    color: var(--mobile-ink);
    box-shadow: var(--mobile-shadow-card);
  }

  html[data-theme^="glass-"] .topbar .topbar-icon-button,
  html[data-theme^="glass-"] .topbar .topbar-icon-button:hover:not(:disabled),
  html[data-theme^="glass-"] .topbar .topbar-icon-button:focus-visible,
  html[data-theme^="glass-"] .topbar .topbar-icon-button:active:not(:disabled),
  html[data-theme^="glass-"] .topbar .notification-bell,
  html[data-theme^="glass-"] .topbar .notification-bell:hover:not(:disabled),
  html[data-theme^="glass-"] .topbar .notification-bell:focus-visible,
  html[data-theme^="glass-"] .topbar .notification-bell:active:not(:disabled) {
    border-color: transparent;
    background: transparent;
    color: var(--mobile-ink-soft);
    box-shadow: none;
  }

  html[data-theme^="glass-"] body button {
    border-color: rgba(107, 195, 212, 0.2);
    background: #347f90;
    color: #f7fcfd;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  }

  html[data-theme^="glass-"] body button:hover:not(:disabled),
  html[data-theme^="glass-"] body button:focus-visible {
    border-color: rgba(154, 220, 232, 0.3);
    background: #3c8c9e;
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  }

  html[data-theme^="glass-"] body button:active:not(:disabled) {
    background: #2d7282;
  }

  html[data-theme^="glass-"] .secondary-button,
  html[data-theme^="glass-"] .ghost-button,
  html[data-theme^="glass-"] .profile-action-button,
  html[data-theme^="glass-"] .history-toggle-button,
  html[data-theme^="glass-"] .settings-back-button,
  html[data-theme^="glass-"] .settings-logout-button,
  html[data-theme^="glass-"] .food-selection-manual-button,
  html[data-theme^="glass-"] .modal-icon-button,
  html[data-theme^="glass-"] .notification-mark-read,
  html[data-theme^="glass-"] .notification-close,
  html[data-theme^="glass-"] .community-detail-close,
  html[data-theme^="glass-"] .community-comments-close,
  html[data-theme^="glass-"] .ai-summary-close,
  html[data-theme^="glass-"] .image-preview-close {
    border-color: var(--mobile-line);
    background: var(--mobile-control);
    color: var(--mobile-ink-soft);
    box-shadow: none;
  }

  html[data-theme^="glass-"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  html[data-theme^="glass-"] select,
  html[data-theme^="glass-"] textarea {
    border-color: var(--mobile-line-strong);
    background: #0d1922;
    color: var(--mobile-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  }

  html[data-theme^="glass-"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
  html[data-theme^="glass-"] select:focus,
  html[data-theme^="glass-"] textarea:focus {
    border-color: rgba(107, 195, 212, 0.56);
    background: #101e28;
    box-shadow: 0 0 0 3px rgba(107, 195, 212, 0.12);
  }

  html[data-theme^="glass-"] .login-copy::before {
    border-color: rgba(255, 255, 255, 0.12);
    background: url("../icon-192.png") center / cover no-repeat;
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  html[data-theme^="glass-"] .login-panel,
  html[data-theme^="glass-"] .qq-only-login-panel {
    border-color: var(--mobile-line);
    background: rgba(17, 29, 39, 0.965);
  }

  html[data-theme^="glass-"] .login-options .apple-login-entry,
  html[data-theme^="glass-"] .login-options .apple-login-entry:visited,
  html[data-theme^="glass-"] .login-options .apple-login-entry:focus,
  html[data-theme^="glass-"] .login-options .apple-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .apple-login-entry:hover:not(:disabled) {
    border-color: #34434d;
    background: #050a0e;
    color: #f8fbfc;
    box-shadow: none;
  }

  html[data-theme^="glass-"] .login-options .qq-login-entry,
  html[data-theme^="glass-"] .login-options .qq-login-entry:visited,
  html[data-theme^="glass-"] .login-options .qq-login-entry:focus,
  html[data-theme^="glass-"] .login-options .qq-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .qq-login-entry:hover,
  html[data-theme^="glass-"] .login-options .huawei-login-entry,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:focus,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:hover:not(:disabled),
  html[data-theme^="glass-"] .login-options .passkey-login-entry,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:focus,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:hover:not(:disabled),
  html[data-theme^="glass-"] .login-options .passkey-login-entry[aria-busy="true"] {
    border-color: var(--mobile-line);
    background: var(--mobile-control);
    color: var(--mobile-ink-soft);
    box-shadow: none;
  }

  html[data-theme^="glass-"] .login-options .huawei-login-entry,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:focus,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .huawei-login-entry:hover:not(:disabled) {
    color: #ff9baa;
  }

  html[data-theme^="glass-"] .login-options .passkey-login-entry,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:focus,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:focus-visible,
  html[data-theme^="glass-"] .login-options .passkey-login-entry:hover:not(:disabled),
  html[data-theme^="glass-"] .login-options .passkey-login-entry[aria-busy="true"] {
    color: var(--mobile-primary-strong);
  }

  html[data-theme^="glass-"] .bottom-tabs {
    border-color: rgba(255, 255, 255, 0.11);
    background: rgba(15, 27, 36, 0.84);
    box-shadow: var(--mobile-shadow-nav);
  }

  html[data-theme^="glass-"] .bottom-tab,
  html[data-theme^="glass-"] .bottom-tab:hover:not(:disabled),
  html[data-theme^="glass-"] .bottom-tab:focus-visible,
  html[data-theme^="glass-"] .bottom-tab:active:not(:disabled) {
    color: var(--mobile-muted);
  }

  html[data-theme^="glass-"] .bottom-tab.is-active,
  html[data-theme^="glass-"] .bottom-tab.is-active:hover:not(:disabled),
  html[data-theme^="glass-"] .bottom-tab.is-active:focus-visible {
    background: rgba(107, 195, 212, 0.13);
    color: var(--mobile-primary-strong);
  }

  html[data-theme^="glass-"] .consent-dialog,
  html[data-theme^="glass-"] .profile-edit-dialog,
  html[data-theme^="glass-"] .confirmation-dialog,
  html[data-theme^="glass-"] .action-confirm-dialog,
  html[data-theme^="glass-"] .feedback-dialog,
  html[data-theme^="glass-"] .food-selection-dialog,
  html[data-theme^="glass-"] .manual-food-dialog,
  html[data-theme^="glass-"] .policy-panel,
  html[data-theme^="glass-"] .notification-panel,
  html[data-theme^="glass-"] .ai-summary-panel,
  html[data-theme^="glass-"] .community-detail-panel,
  html[data-theme^="glass-"] .community-comments-panel {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(14, 25, 34, 0.97);
    color: var(--mobile-ink);
    box-shadow: 0 -20px 68px rgba(0, 0, 0, 0.48);
  }

  html[data-theme^="glass-"] .policy-header,
  html[data-theme^="glass-"] .notification-header,
  html[data-theme^="glass-"] .ai-summary-header,
  html[data-theme^="glass-"] .community-detail-header,
  html[data-theme^="glass-"] .community-comments-modal-header {
    border-bottom-color: var(--mobile-line);
    background: rgba(14, 25, 34, 0.95);
  }

  html[data-theme^="glass-"] .consent-dialog::before,
  html[data-theme^="glass-"] .profile-edit-dialog::before,
  html[data-theme^="glass-"] .confirmation-dialog::before,
  html[data-theme^="glass-"] .action-confirm-dialog::before,
  html[data-theme^="glass-"] .feedback-dialog::before,
  html[data-theme^="glass-"] .food-selection-dialog::before,
  html[data-theme^="glass-"] .manual-food-dialog::before,
  html[data-theme^="glass-"] .policy-panel::before,
  html[data-theme^="glass-"] .notification-panel::before,
  html[data-theme^="glass-"] .ai-summary-panel::before,
  html[data-theme^="glass-"] .community-detail-panel::before,
  html[data-theme^="glass-"] .community-comments-panel::before {
    background: rgba(198, 217, 225, 0.24);
  }

  html[data-theme^="glass-"] .danger-confirm-button,
  html[data-theme^="glass-"] .withdraw-button,
  html[data-theme^="glass-"] .account-delete-button {
    border-color: rgba(255, 155, 169, 0.2);
    background: var(--mobile-danger-soft);
    color: var(--mobile-danger);
  }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce),
  (max-width: 1366px) and (any-pointer: coarse) and (prefers-reduced-motion: reduce) {
  html[data-theme^="glass-"] *,
  html[data-theme^="glass-"] *::before,
  html[data-theme^="glass-"] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
