/* ==========================================================================
   5 Luxury Business / 5-Star Hotel Lobby Themes + Floating Theme Switcher
   Keyed on html[data-theme="sapphire|gold|silver|emerald|walnut"]
   Supports both LED/Web (#stage 2400x5760) and Mobile (body[data-mode="mobile"])
   ========================================================================== */

/* Smooth theme transition */
#stage,
.bg,
.card,
.glass,
#ticker {
  transition: background 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease, color 0.35s ease;
}

/* ==========================================================================
   1. SAPPHIRE (深蓝商务 — Refined Deep Sapphire Baseline)
   ========================================================================== */

[data-theme="sapphire"] {
  --accent: #38bdf8;
}

[data-theme="sapphire"] .live-dot {
  background: #38bdf8;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.9);
}

/* ==========================================================================
   2. GOLD (黑金奢华 — Obsidian & Champagne Gold, Editorial Serif, Double Frame)
   ========================================================================== */

[data-theme="gold"] {
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia, serif;
  --text-primary: #faf6ee;
  --text-secondary: rgba(241, 214, 138, 0.84);
  --text-muted: rgba(212, 175, 55, 0.62);
  --glass-bg: linear-gradient(
    160deg,
    rgba(24, 21, 16, 0.84) 0%,
    rgba(12, 11, 9, 0.78) 100%
  );
  --glass-border: rgba(212, 175, 55, 0.52);
  --glass-shadow:
    inset 0 1px 2px rgba(245, 224, 160, 0.28),
    inset 0 -2px 24px rgba(0, 0, 0, 0.55),
    0 28px 80px rgba(0, 0, 0, 0.68);
  --radius-card: 32px;
}

[data-theme="gold"] body[data-mode="mobile"] {
  background: #0a0a0c;
  --radius-card: 14px;
}

[data-theme="gold"] #stage,
[data-theme="gold"] body[data-mode="mobile"] .bg {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(212, 175, 55, 0.022) 0px,
      rgba(212, 175, 55, 0.022) 2px,
      transparent 2px,
      transparent 34px
    ),
    linear-gradient(170deg, #09090b 0%, #12100d 48%, #0c0b09 100%);
}

[data-theme="gold"] .blob-a {
  background: radial-gradient(circle at 40% 40%, rgba(212, 175, 55, 0.42) 0%, rgba(146, 108, 28, 0.16) 48%, transparent 72%);
  opacity: 0.7;
}

[data-theme="gold"] .blob-b {
  background: radial-gradient(circle at 50% 50%, rgba(180, 134, 48, 0.32) 0%, rgba(92, 66, 20, 0.12) 48%, transparent 72%);
  opacity: 0.6;
}

[data-theme="gold"] .blob-c {
  background: radial-gradient(circle at 50% 50%, rgba(235, 198, 102, 0.24) 0%, rgba(110, 82, 24, 0.08) 48%, transparent 72%);
  opacity: 0.55;
}

/* Editorial serif typography for luxury hotel lobby presence */
[data-theme="gold"] #brand-zh,
[data-theme="gold"] #clock-hm,
[data-theme="gold"] #clock-s,
[data-theme="gold"] #weather-temp,
[data-theme="gold"] .slide-title {
  font-family: var(--font-display);
  font-weight: 500;
}

[data-theme="gold"] #brand-sub {
  display: none !important;
}

/* Double-hairline champagne gold frame on cards */
[data-theme="gold"] #stage .card {
  outline: 1.5px solid rgba(212, 175, 55, 0.28);
  outline-offset: -18px;
}

[data-theme="gold"] body[data-mode="mobile"] .card {
  outline: 1px solid rgba(212, 175, 55, 0.26);
  outline-offset: -6px;
}

[data-theme="gold"] .slides-card::after {
  border-color: rgba(212, 175, 55, 0.62);
  box-shadow: inset 0 0 0 14px rgba(10, 10, 12, 0.32), inset 0 0 0 16px rgba(212, 175, 55, 0.34);
}

[data-theme="gold"] body[data-mode="mobile"] .slides-card::after {
  box-shadow: inset 0 0 0 5px rgba(10, 10, 12, 0.32), inset 0 0 0 6px rgba(212, 175, 55, 0.36);
}

[data-theme="gold"] #clock-hm .colon,
[data-theme="gold"] #lunar,
[data-theme="gold"] #weather-location {
  color: #e6c66e;
}

[data-theme="gold"] .divider {
  background: linear-gradient(
    90deg,
    rgba(212, 175, 55, 0) 0%,
    rgba(212, 175, 55, 0.72) 25%,
    rgba(245, 224, 160, 0.9) 50%,
    rgba(212, 175, 55, 0.72) 75%,
    rgba(212, 175, 55, 0) 100%
  );
}

[data-theme="gold"] .live-dot {
  background: #d4af37;
  box-shadow: 0 0 22px rgba(212, 175, 55, 0.95);
}

[data-theme="gold"] .meta-item,
[data-theme="gold"] .forecast-day,
[data-theme="gold"] .market-item {
  background: rgba(212, 175, 55, 0.06);
  border-color: rgba(212, 175, 55, 0.26);
  border-radius: 20px;
}

[data-theme="gold"] body[data-mode="mobile"] .meta-item,
[data-theme="gold"] body[data-mode="mobile"] .forecast-day,
[data-theme="gold"] body[data-mode="mobile"] .market-item {
  border-radius: 10px;
}

[data-theme="gold"] .market-title {
  color: #e6c66e;
}

[data-theme="gold"] .mk-price {
  font-family: var(--font-display);
}

[data-theme="gold"] .slide-title {
  color: #f6e2a4;
}

[data-theme="gold"] #slide-dots .dot.active {
  background: #d4af37;
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.85);
}

[data-theme="gold"] #ticker {
  border-radius: 32px;
}

[data-theme="gold"] body[data-mode="mobile"] #ticker {
  border-radius: 14px;
}

[data-theme="gold"] .mode-switch {
  border-color: rgba(212, 175, 55, 0.48);
  color: #f1d68a;
}

/* ==========================================================================
   3. SILVER (银灰建筑 — Bright Platinum Light Theme, Swiss Architectural Grid)
   ========================================================================== */

[data-theme="silver"] {
  --text-primary: #161b22;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --glass-bg: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(244, 246, 249, 0.78) 100%
  );
  --glass-border: #cbd5e1;
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 20px 54px rgba(15, 23, 42, 0.08);
  --radius-card: 24px;
}

[data-theme="silver"] body[data-mode="mobile"] {
  background: #e8ecef;
  --radius-card: 12px;
}

[data-theme="silver"] #stage,
[data-theme="silver"] body[data-mode="mobile"] .bg {
  background: linear-gradient(165deg, #f4f6f8 0%, #e8ecef 50%, #dfe5ec 100%);
}

[data-theme="silver"] .blob-a {
  background: radial-gradient(circle at 40% 40%, rgba(148, 163, 184, 0.34) 0%, rgba(203, 213, 225, 0.14) 50%, transparent 72%);
  opacity: 0.65;
}

[data-theme="silver"] .blob-b {
  background: radial-gradient(circle at 50% 50%, rgba(186, 210, 232, 0.42) 0%, rgba(226, 232, 240, 0.18) 50%, transparent 72%);
  opacity: 0.7;
}

[data-theme="silver"] .blob-c {
  background: radial-gradient(circle at 50% 50%, rgba(148, 163, 184, 0.25) 0%, transparent 70%);
  opacity: 0.55;
}

[data-theme="silver"] .bg-vignette {
  background: radial-gradient(ellipse at 50% 25%, rgba(255, 255, 255, 0.3) 0%, rgba(148, 163, 184, 0.16) 100%);
}

/* Remove dark-mode shadows on light surfaces */
[data-theme="silver"] #brand-zh,
[data-theme="silver"] #clock-hm,
[data-theme="silver"] #clock-s,
[data-theme="silver"] #weather-temp {
  text-shadow: none;
}

[data-theme="silver"] #brand-logo {
  filter: none;
}

/* Swiss architectural grid accent bars */
[data-theme="silver"] #stage .clock-card,
[data-theme="silver"] #stage .weather-card,
[data-theme="silver"] #stage .market-card {
  border-left: 10px solid #161b22;
}

[data-theme="silver"] body[data-mode="mobile"] .clock-card,
[data-theme="silver"] body[data-mode="mobile"] .weather-card,
[data-theme="silver"] body[data-mode="mobile"] .market-card {
  border-left: 4px solid #161b22;
}

[data-theme="silver"] #stage .clock-card {
  align-items: flex-start;
}

[data-theme="silver"] #stage .clock-row {
  justify-content: flex-start;
}

[data-theme="silver"] #stage .date-row {
  align-items: flex-start;
}

[data-theme="silver"] #clock-hm .colon {
  color: #2563eb;
  opacity: 0.9;
}

[data-theme="silver"] .divider {
  background: linear-gradient(90deg, #cbd5e1 0%, #cbd5e1 85%, transparent 100%);
}

[data-theme="silver"] #lunar {
  color: #1d4ed8;
  font-weight: 500;
}

[data-theme="silver"] .status-pill,
[data-theme="silver"] .mode-switch {
  background: rgba(255, 255, 255, 0.85);
  border-color: #cbd5e1;
  color: #161b22;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

[data-theme="silver"] .status-text {
  color: #161b22;
}

[data-theme="silver"] .live-dot {
  background: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

[data-theme="silver"] .meta-item,
[data-theme="silver"] .forecast-day,
[data-theme="silver"] .market-item {
  background: rgba(241, 245, 249, 0.92);
  border-color: #cbd5e1;
  border-radius: 16px;
  box-shadow: none;
}

[data-theme="silver"] body[data-mode="mobile"] .meta-item,
[data-theme="silver"] body[data-mode="mobile"] .forecast-day,
[data-theme="silver"] body[data-mode="mobile"] .market-item {
  border-radius: 10px;
}

/* High-contrast up/down market colors on light silver cards */
[data-theme="silver"] [data-color-scheme="cn"] .market-item.is-up .mk-change {
  color: #dc2626;
}

[data-theme="silver"] [data-color-scheme="cn"] .market-item.is-down .mk-change {
  color: #059669;
}

[data-theme="silver"] [data-color-scheme="intl"] .market-item.is-up .mk-change {
  color: #059669;
}

[data-theme="silver"] [data-color-scheme="intl"] .market-item.is-down .mk-change {
  color: #dc2626;
}

/* CRITICAL: Soft slate-blue pill/circle backdrop so white cloud SVGs pop clearly on light cards */
[data-theme="silver"] #stage #weather-icon {
  background: linear-gradient(145deg, #2d4a6f 0%, #1b314d 100%);
  border-radius: 56px;
  padding: 36px;
  box-shadow: 0 16px 36px rgba(27, 49, 77, 0.22);
  filter: none;
}

[data-theme="silver"] #stage .fd-icon {
  background: linear-gradient(145deg, #37567d 0%, #233b59 100%);
  border-radius: 28px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(27, 49, 77, 0.16);
}

[data-theme="silver"] body[data-mode="mobile"] #weather-icon {
  background: linear-gradient(145deg, #2d4a6f 0%, #1b314d 100%);
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 6px 16px rgba(27, 49, 77, 0.22);
  filter: none;
}

[data-theme="silver"] body[data-mode="mobile"] .fd-icon {
  background: linear-gradient(145deg, #37567d 0%, #233b59 100%);
  border-radius: 10px;
  padding: 4px;
}

/* Keep slide captions pure white over dark bottom gradient scrim */
[data-theme="silver"] .slides-card::after {
  border-color: #cbd5e1;
  box-shadow: none;
}

[data-theme="silver"] .slide-title {
  color: #ffffff;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.62);
}

[data-theme="silver"] .slide-subtitle {
  color: rgba(255, 255, 255, 0.90);
}

[data-theme="silver"] #ticker {
  border-radius: 20px;
}

[data-theme="silver"] body[data-mode="mobile"] #ticker {
  border-radius: 12px;
}

[data-theme="silver"] #ticker-text {
  color: #161b22;
}

/* ==========================================================================
   4. EMERALD (翡翠私邸 — Deep Botanical Emerald & Brushed Brass Concierge)
   ========================================================================== */

[data-theme="emerald"] {
  --text-primary: #f6f2e9;
  --text-secondary: rgba(226, 217, 198, 0.84);
  --text-muted: rgba(200, 169, 106, 0.72);
  --glass-bg: linear-gradient(
    158deg,
    rgba(13, 48, 40, 0.78) 0%,
    rgba(7, 29, 24, 0.74) 100%
  );
  --glass-border: rgba(200, 169, 106, 0.42);
  --glass-shadow:
    inset 0 1px 2px rgba(232, 210, 158, 0.24),
    inset 0 -3px 24px rgba(2, 16, 12, 0.48),
    0 32px 84px rgba(2, 14, 11, 0.56);
  --radius-card: 52px;
}

[data-theme="emerald"] body[data-mode="mobile"] {
  background: #071e19;
  --radius-card: 20px;
}

[data-theme="emerald"] #stage,
[data-theme="emerald"] body[data-mode="mobile"] .bg {
  background: linear-gradient(165deg, #061b16 0%, #0a2a23 44%, #0f362d 78%, #061813 100%);
}

[data-theme="emerald"] .blob-a {
  background: radial-gradient(circle at 40% 40%, #10b981 0%, #065f46 48%, transparent 72%);
  opacity: 0.48;
}

[data-theme="emerald"] .blob-b {
  background: radial-gradient(circle at 50% 50%, rgba(200, 169, 106, 0.42) 0%, rgba(120, 96, 48, 0.16) 48%, transparent 72%);
  opacity: 0.55;
}

[data-theme="emerald"] .blob-c {
  background: radial-gradient(circle at 50% 50%, #0d9488 0%, #064e3b 48%, transparent 72%);
  opacity: 0.5;
}

/* Brushed brass architectural accent bar on concierge cards */
[data-theme="emerald"] #stage .clock-card,
[data-theme="emerald"] #stage .weather-card,
[data-theme="emerald"] #stage .market-card {
  border-left: 12px solid #c8a96a;
}

[data-theme="emerald"] body[data-mode="mobile"] .clock-card,
[data-theme="emerald"] body[data-mode="mobile"] .weather-card,
[data-theme="emerald"] body[data-mode="mobile"] .market-card {
  border-left: 4px solid #c8a96a;
}

[data-theme="emerald"] #clock-hm .colon,
[data-theme="emerald"] #weather-location,
[data-theme="emerald"] #lunar,
[data-theme="emerald"] .market-title {
  color: #dec184;
}

[data-theme="emerald"] .divider {
  background: linear-gradient(
    90deg,
    rgba(200, 169, 106, 0) 0%,
    rgba(200, 169, 106, 0.55) 20%,
    rgba(200, 169, 106, 0.55) 80%,
    rgba(200, 169, 106, 0) 100%
  );
}

[data-theme="emerald"] .live-dot {
  background: #c8a96a;
  box-shadow: 0 0 20px rgba(200, 169, 106, 0.9);
}

[data-theme="emerald"] .meta-item,
[data-theme="emerald"] .forecast-day,
[data-theme="emerald"] .market-item {
  background: rgba(200, 169, 106, 0.08);
  border-color: rgba(200, 169, 106, 0.28);
}

[data-theme="emerald"] .fd-hi {
  color: #f3dfb3;
}

[data-theme="emerald"] .slides-card::after {
  border: 3px solid rgba(200, 169, 106, 0.58);
  box-shadow: inset 0 2px 6px rgba(232, 210, 158, 0.32);
}

[data-theme="emerald"] body[data-mode="mobile"] .slides-card::after {
  border-width: 1.5px;
}

[data-theme="emerald"] #slide-dots .dot.active {
  background: #c8a96a;
  box-shadow: 0 0 18px rgba(200, 169, 106, 0.85);
}

[data-theme="emerald"] .mode-switch {
  border-color: rgba(200, 169, 106, 0.45);
  color: #dec184;
}

/* ==========================================================================
   5. WALNUT (暖木雅奢 — Espresso Walnut, Travertine Cream, Expanded Showcase)
   ========================================================================== */

[data-theme="walnut"] {
  --text-primary: #f3e7d3;
  --text-secondary: rgba(226, 206, 178, 0.84);
  --text-muted: rgba(217, 155, 82, 0.72);
  --glass-bg: linear-gradient(
    158deg,
    rgba(52, 36, 24, 0.76) 0%,
    rgba(28, 19, 13, 0.72) 100%
  );
  --glass-border: rgba(217, 155, 82, 0.36);
  --glass-shadow:
    inset 0 2px 3px rgba(243, 231, 211, 0.22),
    inset 0 -3px 26px rgba(14, 8, 4, 0.52),
    0 34px 86px rgba(10, 6, 3, 0.6);
  --radius-card: 110px;
}

[data-theme="walnut"] body[data-mode="mobile"] {
  background: #18110c;
  --radius-card: 28px;
}

[data-theme="walnut"] #stage,
[data-theme="walnut"] body[data-mode="mobile"] .bg {
  background: linear-gradient(168deg, #18110c 0%, #241911 46%, #2f1f14 78%, #150e0a 100%);
}

[data-theme="walnut"] .blob-a {
  background: radial-gradient(circle at 40% 40%, rgba(217, 155, 82, 0.46) 0%, rgba(148, 92, 42, 0.18) 48%, transparent 72%);
  opacity: 0.72;
}

[data-theme="walnut"] .blob-b {
  background: radial-gradient(circle at 50% 50%, rgba(196, 126, 66, 0.38) 0%, rgba(112, 66, 30, 0.15) 48%, transparent 72%);
  opacity: 0.65;
}

[data-theme="walnut"] .blob-c {
  background: radial-gradient(circle at 50% 50%, rgba(236, 188, 120, 0.28) 0%, rgba(126, 82, 42, 0.1) 48%, transparent 72%);
  opacity: 0.6;
}

/* Emphasize showcase slide area on LED (compact top cards, +240px taller slides, zero overlap) */
[data-theme="walnut"] #stage .clock-card {
  top: 260px;
  height: 980px;
  padding: 48px 100px 52px;
}

[data-theme="walnut"] #stage #clock-hm {
  font-size: 580px;
}

[data-theme="walnut"] #stage .weather-card {
  top: 1280px;
  height: 980px;
  padding: 44px 88px 48px;
}

[data-theme="walnut"] #stage #weather-icon {
  width: 230px;
  height: 230px;
  flex-basis: 230px;
}

[data-theme="walnut"] #stage #weather-temp {
  font-size: 224px;
}

[data-theme="walnut"] #stage .market-card {
  top: 2300px;
  height: 370px;
  padding: 28px 68px 34px;
}

[data-theme="walnut"] #stage .slides-card {
  top: 2710px;
  height: 2750px;
  box-shadow:
    0 0 90px rgba(217, 155, 82, 0.24),
    0 36px 96px rgba(10, 6, 3, 0.65);
}

[data-theme="walnut"] body[data-mode="mobile"] .slides-card {
  aspect-ratio: 3 / 4;
  box-shadow:
    0 0 32px rgba(217, 155, 82, 0.24),
    0 14px 36px rgba(10, 6, 3, 0.55);
}

[data-theme="walnut"] .slides-card::after {
  border-color: rgba(217, 155, 82, 0.55);
  box-shadow: inset 0 2px 6px rgba(243, 231, 211, 0.32);
}

[data-theme="walnut"] #clock-hm .colon,
[data-theme="walnut"] #lunar,
[data-theme="walnut"] .market-title {
  color: #e8b470;
}

[data-theme="walnut"] .live-dot {
  background: #d99b52;
  box-shadow: 0 0 22px rgba(217, 155, 82, 0.9);
}

[data-theme="walnut"] .meta-item,
[data-theme="walnut"] .forecast-day,
[data-theme="walnut"] .market-item {
  background: rgba(243, 231, 211, 0.07);
  border-color: rgba(217, 155, 82, 0.24);
}

[data-theme="walnut"] #slide-dots .dot.active {
  background: #e8b470;
  box-shadow: 0 0 18px rgba(217, 155, 82, 0.85);
}

[data-theme="walnut"] .mode-switch {
  border-color: rgba(217, 155, 82, 0.44);
  color: #f3e7d3;
}

/* ==========================================================================
   Floating Theme Switcher (#theme-switcher, injected into document.body)
   Always in native viewport pixels, crisp on both dark and light themes.
   ========================================================================== */

#theme-switcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  font-family: "HarmonyOS Sans", "SF Pro Display", "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  cursor: auto;
  user-select: none;
  -webkit-user-select: none;
}

#theme-switcher .ts-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(12, 17, 29, 0.84);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

[data-theme="silver"] #theme-switcher .ts-bar {
  background: rgba(22, 27, 34, 0.90);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
}

#theme-switcher .ts-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

#theme-switcher .ts-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

#theme-switcher .ts-btn.active {
  background: rgba(255, 255, 255, 0.20);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-weight: 600;
}

#theme-switcher .ts-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55);
}

#theme-switcher .ts-mode {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  margin-left: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(186, 230, 253, 0.94);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s ease;
}

#theme-switcher .ts-mode:hover {
  color: #ffffff;
}

#theme-switcher .ts-toggle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

#theme-switcher .ts-toggle:hover {
  background: rgba(255, 255, 255, 0.20);
}

#theme-switcher.collapsed .ts-btn,
#theme-switcher.collapsed .ts-mode {
  display: none;
}

#theme-switcher.collapsed .ts-bar {
  padding: 5px;
}

#theme-switcher.collapsed .ts-toggle {
  width: 36px;
  height: 36px;
  font-size: 17px;
}

/* Mobile positioning: centered floating pill above safe-area, zero horizontal overflow */
body[data-mode="mobile"] .mobile-shell {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

body[data-mode="mobile"] #theme-switcher {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 16px);
}

body[data-mode="mobile"] #theme-switcher.collapsed {
  left: auto;
  right: 14px;
  transform: none;
}

body[data-mode="mobile"] #theme-switcher .ts-bar {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-mode="mobile"] #theme-switcher .ts-bar::-webkit-scrollbar {
  display: none;
}

@media (max-width: 440px) {
  body[data-mode="mobile"] #theme-switcher .ts-bar {
    gap: 2px;
    padding: 5px 6px;
  }

  body[data-mode="mobile"] #theme-switcher .ts-btn {
    padding: 5px 6px;
    font-size: 11px;
    gap: 3px;
  }

  body[data-mode="mobile"] #theme-switcher .ts-swatch {
    width: 8px;
    height: 8px;
  }

  body[data-mode="mobile"] #theme-switcher .ts-mode {
    padding: 5px 6px;
    font-size: 11px;
  }

  body[data-mode="mobile"] #theme-switcher .ts-toggle {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
}
