/* 倒数日 · Days Matter — pixel-careful styles */
:root {
  /* brand */
  --color-primary: #2196f3;
  --color-primary-dark: #1e88e5;
  --color-primary-light: #64b5f6;

  /* surfaces */
  --color-surface: #ffffff;
  --color-surface-2: #f5f5f5;
  --color-text: #212121;
  --color-text-secondary: #757575;
  --color-text-muted: #9e9e9e;
  --color-text-on-primary: #ffffff;
  --color-divider: #e0e0e0;
  --color-divider-dot: #bdbdbd;
  --color-danger: #e53935;
  --color-overlay: rgba(0, 0, 0, 0.4);
  --color-shadow: rgba(0, 0, 0, 0.18);
  --color-card-footer: #fafafa;

  /* wood desk */
  --wood-base: #e8d5b5;
  --wood-mid: #d4b896;
  --wood-dark: #c4a574;
  --wood-light: #f0e4d0;
  --wood-line: rgba(139, 105, 60, 0.08);

  /* type — soft modern sans, not stiff Kai/serif */
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB",
    "HarmonyOS Sans SC", "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI",
    system-ui, -apple-system, sans-serif;
  --font-num: "DM Sans", "SF Pro Display", "Helvetica Neue", "Noto Sans SC",
    system-ui, sans-serif;
  /* Classic Days Matter hero digit — huge & light */
  --fs-hero: clamp(124px, 38vw, 168px);
  --fw-hero: 300;
  --fw-body: 400;
  --fw-ui: 500;
  --ls-tight: 0.01em;
  --ls-ui: 0.02em;

  /* shape */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --card-width: 86%;
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-fab: 0 6px 16px rgba(33, 150, 243, 0.4);

  /* layout */
  --fab-size: 56px;
  --touch-min: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --page-max: 480px;
  --detail-nav-h: 52px;
  --detail-actions-h: 72px;

  /* aliases used in components */
  --blue: var(--color-primary-dark);
  --blue-dark: #1565c0;
  --text: var(--color-text);
  --text-muted: var(--color-text-muted);
  --card: var(--color-surface);
  --card-footer: var(--color-card-footer);
  --shadow: var(--shadow-card);
  --radius: var(--radius-lg);
  --font: var(--font-sans);
  --num-font: var(--font-num);
}

[data-theme="dark"] {
  --color-primary: #42a5f5;
  --color-primary-dark: #1e88e5;
  --color-surface: #2c2c2c;
  --color-surface-2: #383838;
  --color-text: #f5f5f5;
  --color-text-secondary: #b0b0b0;
  --color-text-muted: #8a8a8a;
  --color-divider: #424242;
  --color-divider-dot: #616161;
  --color-overlay: rgba(0, 0, 0, 0.6);
  --color-shadow: rgba(0, 0, 0, 0.45);
  --color-card-footer: #242424;
  --wood-base: #2a2218;
  --wood-mid: #1f1912;
  --wood-dark: #16120c;
  --wood-light: #3a3024;
  --wood-line: rgba(0, 0, 0, 0.2);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-fab: 0 6px 16px rgba(33, 150, 243, 0.35);
  --blue: #42a5f5;
  --blue-dark: #1e88e5;
  --text: #f5f5f5;
  --text-muted: #8a8a8a;
  --card: #2c2c2c;
  --card-footer: #242424;
  --shadow: var(--shadow-card);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  max-width: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: var(--fw-body);
  letter-spacing: var(--ls-tight);
  color: var(--color-text);
  background-color: var(--wood-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior: none;
  width: 100%;
  position: relative;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* ── Wood desk background (CSS only, no image) ───────────────────── */
.wood-bg {
  min-height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--wood-base);
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 2px,
      var(--wood-line) 2px,
      var(--wood-line) 3px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 48px,
      rgba(180, 140, 90, 0.06) 48px,
      rgba(180, 140, 90, 0.06) 50px
    ),
    linear-gradient(
      160deg,
      var(--wood-light) 0%,
      var(--wood-base) 40%,
      var(--wood-mid) 75%,
      var(--wood-dark) 100%
    );
  /* fixed is janky / can cause h-scroll on iOS; scroll is safer for PWA */
  background-attachment: scroll;
  position: relative;
}

.wood-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: multiply;
  z-index: 0;
}

[data-theme="dark"] .wood-bg::before {
  opacity: 0.25;
  mix-blend-mode: soft-light;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  min-height: 100svh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  box-sizing: border-box;
  margin: 0 auto;
}

/* ── Screens ─────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.screen.active {
  display: flex;
}

/* ── List (home) ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  gap: 10px;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.topbar-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, transform 0.1s;
}

.icon-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.35);
}

.search-bar {
  margin: 0 auto 12px;
  padding: 0 16px;
  position: relative;
  max-width: var(--page-max);
  width: 100%;
  box-sizing: border-box;
}

.search-bar input {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  padding: 0 14px 0 40px;
  font-size: 16px; /* avoid iOS zoom */
  background: rgba(255, 255, 255, 0.88);
  color: var(--color-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  outline: none;
  font-family: inherit;
}

[data-theme="dark"] .search-bar input {
  background: rgba(44, 44, 46, 0.92);
  color: #f5f5f5;
}

.search-bar::before {
  content: "⌕";
  position: absolute;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.toolbar {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.toolbar::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: #fff;
  color: var(--color-primary-dark);
  font-weight: 600;
}

[data-theme="dark"] .chip.active {
  color: #1565c0;
}

.event-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.event-card {
  display: flex;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 72px;
  touch-action: manipulation;
}

.event-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

.event-card.pinned {
  box-shadow: 0 4px 16px rgba(33, 150, 243, 0.22);
}

.event-color {
  width: 4px;
  flex-shrink: 0;
}

.event-body {
  flex: 1;
  padding: 14px 14px 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.event-meta {
  min-width: 0;
  flex: 1;
}

.event-title {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
}

.event-title .emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.event-title .pin-badge {
  font-size: 0.75rem;
  flex-shrink: 0;
}

.event-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-count {
  text-align: right;
  flex-shrink: 0;
}

.event-count .num {
  font-size: 26px;
  font-weight: 300;
  font-family: var(--font-num);
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.event-count .label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.event-count.is-today .num {
  color: var(--color-primary);
  font-weight: 400;
}

.event-count.is-past .num {
  color: var(--color-text-muted);
}

.badge-yearly {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(33, 150, 243, 0.12);
  color: var(--color-primary-dark);
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 500;
}

[data-theme="dark"] .badge-yearly {
  background: rgba(66, 165, 245, 0.18);
  color: #90caf9;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: rgba(255, 255, 255, 0.92);
}

.empty-state .big {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.9;
}

.empty-state p {
  opacity: 0.9;
  font-size: 15px;
  line-height: 1.5;
}

.fab {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--safe-bottom));
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  z-index: 20;
  display: grid;
  place-items: center;
  transition: transform 0.1s, background 0.1s;
}

.fab:active {
  transform: scale(0.92);
  background: var(--color-primary-dark);
}

/* ── Detail (screenshot-faithful Days Matter card) ───────────────── */
/* Shell already applies safe-area — do NOT add env() again here. */
#screen-detail {
  flex: 1;
  min-height: 0;
  width: 100%;
  justify-content: center;
  align-items: center;
  position: relative;
  box-sizing: border-box;
  /* room for floating nav + action row; card stays vertically centered */
  padding: var(--detail-nav-h) 18px var(--detail-actions-h);
}

.detail-nav {
  position: absolute;
  top: 6px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  z-index: 5;
  pointer-events: none;
}

.detail-nav .icon-btn {
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
}

/* The card — classic Days Matter on wood desk */
.days-card {
  width: var(--card-width);
  max-width: 360px;
  background: #ffffff;
  background: var(--color-surface);
  border-radius: var(--radius-lg); /* 20px */
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* tall “desk card” proportions, not a stub */
  min-height: min(54dvh, 400px);
  max-height: min(72dvh, 560px);
  animation: card-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Blue #2196F3 header bar — single-line white title (type pill optional corner) */
.days-card-header {
  position: relative;
  background: var(--header-color, #2196f3);
  color: #ffffff;
  text-align: center;
  padding: 0 16px;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 0;
}

.days-card-header h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: #fff;
  margin: 0;
  padding: 0 4px;
}

.days-card-body {
  flex: 1 1 auto;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 12px;
  background: var(--color-surface);
}

/* Hero day number — screenshot star (huge light “0”) */
.days-number {
  font-family: var(--font-num);
  font-size: var(--fs-hero); /* clamp(120px, 36vw, 160px) */
  font-weight: var(--fw-hero); /* 300 */
  line-height: 0.9;
  color: var(--color-text); /* #212121 */
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  user-select: none;
  margin: 0;
  padding: 0;
}

.days-unit {
  margin-top: 2px;
  font-size: 18px;
  color: var(--color-text-secondary);
  font-weight: 400;
  line-height: 1.2;
}

.days-unit[hidden],
.days-hint[hidden],
.days-note[hidden],
.days-label[hidden] {
  display: none !important;
}

.days-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  min-height: 0;
  text-align: center;
  max-width: 92%;
}

.days-note {
  margin-top: 12px;
  max-width: 90%;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.45;
  word-break: break-word;
}

/* Dotted divider — classic Days Matter bead line */
.days-card-divider {
  border: none;
  height: 1px;
  margin: 4px 22px 0;
  flex-shrink: 0;
  background-image: radial-gradient(
    circle,
    var(--color-divider-dot) 1px,
    transparent 1.2px
  );
  background-size: 8px 2px;
  background-repeat: repeat-x;
  background-position: center;
  border-top: none;
}

/* 目标日 footer */
.days-card-footer {
  background: var(--color-surface);
  padding: 14px 16px 18px;
  text-align: center;
  flex-shrink: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.days-card-footer .target-label {
  font-size: 13px;
  color: var(--color-text-muted); /* #9E9E9E */
  letter-spacing: 0.01em;
  line-height: 1.4;
  font-weight: 400;
}

.detail-actions {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  flex-wrap: wrap;
  z-index: 5;
}

.detail-actions .action-btn {
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-text);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
}

[data-theme="dark"] .detail-actions .action-btn {
  background: rgba(44, 44, 46, 0.92);
  color: #f5f5f5;
}

.detail-actions .action-btn.danger {
  color: var(--color-danger);
}

.detail-actions .action-btn.primary {
  background: var(--color-primary);
  color: #fff;
}

.detail-actions .action-btn.primary.done {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.event-sub-soft {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Type picker on form */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--color-surface-2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--color-text);
  transition: border-color 0.15s, background 0.15s;
}

.type-opt .t-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.type-opt .t-name {
  font-size: 15px;
  font-weight: 600;
}

.type-opt .t-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

.type-opt.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.1);
}

[data-theme="dark"] .type-opt.selected {
  background: rgba(66, 165, 245, 0.14);
}

/* More sheet */
.more-sheet {
  max-width: 320px;
  padding-bottom: 12px;
}

.more-sheet h4 {
  margin-bottom: 12px;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 10px;
  border: none;
  background: transparent;
  color: var(--color-text);
  font-size: 15px;
  font-family: inherit;
  border-radius: 10px;
  cursor: pointer;
}

.menu-item:active {
  background: var(--color-surface-2);
}

.menu-item.active {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.menu-item.ghost {
  margin-top: 6px;
  color: var(--color-text-muted);
  text-align: center;
}

.menu-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 6px 4px;
}

/* ── Form sheet ──────────────────────────────────────────────────── */
#screen-form {
  background: var(--color-overlay);
  justify-content: flex-end;
  position: fixed;
  inset: 0;
  z-index: 30;
  padding-top: var(--safe-top);
}

.sheet {
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 12px 20px calc(24px + var(--safe-bottom));
  animation: sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
}

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--color-divider);
  border-radius: 2px;
  margin: 4px auto 16px;
}

.sheet h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: center;
  color: var(--color-text);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.field input[type="text"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--color-surface-2);
  color: var(--color-text);
  outline: none;
  transition: box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  box-shadow: 0 0 0 2px var(--color-primary-light);
}

.color-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
  position: relative;
  padding: 0;
}

.color-swatch.selected {
  border-color: var(--color-text);
  transform: scale(1.08);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-primary);
}

.emoji-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.emoji-pick {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--color-surface-2);
  font-size: 1.25rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.emoji-pick.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.12);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  gap: 12px;
}

.toggle-row > span,
.toggle-row > div > span {
  font-size: 15px;
  color: var(--color-text);
}

.toggle-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 31px;
  cursor: pointer;
  transition: 0.2s;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: var(--color-primary);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:active {
  background: var(--color-primary-dark);
}

.btn-ghost {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
  margin-top: 12px;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-danger-solid {
  background: var(--color-danger);
  color: #fff;
  border: none;
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* Modal confirm */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-root[hidden] {
  display: none !important;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}

.modal-card {
  position: relative;
  background: var(--color-surface);
  border-radius: 16px;
  max-width: 300px;
  width: 100%;
  padding: 20px 18px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  animation: card-in 0.2s ease-out;
}

.modal-card h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.modal-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(33, 33, 33, 0.92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  z-index: 100;
  white-space: nowrap;
  /* avoid 100vw horizontal scroll on mobile browsers */
  max-width: min(320px, calc(100% - 32px));
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Stats strip on list */
.stats {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.stat-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  color: #fff;
}

.stat-pill .n {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font-num);
}

.stat-pill .l {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Narrow phones */
@media (max-width: 320px) {
  .days-card {
    width: 90%;
  }

  .days-number {
    font-size: clamp(96px, 30vw, 120px);
  }
}

/* ── Type system (精简扩展) ───────────────────────────────────────── */
.type-tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-secondary);
  margin-right: 4px;
  font-weight: 500;
}

[data-theme="dark"] .type-tag {
  background: rgba(255, 255, 255, 0.1);
}

.event-count.is-streak .num {
  color: #ef6c00;
  font-weight: 400;
}

.event-card.need-check {
  box-shadow: 0 4px 16px rgba(239, 108, 0, 0.2);
}

.pin-badge {
  font-size: 0.75rem;
  margin-left: 2px;
}

/*
 * Type pill: classic Days Matter header is title-only.
 * Keep pill for a11y/JS but out of the visual chrome (no column stack).
 */
.type-pill {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Status line above number — quiet secondary, not competing with hero “0” */
.days-label {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
  min-height: 0;
  line-height: 1.3;
  text-align: center;
}

.days-label:empty {
  display: none;
}

.progress-wrap {
  width: 80%;
  margin-top: 18px;
}

.progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

[data-theme="dark"] .progress-bar {
  background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffa726, #ef6c00);
  border-radius: 3px;
  transition: width 0.35s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
  text-align: center;
}

.action-btn.primary {
  background: linear-gradient(145deg, #42a5f5, #1e88e5);
  color: #fff;
  font-weight: 600;
}

.action-btn.primary.done {
  background: rgba(255, 255, 255, 0.88);
  color: #ef6c00;
  font-weight: 600;
}

[data-theme="dark"] .action-btn.primary.done {
  background: rgba(44, 44, 46, 0.95);
}

/* Type picker grid */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.type-opt {
  border: 1.5px solid var(--color-divider);
  background: var(--color-surface);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  color: var(--color-text);
}

.type-opt:active {
  transform: scale(0.97);
}

.type-opt.selected {
  border-color: var(--color-primary);
  background: rgba(33, 150, 243, 0.08);
}

.type-opt .t-emoji {
  font-size: 1.5rem;
  line-height: 1;
}

.type-opt .t-name {
  font-size: 15px;
  font-weight: 600;
}

.type-opt .t-hint {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* More menu */
.more-sheet {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 12px;
}

.more-sheet h4 {
  margin-bottom: 8px;
  text-align: center;
}

.menu-item {
  width: 100%;
  height: 48px;
  border: none;
  background: var(--color-surface-2);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  text-align: center;
}

.menu-item:active {
  opacity: 0.85;
}

.menu-item.ghost {
  background: transparent;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.btn-danger-solid {
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: 12px;
  height: 48px;
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.modal-root[hidden] {
  display: none !important;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}

.modal-card {
  position: relative;
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px;
  width: min(340px, 100%);
  box-shadow: var(--shadow-card);
  color: var(--color-text);
}

.modal-card h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.modal-card p {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.event-sub-soft {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-text-muted);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item.active {
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* ── Custom background image ─────────────────────────────────────── */
.wood-bg.has-custom-bg {
  background-color: #1a1a1a;
  background-image: var(--custom-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

.wood-bg.has-custom-bg::before {
  opacity: 0.35;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.45) 100%
  );
  background-image: none;
  mix-blend-mode: normal;
}

/* ── Announcement popup ──────────────────────────────────────────── */
.announce-root {
  z-index: 90;
  align-items: flex-end;
  padding: 0;
}

@media (min-width: 480px) {
  .announce-root {
    align-items: center;
    padding: 24px;
  }
}

.announce-card {
  width: min(420px, 100%);
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + var(--safe-bottom));
  animation: sheet-up 0.28s ease-out;
}

@media (min-width: 480px) {
  .announce-card {
    border-radius: 18px;
    padding: 22px;
    animation: card-in 0.28s ease-out;
  }
}

.announce-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.announce-badge.soft {
  background: linear-gradient(135deg, #66bb6a, #43a047);
}

.announce-card h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-text);
}

.announce-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
  padding-right: 2px;
}

.announce-lead {
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin-bottom: 14px;
}

.announce-body h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin: 14px 0 8px;
}

.announce-list {
  margin: 0;
  padding-left: 1.15em;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.announce-list li {
  margin-bottom: 4px;
}

.announce-list.ordered {
  padding-left: 1.3em;
}

.announce-list strong {
  color: var(--color-text);
  font-weight: 600;
}

.announce-credits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.announce-credits > div {
  background: var(--color-surface-2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.announce-credits span {
  font-size: 11px;
  color: var(--color-text-muted);
}

.announce-credits b {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.announce-foot {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.announce-note {
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

.announce-note code {
  display: inline-block;
  margin: 4px 0;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-surface-2);
  font-size: 12.5px;
  word-break: break-all;
}

.announce-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-shrink: 0;
}

.announce-actions .btn {
  flex: 1;
}

.menu-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 6px 0;
  border: none;
}

/* ═══════════════════════════════════════════════════════════════
   v1.3 — Tab bar · Settings stack · Me · livelier chrome
   ═══════════════════════════════════════════════════════════════ */

:root {
  --tab-h: 56px;
  --page-bg-solid: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] {
  --page-bg-solid: rgba(28, 28, 30, 0.94);
}

/* App body offset for tab bar */
.app {
  padding-bottom: 0;
}

.tab-screen {
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
}

.event-list {
  padding-bottom: calc(100px + var(--safe-bottom)) !important;
}

.fab {
  bottom: calc(var(--tab-h) + 16px + var(--safe-bottom)) !important;
}

body.tab-hidden .fab {
  bottom: calc(24px + var(--safe-bottom)) !important;
}

/* ── Bottom tab bar ──────────────────────────────────────────── */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  background: var(--page-bg-solid);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
  max-width: 100%;
}

[data-theme="dark"] .tab-bar {
  border-top-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}

.tab-bar.hidden {
  display: none !important;
}

.tab-item {
  flex: 1;
  max-width: 120px;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-text-muted);
  border-radius: 14px;
  transition: color 0.2s, transform 0.15s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 0;
}

.tab-item:active {
  transform: scale(0.94);
}

.tab-item.active {
  color: var(--color-primary-dark);
}

.tab-item.active .tab-ico {
  transform: translateY(-1px) scale(1.08);
  filter: drop-shadow(0 2px 6px rgba(33, 150, 243, 0.35));
}

.tab-ico {
  font-size: 20px;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.tab-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tab-item.active .tab-label {
  font-weight: 600;
}

/* ── Glass / page headers ────────────────────────────────────── */
.glass-bar {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.topbar.glass-bar {
  align-items: flex-start;
}

.topbar-title-wrap h1 {
  margin: 0;
}

.topbar-sub {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  padding-top: calc(12px + var(--safe-top));
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header.solid {
  background: var(--page-bg-solid);
  border-bottom: 1px solid var(--color-divider);
}

.page-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.nav-back-header {
  justify-content: space-between;
}

.nav-back {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
  padding: 0 0 2px;
}

.nav-spacer {
  width: 40px;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.settings-scroll {
  padding: 12px 16px calc(var(--tab-h) + var(--safe-bottom) + 24px);
  max-width: var(--page-max);
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

#screen-settings-sub .settings-scroll,
#screen-auth .settings-scroll {
  padding-bottom: calc(24px + var(--safe-bottom));
}

/* ── Announce button ─────────────────────────────────────────── */
.announce-btn {
  position: relative;
}

.announce-btn .announce-icon {
  font-size: 1.05rem;
}

.announce-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5252;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
  animation: pulse-dot 1.6s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

/* ── Stats livelier ──────────────────────────────────────────── */
.stat-pill {
  transition: transform 0.15s;
}

.stat-pill.accent {
  background: linear-gradient(145deg, rgba(255, 167, 38, 0.35), rgba(255, 255, 255, 0.18));
}

.stat-pill.warm {
  background: linear-gradient(145deg, rgba(66, 165, 245, 0.35), rgba(255, 255, 255, 0.18));
}

.event-card {
  animation: card-rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.event-card:nth-child(1) { animation-delay: 0.02s; }
.event-card:nth-child(2) { animation-delay: 0.05s; }
.event-card:nth-child(3) { animation-delay: 0.08s; }
.event-card:nth-child(4) { animation-delay: 0.11s; }
.event-card:nth-child(5) { animation-delay: 0.14s; }

.fab {
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.2s !important;
}

.fab:active {
  transform: scale(0.9) rotate(90deg) !important;
}

/* ── Settings rows ───────────────────────────────────────────── */
.settings-group {
  margin-bottom: 20px;
}

.settings-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  margin: 0 4px 8px;
  text-transform: none;
}

.settings-card {
  background: var(--color-surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.settings-card.pad {
  padding: 16px;
}

.settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border: none;
  border-bottom: 1px solid var(--color-divider);
  background: transparent;
  font-family: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row:not(.static):active {
  background: var(--color-surface-2);
}

.settings-row.selected {
  background: rgba(33, 150, 243, 0.08);
}

.sr-icon {
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.sr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-title {
  font-size: 15px;
  font-weight: 500;
}

.sr-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.sr-chevron {
  color: var(--color-text-muted);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.sr-check {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.settings-footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 8px 0 24px;
  opacity: 0.9;
}

/* Settings pages on solid-ish surface over wood */
#screen-settings,
#screen-settings-sub,
#screen-me,
#screen-auth {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 100%
  );
}

[data-theme="dark"] #screen-settings,
[data-theme="dark"] #screen-settings-sub,
[data-theme="dark"] #screen-me,
[data-theme="dark"] #screen-auth {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* ── Me ──────────────────────────────────────────────────────── */
.me-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #42a5f5 0%, #7e57c2 55%, #ec407a 100%);
  border-radius: 20px;
  box-shadow: 0 8px 28px rgba(33, 150, 243, 0.28);
  color: #fff;
  animation: card-in 0.4s ease;
}

.me-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.55);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 600;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

.me-name {
  font-size: 20px;
  font-weight: 700;
}

.me-meta {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

/* ── Auth ────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--color-surface);
  padding: 4px;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.auth-tab {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 11px;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: 0.18s;
}

.auth-tab.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.35);
}

.auth-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 4px 0 16px;
}

.btn-block {
  width: 100%;
}

.auth-form .field {
  margin-bottom: 14px;
}

/* ── About / install sub ─────────────────────────────────────── */
.about-page,
.install-page {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.about-logo {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #42a5f5, #7e57c2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 4px;
}

.about-tag {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.install-page h5 {
  margin: 14px 0 8px;
  font-size: 14px;
  color: var(--color-text);
}

.install-page .announce-list {
  color: var(--color-text-secondary);
}

/* Chip polish */
.chip {
  transition: transform 0.12s, background 0.15s, color 0.15s;
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}

/* ── Catalog tab ─────────────────────────────────────────────────── */
.catalog-scroll {
  padding-top: 8px;
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.catalog-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.catalog-select {
  flex: 1;
  min-width: 140px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  padding: 0 12px;
}

.btn-sm {
  height: 40px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  flex: 0 0 auto;
}

.catalog-export-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.chip-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  cursor: pointer;
}

.chip-btn:active {
  transform: scale(0.96);
}

.catalog-section {
  margin-bottom: 18px;
}

.catalog-section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 8px;
}

.catalog-section-h h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.catalog-section-h span {
  font-size: 12px;
  color: var(--color-text-muted);
}

.catalog-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--color-divider);
  background: transparent;
  font-family: inherit;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.catalog-row:last-child {
  border-bottom: none;
}

.catalog-row:active {
  background: var(--color-surface-2);
}

.cr-emoji {
  font-size: 1.35rem;
  width: 28px;
  text-align: center;
}

.cr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cr-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-num {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 300;
  text-align: right;
  line-height: 1;
}

.cr-num small {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
  font-weight: 500;
}

.empty-state.solid {
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border-radius: 16px;
  margin-top: 12px;
}

#screen-catalog {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.35) 100%
  );
}

[data-theme="dark"] #screen-catalog {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

/* Top title smaller on narrow screens for long app name */
.topbar h1 {
  font-size: clamp(15px, 4.2vw, 18px) !important;
  max-width: 70vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════
   UI modes: simple (简约) vs zone (花哨)
   ═══════════════════════════════════════════════════════════════ */

/* ── Mode picker cards ───────────────────────────────────────── */
.mode-pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-card {
  position: relative;
  border: 2px solid var(--color-divider);
  border-radius: 18px;
  background: var(--color-surface);
  padding: 12px 10px 14px;
  text-align: left;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}

.mode-card:active {
  transform: scale(0.97);
}

.mode-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 8px 28px rgba(33, 150, 243, 0.25);
}

.mode-card-preview {
  height: 72px;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.simple-preview {
  background: linear-gradient(180deg, #f5f5f5, #e8e8e8);
  border: 1px solid #e0e0e0;
}

.simple-preview::after {
  content: "";
  display: block;
  width: 60%;
  height: 10px;
  margin: 28px auto 0;
  background: #cfcfcf;
  border-radius: 4px;
}

.zone-preview {
  background:
    radial-gradient(circle at 20% 30%, #ff80ab, transparent 45%),
    radial-gradient(circle at 80% 70%, #82b1ff, transparent 50%),
    linear-gradient(135deg, #7c4dff, #00bcd4);
  animation: zone-preview-shift 3s ease infinite alternate;
}

@keyframes zone-preview-shift {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(25deg); }
}

.mode-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.mode-card-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.mode-card-check {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--color-primary);
  font-weight: 800;
}

/* ── Zone ambient orbs ───────────────────────────────────────── */
.zone-orbs {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

html[data-ui="zone"] .zone-orbs {
  display: block;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: orb-float 12s ease-in-out infinite;
}

.orb.o1 {
  width: 220px;
  height: 220px;
  left: -40px;
  top: 12%;
  background: #ff80ab;
  animation-delay: 0s;
}

.orb.o2 {
  width: 260px;
  height: 260px;
  right: -60px;
  top: 40%;
  background: #82b1ff;
  animation-delay: -4s;
}

.orb.o3 {
  width: 180px;
  height: 180px;
  left: 30%;
  bottom: 8%;
  background: #b388ff;
  animation-delay: -7s;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -24px) scale(1.08); }
}

/* ── Zone flashy polish ──────────────────────────────────────── */
html[data-ui="zone"] {
  --color-primary: #7c4dff;
  --color-primary-dark: #651fff;
  --color-primary-light: #b388ff;
  --shadow-fab: 0 8px 28px rgba(124, 77, 255, 0.5);
  --blue: #7c4dff;
  --blue-dark: #651fff;
}

html[data-ui="zone"][data-theme="dark"] {
  --color-primary: #b388ff;
  --color-primary-dark: #7c4dff;
  --blue: #b388ff;
}

html[data-ui="zone"] .wood-bg:not(.has-custom-bg) {
  background-image:
    radial-gradient(ellipse at 10% 0%, rgba(255, 128, 171, 0.35), transparent 50%),
    radial-gradient(ellipse at 90% 20%, rgba(130, 177, 255, 0.4), transparent 45%),
    radial-gradient(ellipse at 50% 100%, rgba(179, 136, 255, 0.3), transparent 50%),
    linear-gradient(165deg, #1a1040 0%, #2d1b69 35%, #0d47a1 70%, #006064 100%);
  background-color: #1a1040;
}

html[data-ui="zone"][data-theme="light"] .wood-bg:not(.has-custom-bg) {
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(255, 171, 199, 0.55), transparent 45%),
    radial-gradient(ellipse at 100% 10%, rgba(140, 198, 255, 0.5), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(206, 147, 255, 0.4), transparent 45%),
    linear-gradient(160deg, #f3e5f5 0%, #e3f2fd 40%, #e8eaf6 70%, #fce4ec 100%);
  background-color: #e8eaf6;
}

html[data-ui="zone"] .wood-bg:not(.has-custom-bg)::before {
  opacity: 0.08;
}

html[data-ui="zone"] .topbar h1 {
  background: linear-gradient(90deg, #fff 0%, #e1bee7 40%, #bbdefb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

html[data-ui="zone"][data-theme="light"] .topbar h1 {
  background: linear-gradient(90deg, #4a148c, #1565c0, #c2185b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: none;
}

html[data-ui="zone"][data-theme="light"] .topbar-sub {
  color: rgba(74, 20, 140, 0.75);
  text-shadow: none;
}

html[data-ui="zone"] .stat-pill {
  background: linear-gradient(145deg, rgba(255,255,255,0.28), rgba(255,255,255,0.1));
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[data-ui="zone"] .stat-pill.accent {
  background: linear-gradient(145deg, rgba(255, 128, 171, 0.45), rgba(255,255,255,0.15));
}

html[data-ui="zone"] .stat-pill.warm {
  background: linear-gradient(145deg, rgba(130, 177, 255, 0.45), rgba(255,255,255,0.15));
}

html[data-ui="zone"] .chip.active {
  background: linear-gradient(135deg, #7c4dff, #448aff);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 77, 255, 0.4);
}

html[data-ui="zone"] .event-card {
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 28px rgba(80, 40, 160, 0.12), 0 2px 8px rgba(0,0,0,0.06);
  backdrop-filter: blur(8px);
}

html[data-ui="zone"] .event-card.pinned {
  box-shadow: 0 8px 32px rgba(124, 77, 255, 0.28);
  border-color: rgba(124, 77, 255, 0.35);
}

html[data-ui="zone"] .fab {
  background: linear-gradient(145deg, #ea80fc, #7c4dff 50%, #448aff);
  box-shadow: 0 10px 32px rgba(124, 77, 255, 0.55);
}

html[data-ui="zone"] .fab:active {
  transform: scale(0.9) rotate(90deg) !important;
}

html[data-ui="zone"] .tab-bar {
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(124, 77, 255, 0.12);
  box-shadow: 0 -8px 32px rgba(100, 60, 200, 0.1);
}

html[data-ui="zone"][data-theme="dark"] .tab-bar {
  background: rgba(30, 20, 50, 0.88);
}

html[data-ui="zone"] .tab-item.active {
  color: #7c4dff;
}

html[data-ui="zone"] .tab-item.active .tab-ico {
  filter: drop-shadow(0 2px 8px rgba(124, 77, 255, 0.5));
}

html[data-ui="zone"] .me-hero {
  background: linear-gradient(135deg, #ea80fc 0%, #7c4dff 40%, #448aff 75%, #18ffff 100%);
  background-size: 200% 200%;
  animation: me-hero-shift 8s ease infinite;
  box-shadow: 0 12px 40px rgba(124, 77, 255, 0.4);
}

@keyframes me-hero-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

html[data-ui="zone"] .settings-card,
html[data-ui="zone"] .catalog-section .settings-card {
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 8px 28px rgba(80, 40, 160, 0.1);
}

html[data-ui="zone"] .days-card {
  box-shadow: 0 16px 48px rgba(80, 40, 180, 0.25), 0 4px 16px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.4);
}

html[data-ui="zone"] .days-card-header {
  background: linear-gradient(
    120deg,
    var(--header-color, #7c4dff),
    color-mix(in srgb, var(--header-color, #7c4dff) 60%, #448aff)
  );
}

html[data-ui="zone"] .announce-card {
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 20px 60px rgba(80, 40, 180, 0.3);
}

html[data-ui="zone"] .announce-badge {
  background: linear-gradient(135deg, #ea80fc, #7c4dff, #448aff);
}

html[data-ui="zone"] .btn-primary {
  background: linear-gradient(135deg, #7c4dff, #448aff);
  box-shadow: 0 6px 18px rgba(124, 77, 255, 0.35);
}

html[data-ui="zone"] .search-bar input {
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 16px rgba(80, 40, 160, 0.1);
}

html[data-ui="zone"] .icon-btn {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

html[data-ui="zone"] .catalog-select {
  border-color: rgba(124, 77, 255, 0.25);
  box-shadow: 0 2px 10px rgba(80, 40, 160, 0.08);
}

/* ── Simple mode: calm & clean ───────────────────────────────── */
html[data-ui="simple"] .zone-orbs {
  display: none !important;
}

html[data-ui="simple"] .wood-bg:not(.has-custom-bg) {
  background: #f0ebe3;
  background-image:
    linear-gradient(180deg, #f5f0e8 0%, #ebe4d8 100%);
}

html[data-ui="simple"][data-theme="dark"] .wood-bg:not(.has-custom-bg) {
  background: #1c1c1e;
  background-image: none;
}

html[data-ui="simple"] .wood-bg::before {
  opacity: 0.04;
}

html[data-ui="simple"] .topbar h1 {
  background: none;
  color: #fff;
  filter: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

html[data-ui="simple"] .stat-pill {
  background: rgba(255,255,255,0.2);
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

html[data-ui="simple"] .event-card {
  animation: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: none;
  backdrop-filter: none;
}

html[data-ui="simple"] .fab {
  background: var(--color-primary);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

html[data-ui="simple"] .fab:active {
  transform: scale(0.94) !important;
}

html[data-ui="simple"] .me-hero {
  animation: none;
  background: #546e7a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

html[data-ui="simple"] .chip.active {
  box-shadow: none;
}

html[data-ui="simple"] .tab-item.active .tab-ico {
  filter: none;
  transform: none;
}

html[data-ui="simple"] .days-card {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border: none;
}

html[data-ui="simple"] .days-card-header {
  background: var(--header-color, var(--color-primary));
}

html[data-ui="simple"] #screen-settings,
html[data-ui="simple"] #screen-catalog,
html[data-ui="simple"] #screen-me,
html[data-ui="simple"] #screen-settings-sub,
html[data-ui="simple"] #screen-auth {
  background: transparent;
}

html[data-ui="simple"] .settings-card {
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.04);
}

/* ═══════════════════════════════════════════════════════════════
   Multi-skin + click FX  (zone / simple / mech / scifi / neon)
   ═══════════════════════════════════════════════════════════════ */

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.fx-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  pointer-events: none;
  animation: fx-ripple 0.55s ease-out forwards;
  z-index: 5;
}

.fx-ripple-zone { background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(124,77,255,0.4) 50%, transparent 70%); }
.fx-ripple-simple { background: rgba(33,150,243,0.35); }
.fx-ripple-mech { background: radial-gradient(circle, #ffd54f, rgba(255,193,7,0.2) 60%, transparent); box-shadow: 0 0 0 1px #424242; }
.fx-ripple-scifi { background: radial-gradient(circle, #18ffff, rgba(0,229,255,0.25) 55%, transparent); }
.fx-ripple-neon { background: radial-gradient(circle, #ff80ab, rgba(0,255,255,0.35) 50%, transparent); }

@keyframes fx-ripple {
  to { transform: scale(18); opacity: 0; }
}

.fx-spark {
  position: fixed;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  pointer-events: none;
  animation: fx-spark 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.fx-spark-zone { background: #e1bee7; box-shadow: 0 0 8px #7c4dff; }
.fx-spark-simple { background: #90caf9; }
.fx-spark-mech { background: #ffc107; border-radius: 1px; width: 5px; height: 5px; }
.fx-spark-scifi { background: #18ffff; box-shadow: 0 0 10px #00e5ff; border-radius: 0; transform: rotate(45deg); }
.fx-spark-neon { background: #00e5ff; box-shadow: 0 0 12px #ff4081, 0 0 4px #00e5ff; }

@keyframes fx-spark {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0) rotate(var(--rot)); opacity: 0; }
}

.fx-burst {
  position: fixed;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  pointer-events: none;
  animation: fx-burst 0.45s ease-out forwards;
}

.fx-burst-zone { border-color: #ce93d8; box-shadow: 0 0 20px #7c4dff; }
.fx-burst-mech { border-color: #ffc107; border-radius: 2px; }
.fx-burst-scifi { border-color: #18ffff; border-radius: 0; box-shadow: 0 0 16px #00e5ff; }
.fx-burst-neon { border-color: #ff80ab; box-shadow: 0 0 18px #00e5ff; }

@keyframes fx-burst {
  to { transform: scale(4); opacity: 0; }
}

button.fx-press,
.chip.fx-press,
.tab-item.fx-press,
.event-card.fx-press,
.settings-row.fx-press,
.mode-card.fx-press {
  transform: scale(0.96);
  transition: transform 0.08s;
}

html[data-ui="zone"] button.fx-press,
html[data-ui="neon"] button.fx-press {
  filter: brightness(1.15);
}

html[data-ui="mech"] button.fx-press {
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.45) !important;
  transform: translateY(1px) scale(0.98);
}

html[data-ui="scifi"] button.fx-press {
  box-shadow: 0 0 16px #18ffff, inset 0 0 8px rgba(0,229,255,0.4) !important;
}

/* overflow for ripples */
button, .chip, .tab-item, .settings-row, .mode-card, .action-btn, .type-opt {
  overflow: hidden;
}

.mode-pick-grid-3 {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 400px) {
  .mode-pick-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

.mode-flagship {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff80ab, #7c4dff, #448aff);
  color: #fff;
}

/* previews */
.mech-preview {
  background:
    repeating-linear-gradient(90deg, #5d4037 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #9e9e9e, #616161 40%, #424242);
  box-shadow: inset 0 0 0 2px #37474f;
}
.mech-preview::after {
  content: "";
  display: block;
  width: 40%;
  height: 14px;
  margin: 28px auto 0;
  background: linear-gradient(180deg, #ffd54f, #ff8f00);
  border: 2px solid #212121;
  border-radius: 2px;
}

.scifi-preview {
  background:
    linear-gradient(rgba(0,229,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.08) 1px, transparent 1px),
    linear-gradient(180deg, #0a192f, #020c1b);
  background-size: 12px 12px, 12px 12px, auto;
}
.scifi-preview::after {
  content: "";
  display: block;
  width: 50%;
  height: 8px;
  margin: 32px auto 0;
  background: #18ffff;
  box-shadow: 0 0 12px #00e5ff;
}

.neon-preview {
  background: #0d0221;
  box-shadow: inset 0 0 20px #ff00aa44;
}
.neon-preview::after {
  content: "";
  display: block;
  width: 55%;
  height: 10px;
  margin: 30px auto 0;
  border: 2px solid #00f0ff;
  box-shadow: 0 0 12px #00f0ff, inset 0 0 8px #ff00aa;
  border-radius: 4px;
}

.hud-grid {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(0,229,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.5) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── MECH skin ───────────────────────────────────────────────── */
html[data-ui="mech"] {
  --color-primary: #ff8f00;
  --color-primary-dark: #ef6c00;
  --color-surface: #eceff1;
  --color-surface-2: #cfd8dc;
  --color-text: #263238;
  --blue: #ff8f00;
  --radius-lg: 6px;
  --radius-md: 4px;
  --font-sans: "DIN Alternate", "Roboto Condensed", "PingFang SC", system-ui, sans-serif;
}

html[data-ui="mech"] .zone-orbs { display: none !important; }

html[data-ui="mech"] .wood-bg:not(.has-custom-bg) {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px),
    linear-gradient(180deg, #78909c 0%, #546e7a 40%, #455a64 100%);
}

html[data-ui="mech"] .topbar h1 {
  background: none;
  color: #fff8e1;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 #212121;
  filter: none;
}

html[data-ui="mech"] .chip,
html[data-ui="mech"] .btn,
html[data-ui="mech"] .icon-btn,
html[data-ui="mech"] .tab-item,
html[data-ui="mech"] .fab,
html[data-ui="mech"] .action-btn,
html[data-ui="mech"] .settings-row,
html[data-ui="mech"] .event-card {
  border-radius: 4px !important;
  border: 2px solid #37474f !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 3px 0 #263238 !important;
  font-weight: 700;
}

html[data-ui="mech"] .chip.active,
html[data-ui="mech"] .btn-primary,
html[data-ui="mech"] .fab {
  background: linear-gradient(180deg, #ffd54f, #ff8f00) !important;
  color: #212121 !important;
}

html[data-ui="mech"] .event-card {
  background: linear-gradient(180deg, #fafafa, #cfd8dc);
}

html[data-ui="mech"] .stat-pill {
  border: 2px solid #37474f;
  border-radius: 4px;
  background: rgba(38,50,56,0.45);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

html[data-ui="mech"] .tab-bar {
  background: #546e7a;
  border-top: 3px solid #263238;
}

html[data-ui="mech"] .tab-item { color: #eceff1; }
html[data-ui="mech"] .tab-item.active { color: #ffd54f; }

html[data-ui="mech"] .me-hero {
  animation: none;
  background: linear-gradient(180deg, #90a4ae, #455a64);
  border: 3px solid #263238;
  border-radius: 6px;
  box-shadow: 0 4px 0 #212121;
}

html[data-ui="mech"] .days-card {
  border: 3px solid #37474f;
  border-radius: 6px;
  box-shadow: 0 6px 0 #263238;
}

html[data-ui="mech"] .days-card-header {
  background: linear-gradient(180deg, #ffd54f, #ff8f00) !important;
  color: #212121;
}

/* ── SCIFI skin ──────────────────────────────────────────────── */
html[data-ui="scifi"] {
  --color-primary: #00e5ff;
  --color-primary-dark: #00b8d4;
  --color-surface: rgba(8, 24, 48, 0.88);
  --color-surface-2: rgba(0, 40, 70, 0.9);
  --color-text: #e0f7fa;
  --color-text-secondary: #80deea;
  --color-text-muted: #4dd0e1;
  --color-divider: rgba(0, 229, 255, 0.2);
  --blue: #00e5ff;
  --page-bg-solid: rgba(4, 12, 28, 0.92);
  --font-sans: "SF Mono", "Menlo", "Consolas", "PingFang SC", monospace;
}

html[data-ui="scifi"] .zone-orbs { display: none !important; }
html[data-ui="scifi"] .hud-grid { display: block; }

html[data-ui="scifi"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,229,255,0.2), transparent 50%),
    linear-gradient(180deg, #020617 0%, #0a192f 50%, #020c1b 100%);
}

html[data-ui="scifi"] .topbar h1 {
  background: none;
  color: #18ffff;
  text-shadow: 0 0 12px #00e5ff, 0 0 24px #00b8d4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 14px !important;
  filter: none;
}

html[data-ui="scifi"] .topbar-sub { color: #4dd0e1; text-shadow: none; }

html[data-ui="scifi"] .chip,
html[data-ui="scifi"] .btn,
html[data-ui="scifi"] .icon-btn,
html[data-ui="scifi"] .action-btn,
html[data-ui="scifi"] .settings-row {
  border: 1px solid rgba(0,229,255,0.45) !important;
  border-radius: 2px !important;
  background: rgba(0, 40, 60, 0.55) !important;
  color: #e0f7fa !important;
  box-shadow: 0 0 12px rgba(0,229,255,0.12), inset 0 0 12px rgba(0,229,255,0.05);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

html[data-ui="scifi"] .chip.active,
html[data-ui="scifi"] .btn-primary,
html[data-ui="scifi"] .fab {
  background: rgba(0, 229, 255, 0.2) !important;
  color: #18ffff !important;
  box-shadow: 0 0 20px rgba(0,229,255,0.45), inset 0 0 10px rgba(0,229,255,0.2) !important;
  border-color: #18ffff !important;
}

html[data-ui="scifi"] .event-card,
html[data-ui="scifi"] .settings-card,
html[data-ui="scifi"] .days-card {
  background: rgba(6, 20, 40, 0.85);
  border: 1px solid rgba(0,229,255,0.35);
  border-radius: 2px;
  box-shadow: 0 0 24px rgba(0,229,255,0.1);
  color: #e0f7fa;
}

html[data-ui="scifi"] .days-card-header {
  background: linear-gradient(90deg, #003344, #006680) !important;
  border-bottom: 1px solid #18ffff;
}

html[data-ui="scifi"] .tab-bar {
  background: rgba(2, 10, 24, 0.92);
  border-top: 1px solid rgba(0,229,255,0.3);
}

html[data-ui="scifi"] .tab-item { color: #4dd0e1; }
html[data-ui="scifi"] .tab-item.active {
  color: #18ffff;
  text-shadow: 0 0 10px #00e5ff;
}

html[data-ui="scifi"] .me-hero {
  animation: none;
  background: linear-gradient(135deg, #001a2e, #003d5c);
  border: 1px solid #18ffff;
  box-shadow: 0 0 28px rgba(0,229,255,0.25);
  border-radius: 4px;
}

html[data-ui="scifi"] .stat-pill {
  background: rgba(0, 40, 60, 0.5);
  border: 1px solid rgba(0,229,255,0.3);
  border-radius: 2px;
  color: #e0f7fa;
}

html[data-ui="scifi"] .search-bar input {
  background: rgba(0, 20, 40, 0.8);
  color: #e0f7fa;
  border: 1px solid rgba(0,229,255,0.35);
  border-radius: 2px;
}

/* scanline */
html[data-ui="scifi"] .wood-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 3px
  );
  opacity: 0.35;
  animation: scan-move 8s linear infinite;
}

@keyframes scan-move {
  from { background-position: 0 0; }
  to { background-position: 0 100px; }
}

/* ── NEON skin ───────────────────────────────────────────────── */
html[data-ui="neon"] {
  --color-primary: #ff2bd6;
  --color-primary-dark: #d500f9;
  --color-surface: rgba(20, 4, 40, 0.9);
  --color-surface-2: rgba(40, 0, 60, 0.95);
  --color-text: #fff0ff;
  --color-text-secondary: #ff80ab;
  --color-text-muted: #80deea;
  --color-divider: rgba(255, 0, 200, 0.2);
  --blue: #00f0ff;
  --page-bg-solid: rgba(12, 0, 28, 0.92);
}

html[data-ui="neon"] .zone-orbs { display: block; }
html[data-ui="neon"] .orb.o1 { background: #ff00aa; opacity: 0.45; }
html[data-ui="neon"] .orb.o2 { background: #00f0ff; opacity: 0.4; }
html[data-ui="neon"] .orb.o3 { background: #d500f9; opacity: 0.35; }

html[data-ui="neon"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,0,170,0.35), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0,240,255,0.3), transparent 45%),
    linear-gradient(160deg, #0d0221 0%, #1a0533 50%, #05010f 100%);
}

html[data-ui="neon"] .topbar h1 {
  background: linear-gradient(90deg, #ff80ab, #00f0ff, #ea80fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255,0,200,0.6));
  animation: neon-title 3s ease infinite alternate;
}

@keyframes neon-title {
  from { filter: drop-shadow(0 0 8px #ff00aa); }
  to { filter: drop-shadow(0 0 16px #00f0ff); }
}

html[data-ui="neon"] .chip.active,
html[data-ui="neon"] .btn-primary,
html[data-ui="neon"] .fab {
  background: transparent !important;
  border: 2px solid #00f0ff !important;
  color: #00f0ff !important;
  box-shadow: 0 0 16px #00f0ff, inset 0 0 12px rgba(0,240,255,0.2), 0 0 28px rgba(255,0,170,0.35) !important;
  text-shadow: 0 0 8px #00f0ff;
}

html[data-ui="neon"] .event-card,
html[data-ui="neon"] .settings-card,
html[data-ui="neon"] .days-card {
  background: rgba(20, 4, 40, 0.85);
  border: 1px solid rgba(255, 0, 200, 0.45);
  box-shadow: 0 0 24px rgba(255, 0, 170, 0.15), inset 0 0 20px rgba(0,240,255,0.05);
  color: #fff0ff;
}

html[data-ui="neon"] .days-card-header {
  background: linear-gradient(90deg, #ff00aa, #7c4dff) !important;
  box-shadow: 0 0 20px rgba(255,0,170,0.5);
}

html[data-ui="neon"] .tab-bar {
  background: rgba(12, 0, 28, 0.9);
  border-top: 1px solid rgba(0,240,255,0.35);
  box-shadow: 0 -4px 24px rgba(255,0,170,0.15);
}

html[data-ui="neon"] .tab-item { color: #ff80ab; }
html[data-ui="neon"] .tab-item.active {
  color: #00f0ff;
  text-shadow: 0 0 12px #00f0ff;
}

html[data-ui="neon"] .me-hero {
  background: linear-gradient(135deg, #ff00aa, #7c4dff, #00f0ff);
  background-size: 200% 200%;
  animation: me-hero-shift 6s ease infinite;
  box-shadow: 0 0 40px rgba(255,0,170,0.45);
}

html[data-ui="neon"] .stat-pill {
  border: 1px solid rgba(0,240,255,0.4);
  background: rgba(255,0,170,0.15);
  box-shadow: 0 0 12px rgba(0,240,255,0.15);
}

/* Auth gate polish */
#screen-auth .auth-form {
  animation: card-in 0.35s ease;
}

html[data-ui="zone"] #screen-auth,
html[data-ui="neon"] #screen-auth,
html[data-ui="scifi"] #screen-auth {
  background: rgba(0,0,0,0.25);
}

/* ═══════════════════════════════════════════════════════════════
   Contrast fixes — readable text on home + settings (mobile)
   ═══════════════════════════════════════════════════════════════ */

/* Home stats: solid cards, never white-on-white */
.stat-pill {
  background: rgba(255, 255, 255, 0.94) !important;
  color: #1a1a1a !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stat-pill .n {
  color: #111 !important;
  font-weight: 700 !important;
}

.stat-pill .l {
  color: #444 !important;
  opacity: 1 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.02em;
}

.stat-pill.accent {
  background: linear-gradient(160deg, #fff3e0 0%, #ffe0b2 100%) !important;
  border-color: rgba(239, 108, 0, 0.2) !important;
}

.stat-pill.accent .n {
  color: #e65100 !important;
}

.stat-pill.warm {
  background: linear-gradient(160deg, #e3f2fd 0%, #bbdefb 100%) !important;
  border-color: rgba(25, 118, 210, 0.2) !important;
}

.stat-pill.warm .n {
  color: #1565c0 !important;
}

/* Dark theme home stats */
[data-theme="dark"] .stat-pill {
  background: rgba(40, 40, 44, 0.94) !important;
  color: #f5f5f5 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .stat-pill .n {
  color: #fff !important;
}

[data-theme="dark"] .stat-pill .l {
  color: #c8c8c8 !important;
}

[data-theme="dark"] .stat-pill.accent {
  background: linear-gradient(160deg, #3e2723 0%, #4e342e 100%) !important;
  border-color: rgba(255, 183, 77, 0.35) !important;
}

[data-theme="dark"] .stat-pill.accent .n {
  color: #ffb74d !important;
}

[data-theme="dark"] .stat-pill.warm {
  background: linear-gradient(160deg, #0d2137 0%, #1565c0 160%) !important;
  border-color: rgba(100, 181, 246, 0.35) !important;
}

[data-theme="dark"] .stat-pill.warm .n {
  color: #90caf9 !important;
}

/* Home filter chips: readable on both light & dark zone bg */
.chip {
  background: rgba(255, 255, 255, 0.88) !important;
  color: #1a1a1a !important;
  font-weight: 600 !important;
  text-shadow: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.chip.active {
  background: linear-gradient(135deg, #5e35b1, #1e88e5) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 12px rgba(94, 53, 177, 0.35) !important;
}

[data-theme="dark"] .chip {
  background: rgba(50, 50, 54, 0.92) !important;
  color: #f0f0f0 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .chip.active {
  background: linear-gradient(135deg, #7c4dff, #42a5f5) !important;
  color: #fff !important;
}

/* Topbar greeting on light zone */
html[data-ui="zone"][data-theme="light"] .topbar-sub {
  color: #3d1a5c !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

html[data-ui="zone"][data-theme="light"] .topbar h1 {
  /* solid fallback if gradient clip fails on some devices */
  color: #4a148c !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) !important;
  filter: none !important;
  font-weight: 800 !important;
}

html[data-ui="zone"][data-theme="dark"] .topbar h1 {
  color: #fff !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45) !important;
  filter: none !important;
}

html[data-ui="zone"][data-theme="dark"] .topbar-sub {
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 500 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

/* Default (non-zone) topbar keep white with stronger shadow */
.topbar h1 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 1px rgba(0, 0, 0, 0.2) !important;
}

.topbar-sub {
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Settings / theme pages: high contrast rows */
.settings-card {
  background: #ffffff !important;
  color: #1a1a1a !important;
}

.settings-row {
  color: #1a1a1a !important;
  background: transparent !important;
}

.settings-row .sr-title {
  color: #111111 !important;
  font-weight: 600 !important;
}

.settings-row .sr-desc {
  color: #555555 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
}

.settings-row .sr-chevron,
.settings-row .sr-check {
  color: #5e35b1 !important;
  opacity: 1 !important;
}

.settings-row.selected {
  background: #ede7f6 !important;
}

.settings-row.selected .sr-title {
  color: #311b92 !important;
}

.settings-group-title {
  color: #424242 !important;
  font-weight: 700 !important;
}

.page-header.solid {
  background: rgba(255, 255, 255, 0.96) !important;
}

.page-header h1 {
  color: #111 !important;
  font-weight: 800 !important;
}

.settings-footer-note {
  color: #555 !important;
  font-weight: 500 !important;
}

/* Dark theme settings */
[data-theme="dark"] .settings-card {
  background: #2c2c2e !important;
  color: #f5f5f5 !important;
}

[data-theme="dark"] .settings-row {
  color: #f5f5f5 !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .settings-row .sr-title {
  color: #ffffff !important;
}

[data-theme="dark"] .settings-row .sr-desc {
  color: #bdbdbd !important;
}

[data-theme="dark"] .settings-row .sr-chevron,
[data-theme="dark"] .settings-row .sr-check {
  color: #b388ff !important;
}

[data-theme="dark"] .settings-row.selected {
  background: rgba(124, 77, 255, 0.22) !important;
}

[data-theme="dark"] .settings-group-title {
  color: #e0e0e0 !important;
}

[data-theme="dark"] .page-header.solid {
  background: rgba(28, 28, 30, 0.96) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .page-header h1 {
  color: #fff !important;
}

[data-theme="dark"] .settings-footer-note {
  color: #b0b0b0 !important;
}

/* Theme option rows: explicit readable labels */
.theme-opt .sr-title,
.lang-opt .sr-title,
.sort-opt .sr-title {
  color: #111 !important;
  font-size: 16px !important;
}

.theme-opt .sr-desc,
.lang-opt .sr-desc,
.sort-opt .sr-desc {
  color: #555 !important;
}

[data-theme="dark"] .theme-opt .sr-title,
[data-theme="dark"] .lang-opt .sr-title,
[data-theme="dark"] .sort-opt .sr-title {
  color: #fff !important;
}

[data-theme="dark"] .theme-opt .sr-desc,
[data-theme="dark"] .lang-opt .sr-desc,
[data-theme="dark"] .sort-opt .sr-desc {
  color: #c0c0c0 !important;
}

/* Sci-fi / neon skins force light text — keep settings readable */
html[data-ui="scifi"] .settings-card,
html[data-ui="neon"] .settings-card {
  background: rgba(8, 20, 40, 0.95) !important;
  border: 1px solid rgba(0, 229, 255, 0.35) !important;
}

html[data-ui="scifi"] .settings-row .sr-title,
html[data-ui="neon"] .settings-row .sr-title {
  color: #e8ffff !important;
}

html[data-ui="scifi"] .settings-row .sr-desc,
html[data-ui="neon"] .settings-row .sr-desc {
  color: #9adce8 !important;
}

html[data-ui="scifi"] .page-header h1,
html[data-ui="neon"] .page-header h1 {
  color: #e8ffff !important;
}

html[data-ui="scifi"] .settings-group-title,
html[data-ui="neon"] .settings-group-title {
  color: #80deea !important;
}

html[data-ui="scifi"] .stat-pill,
html[data-ui="neon"] .stat-pill {
  background: rgba(0, 30, 50, 0.88) !important;
  border: 1px solid rgba(0, 229, 255, 0.4) !important;
  color: #e8ffff !important;
}

html[data-ui="scifi"] .stat-pill .n,
html[data-ui="neon"] .stat-pill .n {
  color: #18ffff !important;
}

html[data-ui="scifi"] .stat-pill .l,
html[data-ui="neon"] .stat-pill .l {
  color: #b2ebf2 !important;
}

html[data-ui="scifi"] .chip,
html[data-ui="neon"] .chip {
  background: rgba(0, 40, 60, 0.85) !important;
  color: #e0f7fa !important;
  border-color: rgba(0, 229, 255, 0.4) !important;
}

html[data-ui="scifi"] .chip.active,
html[data-ui="neon"] .chip.active {
  color: #021018 !important;
  background: #18ffff !important;
}

/* Mech: dark labels on metal pills */
html[data-ui="mech"] .stat-pill {
  background: linear-gradient(180deg, #fafafa, #cfd8dc) !important;
  color: #212121 !important;
  border: 2px solid #37474f !important;
}

html[data-ui="mech"] .stat-pill .n {
  color: #212121 !important;
}

html[data-ui="mech"] .stat-pill .l {
  color: #455a64 !important;
}

html[data-ui="mech"] .chip {
  background: #eceff1 !important;
  color: #212121 !important;
  border: 2px solid #37474f !important;
}

html[data-ui="mech"] .chip.active {
  background: linear-gradient(180deg, #ffd54f, #ff8f00) !important;
  color: #212121 !important;
}

/* Catalog section headers */
.catalog-section-h h3 {
  color: #111 !important;
  font-weight: 800 !important;
}

.catalog-section-h span {
  color: #555 !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .catalog-section-h h3 {
  color: #fff !important;
}

[data-theme="dark"] .catalog-section-h span {
  color: #c0c0c0 !important;
}

.catalog-label {
  color: #222 !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .catalog-label {
  color: #eee !important;
}

.cr-title {
  color: #111 !important;
  font-weight: 700 !important;
}

.cr-sub {
  color: #555 !important;
}

.cr-num {
  color: #111 !important;
}

[data-theme="dark"] .cr-title,
[data-theme="dark"] .cr-num {
  color: #fff !important;
}

[data-theme="dark"] .cr-sub {
  color: #c0c0c0 !important;
}

/* Search input contrast */
.search-bar input {
  color: #111 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  font-weight: 500;
}

.search-bar input::placeholder {
  color: #666 !important;
  opacity: 1 !important;
}

[data-theme="dark"] .search-bar input {
  color: #fff !important;
  background: rgba(40, 40, 44, 0.95) !important;
}

[data-theme="dark"] .search-bar input::placeholder {
  color: #aaa !important;
}

/* Tab bar labels a bit stronger */
.tab-item {
  color: #616161 !important;
  font-weight: 600;
}

.tab-item.active {
  color: #5e35b1 !important;
  font-weight: 700;
}

[data-theme="dark"] .tab-item {
  color: #b0b0b0 !important;
}

[data-theme="dark"] .tab-item.active {
  color: #ce93d8 !important;
}

/* Mode cards on settings */
.mode-card-title {
  color: #111 !important;
  font-weight: 800 !important;
}

.mode-card-desc {
  color: #555 !important;
  font-weight: 500 !important;
}

[data-theme="dark"] .mode-card {
  background: #2c2c2e !important;
}

[data-theme="dark"] .mode-card-title {
  color: #fff !important;
}

[data-theme="dark"] .mode-card-desc {
  color: #c0c0c0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Semi-transparent glass UI — custom bg shows through
   ═══════════════════════════════════════════════════════════════ */

/* Stats pills */
.stat-pill {
  background: rgba(255, 255, 255, 0.38) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: blur(14px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.2) !important;
  color: #111 !important;
}

.stat-pill .n {
  color: #0d0d0d !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.stat-pill .l {
  color: #222 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.stat-pill.accent {
  background: rgba(255, 183, 77, 0.38) !important;
  border-color: rgba(255, 152, 0, 0.4) !important;
}

.stat-pill.warm {
  background: rgba(100, 181, 246, 0.38) !important;
  border-color: rgba(30, 136, 229, 0.35) !important;
}

[data-theme="dark"] .stat-pill {
  background: rgba(20, 20, 24, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

[data-theme="dark"] .stat-pill .n {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .stat-pill .l {
  color: rgba(255, 255, 255, 0.88) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .stat-pill.accent {
  background: rgba(255, 152, 0, 0.28) !important;
}

[data-theme="dark"] .stat-pill.warm {
  background: rgba(33, 150, 243, 0.3) !important;
}

/* Filter chips */
.chip {
  background: rgba(255, 255, 255, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #111 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

.chip.active {
  background: rgba(94, 53, 177, 0.78) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

[data-theme="dark"] .chip {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #f5f5f5 !important;
}

[data-theme="dark"] .chip.active {
  background: rgba(124, 77, 255, 0.72) !important;
  color: #fff !important;
}

/* Search bar */
.search-bar input {
  background: rgba(255, 255, 255, 0.42) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
  color: #111 !important;
}

[data-theme="dark"] .search-bar input {
  background: rgba(0, 0, 0, 0.42) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

/* Event list cards */
.event-card {
  background: rgba(255, 255, 255, 0.52) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(16px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.15) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
}

.event-card .event-title,
.event-card .num {
  color: #111 !important;
}

.event-card .event-sub,
.event-card .event-sub-soft,
.event-card .label {
  color: #333 !important;
}

[data-theme="dark"] .event-card {
  background: rgba(20, 20, 28, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .event-card .event-title,
[data-theme="dark"] .event-card .num {
  color: #fff !important;
}

[data-theme="dark"] .event-card .event-sub,
[data-theme="dark"] .event-card .event-sub-soft,
[data-theme="dark"] .event-card .label {
  color: rgba(255, 255, 255, 0.78) !important;
}

/* Icon buttons on home */
.icon-btn {
  background: rgba(255, 255, 255, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

html[data-ui="zone"][data-theme="light"] .icon-btn {
  color: #3d1a5c !important;
  text-shadow: none;
}

[data-theme="dark"] .icon-btn {
  background: rgba(0, 0, 0, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

/* FAB */
.fab {
  background: rgba(94, 53, 177, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Tab bar glass */
.tab-bar {
  background: rgba(255, 255, 255, 0.55) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(22px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.3) !important;
}

[data-theme="dark"] .tab-bar {
  background: rgba(18, 18, 22, 0.55) !important;
  border-top-color: rgba(255, 255, 255, 0.12) !important;
}

/* Settings cards + rows */
.settings-card {
  background: rgba(255, 255, 255, 0.48) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(18px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.15) !important;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08) !important;
}

.settings-row {
  background: transparent !important;
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

.settings-row .sr-title {
  color: #111 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.settings-row .sr-desc {
  color: #333 !important;
}

.settings-row.selected {
  background: rgba(94, 53, 177, 0.14) !important;
}

.page-header.solid {
  background: rgba(255, 255, 255, 0.5) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
}

.page-header h1 {
  color: #111 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .settings-card {
  background: rgba(24, 24, 30, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .settings-row .sr-title {
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .settings-row .sr-desc {
  color: rgba(255, 255, 255, 0.78) !important;
}

[data-theme="dark"] .page-header.solid {
  background: rgba(18, 18, 24, 0.5) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .page-header h1 {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Mode cards */
.mode-card {
  background: rgba(255, 255, 255, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.mode-card.selected {
  border-color: rgba(94, 53, 177, 0.7) !important;
  background: rgba(237, 231, 246, 0.55) !important;
}

[data-theme="dark"] .mode-card {
  background: rgba(24, 24, 30, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

/* Catalog */
.catalog-select {
  background: rgba(255, 255, 255, 0.42) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #111 !important;
}

.chip-btn {
  background: rgba(255, 255, 255, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #222 !important;
}

.catalog-row {
  background: transparent !important;
  border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}

[data-theme="dark"] .catalog-select,
[data-theme="dark"] .chip-btn {
  background: rgba(0, 0, 0, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

/* Auth form card */
.auth-form.settings-card,
.settings-card.pad {
  background: rgba(255, 255, 255, 0.5) !important;
}

/* Type options in form */
.type-opt {
  background: rgba(255, 255, 255, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.type-opt.selected {
  background: rgba(94, 53, 177, 0.2) !important;
  border-color: rgba(94, 53, 177, 0.55) !important;
}

/* Sheet / form panel */
.sheet {
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: blur(22px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.2) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .sheet {
  background: rgba(22, 22, 28, 0.78) !important;
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* Detail action buttons */
.action-btn {
  background: rgba(255, 255, 255, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: #111 !important;
}

.action-btn.primary {
  background: rgba(94, 53, 177, 0.78) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

[data-theme="dark"] .action-btn {
  background: rgba(0, 0, 0, 0.4) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

/* Days Matter detail card — slightly glass so bg peeks at edges */
.days-card {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
}

[data-theme="dark"] .days-card {
  background: rgba(30, 30, 34, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Sci-fi / neon keep glass but tinted */
html[data-ui="scifi"] .stat-pill,
html[data-ui="neon"] .stat-pill {
  background: rgba(0, 40, 60, 0.45) !important;
  border: 1px solid rgba(0, 229, 255, 0.4) !important;
  color: #e8ffff !important;
}

html[data-ui="scifi"] .stat-pill .n,
html[data-ui="neon"] .stat-pill .n {
  color: #18ffff !important;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

html[data-ui="scifi"] .stat-pill .l,
html[data-ui="neon"] .stat-pill .l {
  color: #b2ebf2 !important;
  text-shadow: none;
}

html[data-ui="scifi"] .chip,
html[data-ui="neon"] .chip,
html[data-ui="scifi"] .event-card,
html[data-ui="neon"] .event-card,
html[data-ui="scifi"] .settings-card,
html[data-ui="neon"] .settings-card {
  background: rgba(4, 20, 40, 0.48) !important;
  border-color: rgba(0, 229, 255, 0.35) !important;
  color: #e8ffff !important;
}

html[data-ui="scifi"] .chip.active,
html[data-ui="neon"] .chip.active {
  background: rgba(0, 229, 255, 0.35) !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4) !important;
}

html[data-ui="scifi"] .event-card .event-title,
html[data-ui="neon"] .event-card .event-title,
html[data-ui="scifi"] .event-card .num,
html[data-ui="neon"] .event-card .num {
  color: #e8ffff !important;
}

html[data-ui="mech"] .stat-pill,
html[data-ui="mech"] .chip,
html[data-ui="mech"] .event-card,
html[data-ui="mech"] .settings-card {
  background: rgba(236, 239, 241, 0.55) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* ═══════════════════════════════════════════════════════════════
   Background-aware UI
   - default  → frosted glass (毛玻璃)
   - custom   → fully transparent frames (全透明框，背景全露)
   ═══════════════════════════════════════════════════════════════ */

/* Custom photo: full-bleed, slight dark veil only for text safety */
html[data-bg="custom"] .wood-bg.has-custom-bg {
  background-color: #111 !important;
  background-image: var(--custom-bg) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

html[data-bg="custom"] .wood-bg.has-custom-bg::before {
  opacity: 1 !important;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.12) 40%,
    rgba(0, 0, 0, 0.22) 100%
  ) !important;
  background-image: none !important;
  mix-blend-mode: normal !important;
  backdrop-filter: none !important;
}

html[data-bg="custom"] .zone-orbs,
html[data-bg="custom"] .hud-grid {
  display: none !important;
}

html[data-bg="custom"] .wood-bg::after {
  display: none !important;
}

/* ── Fully transparent chrome on custom bg ───────────────────── */
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card,
html[data-bg="custom"] .icon-btn,
html[data-bg="custom"] .settings-card,
html[data-bg="custom"] .mode-card,
html[data-bg="custom"] .catalog-select,
html[data-bg="custom"] .chip-btn,
html[data-bg="custom"] .type-opt,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .page-header.solid,
html[data-bg="custom"] .tab-bar,
html[data-bg="custom"] .sheet,
html[data-bg="custom"] .auth-tabs,
html[data-bg="custom"] .me-hero {
  background: transparent !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

/* Thin outline so controls stay tappable / visible without solid fill */
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card,
html[data-bg="custom"] .settings-card,
html[data-bg="custom"] .mode-card,
html[data-bg="custom"] .type-opt,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .catalog-select,
html[data-bg="custom"] .chip-btn {
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
}

html[data-bg="custom"] .icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75) !important;
}

/* Text: high-contrast white + shadow over any photo */
html[data-bg="custom"] .topbar h1,
html[data-bg="custom"] .topbar-sub,
html[data-bg="custom"] .stat-pill,
html[data-bg="custom"] .stat-pill .n,
html[data-bg="custom"] .stat-pill .l,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card .event-title,
html[data-bg="custom"] .event-card .num,
html[data-bg="custom"] .event-card .event-sub,
html[data-bg="custom"] .event-card .event-sub-soft,
html[data-bg="custom"] .event-card .label,
html[data-bg="custom"] .settings-row .sr-title,
html[data-bg="custom"] .settings-row .sr-desc,
html[data-bg="custom"] .settings-group-title,
html[data-bg="custom"] .page-header h1,
html[data-bg="custom"] .settings-footer-note,
html[data-bg="custom"] .mode-card-title,
html[data-bg="custom"] .mode-card-desc,
html[data-bg="custom"] .catalog-label,
html[data-bg="custom"] .catalog-section-h h3,
html[data-bg="custom"] .catalog-section-h span,
html[data-bg="custom"] .cr-title,
html[data-bg="custom"] .cr-sub,
html[data-bg="custom"] .cr-num,
html[data-bg="custom"] .tab-item,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .type-opt .t-name,
html[data-bg="custom"] .type-opt .t-hint,
html[data-bg="custom"] .me-name,
html[data-bg="custom"] .me-meta {
  color: #fff !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 8px rgba(0, 0, 0, 0.45) !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  filter: none !important;
}

html[data-bg="custom"] .search-bar input::placeholder {
  color: rgba(255, 255, 255, 0.75) !important;
}

html[data-bg="custom"] .search-bar::before {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Active chip: soft white fill only, still mostly see-through */
html[data-bg="custom"] .chip.active {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: #fff !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: none !important;
}

html[data-bg="custom"] .settings-row.selected,
html[data-bg="custom"] .type-opt.selected,
html[data-bg="custom"] .mode-card.selected {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
}

html[data-bg="custom"] .settings-row {
  border-bottom-color: rgba(255, 255, 255, 0.15) !important;
}

html[data-bg="custom"] .sr-chevron,
html[data-bg="custom"] .sr-check {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

/* Tab bar: transparent strip, white labels */
html[data-bg="custom"] .tab-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
  background: transparent !important;
}

html[data-bg="custom"] .tab-item {
  color: rgba(255, 255, 255, 0.75) !important;
}

html[data-bg="custom"] .tab-item.active {
  color: #fff !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6), 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

/* FAB: keep a bit of tint so it's findable, still translucent */
html[data-bg="custom"] .fab {
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: none !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Detail card: keep mostly opaque for classic Days Matter look,
   but slightly translucent so photo peeks through edges */
html[data-bg="custom"] .days-card {
  background: rgba(255, 255, 255, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(2px) !important;
  -webkit-backdrop-filter: blur(2px) !important;
}

html[data-bg="custom"] .days-card .days-number,
html[data-bg="custom"] .days-card .days-label,
html[data-bg="custom"] .days-card .target-label,
html[data-bg="custom"] .days-card .days-hint,
html[data-bg="custom"] .days-card .days-note {
  text-shadow: none !important;
  color: inherit !important;
}

/* Form fields on transparent sheet */
html[data-bg="custom"] .sheet {
  background: rgba(0, 0, 0, 0.35) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
}

html[data-bg="custom"] .sheet h3,
html[data-bg="custom"] .field label,
html[data-bg="custom"] .toggle-row span {
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
}

html[data-bg="custom"] .field input,
html[data-bg="custom"] .field select,
html[data-bg="custom"] .field textarea {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  color: #fff !important;
  backdrop-filter: none !important;
}

html[data-bg="custom"] .btn-ghost {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
}

html[data-bg="custom"] .btn-primary {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid #fff !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* Me hero transparent with ring */
html[data-bg="custom"] .me-hero {
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  animation: none !important;
}

/* 自定义背景：不要用 background 简写，否则会冲掉头像的 background-image / 子 img */
html[data-bg="custom"] .me-avatar {
  background-color: rgba(0, 0, 0, 0.25) !important;
  border-color: rgba(255, 255, 255, 0.75) !important;
  color: #fff !important;
}

html[data-bg="custom"] .me-avatar.has-photo {
  background-color: transparent !important;
  color: transparent !important;
}

html[data-bg="custom"] .me-avatar .me-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Screens that had solid tints — clear them so photo shows */
html[data-bg="custom"] #screen-settings,
html[data-bg="custom"] #screen-settings-sub,
html[data-bg="custom"] #screen-me,
html[data-bg="custom"] #screen-auth,
html[data-bg="custom"] #screen-catalog {
  background: transparent !important;
}

/* Default bg: keep frosted glass (already defined above).
   Ensure data-bg=default is explicit for clarity. */
html[data-bg="default"] .stat-pill,
html[data-bg="default"] .chip:not(.active),
html[data-bg="default"] .settings-card {
  /* glass retained from previous rules */
}

/* ═══════════════════════════════════════════════════════════════
   Typography polish — lively but grounded, no heavy outline
   ═══════════════════════════════════════════════════════════════ */

body,
button,
input,
select,
textarea {
  font-family: var(--font-sans) !important;
}

/* Soft hierarchy — avoid 700/800 “stamp” weights */
.topbar h1,
.page-header h1,
.me-name,
.catalog-section-h h3,
.sr-title,
.mode-card-title,
.event-title,
.cr-title {
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
}

.topbar h1 {
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  /* soft glow, not hard outline */
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.12) !important;
}

.topbar-sub,
.stat-pill .l,
.chip,
.sr-desc,
.event-sub,
.event-sub-soft,
.cr-sub,
.catalog-label,
.settings-group-title,
.settings-footer-note {
  font-weight: 400 !important;
  letter-spacing: 0.04em !important;
}

.stat-pill .n,
.event-count .num,
.cr-num,
.days-number {
  font-family: var(--font-num) !important;
  font-weight: 400 !important;
  letter-spacing: -0.02em !important;
  font-variant-numeric: tabular-nums;
}

.days-number {
  font-weight: 300 !important;
  letter-spacing: -0.04em !important;
}

.chip,
.tab-item,
.btn,
.action-btn,
.settings-row {
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
}

.tab-label {
  font-weight: 400 !important;
  letter-spacing: 0.06em !important;
  font-size: 11px !important;
}

/* Kill harsh multi-layer shadows from earlier contrast passes */
.stat-pill .n,
.stat-pill .l,
.chip,
.event-card .event-title,
.event-card .num,
.event-card .event-sub,
.event-card .label,
.settings-row .sr-title,
.settings-row .sr-desc,
.page-header h1,
.mode-card-title,
.mode-card-desc,
.cr-title,
.cr-sub,
.cr-num,
.catalog-section-h h3,
.me-name,
.me-meta {
  text-shadow: none !important;
}

/* Custom photo bg: soft legibility, not 人机描边 */
html[data-bg="custom"] .topbar h1,
html[data-bg="custom"] .topbar-sub,
html[data-bg="custom"] .stat-pill .n,
html[data-bg="custom"] .stat-pill .l,
html[data-bg="custom"] .chip,
html[data-bg="custom"] .search-bar input,
html[data-bg="custom"] .event-card .event-title,
html[data-bg="custom"] .event-card .num,
html[data-bg="custom"] .event-card .event-sub,
html[data-bg="custom"] .event-card .event-sub-soft,
html[data-bg="custom"] .event-card .label,
html[data-bg="custom"] .settings-row .sr-title,
html[data-bg="custom"] .settings-row .sr-desc,
html[data-bg="custom"] .settings-group-title,
html[data-bg="custom"] .page-header h1,
html[data-bg="custom"] .settings-footer-note,
html[data-bg="custom"] .mode-card-title,
html[data-bg="custom"] .mode-card-desc,
html[data-bg="custom"] .catalog-label,
html[data-bg="custom"] .catalog-section-h h3,
html[data-bg="custom"] .catalog-section-h span,
html[data-bg="custom"] .cr-title,
html[data-bg="custom"] .cr-sub,
html[data-bg="custom"] .cr-num,
html[data-bg="custom"] .tab-item,
html[data-bg="custom"] .action-btn,
html[data-bg="custom"] .type-opt .t-name,
html[data-bg="custom"] .type-opt .t-hint,
html[data-bg="custom"] .me-name,
html[data-bg="custom"] .me-meta,
html[data-bg="custom"] .icon-btn,
html[data-bg="custom"] .sr-chevron,
html[data-bg="custom"] .sr-check {
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35) !important;
  font-weight: 500 !important;
}

html[data-bg="custom"] .topbar h1 {
  font-weight: 600 !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4) !important;
}

/* Slight bounce for titles — lively, not floaty */
.topbar h1,
.page-header h1 {
  font-optical-sizing: auto;
}

/* Zone light title: soft color, no gradient clip weirdness */
html[data-ui="zone"][data-theme="light"] .topbar h1 {
  color: #4a3080 !important;
  background: none !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

html[data-ui="zone"][data-theme="dark"] .topbar h1 {
  color: #f3e8ff !important;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25) !important;
}

/* Mech: still industrial but not brick-stiff type */
html[data-ui="mech"] {
  --font-sans: "Noto Sans SC", "PingFang SC", system-ui, sans-serif !important;
}

html[data-ui="mech"] body,
html[data-ui="mech"] button {
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}

/* Sci-fi: keep mono numbers, softer UI labels */
html[data-ui="scifi"] {
  --font-sans: "Noto Sans SC", "DM Sans", "PingFang SC", system-ui, sans-serif !important;
}

html[data-ui="scifi"] .chip,
html[data-ui="scifi"] .btn,
html[data-ui="scifi"] .settings-row {
  text-transform: none !important;
  letter-spacing: 0.03em !important;
  font-size: inherit;
}

.field-select,
.field input[type="time"] {
  width: 100%;
  height: 46px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.field-select:focus,
.field input[type="time"]:focus {
  border-color: var(--color-primary);
}

.toggle-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-weight: 400;
}

/* In-app reminder banner (fallback for WeChat etc.) */
.inapp-remind-host {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  right: 12px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.inapp-remind-card {
  pointer-events: auto;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(30, 30, 36, 0.88);
  color: #fff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-family: inherit;
  cursor: pointer;
  animation: ir-in 0.35s ease;
}

.inapp-remind-card .ir-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.inapp-remind-card .ir-body {
  font-size: 13px;
  opacity: 0.9;
  line-height: 1.4;
}

@keyframes ir-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Ambient FX + new skins + avatar + readable text all modes
   ═══════════════════════════════════════════════════════════════ */

.fx-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

html[data-bg="custom"] .fx-ambient {
  opacity: 0.25;
}

/* Rising stars / dots */
.amb-star,
.amb-dot {
  position: absolute;
  bottom: -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  animation: amb-rise linear infinite;
}

.amb-dot {
  background: rgba(180, 220, 255, 0.9);
  box-shadow: 0 0 8px rgba(100, 200, 255, 0.7);
}

@keyframes amb-rise {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  10% { opacity: 1; }
  100% {
    transform: translate(var(--sx, 0), -110vh) scale(1);
    opacity: 0;
  }
}

/* Sakura petals */
.amb-petal {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 10px;
  background: radial-gradient(circle at 30% 30%, #ffc0d9, #ff80ab 70%);
  border-radius: 80% 0 80% 0;
  animation: amb-fall linear infinite;
  opacity: 0.85;
}

@keyframes amb-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.9; }
  100% {
    transform: translate(var(--drift, 40px), 110vh) rotate(360deg);
    opacity: 0.2;
  }
}

/* Aurora bands */
.amb-aurora {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 40%;
  filter: blur(40px);
  opacity: 0.45;
  animation: amb-aurora 12s ease-in-out infinite alternate;
}
.amb-aurora.a1 {
  top: 5%;
  background: linear-gradient(90deg, transparent, #00e676, #18ffff, transparent);
}
.amb-aurora.a2 {
  top: 25%;
  background: linear-gradient(90deg, transparent, #ea80fc, #7c4dff, transparent);
  animation-delay: -4s;
  opacity: 0.35;
}
.amb-aurora.a3 {
  top: 45%;
  background: linear-gradient(90deg, transparent, #82b1ff, #00bcd4, transparent);
  animation-delay: -7s;
  opacity: 0.3;
}

@keyframes amb-aurora {
  from { transform: translateX(-8%) skewX(-6deg); }
  to { transform: translateX(8%) skewX(6deg); }
}

.amb-neon-spark {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #ff00aa, 0 0 4px #00f0ff;
  animation: amb-twinkle 2.4s ease-in-out infinite;
}

@keyframes amb-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.4); }
}

.amb-ink-blot {
  position: absolute;
  width: 120px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,30,30,0.08), transparent 70%);
  animation: amb-ink 10s ease-in-out infinite alternate;
}

@keyframes amb-ink {
  from { transform: scale(1); opacity: 0.5; }
  to { transform: scale(1.2); opacity: 0.25; }
}

/* Mode previews */
.aurora-preview {
  background: linear-gradient(120deg, #0a1628, #123 40%, #1a3a4a);
  position: relative;
  overflow: hidden;
}
.aurora-preview::after {
  content: "";
  position: absolute;
  inset: 20% -10%;
  background: linear-gradient(90deg, transparent, #00e67688, #18ffff88, transparent);
  filter: blur(8px);
}

.starry-preview {
  background: radial-gradient(circle at 30% 20%, #1a237e, #000 70%);
}
.starry-preview::after {
  content: "✦ · ✧ · ✦";
  display: block;
  text-align: center;
  padding-top: 28px;
  color: #fff;
  font-size: 10px;
  letter-spacing: 4px;
  opacity: 0.85;
}

.sakura-preview {
  background: linear-gradient(180deg, #fff0f5, #f8bbd0 50%, #fce4ec);
}
.sakura-preview::after {
  content: "❀";
  display: block;
  text-align: center;
  padding-top: 24px;
  font-size: 22px;
  opacity: 0.7;
}

.ink-preview {
  background: linear-gradient(160deg, #f5f0e8, #e8e0d4 50%, #d7cfc4);
}
.ink-preview::after {
  content: "";
  display: block;
  width: 50%;
  height: 2px;
  margin: 34px auto 0;
  background: #5d4037;
  opacity: 0.4;
}

/* ── AURORA skin ─────────────────────────────────────────────── */
html[data-ui="aurora"] {
  --color-primary: #26a69a;
  --color-primary-dark: #00897b;
  --color-text: #e8fff8;
  --color-text-secondary: #b2dfdb;
  --color-text-muted: #80cbc4;
  --color-surface: rgba(8, 28, 32, 0.72);
  --color-surface-2: rgba(12, 40, 44, 0.85);
  --color-divider: rgba(0, 230, 180, 0.2);
  --page-bg-solid: rgba(6, 18, 24, 0.88);
  --blue: #26c6da;
}

html[data-ui="aurora"] .zone-orbs { display: none !important; }

html[data-ui="aurora"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 230, 118, 0.35), transparent 45%),
    radial-gradient(ellipse at 80% 30%, rgba(0, 229, 255, 0.28), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(124, 77, 255, 0.25), transparent 45%),
    linear-gradient(180deg, #041018 0%, #0a2030 50%, #061820 100%);
}

html[data-ui="aurora"] .topbar h1 {
  color: #e0fff6 !important;
  background: none !important;
  text-shadow: 0 0 16px rgba(0, 230, 180, 0.45) !important;
  font-weight: 600 !important;
}

html[data-ui="aurora"] .topbar-sub {
  color: #b2dfdb !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
}

html[data-ui="aurora"] .chip.active,
html[data-ui="aurora"] .btn-primary,
html[data-ui="aurora"] .fab {
  background: linear-gradient(135deg, #26a69a, #00bcd4) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(0, 188, 212, 0.35) !important;
}

html[data-ui="aurora"] .tab-item { color: #80cbc4 !important; }
html[data-ui="aurora"] .tab-item.active { color: #e0f7fa !important; }

/* ── STARRY skin ─────────────────────────────────────────────── */
html[data-ui="starry"] {
  --color-primary: #7e57c2;
  --color-primary-dark: #5e35b1;
  --color-text: #f3e5f5;
  --color-text-secondary: #e1bee7;
  --color-text-muted: #ce93d8;
  --color-surface: rgba(16, 12, 40, 0.75);
  --color-surface-2: rgba(28, 20, 56, 0.88);
  --color-divider: rgba(179, 136, 255, 0.22);
  --page-bg-solid: rgba(10, 8, 28, 0.9);
  --blue: #b388ff;
}

html[data-ui="starry"] .zone-orbs { display: none !important; }

html[data-ui="starry"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(63, 81, 181, 0.35), transparent 50%),
    radial-gradient(circle at 20% 30%, rgba(103, 58, 183, 0.25), transparent 35%),
    linear-gradient(180deg, #050510 0%, #0d0a24 45%, #12082a 100%);
}

html[data-ui="starry"] .topbar h1 {
  color: #f8e8ff !important;
  background: none !important;
  text-shadow: 0 0 18px rgba(179, 136, 255, 0.5) !important;
  font-weight: 600 !important;
}

html[data-ui="starry"] .topbar-sub {
  color: #e1bee7 !important;
}

html[data-ui="starry"] .chip.active,
html[data-ui="starry"] .btn-primary,
html[data-ui="starry"] .fab {
  background: linear-gradient(135deg, #7e57c2, #5c6bc0) !important;
  color: #fff !important;
  box-shadow: 0 6px 22px rgba(126, 87, 194, 0.4) !important;
  border: none !important;
}

html[data-ui="starry"] .tab-item { color: #b39ddb !important; }
html[data-ui="starry"] .tab-item.active { color: #f3e5f5 !important; }

/* ── SAKURA skin ─────────────────────────────────────────────── */
html[data-ui="sakura"] {
  --color-primary: #ec407a;
  --color-primary-dark: #d81b60;
  --color-text: #4a148c;
  --color-text-secondary: #6a1b9a;
  --color-text-muted: #8e24aa;
  --color-surface: rgba(255, 255, 255, 0.72);
  --color-surface-2: rgba(255, 240, 246, 0.9);
  --color-divider: rgba(236, 64, 122, 0.15);
  --page-bg-solid: rgba(255, 250, 252, 0.9);
  --blue: #ec407a;
}

html[data-ui="sakura"] .zone-orbs { display: none !important; }

html[data-ui="sakura"] .wood-bg:not(.has-custom-bg) {
  background:
    radial-gradient(ellipse at 10% 0%, rgba(255, 192, 203, 0.55), transparent 40%),
    radial-gradient(ellipse at 90% 20%, rgba(255, 224, 230, 0.5), transparent 40%),
    linear-gradient(165deg, #fff5f8 0%, #fce4ec 40%, #f3e5f5 100%);
}

html[data-ui="sakura"] .topbar h1 {
  color: #880e4f !important;
  background: none !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5) !important;
  font-weight: 600 !important;
}

html[data-ui="sakura"] .topbar-sub {
  color: #ad1457 !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

html[data-ui="sakura"] .chip {
  color: #4a148c !important;
  background: rgba(255,255,255,0.65) !important;
}

html[data-ui="sakura"] .chip.active,
html[data-ui="sakura"] .btn-primary,
html[data-ui="sakura"] .fab {
  background: linear-gradient(135deg, #f48fb1, #ec407a) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(236, 64, 122, 0.3) !important;
}

html[data-ui="sakura"] .tab-item { color: #8e24aa !important; }
html[data-ui="sakura"] .tab-item.active { color: #c2185b !important; }

html[data-ui="sakura"] .settings-row .sr-title,
html[data-ui="sakura"] .page-header h1 {
  color: #4a148c !important;
}

html[data-ui="sakura"] .settings-row .sr-desc {
  color: #6a1b9a !important;
}

/* ── INK skin ────────────────────────────────────────────────── */
html[data-ui="ink"] {
  --color-primary: #5d4037;
  --color-primary-dark: #3e2723;
  --color-text: #2c2416;
  --color-text-secondary: #5d4e37;
  --color-text-muted: #6d5c4d;
  --color-surface: rgba(255, 252, 245, 0.82);
  --color-surface-2: rgba(245, 240, 230, 0.92);
  --color-divider: rgba(93, 64, 55, 0.12);
  --page-bg-solid: rgba(250, 247, 240, 0.92);
  --blue: #6d4c41;
}

html[data-ui="ink"] .zone-orbs { display: none !important; }

html[data-ui="ink"] .wood-bg:not(.has-custom-bg) {
  background:
    linear-gradient(165deg, #faf6ef 0%, #f0e9dc 50%, #e6dfd0 100%);
}

html[data-ui="ink"] .topbar h1 {
  color: #3e2723 !important;
  background: none !important;
  text-shadow: none !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
}

html[data-ui="ink"] .topbar-sub {
  color: #5d4037 !important;
  text-shadow: none !important;
}

html[data-ui="ink"] .chip {
  color: #3e2723 !important;
  background: rgba(255,255,255,0.55) !important;
  border-color: rgba(93,64,55,0.15) !important;
}

html[data-ui="ink"] .chip.active,
html[data-ui="ink"] .btn-primary,
html[data-ui="ink"] .fab {
  background: #5d4037 !important;
  color: #faf6ef !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(62, 39, 35, 0.25) !important;
}

html[data-ui="ink"] .tab-item { color: #6d4c41 !important; }
html[data-ui="ink"] .tab-item.active { color: #3e2723 !important; font-weight: 600 !important; }

html[data-ui="ink"] .settings-row .sr-title,
html[data-ui="ink"] .page-header h1 {
  color: #2c2416 !important;
}

html[data-ui="ink"] .settings-row .sr-desc {
  color: #5d4e37 !important;
}

/* Avatar photo */
.me-avatar {
  cursor: pointer;
  overflow: hidden;
  position: relative;
  padding: 0;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  transition: transform 0.15s, box-shadow 0.2s;
  border: 2px solid rgba(255, 255, 255, 0.55);
  font-family: inherit;
  color: #fff;
}

.me-avatar .me-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
}

.me-avatar.has-photo {
  color: transparent !important;
}

.me-avatar:active {
  transform: scale(0.96);
}

/* Flagship corner tag on mode cards */
.mode-flagship {
  display: inline-block !important;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c4dff, #448aff);
  color: #fff !important;
  text-shadow: none !important;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(68, 138, 255, 0.35);
}

/* ── Readable text: all dark skins ───────────────────────────── */
html[data-ui="aurora"] .settings-card,
html[data-ui="starry"] .settings-card,
html[data-ui="scifi"] .settings-card,
html[data-ui="neon"] .settings-card {
  background: rgba(10, 16, 28, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

html[data-ui="aurora"] .settings-row .sr-title,
html[data-ui="starry"] .settings-row .sr-title,
html[data-ui="scifi"] .settings-row .sr-title,
html[data-ui="neon"] .settings-row .sr-title,
html[data-ui="aurora"] .page-header h1,
html[data-ui="starry"] .page-header h1,
html[data-ui="scifi"] .page-header h1,
html[data-ui="neon"] .page-header h1,
html[data-ui="aurora"] .mode-card-title,
html[data-ui="starry"] .mode-card-title {
  color: #f5f9ff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35) !important;
  font-weight: 600 !important;
}

html[data-ui="aurora"] .settings-row .sr-desc,
html[data-ui="starry"] .settings-row .sr-desc,
html[data-ui="scifi"] .settings-row .sr-desc,
html[data-ui="neon"] .settings-row .sr-desc,
html[data-ui="aurora"] .mode-card-desc,
html[data-ui="starry"] .mode-card-desc {
  color: rgba(230, 240, 255, 0.82) !important;
}

html[data-ui="aurora"] .page-header.solid,
html[data-ui="starry"] .page-header.solid,
html[data-ui="scifi"] .page-header.solid,
html[data-ui="neon"] .page-header.solid {
  background: rgba(8, 12, 24, 0.55) !important;
  border-bottom-color: rgba(255,255,255,0.1) !important;
}

html[data-ui="aurora"] .chip:not(.active),
html[data-ui="starry"] .chip:not(.active) {
  background: rgba(255,255,255,0.12) !important;
  color: #f0f7ff !important;
  border-color: rgba(255,255,255,0.22) !important;
}

html[data-ui="aurora"] .event-card,
html[data-ui="starry"] .event-card {
  background: rgba(12, 18, 36, 0.55) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
}

html[data-ui="aurora"] .event-card .event-title,
html[data-ui="starry"] .event-card .event-title,
html[data-ui="aurora"] .event-card .num,
html[data-ui="starry"] .event-card .num {
  color: #f5f9ff !important;
}

html[data-ui="aurora"] .event-card .event-sub,
html[data-ui="starry"] .event-card .event-sub,
html[data-ui="aurora"] .event-card .label,
html[data-ui="starry"] .event-card .label {
  color: rgba(220, 230, 255, 0.8) !important;
}

html[data-ui="aurora"] .stat-pill,
html[data-ui="starry"] .stat-pill {
  background: rgba(255,255,255,0.12) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
}

html[data-ui="aurora"] .stat-pill .n,
html[data-ui="starry"] .stat-pill .n {
  color: #fff !important;
}

html[data-ui="aurora"] .stat-pill .l,
html[data-ui="starry"] .stat-pill .l {
  color: rgba(255,255,255,0.88) !important;
}

html[data-ui="aurora"] .search-bar input,
html[data-ui="starry"] .search-bar input {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.22) !important;
}

html[data-ui="aurora"] .search-bar input::placeholder,
html[data-ui="starry"] .search-bar input::placeholder {
  color: rgba(255,255,255,0.55) !important;
}

/* Light skins readable */
html[data-ui="sakura"] .event-card .event-title,
html[data-ui="ink"] .event-card .event-title,
html[data-ui="sakura"] .event-card .num,
html[data-ui="ink"] .event-card .num {
  color: #2c1810 !important;
}

html[data-ui="sakura"] .event-card .event-sub,
html[data-ui="ink"] .event-card .event-sub {
  color: #5d4037 !important;
}

html[data-ui="sakura"] .stat-pill .n,
html[data-ui="ink"] .stat-pill .n {
  color: #3e2723 !important;
}

html[data-ui="sakura"] .stat-pill .l,
html[data-ui="ink"] .stat-pill .l {
  color: #5d4037 !important;
}

/* Custom bg still wins for white text */
html[data-bg="custom"] .fx-ambient {
  display: none;
}

/* Zone flagship badge — corner tag only */
.mode-flagship {
  display: inline-block !important;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c4dff, #448aff);
  color: #fff !important;
  text-shadow: none !important;
  box-shadow: 0 2px 8px rgba(68, 138, 255, 0.35);
  line-height: 1.4;
}

/* Simple mode: title / greeting never white-on-light */
html[data-ui="simple"] .topbar h1 {
  color: #1a237e !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) !important;
  filter: none !important;
  font-weight: 600 !important;
}

html[data-ui="simple"] .topbar-sub {
  color: #283593 !important;
  text-shadow: none !important;
  font-weight: 500 !important;
  opacity: 1 !important;
}

html[data-ui="simple"][data-theme="dark"] .topbar h1 {
  color: #e8eaf6 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45) !important;
}

html[data-ui="simple"][data-theme="dark"] .topbar-sub {
  color: #c5cae9 !important;
}

/* Simple light: slightly deeper wood so navy title pops */
html[data-ui="simple"][data-theme="light"] .wood-bg:not(.has-custom-bg) {
  background: linear-gradient(180deg, #ebe4d6 0%, #e0d6c6 100%) !important;
}

html[data-ui="simple"] .icon-btn {
  color: #1a237e !important;
  text-shadow: none !important;
  background: rgba(255, 255, 255, 0.55) !important;
  border-color: rgba(26, 35, 126, 0.15) !important;
}

html[data-ui="simple"][data-theme="dark"] .icon-btn {
  color: #fff !important;
  background: rgba(0, 0, 0, 0.35) !important;
}

.install-callout {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

.install-callout.warn {
  background: rgba(255, 243, 224, 0.9);
  border-color: rgba(255, 152, 0, 0.35);
}

.install-callout h5 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.install-callout .announce-note {
  margin: 0;
}

[data-theme="dark"] .install-callout {
  background: rgba(40, 40, 44, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .install-callout.warn {
  background: rgba(80, 50, 10, 0.55);
  border-color: rgba(255, 183, 77, 0.35);
}

.install-page h5 {
  margin-top: 16px;
}
