:root {
  color-scheme: light;
  --font-body: "Space Grotesk", "Roboto", "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Roboto", "Segoe UI", sans-serif;
  
  /* Clean Flat Palette */
  --bg: #f8f9fa;
  --panel: #ffffff;
  --panel-2: #f1f3f4;
  
  --border: #dadce0;
  --border-soft: #e8eaed;
  
  --text: #202124;
  --muted: #5f6368;
  
  /* Efficient Blue Accent */
  --accent: #1a73e8;
  --accent-soft: rgba(26, 115, 232, 0.1);
  --accent-strong: #1557b0;
  
  --danger: #d93025;
  --danger-ink: #ffffff;
  
  --topbar-height: 64px; /* Compact efficiency */
  
  --focus-good: #10b981;
  --focus-warn: #f59e0b;
  --focus-urgent: #ef4444;
  --focus-neutral: var(--text);
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #202124;
  --panel: #2b2c2f;
  --panel-2: #303134;
  --border: #5f6368;
  --border-soft: #3c4043;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #8ab4f8;
  --accent-soft: rgba(138, 180, 248, 0.15);
  --accent-strong: #a8c7fa;
  --danger: #f28b82;
  --danger-ink: #1f1f1f;
  --focus-good: #81c995;
  --focus-warn: #fdd663;
  --focus-urgent: #f28b82;
  --focus-neutral: var(--text);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ── Splash / Loading Screen ── */
#splash-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

html[data-app-ready="1"] #splash-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#splash-loader .splash-logo {
  width: 72px;
  height: 72px;
  animation: splash-pulse 1.6s ease-in-out infinite;
}

#splash-loader .splash-title {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

#splash-loader .splash-dots {
  margin-top: 24px;
  display: flex;
  gap: 6px;
}

#splash-loader .splash-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: splash-dot 1.4s ease-in-out infinite;
}

#splash-loader .splash-dots span:nth-child(2) { animation-delay: 0.2s; }
#splash-loader .splash-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes splash-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}

@keyframes splash-dot {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  #splash-loader .splash-logo { width: 56px; height: 56px; }
  #splash-loader .splash-title { font-size: 1.2rem; }
}

* {
  box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 20px;
  border: 3px solid transparent;
  background-clip: content-box;
  transition: background-color 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button {
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.action-link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.sidebar-bmc {
  justify-content: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffdd00 0%, #f7c300 100%);
  color: #111;
  border: none;
  font-size: 0.85rem;
  padding: 10px;
  box-shadow: var(--shadow-md);
}

.sidebar-bmc i {
  color: #111;
}

.sidebar-bmc:hover {
  background: linear-gradient(135deg, #f7c300 0%, #ffdd00 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.side-actions-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.w-100 {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  min-height: var(--topbar-height);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Minimal shadow */
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-spacer {
  flex: 1 1 auto;
}

.topbar-date-label {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.top-banners-row {
  display: flex;
  gap: 8px;
  padding: 8px 20px 4px;
}

.top-banners-row:has(> .hidden:first-child):has(> .hidden:last-child),
.top-banners-row:empty {
  display: none;
}

.trial-countdown-banner {
  margin: 0;
  flex: 1 1 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--accent-soft) 88%, var(--panel)),
    color-mix(in srgb, var(--accent-soft) 38%, var(--panel))
  );
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trial-countdown-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  font-weight: 700;
}

.trial-countdown-label i {
  color: var(--accent);
  font-size: 0.82rem;
}

.trial-countdown-timer {
  font-family: "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-soft));
  border-radius: 8px;
  padding: 4px 10px;
}

.trial-countdown-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.trial-countdown-usage {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.trial-countdown-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.trial-upgrade-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border-soft));
  background: var(--panel);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 7px 12px;
  min-height: 34px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.trial-upgrade-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--border-soft));
  transform: translateY(-1px);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 18%, transparent);
}

.trial-upgrade-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.countdown-container {
  position: sticky;
  top: var(--topbar-height, 64px);
  z-index: 9;
  margin: 0;
  flex: 1 1 0;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(120deg, var(--accent-soft), transparent);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.countdown-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.countdown-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.countdown-title {
  font-size: 1rem;
  font-weight: 600;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.countdown-timer {
  font-family: "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  color: var(--text);
}

.countdown-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.countdown-container.urgent {
  background: linear-gradient(120deg, rgba(234, 67, 53, 0.2), rgba(234, 67, 53, 0.05));
  border-color: rgba(234, 67, 53, 0.4);
}

.countdown-container.urgent .countdown-timer {
  color: var(--focus-urgent);
  border-color: rgba(234, 67, 53, 0.3);
}

.countdown-container.inactive {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--muted);
  box-shadow: none;
}

.countdown-container.inactive .countdown-timer {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--muted);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
}

.brand-text {
  display: flex;
  align-items: center;
  min-width: 0;
}

.title-input {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  border: none;
  background: transparent;
  padding: 0;
  outline: none;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px; /* Buffer for scrollbar */
  scrollbar-width: thin; /* Firefox */
}
.top-actions::-webkit-scrollbar {
  height: 4px; /* Slim horizontal scrollbar */
  display: block;
}
.top-actions::-webkit-scrollbar-track {
  background: transparent;
}
.top-actions::-webkit-scrollbar-thumb {
  background-color: var(--border-soft);
  border-radius: 4px;
}
.top-actions::-webkit-scrollbar-thumb:hover {
  background-color: var(--muted);
}


.secondary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.action-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.nav-group {
  display: inline-flex;
  gap: 4px;
}

.nav-group button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-menu {
  position: relative;
}

.view-menu-trigger {
  min-width: 112px;
  height: 34px;
  border-radius: 10px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.view-menu-trigger i {
  font-size: 0.7rem;
  color: var(--muted);
}

.topbar-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-tool-btn i {
  font-size: 0.88rem;
}

.topbar-theme-btn {
  height: 34px;
  border-radius: 10px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.topbar-theme-btn i {
  font-size: 0.8rem;
}

.topbar-icon-link {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.topbar-icon-link:hover {
  background: var(--panel-2);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.topbar-icon-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.menu-dropdown {
  position: relative;
}

.menu-trigger {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-trigger::-webkit-details-marker {
  display: none;
}

.menu-trigger::marker {
  content: "";
}

.menu-trigger:hover {
  background: var(--panel-2);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-sm);
}

.menu-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.menu-dropdown[open] .menu-trigger {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.menu-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  max-width: min(320px, 92vw);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
}

.menu-dropdown:not([open]) .menu-dropdown-panel {
  display: none;
}

.menu-dropdown-panel button,
.menu-dropdown-panel .action-link,
.menu-dropdown-panel .dropdown-container {
  width: 100%;
}

.menu-dropdown-panel button,
.menu-dropdown-panel .action-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  text-align: left;
}

.menu-dropdown-panel button {
  padding: 8px 10px;
}

.menu-dropdown-panel button > i:first-child,
.menu-dropdown-panel .action-link > i:first-child {
  width: 18px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

.menu-dropdown-panel button > span,
.menu-dropdown-panel .action-link > span {
  flex: 1 1 auto;
}

.menu-dropdown-panel .action-link {
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: none;
}

.view-menu-panel {
  right: auto;
  left: 0;
  min-width: 148px;
}

.view-menu-option.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.view-menu-option > i:first-child {
  color: var(--muted);
}

.view-menu-option.active > i:first-child {
  color: var(--accent);
}

.settings-menu-panel .dropdown-trigger {
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  gap: 10px;
  justify-content: space-between;
}

.settings-menu-panel .dropdown-menu {
  right: auto;
  left: 0;
  min-width: 100%;
}

.settings-menu-panel .dropdown-trigger > i:first-child {
  width: 18px;
  min-width: 18px;
  text-align: center;
}

.settings-menu-panel .dropdown-trigger #current-lang {
  flex: 1 1 auto;
  text-align: left;
}

.settings-menu-panel .dropdown-trigger .fa-chevron-down {
  margin-left: auto;
}

.menu-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.add-event-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.add-event-btn i {
  font-size: 0.8rem;
}

.cloud-cta-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-soft) 78%, var(--panel)),
    color-mix(in srgb, var(--accent-soft) 28%, var(--panel))
  );
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 10px 18px color-mix(in srgb, var(--accent) 20%, transparent);
}

.cloud-cta-btn i {
  font-size: 0.8rem;
}

.cloud-cta-btn:hover {
  border-color: var(--accent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-soft) 88%, var(--panel)),
    color-mix(in srgb, var(--accent-soft) 38%, var(--panel))
  );
  box-shadow: 0 12px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}

.login-cta-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.login-cta-btn i {
  font-size: 0.78rem;
  color: var(--accent);
}

.login-cta-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 78%, var(--panel));
}

.new-calendar-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--panel));
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.new-calendar-btn i {
  font-size: 0.78rem;
}

.new-calendar-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 92%, var(--panel));
}

.profile-menu {
  position: relative;
}

.profile-menu-trigger {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-menu-trigger:hover {
  border-color: var(--accent);
}

.profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.profile-menu-panel {
  right: 0;
  left: auto;
  min-width: 230px;
  display: none;
  gap: 6px;
}

.profile-menu:hover .profile-menu-panel,
.profile-menu:focus-within .profile-menu-panel {
  display: flex;
}

.profile-menu-user {
  margin: 0;
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-menu-user strong {
  font-size: 0.8rem;
  color: var(--text);
  word-break: break-all;
}

#profile-cancel-sub-btn {
  border-top: 1px solid var(--border-soft);
}

.mobile-drawer-cloud-btn i {
  color: var(--accent);
}

.mobile-drawer-login-btn i {
  color: var(--accent);
}

.mobile-drawer-new-calendar-btn i {
  color: var(--accent);
}

.mobile-drawer-version-history-btn i {
  color: var(--accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 4px;
}

button {
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

button:hover {
  background: var(--panel-2);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-sm);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px var(--accent-soft);
}

button.primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 6px 16px var(--accent-soft);
  transform: translateY(-1px);
}

/* View toggle overrides */
.view-toggle button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 6px 12px;
  box-shadow: none;
}

.view-toggle button:hover {
  background: transparent;
  box-shadow: none;
}

.view-toggle button.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  border-radius: 999px;
}

button.ghost {
  background: transparent;
}

button.is-active-toggle,
.mobile-drawer-item.is-active-toggle {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

button.danger,
.danger-btn {
  background: var(--danger);
  color: var(--danger-ink);
  border-color: transparent;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 260px;
  grid-template-areas: "side calendar tz";
}

.side-panel {
  grid-area: side;
  order: -1;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.calendar-panel {
  grid-area: calendar;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
}

.tz-sidebar {
  grid-area: tz;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.tz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tz-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.tz-subtitle {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.tz-add {
  font-size: 1rem;
  line-height: 1;
}

.tz-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.tz-card {
  background: var(--panel-2);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tz-card.is-local {
  border-left-color: var(--accent);
}

.tz-name {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tz-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tz-offset {
  color: var(--muted);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.tz-time {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tz-diff {
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 600;
}

.tz-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tz-card:hover .tz-remove {
  opacity: 1;
}

.tz-remove:focus-visible {
  opacity: 1;
}

.tz-remove:hover {
  background: transparent;
  box-shadow: none;
}

.tz-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.month-label {
  margin: 0 0 4px;
  font-size: 1.4rem;
  font-weight: 600;
  font-family: var(--font-display);
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.command-palette-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.command-palette-btn > i {
  font-size: 0.8rem;
}

.event-search-body {
  gap: 10px;
}

.event-search-advanced-toggle {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
}

.event-search-advanced-toggle > i {
  font-size: 0.8rem;
}

.event-search-advanced-toggle.active,
.event-search-advanced-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent), transparent 45%);
  background: color-mix(in srgb, var(--accent-soft), transparent 22%);
}

.event-search-advanced {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel), transparent 2%),
    color-mix(in srgb, var(--panel-2), transparent 16%)
  );
}

.event-filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 10px;
  padding: 12px;
}

.event-filter-bar.active {
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent), transparent 74%);
}

.event-filter-bar-modal {
  background: transparent;
}

.event-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.event-filter-field > span {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.event-filter-field input,
.event-filter-field select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text);
  font-size: 0.82rem;
}

.event-filter-field input:focus,
.event-filter-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.event-filter-clear {
  align-self: end;
  justify-self: end;
  min-height: 36px;
  min-width: 72px;
  border-radius: 9px;
}

.timeline-controls {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--panel), transparent 8%);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 4;
  width: min(760px, calc(100% - 24px));
  max-width: calc(100% - 24px);
}

.timeline-controls-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}

.timeline-minimap {
  position: relative;
  height: 34px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel-2), transparent 6%),
    color-mix(in srgb, var(--panel), transparent 0%)
  );
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
}

.timeline-minimap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.timeline-minimap-events {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.timeline-minimap-segment {
  position: absolute;
  top: 9px;
  bottom: 9px;
  min-width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), transparent 36%);
  opacity: 0.9;
}

.timeline-minimap-today,
.timeline-minimap-selected {
  position: absolute;
  top: 3px;
  bottom: 3px;
  width: 2px;
  z-index: 3;
  pointer-events: none;
}

.timeline-minimap-today {
  background: color-mix(in srgb, var(--focus-urgent), transparent 10%);
}

.timeline-minimap-selected {
  background: color-mix(in srgb, var(--accent), transparent 0%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--panel), transparent 15%);
}

.timeline-minimap-viewport {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 100%;
  min-width: 18px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 35%);
  background: color-mix(in srgb, var(--accent-soft), transparent 12%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--panel), transparent 40%);
  z-index: 4;
  pointer-events: none;
}

.timeline-zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--panel);
}

.timeline-zoom-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline-zoom-value {
  min-width: 56px;
  display: inline-block;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

#timeline-zoom-range {
  accent-color: var(--accent);
  width: clamp(108px, 16vw, 180px);
  cursor: pointer;
}

.timeline-center-btn {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.weekday-row.hidden {
  display: none;
}

.weekday {
  padding: 12px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.calendar-grid {
  flex: 1;
  min-height: 0;
  background: var(--panel);
}

.calendar-grid.agenda-view {
  display: block;
  overflow-y: auto;
  padding: 16px 20px 24px;
  background: var(--panel);
  scrollbar-gutter: stable;
}

.agenda-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agenda-date-header {
  margin: 12px 0 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 2;
}

.agenda-event-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--bg-color, var(--accent));
  background: color-mix(in srgb, var(--bg-color, var(--accent)), transparent 95%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.agenda-event-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, 0.2);
  background: color-mix(in srgb, var(--bg-color, var(--accent)), transparent 90%);
}

.agenda-event-item.is-continuation {
  opacity: 0.7;
  background: color-mix(in srgb, var(--bg-color, var(--accent)), transparent 97%);
  border-left-style: dashed;
}

.agenda-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.agenda-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agenda-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.agenda-empty {
  margin: 20px auto 0;
  padding: 24px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--panel-2);
  color: var(--muted);
  text-align: center;
  max-width: 420px;
}

.calendar-grid.analytics-view {
  display: block;
  overflow: auto;
  padding: 16px 20px 24px;
  scrollbar-gutter: stable;
  background:
    radial-gradient(circle at 7% 6%, color-mix(in srgb, var(--accent-soft), transparent 28%), transparent 36%),
    radial-gradient(circle at 94% 2%, color-mix(in srgb, var(--accent), transparent 92%), transparent 34%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
}

.analytics-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics-summary-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--muted);
}

.analytics-range-hint {
  margin: 0;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--text), var(--muted) 38%);
  font-weight: 500;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.analytics-kpi-card {
  border: 1px solid color-mix(in srgb, var(--border-soft), var(--accent) 10%);
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--panel), transparent 3%),
    color-mix(in srgb, var(--panel-2), transparent 9%)
  );
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: cell-fade-in 0.35s ease backwards;
  animation-delay: calc(var(--cell-index, 0) * 12ms);
}

.analytics-kpi-label {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
}

.analytics-kpi-value {
  margin: 0;
  font-size: 1.38rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.analytics-kpi-meta {
  margin: 0;
  font-size: 0.76rem;
  color: color-mix(in srgb, var(--text), var(--muted) 44%);
  font-weight: 500;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.analytics-card {
  border: 1px solid color-mix(in srgb, var(--border-soft), var(--accent) 8%);
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel), transparent 2%), color-mix(in srgb, var(--panel-2), transparent 8%));
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
}

.analytics-breakdown-card {
  grid-row: span 2;
}

.analytics-card-title {
  margin: 0 0 10px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-chart-wrap {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.analytics-donut {
  width: clamp(168px, 26vw, 218px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--chart-gradient);
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid color-mix(in srgb, var(--border-soft), var(--accent) 16%);
  box-shadow: var(--shadow-md);
}

.analytics-donut-inner {
  width: 62%;
  height: 62%;
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel), var(--panel-2) 14%);
  border: 1px solid color-mix(in srgb, var(--border-soft), var(--accent) 12%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  padding: 8px;
}

.analytics-donut-value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.analytics-donut-label {
  font-size: 0.66rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.analytics-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analytics-legend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid color-mix(in srgb, var(--border-soft), transparent 15%);
  border-radius: 12px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--panel), transparent 4%);
  animation: cell-fade-in 0.3s ease backwards;
  animation-delay: calc(var(--cell-index, 0) * 10ms);
}

.analytics-legend-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.analytics-legend-label-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, #000, transparent 86%);
  flex: 0 0 auto;
}

.analytics-legend-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-legend-meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.analytics-legend-bar {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel-2), var(--border) 35%);
  overflow: hidden;
}

.analytics-legend-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.analytics-legend-value {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.analytics-list-card {
  display: flex;
  flex-direction: column;
}

.analytics-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.analytics-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--border-soft), transparent 10%);
  border-radius: 11px;
  background: color-mix(in srgb, var(--panel), transparent 2%);
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  animation: cell-fade-in 0.3s ease backwards;
  animation-delay: calc(var(--cell-index, 0) * 10ms);
}

.analytics-list-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent), transparent 58%);
  box-shadow: var(--shadow-sm);
}

.analytics-list-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.analytics-list-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}

.analytics-list-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.analytics-top-day.is-active {
  border-color: color-mix(in srgb, var(--accent), transparent 48%);
  background: color-mix(in srgb, var(--accent-soft), var(--panel) 24%);
}

.analytics-upcoming-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.analytics-upcoming-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  color: var(--muted);
  background: color-mix(in srgb, var(--panel-2), transparent 8%);
  font-size: 0.8rem;
}

.calendar-grid.timeline-view {
  display: block;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 4%, color-mix(in srgb, var(--accent-soft), transparent 30%), transparent 38%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
}

.calendar-grid.timeline-view .timeline-scroll {
  padding-bottom: 156px;
}

.timeline-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.timeline-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-top: 1px solid var(--border-soft);
  scrollbar-gutter: stable both-edges;
  outline: none;
}

.timeline-canvas {
  position: relative;
  min-height: 100%;
  isolation: isolate;
}

.timeline-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.timeline-ruler {
  position: sticky;
  top: 0;
  height: 72px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel), transparent 6%), color-mix(in srgb, var(--panel-2), transparent 15%));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 6;
}

.timeline-day-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--border-soft), transparent 22%);
}

.timeline-day-line.is-major {
  width: 2px;
  background: color-mix(in srgb, var(--accent), transparent 60%);
}

.timeline-hour-line,
.timeline-minute-line {
  position: absolute;
  top: 72px;
  bottom: 0;
  width: 1px;
  pointer-events: none;
}

.timeline-hour-line {
  background: color-mix(in srgb, var(--border), transparent 55%);
}

.timeline-hour-line.is-major {
  background: color-mix(in srgb, var(--accent), transparent 78%);
}

.timeline-minute-line {
  background: color-mix(in srgb, var(--border-soft), transparent 72%);
}

.timeline-month-chip,
.timeline-week-chip {
  position: absolute;
  top: 10px;
  pointer-events: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}

.timeline-month-chip {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-week-chip {
  top: 38px;
  font-size: 0.72rem;
  color: var(--muted);
}

.timeline-day-chip,
.timeline-hour-chip,
.timeline-minute-chip {
  position: absolute;
  pointer-events: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.timeline-day-chip {
  top: 28px;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-hour-chip {
  top: 46px;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.timeline-minute-chip {
  top: 58px;
  font-size: 0.52rem;
  letter-spacing: 0.03em;
  opacity: 0.92;
}

.timeline-focus-line {
  position: absolute;
  top: 72px;
  bottom: 0;
  width: 2px;
  z-index: 2;
}

.timeline-focus-line.is-selected {
  background: color-mix(in srgb, var(--accent), transparent 20%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent), transparent 70%);
}

.timeline-focus-line.is-today {
  background: color-mix(in srgb, var(--focus-urgent), transparent 15%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--focus-urgent), transparent 45%);
}

.timeline-events {
  position: relative;
  z-index: 4;
}

.timeline-event {
  position: absolute;
  height: 56px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--bg-color, var(--accent)), #ffffff 70%);
  border-left-width: 4px;
  border-left-color: var(--bg-color, var(--accent));
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--bg-color, var(--accent)), transparent 84%),
    color-mix(in srgb, var(--panel), transparent 5%)
  );
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 12px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: cell-fade-in 0.35s ease backwards;
  animation-delay: calc(var(--cell-index, 0) * 15ms);
}

.timeline-event:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--bg-color, var(--accent)), #ffffff 50%);
}

.timeline-event.is-compact {
  padding: 6px 8px;
  gap: 2px;
  border-left-width: 3px;
}

.timeline-event.is-micro {
  padding: 4px 6px;
  border-left-width: 2px;
}

.timeline-event.is-micro .timeline-event-time {
  display: none;
}

.timeline-event-time {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-event-title {
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-empty {
  position: absolute;
  left: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--panel-2), transparent 10%);
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 340px;
}

.calendar-grid.month-view {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(6, minmax(0, 1fr));
  border-left: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
}

.day-cell {
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: var(--panel);
  transition: background 0.15s ease, box-shadow 0.2s ease;
  animation: cell-fade-in 0.4s ease backwards;
  animation-delay: calc(var(--cell-index, 0) * 15ms);
}

.day-cell:hover {
  background: var(--panel-blur);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
  z-index: 1;
}

.day-cell.is-outside {
  background: var(--panel-2);
  color: var(--muted);
}

.day-cell.is-today {
  background: var(--accent-soft);
}

.day-cell.is-selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.day-number {
  font-size: 0.72rem;
  font-weight: 600;
  color: inherit;
  align-self: flex-end;
}

.event-chip {
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: var(--bg-color, var(--accent));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.event-chip:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-md);
  filter: brightness(1.1);
  color: #000;
  border-color: rgba(255, 255, 255, 0.4);
}

body[data-theme="dark"] .event-chip:hover {
  color: #fff;
  filter: brightness(1.2);
}

.event-chip.is-continuation {
  opacity: 0.7;
  border-style: solid;
  border-width: 1px;
  background: color-mix(in srgb, var(--bg-color, var(--accent)), transparent 40%);
}

.event-chip .time {
  font-weight: 700;
  font-size: 0.65rem;
  opacity: 0.9;
  font-family: var(--font-mono, monospace);
}

.event-more {
  font-size: 0.72rem;
  color: var(--muted);
}

.calendar-grid.week-view,
.calendar-grid.day-view {
  display: grid;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  background: var(--panel);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.time-label {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px 6px;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: right;
  background: var(--panel);
}

.time-label.all-day-label {
  text-align: center;
  font-weight: 600;
}

.time-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.time-cell.all-day {
  background: var(--panel-2);
}

.time-event {
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: #fff;
  background: color-mix(in srgb, var(--bg-color, var(--accent)), transparent 15%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.time-event:hover {
  transform: scale(1.02);
  z-index: 10 !important;
  filter: brightness(1.1);
  color: #000;
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.5);
}

body[data-theme="dark"] .time-event:hover {
  color: #fff;
  filter: brightness(1.2);
}

.time-event .time {
  font-weight: 700;
  font-size: 0.65rem;
  opacity: 0.9;
  font-family: var(--font-mono, monospace);
}

.time-event .title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-grid.year-view {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px;
  overflow: auto;
  background: var(--bg);
}

.time-indicator {
  position: relative;
  z-index: 15;
  pointer-events: none;
  display: flex;
  align-items: center;
  height: 0;
}

.time-indicator-line {
  flex: 1;
  height: 2px;
  background: var(--focus-urgent);
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.time-indicator-circle {
  width: 10px;
  height: 10px;
  background: var(--focus-urgent);
  border-radius: 50%;
  position: absolute;
  left: -2px;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

body[data-theme="dark"] .time-indicator-line,
body[data-theme="dark"] .time-indicator-circle {
  background: #ff5252;
  box-shadow: 0 0 8px rgba(255, 82, 82, 0.5);
}

.mini-month {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.mini-weekday {
  font-size: 0.6rem;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
}

.mini-day {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.65rem;
  padding: 4px 0;
  border-radius: 4px;
  position: relative;
}

.mini-day.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.mini-day.is-outside {
  color: var(--muted);
}

.mini-day.is-selected {
  background: var(--accent-soft);
}

.mini-day:hover {
  background: var(--panel-2);
}

.mini-dot {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateX(-50%);
}

.side-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.side-card.danger {
  border-color: rgba(217, 48, 37, 0.4);
}

.side-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  cursor: pointer;
}

.event-item:hover {
  border-color: var(--border);
}

.event-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.event-time {
  font-size: 0.75rem;
  color: var(--muted);
}

.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
}

.url-warning {
  margin: 0;
  font-size: 0.72rem;
  color: var(--danger);
}

.stacked-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stacked-actions button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
  border-radius: 8px;
}

.stacked-actions button > i:first-child {
  width: 18px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

.stacked-actions button > span {
  flex: 1 1 auto;
  text-align: left;
}

.focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: clamp(20px, 4vw, 48px);
  background:
    radial-gradient(circle at top left, var(--accent-soft), transparent 45%),
    radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.08), transparent 40%),
    var(--bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.focus-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.focus-overlay[data-tone="good"] .focus-timer,
.focus-overlay[data-tone="good"] .focus-status {
  color: var(--focus-good);
}

.focus-overlay[data-tone="warn"] .focus-timer,
.focus-overlay[data-tone="warn"] .focus-status {
  color: var(--focus-warn);
}

.focus-overlay[data-tone="urgent"] .focus-timer,
.focus-overlay[data-tone="urgent"] .focus-status {
  color: var(--focus-urgent);
}

.focus-overlay[data-tone="neutral"] .focus-timer {
  color: var(--focus-neutral);
}

.focus-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(24px, 5vw, 56px);
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.focus-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.focus-exit {
  border-color: var(--border-soft);
  background: var(--panel-2);
}

.focus-clock {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
}

.focus-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

.focus-status {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--muted);
}

.focus-timer {
  font-family: "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--focus-neutral);
  letter-spacing: 0.08em;
}

.focus-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 600;
}

.focus-event {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.focus-time {
  font-size: 1rem;
  color: var(--muted);
}

.focus-upnext {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 520px;
}

.focus-upnext-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--muted);
}

.focus-upnext-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.focus-upnext-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  font-size: 0.9rem;
}

.focus-upnext-time {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.focus-upnext-title {
  font-weight: 600;
  text-align: right;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.tz-modal {
  border: none;
  padding: 0;
  background: transparent;
  margin: auto;
}

.tz-modal::backdrop {
  background: rgba(32, 33, 36, 0.6);
}

.tz-modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  width: min(420px, 92vw);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tz-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tz-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.tz-result-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  font-size: 0.82rem;
  color: var(--text);
}

.tz-result-btn:hover {
  border-color: var(--border);
}

.tz-result-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tz-result-offset {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 33, 36, 0.6);
}

.modal-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  width: min(520px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  animation: modal-pop 0.2s cubic-bezier(0,0,0.2,1);
  overflow: hidden;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.json-modal-card {
  width: min(720px, 94vw);
}

.template-modal-card {
  width: min(860px, 96vw);
}

.qr-modal-card {
  width: min(420px, 92vw);
  text-align: center;
}

.embed-modal-card {
  width: min(520px, 94vw);
}

.embed-code-textarea {
  font-family: "Courier New", Consolas, monospace;
  font-size: 0.75rem;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text);
  resize: vertical;
  width: 100%;
  line-height: 1.5;
}

.embed-code-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.embed-helper {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.cloud-trial-modal-card {
  width: min(580px, 94vw);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  box-shadow: var(--shadow-premium);
}

.cloud-trial-modal-header {
  border-bottom-color: color-mix(in srgb, var(--accent) 16%, var(--border-soft));
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--accent-soft) 86%, var(--panel)),
    color-mix(in srgb, var(--accent-soft) 22%, var(--panel))
  );
}

.cloud-trial-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-trial-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.cloud-trial-modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.cloud-trial-modal-body {
  gap: 18px;
}

.cloud-trial-copy {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
}

.cloud-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cloud-pricing-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cloud-pricing-trial {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-soft));
  background: color-mix(in srgb, var(--accent-soft), var(--panel) 64%);
}

.cloud-pricing-paid {
  border-color: var(--border-soft);
}

.cloud-pricing-label {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 700;
}

.cloud-pricing-value {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.cloud-pricing-value span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

.cloud-pricing-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.cloud-trial-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cloud-trial-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.cloud-trial-benefits i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 86%, transparent);
  flex-shrink: 0;
}

.cloud-trial-actions {
  border-top-color: color-mix(in srgb, var(--accent) 16%, var(--border-soft));
}

.cloud-trial-later-btn {
  min-width: 116px;
}

.cloud-trial-start-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  min-height: 38px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 30%, transparent);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cloud-trial-start-link:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.cloud-trial-start-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.upgrade-calendar-modal-card {
  width: min(620px, 94vw);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  box-shadow: var(--shadow-premium);
}

.upgrade-calendar-modal-header {
  border-bottom-color: color-mix(in srgb, var(--accent) 16%, var(--border-soft));
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-soft) 82%, var(--panel)),
    color-mix(in srgb, var(--accent-soft) 22%, var(--panel))
  );
}

.upgrade-calendar-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upgrade-calendar-eyebrow {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.upgrade-calendar-modal-header h3 {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: 0.01em;
}

.upgrade-calendar-modal-body {
  gap: 16px;
}

.upgrade-calendar-copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.upgrade-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.upgrade-plan-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.upgrade-plan-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upgrade-plan-card-content {
  min-height: 146px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  transition: all 0.2s ease;
}

.upgrade-plan-card input:checked + .upgrade-plan-card-content {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border-soft));
  background: color-mix(in srgb, var(--accent-soft), var(--panel) 68%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.upgrade-plan-card:focus-within .upgrade-plan-card-content {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.upgrade-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upgrade-plan-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.upgrade-plan-price {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.upgrade-plan-price span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: 3px;
}

.upgrade-plan-meta {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.upgrade-plan-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-soft));
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 700;
}

.auth-modal-card {
  width: min(460px, 92vw);
}

.invoices-modal-card {
  width: min(760px, 96vw);
}

.version-history-modal-card {
  width: min(760px, 96vw);
}

.invoices-modal-body {
  gap: 12px;
}

.version-history-modal-body {
  gap: 12px;
}

.invoices-copy,
.invoices-loading,
.invoices-empty {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.version-history-copy,
.version-history-loading,
.version-history-empty {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
}

.invoices-status {
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  background: var(--panel-2);
  color: var(--text);
}

.invoices-status.bad {
  border-color: rgba(217, 48, 37, 0.38);
  color: var(--danger);
}

.invoices-status.good {
  border-color: rgba(52, 168, 83, 0.45);
  color: #1f7a3d;
}

.invoices-status.warn {
  border-color: rgba(251, 188, 5, 0.45);
}

.version-history-status {
  margin: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.82rem;
  background: var(--panel-2);
  color: var(--text);
}

.version-history-status.bad {
  border-color: rgba(217, 48, 37, 0.38);
  color: var(--danger);
}

.version-history-status.good {
  border-color: rgba(52, 168, 83, 0.45);
  color: #1f7a3d;
}

.version-history-status.warn {
  border-color: rgba(251, 188, 5, 0.45);
}

.invoices-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 44vh;
  overflow-y: auto;
}

.version-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 44vh;
  overflow-y: auto;
}

.invoice-item {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.version-history-item {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 11px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.version-history-details {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.version-history-title-row {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.version-history-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.version-history-source {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--panel);
  font-weight: 700;
}

.version-history-source.restore {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-soft));
  color: var(--accent-strong);
}

.version-history-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.version-history-restore-btn {
  min-width: 92px;
}

.invoice-details {
  min-width: 0;
  flex: 1;
}

.invoice-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invoice-meta {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.invoice-view-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  white-space: nowrap;
}

.invoice-view-link:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  color: var(--accent-strong);
}

.invoice-view-link.is-disabled {
  opacity: 0.66;
  cursor: not-allowed;
}

.auth-modal-header {
  border-bottom-color: color-mix(in srgb, var(--accent) 12%, var(--border-soft));
}

.auth-modal-body {
  gap: 14px;
}

.auth-modal-note {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.auth-success {
  margin: 0;
  font-size: 0.8rem;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
}

.auth-switch-row {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-switch-btn {
  border: none;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-switch-btn:hover {
  background: transparent;
  color: var(--accent-strong);
  box-shadow: none;
}

.command-palette-card {
  width: min(760px, 95vw);
  max-height: min(72vh, 680px);
}

.command-palette-header {
  gap: 10px;
}

.command-palette-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
}

.command-palette-input-wrap > i {
  font-size: 0.82rem;
  color: var(--muted);
}

#command-palette-input,
#event-search-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  padding: 4px 0;
}

#command-palette-input:focus,
#event-search-input:focus {
  outline: none;
}

.command-palette-body {
  padding: 8px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.command-palette-empty {
  margin: 4px 2px 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.command-palette-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.command-palette-item {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  color: var(--text);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  text-align: left;
}

.command-palette-item:hover,
.command-palette-item.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft), transparent 22%);
}

.command-palette-item-title {
  font-size: 0.84rem;
  font-weight: 600;
  min-width: 0;
}

.command-palette-item-meta {
  font-size: 0.73rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.qr-code {
  padding: 12px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qr-code canvas,
.qr-code img {
  display: block;
}

.qr-warning {
  margin: 0;
  font-size: 0.8rem;
  color: var(--danger);
  background: rgba(217, 48, 37, 0.08);
  border: 1px solid rgba(217, 48, 37, 0.2);
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  align-self: stretch;
  word-break: break-word;
}

.qr-helper {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.qr-modal-actions {
  justify-content: center;
}

.app-launcher-modal-panel {
  position: relative;
  width: min(980px, 96vw);
  max-height: min(92vh, 760px);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid #d4dae4;
  border-radius: 16px;
  background: #f8fafc;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-theme="dark"] .app-launcher-modal-panel,
.dark-mode .app-launcher-modal-panel {
  background: #1f2937;
  border-color: #374151;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.app-launcher-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-launcher-modal-title {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

body[data-theme="dark"] .app-launcher-modal-title,
.dark-mode .app-launcher-modal-title {
  color: #e5e7eb;
}

.app-launcher-modal-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #d4dae4;
  background: rgba(255, 255, 255, 0.75);
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-launcher-modal-close:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

body[data-theme="dark"] .app-launcher-modal-close,
.dark-mode .app-launcher-modal-close {
  background: rgba(15, 23, 42, 0.7);
  border-color: #4b5563;
  color: #cbd5e1;
}

body[data-theme="dark"] .app-launcher-modal-close:hover,
.dark-mode .app-launcher-modal-close:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: #60a5fa;
  color: #93c5fd;
}

.app-launcher-modal-body {
  width: 100%;
  height: min(76vh, 680px);
  min-height: 360px;
  border: 1px solid #d4dae4;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
}

body[data-theme="dark"] .app-launcher-modal-body,
.dark-mode .app-launcher-modal-body {
  border-color: #334155;
  background: #0f172a;
}

.app-launcher-modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.icon-btn i,
.icon-btn svg {
  display: block;
  line-height: 1;
}

.modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.json-output {
  min-height: 220px;
  font-family: "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  resize: vertical;
  white-space: pre;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--panel);
}

.field input.is-invalid,
.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field input.is-invalid:focus,
.field input[aria-invalid="true"]:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.color-field-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 4px 2px;
}

#event-color {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

#event-color::-webkit-color-swatch-wrapper {
  padding: 2px;
}

#event-color::-webkit-color-swatch {
  border-radius: 6px;
  border: none;
}

.color-palette {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent-soft);
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--panel);
}

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

.modal-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.modal-error {
  margin: 0;
  font-size: 0.75rem;
  color: var(--danger);
}

.template-modal-body {
  gap: 14px;
}

.template-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.template-card {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.template-card-title {
  margin: 0;
  font-size: 0.9rem;
}

.template-card-description {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  flex: 1;
}

.template-card-link {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--panel);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.template-card-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.locked-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(32, 33, 36, 0.4);
  z-index: 5;
}

.locked-overlay.hidden {
  display: none;
}

.locked-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  width: min(320px, 80%);
  box-shadow: var(--shadow-md);
}

.mobile-warning {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(32, 33, 36, 0.45);
  z-index: 40;
}

.mobile-warning-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(520px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 12px 14px;
}

.mobile-warning-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-warning-title {
  font-size: 0.86rem;
  font-weight: 600;
}

.mobile-warning-text {
  font-size: 0.78rem;
  color: var(--muted);
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 40;
}

.toast {
  background: var(--panel);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 200px;
}

.toast.success {
  border-color: rgba(52, 168, 83, 0.6);
}

.toast.error {
  border-color: rgba(217, 48, 37, 0.6);
}

@media (max-width: 640px) {
  .cloud-pricing-grid {
    grid-template-columns: 1fr;
  }

  .upgrade-plan-grid {
    grid-template-columns: 1fr;
  }

  .cloud-trial-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .upgrade-calendar-modal-card .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .upgrade-calendar-modal-card .modal-actions-right {
    width: 100%;
  }

  #upgrade-calendar-submit,
  #upgrade-calendar-cancel {
    width: 100%;
  }

  .cloud-trial-actions .modal-actions-right {
    width: 100%;
  }

  .cloud-trial-later-btn,
  .cloud-trial-start-link {
    width: 100%;
    justify-content: center;
  }

  .invoice-item {
    flex-direction: column;
    align-items: stretch;
  }

  .invoice-view-link {
    width: 100%;
  }
}

.hidden {
  display: none !important;
}

.mobile-only {
  display: none !important;
}

/* Prevent topbar action overflow from covering month navigation at desktop test widths. */
@media (max-width: 1320px) {
  .topbar {
    padding: 8px 14px;
    gap: 8px;
  }

  .topbar-left {
    gap: 8px;
  }

  .secondary-actions {
    gap: 6px;
  }

  .title-input {
    max-width: 150px;
    font-size: 0.95rem;
  }

  .topbar-date-label {
    display: none;
  }

  .add-event-btn,
  .cloud-cta-btn,
  .login-cta-btn,
  .new-calendar-btn,
  .topbar-theme-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .add-event-btn span,
  .cloud-cta-btn span,
  .login-cta-btn span,
  .new-calendar-btn span,
  .topbar-theme-btn .theme-toggle-text {
    display: none;
  }
}

@media (max-width: 1100px) {
  .topbar {
    padding: 8px 14px;
  }

  .secondary-actions {
    gap: 6px;
  }

  .topbar-left {
    gap: 8px;
  }

  .title-input {
    max-width: 150px;
    font-size: 0.95rem;
  }

  .topbar-date-label {
    font-size: 0.9rem;
  }

  .add-event-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .cloud-cta-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .login-cta-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .new-calendar-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .profile-menu-trigger {
    width: 34px;
    height: 34px;
  }

  .topbar-theme-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .topbar-theme-btn .theme-toggle-text {
    display: none;
  }

  .add-event-btn span {
    display: none;
  }

  .cloud-cta-btn span {
    display: none;
  }

  .login-cta-btn span {
    display: none;
  }

  .new-calendar-btn span {
    display: none;
  }

  .calendar-panel {
    height: 100%;
    overflow: hidden;
  }

  .panel-header {
    padding: 12px 16px;
  }

  .event-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .month-label {
    font-size: 1.2rem;
  }

  .panel-actions {
    width: 100%;
    justify-content: space-between;
  }

  .timeline-controls {
    max-width: calc(100% - 20px);
    width: calc(100% - 20px);
    bottom: 10px;
    padding: 7px;
    gap: 7px;
  }

  .timeline-minimap {
    height: 31px;
  }

  .timeline-controls-row {
    justify-content: space-between;
  }

  #timeline-zoom-range {
    width: min(220px, 42vw);
  }

  .calendar-grid.month-view {
    font-size: 0.8rem;
  }

  .day-cell {
    padding: 4px;
  }

  .event-chip {
    padding: 1px 4px;
    font-size: 0.6rem;
  }

  .side-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
  }

  .side-close:hover {
    background: var(--bg);
  }
}

@media (max-width: 480px) {
  .brand-text {
    display: none;
  }

  .topbar-date-label {
    display: none;
  }
  
  .nav-group button {
    padding: 0 8px;
    font-size: 0.8rem;
  }
}

@media (max-width: 1100px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-breakdown-card {
    grid-row: auto;
  }

  .analytics-chart-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: var(--topbar-height);
    padding: 8px 10px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .topbar-left {
    gap: 6px;
    min-width: 0;
  }

  .topbar-date-label {
    display: none;
  }

  .top-banners-row {
    flex-direction: column;
    padding: 4px 12px 2px;
    gap: 4px;
  }

  .countdown-container {
    margin: 0;
    flex-direction: row;
    align-items: center;
    padding: 6px 10px;
    gap: 8px;
    border-radius: 8px;
  }

  .trial-countdown-banner {
    margin: 0;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    padding: 6px 10px;
    gap: 8px;
    border-radius: 8px;
  }

  .trial-countdown-label span {
    display: none;
  }

  .trial-countdown-meta {
    display: none;
  }

  .trial-countdown-usage {
    display: none;
  }

  .trial-countdown-actions {
    width: auto;
    margin-left: auto;
  }

  .trial-upgrade-btn {
    width: auto;
    padding: 4px 10px;
    font-size: 0.7rem;
    min-height: 28px;
  }

  .trial-countdown-timer {
    width: auto;
    text-align: center;
    font-size: 0.85rem;
    padding: 2px 8px;
  }

  .countdown-label {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
  }

  .countdown-content {
    width: auto;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
  }

  .countdown-title {
    font-size: 0.82rem;
    max-width: 140px;
  }

  .countdown-timer {
    font-size: 0.85rem;
    padding: 2px 8px;
  }

  .countdown-meta {
    display: none;
  }

  .countdown-title {
    max-width: 100%;
    white-space: normal;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .command-palette-btn span {
    display: none;
  }

  .event-filter-bar {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .event-filter-clear {
    grid-column: 1 / -1;
    width: 100%;
  }

  .command-palette-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .command-palette-item-meta {
    white-space: normal;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .focus-shell {
    padding: 24px;
    border-radius: 20px;
  }

  .focus-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .focus-upnext {
    align-self: stretch;
  }

  .focus-upnext-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .focus-upnext-title {
    text-align: left;
  }

  .calendar-grid.agenda-view {
    padding: 12px 14px 18px;
  }

  .calendar-grid.analytics-view {
    padding: 12px 14px 18px;
  }

  .analytics-shell {
    gap: 10px;
  }

  .analytics-kpi-grid {
    gap: 8px;
  }

  .analytics-kpi-card {
    padding: 10px 11px;
  }

  .analytics-kpi-value {
    font-size: 1.2rem;
  }

  .analytics-chart-wrap {
    gap: 10px;
  }

  .analytics-donut {
    width: min(200px, 56vw);
  }

  .analytics-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .analytics-list-meta {
    white-space: normal;
  }

  .agenda-event-item {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .agenda-time {
    font-size: 0.68rem;
  }

  .calendar-grid.timeline-view .timeline-scroll {
    padding-bottom: 186px;
  }

  .timeline-controls {
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    max-width: none;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 6px;
    gap: 6px;
  }

  .timeline-minimap {
    height: 28px;
  }

  .timeline-controls-row {
    gap: 6px;
    justify-content: space-between;
  }

  .timeline-zoom-label {
    flex: 1 1 auto;
    min-width: 0;
  }

  .timeline-zoom-label-text {
    display: none;
  }

  .timeline-zoom-value {
    min-width: 48px;
    padding: 4px 6px;
    font-size: 0.66rem;
  }

  #timeline-zoom-range {
    width: clamp(108px, 37vw, 170px);
  }

  .timeline-center-btn {
    padding-inline: 10px;
    font-size: 0.7rem;
  }

  .timeline-ruler {
    height: 64px;
  }

  .timeline-focus-line {
    top: 64px;
  }

  .timeline-hour-line,
  .timeline-minute-line {
    top: 64px;
  }

  .timeline-day-chip {
    top: 22px;
    font-size: 0.62rem;
  }

  .timeline-hour-chip {
    top: 38px;
    font-size: 0.54rem;
  }

  .timeline-minute-chip {
    top: 50px;
    font-size: 0.48rem;
  }

  .timeline-event {
    height: 52px;
    border-radius: 12px;
    padding: 7px 10px;
  }

  .timeline-event-time {
    font-size: 0.62rem;
  }

  .timeline-event-title {
    font-size: 0.8rem;
  }

  .mobile-warning-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-warning-card button {
    align-self: stretch;
  }
}

@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  .side-close.mobile-only {
    display: flex !important;
  }

  .mobile-quick-actions {
    display: flex !important;
  }

  .mobile-drawer,
  .mobile-drawer-backdrop {
    display: flex !important;
  }

  .secondary-actions {
    display: none !important;
  }

  .mobile-warning {
    display: flex;
  }

  .countdown-container {
    top: var(--topbar-plus-quick, calc(var(--topbar-height, 64px) + 56px));
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas: "calendar";
    position: relative;
    overflow: hidden;
  }

  .side-panel,
  .tz-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    background: var(--panel);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border: none;
  }

  .side-panel.is-active,
  .tz-sidebar.is-active {
    transform: translateX(0);
  }

  /* Hide settings from panel-header on mobile — they live in the drawer */
  #weekstart-toggle,
  #theme-toggle,
  .lang-selector,
  #mobile-sidebar-toggle {
    display: none !important;
  }
}

/* --- World Planner Modal & Grid --- */

.planner-modal-card {
  background: var(--panel);
  width: 95vw;
  max-width: 1200px; /* Wide format for the timeline */
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 85vh; /* Occupy most of height */
  overflow: hidden;
  position: relative;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-shrink: 0;
  gap: 16px;
}

.planner-controls-left, .planner-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Planner Search Input */
.wp-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
}

.wp-search-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 2;
}

#wp-add-zone {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9rem;
}

#wp-add-zone:focus {
  outline: 2px solid var(--accent);
  background: var(--panel);
}

/* Reusing .tz-results styles but positioned for WP */
#wp-tz-results.tz-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 50;
  list-style: none;
  padding: 0;
} 

/* Planner Content Grid */
.modal-grid-container {
  display: grid;
  grid-template-columns: 200px 1fr; /* Fixed City Col, Scrollable Timeline */
  flex: 1;
  overflow: hidden; /* Manage overflow internally */
  position: relative;
}

/* Left Column: City Headers */
.city-col {
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: hidden; /* Synced with JS if needed, but flex row usually fits */
  display: flex;
  flex-direction: column;
  z-index: 10; /* Stick on top of scroll */
  box-shadow: 2px 0 5px rgba(0,0,0,0.05);
}

.wp-row-header {
  height: 60px; /* Fixed height for alignment */
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  background: var(--panel);
}

/* Home Row distinctive style */
.wp-row-header.home-row {
  background: var(--panel-2);
}

.wp-city-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.wp-home-icon {
  font-size: 0.8rem;
  color: var(--text);
}

.wp-city-time {
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
}

.wp-city-date {
  font-size: 0.7rem;
  color: var(--muted);
}

.wp-offset-badge {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
}

/* Controls (hover only) */
.wp-row-controls {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none; /* Show on hover */
  gap: 4px;
}

.wp-row-header:hover .wp-row-controls {
  display: flex;
}

.wp-control-btn {
  background: transparent;
  border: none;
  font-size: 0.7rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.wp-control-btn:hover {
  background: var(--border-soft);
  color: var(--danger);
}

/* Right Column: Timeline Track */
.timeline-col {
  overflow-x: auto;
  overflow-y: auto; /* Allow vertical scroll if many rows */
  position: relative;
  background: var(--bg);
  cursor: crosshair;
}

.timeline-track {
  display: flex;
  flex-direction: column;
  min-width: 960px; /* 24 hours * 40px */
  position: relative;
}

.wp-row-cells {
  display: flex;
  height: 60px;
  border-bottom: 1px solid var(--border-soft);
}

.wp-cell {
  flex: 0 0 4.16666%; /* 100% / 24 */
  min-width: 40px;
  border-right: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  position: relative;
  user-select: none;
}

/* Color Aesthetic "Exact Match" */
/* Business Hours: 8am - 5pm */
.wp-cell.business {
  background: #E3F2FD; /* Light Blue */
  color: #1565C0; /* Dark Blue Text */
}
[data-theme="dark"] .wp-cell.business {
  background: #1e3a8a;
  color: #bfdbfe;
}

/* Active Hours (Evening): 6pm - 10pm */
.wp-cell.active {
  background: #BBDEFB; /* Slightly darker blue */
  color: #0D47A1;
}
[data-theme="dark"] .wp-cell.active {
  background: #172554;
  color: #93c5fd;
}

/* Sleep Hours: 11pm - 7am */
.wp-cell.sleep {
  background: repeating-linear-gradient(
    45deg,
    var(--panel-2),
    var(--panel-2) 5px,
    var(--border-soft) 5px,
    var(--border-soft) 10px
  );
  color: var(--muted);
  opacity: 0.8;
}

/* Date Date Boundary */
.wp-cell.date-boundary {
  background: #FFF9C4 !important; /* Yellow */
  color: #F57F17;
}
[data-theme="dark"] .wp-cell.date-boundary {
  background: #422006 !important;
  color: #fde047;
}

/* Scrubber Overlay */
.scrubber-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4.16666%; /* 1 cell width */
  min-width: 40px;
  border: 2px solid var(--text);
  background: rgba(0,0,0,0.05); /* Transparent fill */
  pointer-events: none; /* Click-through */
  z-index: 20;
  transition: transform 0.05s linear;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.2); /* Dim everything else */
}

/* Ghost Scrubber (Hover) */
.ghost-scrubber {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4.16666%;
  min-width: 40px;
  border: 2px solid var(--muted); /* Lighter border */
  background: transparent;
  pointer-events: none;
  z-index: 15;
  transition: transform 0.05s linear;
  opacity: 0.5;
}

/* Mobile Responsiveness for World Planner */
@media (max-width: 768px) {
  .planner-modal-card {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .planner-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
    position: relative;
    padding-right: 48px; /* Space for close button */
  }

  .planner-controls-left,
  .planner-controls-right {
    width: 100%;
    gap: 8px;
  }

  .wp-search-wrapper {
    width: 100%;
  }

  .planner-controls-right {
    justify-content: flex-start;
  }

  #wp-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
  }

  
  .modal-grid-container {
    grid-template-columns: 140px 1fr; /* Smaller city col */
  }

  .wp-row-header {
    padding: 8px 8px;
  }

  .wp-city-time {
    font-size: 1rem;
  }
  
  .wp-control-btn {
    font-size: 1rem;
    padding: 8px; /* Larger hit area */
  }
}

.accent-btn {
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.accent-btn:hover {
  background: var(--accent-soft);
}

/* App Launcher (Waffle Menu) */
.app-launcher-container {
  position: relative;
  display: flex;
  align-items: center;
}

.app-launcher-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: -10px;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
  padding: 16px;
  z-index: 100;
  transform-origin: top right;
  animation: menu-pop 0.2s cubic-bezier(0.2, 0, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Glassmorphism attempt */
@supports (backdrop-filter: blur(12px)) {
  .app-launcher-menu {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

body[data-theme="dark"] .app-launcher-menu {
  background: #2b2c2f;
}

@supports (backdrop-filter: blur(12px)) {
  body[data-theme="dark"] .app-launcher-menu {
    background: rgba(43, 44, 47, 0.85);
  }
}

.app-launcher-menu.hidden {
  display: none;
  animation: none;
}

@keyframes menu-pop {
  0% { opacity: 0; transform: scale(0.92) translateY(-8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.app-launcher-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  padding: 12px 8px;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.1s ease;
  text-align: center;
}

.app-launcher-item:hover {
  background: var(--panel-2);
  transform: translateY(-2px);
}

.app-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-launcher-item:hover .app-icon-wrapper {
  transform: scale(1.1);
}

.app-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .app-launcher-modal-panel {
    width: min(100vw, 100vw);
    max-height: 92vh;
    padding: 12px;
    border-radius: 16px 16px 0 0;
  }

  .app-launcher-modal-body {
    height: 72vh;
    min-height: 320px;
  }

  .app-launcher-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 24px 24px 0 0;
    transform-origin: bottom center;
    animation: slide-up 0.3s cubic-bezier(0.2, 0, 0, 1);
    border-bottom: none;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  }

  @keyframes slide-up {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
  }
}

/* --- Micro-animations & Transitions --- */

/* View Transitions */
.calendar-grid.view-animate-in {
  animation: view-fade-in 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.calendar-grid.view-animate-out {
  animation: view-fade-out 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes view-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes view-fade-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* Ripple Effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

body[data-theme="dark"] .ripple {
  background: rgba(255, 255, 255, 0.2);
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Stagger Animation */
@keyframes cell-fade-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--border-soft) 50%, var(--panel-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Hover Lift for Cards */
.side-card, .tz-card, .agenda-event-item, .event-item {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.side-card:hover, .tz-card:hover, .event-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

/* ---- Mobile Quick-Action Bar ---- */
.mobile-quick-actions {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--topbar-height, 64px);
  z-index: 9;
}

.quick-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.quick-action-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.bmc-mobile-btn {
  background: linear-gradient(135deg, #ffdd00 0%, #f7c300 100%);
  color: #111 !important;
  border-color: #e6c200;
}

.bmc-mobile-btn:hover {
  background: linear-gradient(135deg, #f7c300 0%, #ffdd00 100%);
  border-color: #d4b000;
}

.quick-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ---- Mobile Drawer ---- */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32, 33, 36, 0.5);
  z-index: 49;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mobile-drawer-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88vw);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 160%);
  border-left: 1px solid var(--border-soft);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-drawer.is-active {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--panel);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.mobile-drawer-title {
  font-size: 1rem;
  font-weight: 600;
}

.mobile-drawer-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 600;
}

.mobile-drawer-view-toggle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.mobile-drawer-view-toggle button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mobile-drawer-view-toggle button > i:first-child {
  width: 18px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
  font-size: 0.8rem;
  color: var(--muted);
}

.mobile-drawer-view-toggle button > span {
  flex: 1 1 auto;
}

.mobile-drawer-view-toggle button:hover {
  background: var(--accent-soft);
}

.mobile-drawer-view-toggle button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.mobile-drawer-view-toggle button.active > i:first-child {
  color: var(--accent);
}

.mobile-drawer-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.mobile-drawer-item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.mobile-drawer-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mobile-drawer-item > i:first-child {
  width: 28px;
  min-width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--accent);
  font-size: 0.84rem;
  line-height: 1;
}

.mobile-drawer-item > span {
  flex: 1 1 auto;
}

.mobile-drawer-item.action-link::after {
  content: "\f054";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.66rem;
  color: var(--muted);
  margin-left: auto;
  opacity: 0.75;
}

.mobile-language-select {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.mobile-language-select:focus {
  outline: none;
}

/* Constrain embedded lists in mobile drawer */
#mobile-event-list {
  max-height: 200px;
  overflow-y: auto;
  min-height: 60px;
}

#mobile-tz-list {
  max-height: 240px;
  overflow-y: auto;
}

.mobile-drawer-section .side-card {
  padding: 12px;
}

/* Always show remove button on mobile (no hover) */
.mobile-drawer-section .tz-card .tz-remove {
  opacity: 1;
}

/* World Planner Ghost Scrubber */
.ghost-scrubber {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.3;
  pointer-events: none;
  z-index: 5;
}

.scrubber-overlay {
  pointer-events: none;
}

/* Current time slot highlighting */
.wp-cell.current {
  position: relative;
  background: var(--accent-soft) !important;
  border: 2px solid var(--accent);
  font-weight: 600;
  box-shadow: 0 0 8px var(--accent-soft);
}

body[data-theme="dark"] .wp-cell.current {
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* Buy Me a Coffee Button */
.bmc-link {
  background: linear-gradient(135deg, #ffdd00 0%, #ffc800 100%);
  border: 1px solid #e6c200;
  color: #000000 !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
  transition: all 0.2s ease;
}

.bmc-link:hover {
  background: linear-gradient(135deg, #ffe333 0%, #ffcc00 100%);
  border-color: #d4b000;
  box-shadow: 0 4px 12px rgba(255, 221, 0, 0.4);
  transform: translateY(-2px);
}

.bmc-link i {
  color: #000000;
}

/* Dark mode adjustments for BMC button */
body[data-theme="dark"] .bmc-link {
  background: linear-gradient(135deg, #ffdd00 0%, #ffc800 100%);
  border-color: #b39700;
  color: #000000 !important;
  box-shadow: 0 2px 8px rgba(255, 221, 0, 0.2);
}

body[data-theme="dark"] .bmc-link:hover {
  background: linear-gradient(135deg, #ffe333 0%, #ffcc00 100%);
  box-shadow: 0 4px 12px rgba(255, 221, 0, 0.35);
}

/* Mobile drawer BMC button */
.mobile-drawer-item.bmc-link {
  background: linear-gradient(135deg, #ffdd00 0%, #ffc800 100%);
  border: 1px solid #e6c200;
  color: #000000 !important;
  margin-top: 4px;
}

.mobile-drawer-item.bmc-link > i:first-child {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(0, 0, 0, 0.14);
  color: #5f4500;
}

.mobile-drawer-item.bmc-link:hover,
.mobile-drawer-item.bmc-link:active {
  background: linear-gradient(135deg, #ffe333 0%, #ffcc00 100%);
}

.mobile-drawer-item.bmc-link i,
.mobile-drawer-item.bmc-link span {
  color: #000000 !important;
}

/* Hide text on smaller screens in top bar, show just icon */
@media (max-width: 1200px) {
  .side-panel .action-link.bmc-link span {
    display: none;
  }
  
  .side-panel .action-link.bmc-link {
    padding: 8px 10px;
  }
}

/* Hide brand text (hash-calendar title) on mobile */
@media (max-width: 768px) {
  .brand-text {
    display: none;
  }
}

