:root {
  color-scheme: light;

  /* Brand & Status Colors - Refined for Vibrancy */
  --c-online: #34c759;
  --c-offline: #ff3b30;
  --c-soon: #ffcc00;
  --c-primary: #007aff;

  /* Light Theme Palettes */
  --bg-mesh-1: #e0f2ff;
  --bg-mesh-2: #ffe0eb;
  --bg-mesh-3: #f5f5f7;

  /* High Contrast Glass for Light Mode */
  --glass-surface: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.06);
  /* Dark border for visibility on light bg */
  --glass-highlight: rgba(255, 255, 255, 0.5);

  --shadow-lg:
    0 20px 40px -10px rgba(0, 0, 0, 0.08),
    0 10px 20px -10px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.02);
  /* Extra definition */

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  /* Darker grey */
  --text-tertiary: #86868b;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;

  /* Layout */
  --radius-xl: 32px;
  --radius-full: 9999px;
  --transition-smooth: cubic-bezier(0.32, 0.72, 0, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  /* Dark Theme Palettes - Deep & Rich */
  --bg-mesh-1: #0f1c3f;
  --bg-mesh-2: #2a1b3d;
  --bg-mesh-3: #000000;

  --glass-surface: rgba(30, 30, 35, 0.70);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.05);

  --shadow-lg:
    0 50px 100px -20px rgba(0, 0, 0, 0.7),
    0 30px 60px -30px rgba(0, 0, 0, 0.6),
    0 1px 0 0 rgba(255, 255, 255, 0.1) inset;

  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-tertiary: #56565e;
}

/* Global Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg-mesh-3);
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated Mesh Background */
.background-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(at 0% 0%, var(--bg-mesh-1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, var(--bg-mesh-2) 0px, transparent 50%),
    radial-gradient(at 100% 100%, var(--bg-mesh-1) 0px, transparent 50%),
    radial-gradient(at 0% 100%, var(--bg-mesh-2) 0px, transparent 50%);
  background-size: 140% 140%;
  animation: meshFlow 20s ease-in-out infinite alternate;
  opacity: 0.8;
  transition: background 1s ease;
}

@keyframes meshFlow {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 100% 100%;
  }
}

/* Main Layout */
.shell {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

/* Glass Card */
.card {
  position: relative;
  background: var(--glass-surface);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  transform: translateY(0);
  transition: transform 0.4s var(--transition-smooth), box-shadow 0.4s var(--transition-smooth);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 60px 100px -20px rgba(0, 0, 0, 0.2), var(--shadow-lg);
}

/* Header */
.card__header {
  text-align: center;
  position: relative;
}

.card__status-indicator {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--c-primary) 0%, transparent 70%);
  opacity: 0.1;
  filter: blur(20px);
  pointer-events: none;
}

.card__overline {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  margin: 0 0 8px 0;
}

.card__title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Status Section */
.status {
  display: flex;
  justify-content: center;
}

.status__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.status__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.status__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  /* Very subtle fill */
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.3s var(--transition-smooth);
}

[data-theme="dark"] .status__badge {
  background: rgba(0, 0, 0, 0.2);
}

.status__badge:hover {
  background: rgba(255, 255, 255, 0.08);
  /* Slightly more visible on hover */
  transform: scale(1.02);
}

.status__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-tertiary);
  box-shadow: 0 0 10px currentColor;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.status__dot[data-state="online"] {
  color: var(--c-online);
  background-color: var(--c-online);
}

.status__dot[data-state="offline"] {
  color: var(--c-offline);
  background-color: var(--c-offline);
}

.status__dot[data-state="soon"] {
  color: var(--c-soon);
  background-color: var(--c-soon);
}

.status__message {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Divider */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  width: 100%;
}

/* Schedule Section */
.schedule {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.schedule__header {
  text-align: center;
}

.schedule__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.schedule__time {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s var(--transition-smooth);
}

.schedule__time:active {
  transform: scale(0.98);
}

.schedule__time-content {
  text-align: center;
}

.schedule__range {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 0;
  line-height: 1.1;
  background: linear-gradient(180deg, var(--text-primary) 10%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.3s ease;
}

.schedule__zone {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-primary);
  margin: 6px 0 0 0;
  opacity: 0.9;
  letter-spacing: -0.01em;
}

.schedule__icon-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.schedule__time:hover .schedule__icon-hint {
  opacity: 1;
  transform: translateY(-50%) translateX(5px);
}

/* When waiting for load */
.schedule__range.loading {
  opacity: 0.3;
}

.schedule__note {
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s var(--transition-smooth);
  z-index: 100;
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--glass-highlight);
}

.theme-toggle:active {
  transform: translateY(0) scale(0.95);
}

.theme-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.5s var(--transition-smooth);
}

[data-theme="dark"] .theme-icon {
  transform: rotate(180deg);
}

.schedule__nextday {
  font-size: 0.4em;
  vertical-align: top;
  margin-left: 2px;
  font-weight: 600;
  color: var(--c-soon);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  padding-top: 8px;
  /* Optical alignment */
}

/* Mobile Tweaks */
@media (max-width: 600px) {
  .card {
    padding: 30px 24px;
    gap: 28px;
  }

  .card__title {
    font-size: 28px;
  }

  .schedule__range {
    font-size: 40px;
  }
}