:root {
  --primary: #0a84ff;
  --accent: #34c759;
  --danger: #ff3b30;
  --surface: #f7f7f8;
  --surface-elevated: #ffffff;
  --border: #e7e7ea;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --overlay: rgba(0, 0, 0, 0.15);
  
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --danger: #ff453a;
  --surface: #000000;
  --surface-elevated: #0a0a0a;
  --border: #1a1a1a;
  --text: #f5f5f7;
  --text-secondary: #98989d;
  --overlay: rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --danger: #ff453a;
    --surface: #000000;
    --surface-elevated: #0a0a0a;
    --border: #1a1a1a;
    --text: #f5f5f7;
    --text-secondary: #98989d;
    --overlay: rgba(0, 0, 0, 0.35);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  /* Support for safe area insets on notched devices */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--font-system);
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: -webkit-fill-available; /* iOS Safari fix */
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header {
  position: relative;
  z-index: 5;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.nav-open .nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Background Music Player */
/* Global Music Controls (shown in header on all pages) */
.global-music-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.global-music-info {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.bg-music-container {
  position: relative;
}

.bg-music-btn {
  position: relative;
}

.bg-music-btn.active {
  background: rgba(10, 132, 255, 0.2);
  border-color: rgba(10, 132, 255, 0.4);
}

.bg-music-btn.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: #0a84ff;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.bg-music-icon {
  font-size: 1.2rem;
}

.bg-music-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 320px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  pointer-events: none;
}

[data-theme="dark"] .bg-music-menu {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.bg-music-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: all;
}

.bg-music-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-music-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.bg-music-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

.bg-music-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.bg-music-current-track {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  text-align: center;
}

.bg-music-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bg-music-control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-music-control-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.bg-music-volume {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.bg-music-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.bg-music-volume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4);
}

.bg-music-volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.bg-music-volume::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4);
}

.bg-music-track-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.bg-music-track-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  color: var(--text);
  font-size: 0.9rem;
}

.bg-music-track-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(4px);
}

.bg-music-track-item.active {
  background: rgba(10, 132, 255, 0.15);
  border-color: rgba(10, 132, 255, 0.3);
}

.bg-music-track-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.bg-music-track-name {
  flex: 1;
  font-weight: 500;
}

.bg-music-track-active {
  color: var(--primary);
  font-size: 0.8rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .bg-music-menu {
    right: 0;
    left: auto;
    width: calc(100vw - 2rem);
    max-width: 320px;
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
}

.nav-toggle-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.nav-toggle-label {
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

body.nav-open {
  overflow: hidden;
}

.logo {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

#searchInput {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  min-width: 200px;
  transition: border-color 0.2s;
}

#searchInput:focus {
  outline: none;
  border-color: var(--primary);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
  flex: 1;
}

.panel {
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

[data-theme="dark"] .panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.todo-panel {
  background: linear-gradient(135deg, #000000 0%, #000000 30%, #0a0a0a 70%, #000000 100%);
  position: relative;
  max-height: calc(100vh - 10rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

[data-theme="dark"] .todo-panel {
  background: #000000;
}

.todo-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.02) 0%, transparent 50%);
  pointer-events: none;
}

/* Completed day glow effect */
.todo-panel.day-completed {
  position: relative;
  animation: completedGlow 3s ease-in-out infinite;
}

.todo-panel.day-completed::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: 
    radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.2) 0%, rgba(160, 32, 240, 0.15) 50%, transparent 70%);
  border-radius: inherit;
  z-index: -1;
  opacity: 0.6;
  animation: completedPulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes completedGlow {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(138, 43, 226, 0.3),
      0 0 40px rgba(160, 32, 240, 0.2),
      inset 0 0 20px rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(138, 43, 226, 0.4),
      0 0 60px rgba(160, 32, 240, 0.3),
      inset 0 0 30px rgba(138, 43, 226, 0.15);
    border: 1px solid rgba(138, 43, 226, 0.4);
  }
}

@keyframes completedPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

[data-theme="dark"] .todo-panel.day-completed {
  background: linear-gradient(135deg, 
    rgba(20, 10, 25, 0.95) 0%, 
    rgba(15, 5, 30, 0.95) 50%, 
    rgba(20, 10, 25, 0.95) 100%);
}

.todo-panel > * {
  position: relative;
  z-index: 1;
}

.todo-panel .todo-header-nav,
.todo-panel .pending-message,
.todo-panel .progress-section,
.todo-panel .counts,
.todo-panel .filters,
.todo-panel .add-task,
.todo-panel .task-list {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.todo-panel .total-estimated-time-box {
  margin-left: auto;
  margin-right: auto;
}

.todo-panel .todo-header-nav {
  padding-inline: 0.25rem;
}

.todo-panel .progress-section,
.todo-panel .counts,
.todo-panel .filters,
.todo-panel .add-task,
.todo-panel .task-list {
  padding-inline: 0.25rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.5px;
}

.todo-panel .section-title {
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 0%, #b0b0b0 50%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.pending-message {
  display: none;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  font-size: 0.9rem;
}

.pending-message.visible {
  display: flex;
}

.pending-message-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

.pending-message-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.3;
}

.pending-message-text strong {
  font-weight: 600;
}

[data-theme="dark"] .pending-message {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .pending-message-icon {
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.45));
}

.progress-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.progress-bar-container {
  flex: 1;
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(255, 255, 255, 0.25) 25%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    rgba(255, 255, 255, 0.15) 100%
  );
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.3),
    0 0 40px rgba(255, 255, 255, 0.15),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
  border-radius: 10px;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: progressShine 2s infinite;
  pointer-events: none;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  pointer-events: none;
  border-radius: 10px;
}

@keyframes progressShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Completion effect when reaching 100% */
.progress-bar.complete {
  animation: progressComplete 3s ease-out, progressPulse 1.5s ease-in-out infinite;
  box-shadow: 
    0 0 40px rgba(10, 132, 255, 0.9),
    0 0 80px rgba(10, 132, 255, 0.7),
    0 0 120px rgba(52, 199, 89, 0.5),
    inset 0 1px 3px rgba(255, 255, 255, 0.6);
  background: linear-gradient(
    90deg,
    rgba(10, 132, 255, 0.95) 0%,
    rgba(52, 199, 89, 0.9) 25%,
    rgba(10, 132, 255, 0.95) 50%,
    rgba(52, 199, 89, 0.9) 75%,
    rgba(10, 132, 255, 0.95) 100%
  );
}

@keyframes progressComplete {
  0% {
    transform: scaleX(1);
    box-shadow: 
      0 0 20px rgba(255, 255, 255, 0.3),
      0 0 40px rgba(255, 255, 255, 0.15),
      inset 0 1px 2px rgba(255, 255, 255, 0.4);
  }
  20% {
    transform: scaleX(1.05) scaleY(1.2);
    box-shadow: 
      0 0 60px rgba(10, 132, 255, 1),
      0 0 120px rgba(52, 199, 89, 0.8),
      0 0 180px rgba(10, 132, 255, 0.6),
      inset 0 1px 5px rgba(255, 255, 255, 0.8);
  }
  40% {
    transform: scaleX(1.02) scaleY(1.1);
    box-shadow: 
      0 0 50px rgba(10, 132, 255, 0.9),
      0 0 100px rgba(52, 199, 89, 0.7),
      0 0 150px rgba(10, 132, 255, 0.5),
      inset 0 1px 4px rgba(255, 255, 255, 0.7);
  }
  60% {
    transform: scaleX(1.03) scaleY(1.15);
    box-shadow: 
      0 0 55px rgba(10, 132, 255, 0.95),
      0 0 110px rgba(52, 199, 89, 0.75),
      0 0 165px rgba(10, 132, 255, 0.55),
      inset 0 1px 4px rgba(255, 255, 255, 0.75);
  }
  80% {
    transform: scaleX(1.01) scaleY(1.05);
    box-shadow: 
      0 0 45px rgba(10, 132, 255, 0.85),
      0 0 90px rgba(52, 199, 89, 0.65),
      0 0 135px rgba(10, 132, 255, 0.45),
      inset 0 1px 3px rgba(255, 255, 255, 0.65);
  }
  100% {
    transform: scaleX(1) scaleY(1);
    box-shadow: 
      0 0 40px rgba(10, 132, 255, 0.9),
      0 0 80px rgba(10, 132, 255, 0.7),
      0 0 120px rgba(52, 199, 89, 0.5),
      inset 0 1px 3px rgba(255, 255, 255, 0.6);
  }
}

@keyframes progressPulse {
  0%, 100% {
    box-shadow: 
      0 0 40px rgba(10, 132, 255, 0.9),
      0 0 80px rgba(10, 132, 255, 0.7),
      0 0 120px rgba(52, 199, 89, 0.5),
      inset 0 1px 3px rgba(255, 255, 255, 0.6);
  }
  50% {
    box-shadow: 
      0 0 60px rgba(10, 132, 255, 1),
      0 0 120px rgba(52, 199, 89, 0.8),
      0 0 180px rgba(10, 132, 255, 0.6),
      inset 0 1px 4px rgba(255, 255, 255, 0.8);
  }
}

.progress-label {
  font-weight: 700;
  color: #ffffff;
  min-width: 40px;
  font-size: 1rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .progress-label {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 5px rgba(255, 255, 255, 0.2);
}

.progress-label.updating {
  animation: progressLabelPulse 0.4s ease;
}

@keyframes progressLabelPulse {
  0%, 100% {
    transform: scale(1);
    color: #ffffff;
  }
  50% {
    transform: scale(1.15);
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  }
}

.counts {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  flex-wrap: wrap;
}

[data-theme="dark"] .counts {
  color: rgba(255, 255, 255, 0.95);
}

.count-item strong {
  color: #ffffff;
  font-weight: 700;
}

.count-separator {
  opacity: 0.5;
}

.total-estimated-time-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.75rem 1rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
  flex-wrap: nowrap;
  width: fit-content;
}

.time-display-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  width: 100%;
}

.time-display-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.total-estimated-time-box .time-icon {
  font-size: 1rem;
  opacity: 0.9;
}

.total-estimated-time-box .time-label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  white-space: nowrap;
}

.total-estimated-time-box .time-value {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.available-hours-input {
  width: 60px;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.85rem;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
}

.available-hours-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.available-hours-input::-webkit-inner-spin-button,
.available-hours-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-display-item.remaining-time .time-value {
  font-weight: 700;
  font-size: 0.95rem;
}

[data-theme="dark"] .total-estimated-time-box {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.5rem 1.25rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  backdrop-filter: blur(5px);
}

[data-theme="dark"] .chip {
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

[data-theme="dark"] .chip:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.chip.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.filter-chip.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.add-task {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.add-task input {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem 1.25rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  background: rgba(20, 20, 20, 0.8);
  color: #ffffff;
  font-size: 0.95rem;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

[data-theme="dark"] .add-task input {
  background: rgba(20, 20, 20, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.add-task input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .add-task input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.add-task input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.task-time-estimate {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 0 0 auto;
  min-width: 140px;
}

.task-time-estimate label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.time-inputs input[type="number"] {
  flex: 1;
  min-width: 50px;
  max-width: 70px;
  padding: 0.5rem 0.5rem;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.8);
  color: #ffffff;
  font-size: 0.9rem;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  transition: all 0.2s;
}

.time-inputs input[type="number"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(30, 30, 30, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.time-inputs input[type="number"]::-webkit-inner-spin-button,
.time-inputs input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-separator {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  font-weight: 600;
}

[data-theme="dark"] .add-task input:focus {
  background: rgba(30, 30, 30, 1);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Todo panel specific button styling */
.todo-panel .btn-primary {
  background: linear-gradient(135deg, #4a4a4a 0%, #6a6a6a 50%, #4a4a4a 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.todo-panel .btn-primary:hover {
  background: linear-gradient(135deg, #5a5a5a 0%, #7a7a7a 50%, #5a5a5a 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.todo-panel .btn-primary:active {
  background: linear-gradient(135deg, #3a3a3a 0%, #5a5a5a 50%, #3a3a3a 100%);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  min-height: 0;
}

.task-list::-webkit-scrollbar {
  width: 8px;
}

.task-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin: 4px 0;
}

.task-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.task-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
  background-clip: padding-box;
}

.task-item {
  display: grid;
  grid-template-columns: 24px 24px 80px 1fr auto;
  gap: 0.75rem;
  align-items: start;
  padding: 1rem 1.25rem;
  background: rgba(20, 20, 20, 0.8);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  cursor: default;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: visible;
}

[data-theme="dark"] .task-item {
  background: rgba(20, 20, 20, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.task-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.task-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(30, 30, 30, 0.95);
}

[data-theme="dark"] .task-item:hover {
  background: rgba(30, 30, 30, 1);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.task-item:hover::before {
  opacity: 1;
}

.task-item.selected {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(40, 40, 40, 1);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15), 0 0 0 2px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .task-item.selected {
  background: rgba(40, 40, 40, 1);
  border-color: rgba(255, 255, 255, 0.5);
}

.task-item.done {
  opacity: 0.6;
  background: rgba(25, 25, 25, 0.8);
  animation: taskComplete 0.5s ease;
}

[data-theme="dark"] .task-item.done {
  background: rgba(25, 25, 25, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.task-item.done .task-title {
  text-decoration: line-through;
  opacity: 0.7;
}

@keyframes taskComplete {
  0% { transform: scale(1); }
  25% { transform: scale(1.02); }
  50% { 
    transform: scale(0.98);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  }
  100% { transform: scale(1); }
}

.task-item.cancelled {
  opacity: 0.5;
  background: rgba(20, 20, 20, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .task-item.cancelled {
  background: rgba(20, 20, 20, 0.8);
}

.task-item.cancelled .task-title {
  text-decoration: line-through;
  opacity: 0.6;
}

.drag-handle {
  cursor: grab;
  color: rgba(255, 255, 255, 0.3);
  user-select: none;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.drag-handle:active {
  cursor: grabbing;
}

.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

[data-theme="dark"] .task-checkbox {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
}

.task-checkbox:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.task-checkbox:checked {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  animation: checkBounce 0.4s ease;
}

.task-checkbox:checked::before {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 16px;
  font-weight: bold;
  animation: checkPop 0.3s ease;
}

@keyframes checkBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes checkPop {
  0% { transform: translate(-50%, -50%) scale(0); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.task-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.task-title {
  font-weight: 600;
  outline: none;
  padding: 2px 4px;
  border-radius: 4px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  color: #ffffff;
  font-size: 1rem;
  cursor: text;
  transition: all 0.2s;
  max-width: 100%;
}

[data-theme="dark"] .task-title {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.task-title:hover {
  background: rgba(255, 255, 255, 0.05);
}

.task-title:focus {
  background: rgba(255, 255, 255, 0.1);
  cursor: text;
}

.task-note {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  outline: none;
  padding: 2px 4px;
  border-radius: 4px;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  cursor: text;
  transition: all 0.2s;
  max-width: 100%;
}

[data-theme="dark"] .task-note {
  color: rgba(255, 255, 255, 0.8);
}

.task-note:hover {
  background: rgba(255, 255, 255, 0.05);
}

.task-note:focus {
  background: rgba(255, 255, 255, 0.1);
  cursor: text;
}

.task-note:empty::before {
  content: "Add a note...";
  opacity: 0.5;
}

.task-estimated-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: fit-content;
}

.task-estimated-time .time-icon {
  font-size: 0.85rem;
  opacity: 0.8;
}

.priority-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  text-align: center;
  white-space: nowrap;
  min-width: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.priority-chip:hover {
  transform: translateY(-1px) scale(1.04);
}

.priority-chip.IU {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.35), rgba(249, 115, 22, 0.35));
  color: #ffe7e7;
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.2);
}

.priority-chip.IBNU {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35), rgba(129, 140, 248, 0.35));
  color: #e0f2ff;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.18);
}

.priority-chip.NIBU {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(163, 230, 53, 0.35));
  color: #fff7d6;
  box-shadow: 0 10px 25px rgba(251, 191, 36, 0.18);
}

.priority-chip.NINU {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.35), rgba(100, 116, 139, 0.35));
  color: #f1f5f9;
  box-shadow: 0 10px 25px rgba(148, 163, 184, 0.18);
}

.task-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.task-move-panel {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: none;
  gap: 0.875rem;
  position: relative;
  overflow: hidden;
}

.task-move-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2) 50%, 
    transparent
  );
  pointer-events: none;
}

.task-move-panel.open {
  display: flex;
  flex-direction: column;
}

.task-move-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.01em;
}

.task-move-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}

.task-move-date {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}

.task-move-date label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.task-move-date-input {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.task-move-date-input input[type="date"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.task-move-date-input input[type="date"]:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.move-chip {
  font-size: 0.75rem;
  padding-inline: 0.9rem;
}

.btn-compact {
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 999px;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.4rem;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s;
  border-radius: 6px;
}

[data-theme="dark"] .btn-icon {
  color: rgba(255, 255, 255, 0.8);
}

.btn-icon:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pomo-panel {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.hero-bg {
  position: relative;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #000; /* Fallback color while loading */
}

/* Hide background image initially, show only if video fails */
.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/bg-1.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
}

/* Show background image only if video fails to load */
.hero-bg.video-failed::before {
  opacity: 1;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  pointer-events: none;
  background-color: #000; /* Black background while loading */
}

.hero-video.loaded {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  padding: 2rem;
  width: 100%;
}

.pomo-heading {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 2rem;
  outline: none;
  padding: 0.5rem;
  border-radius: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pomo-heading[contenteditable="false"] {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.pomo-heading[contenteditable="true"] {
  cursor: text;
}

.pomo-heading:focus {
  background: rgba(255, 255, 255, 0.1);
}

.mode-pills {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.pill {
  padding: 0.6rem 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.pill.active {
  background: white;
  color: #1d1d1f;
  border-color: white;
}

.timer-display {
  font-size: 6.5rem;
  font-weight: 700;
  letter-spacing: -3px;
  margin-bottom: 2rem;
  font-variant-numeric: tabular-nums;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
  
  /* Glass morphism container */
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 2.5rem 3.5rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(50px) saturate(200%);
  -webkit-backdrop-filter: blur(50px) saturate(200%);
  border-radius: 36px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -1px 2px rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  
  /* Text styling */
  color: #ffffff;
  text-align: center;
  text-shadow: 
    0 2px 20px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.3);
  
  /* Animation and effects */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  z-index: 1;
  
  /* Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.timer-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  animation: shine 10s infinite ease-in-out;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

@keyframes shine {
  0%, 100% {
    left: -100%;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

.timer-display:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 16px 56px rgba(0, 0, 0, 0.45),
    inset 0 2px 6px rgba(255, 255, 255, 0.6),
    inset 0 -1px 3px rgba(255, 255, 255, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.22);
}

.controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.btn-primary {
  padding: 0.75rem 2rem;
  background: var(--primary);
  color: white;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-large {
  padding: 1rem 3rem;
  font-size: 1.1rem;
}

.btn-ghost {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header .btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.3);
}

.header .btn-ghost:hover {
  background: var(--surface);
}

.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pomo-info {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.attached-task {
  margin-bottom: 0.5rem;
  font-style: italic;
  opacity: 0.9;
}

.rounds-counter {
  font-weight: 500;
}

.settings {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.settings summary {
  cursor: pointer;
  font-weight: 500;
  user-select: none;
  list-style: none;
}

.settings summary::-webkit-details-marker {
  display: none;
}

.settings-content {
  margin-top: 1rem;
  display: grid;
  gap: 1rem;
}

.settings-content label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.settings-content input[type="number"] {
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9rem;
}

.settings-content input[type="number"]:focus {
  outline: none;
  border-color: white;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
}

.checkbox-label input {
  width: auto;
  margin-right: 0.5rem;
  accent-color: var(--primary);
}

.footer {
  padding: 1rem 2rem;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border);
  text-align: center;
}

.shortcuts {
  display: flex;
  gap: 2rem;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

kbd {
  padding: 0.2rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-system);
  font-size: 0.8rem;
  margin: 0 0.1rem;
}

/* Tablet and smaller desktop */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }
  
  .timer-display {
    font-size: 4.5rem;
    padding: 2rem 3rem;
    letter-spacing: -2px;
    border-radius: 28px;
  }
  
  .shortcuts {
    gap: 1rem;
  }
}

/* Mobile devices - Android and iOS */
@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .panel {
    padding: 1.5rem;
    border-radius: var(--radius);
  }
  
  .header {
    flex-direction: column;
    padding: 1rem;
    gap: 0.75rem;
    align-items: flex-start;
  }
  
  .header-left {
    width: 100%;
    justify-content: space-between;
  }
  
  
  .header-right {
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    position: static;
  }
  
  .primary-nav {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    display: flex;
    position: static;
    box-shadow: none;
    z-index: auto;
  }
  
  .primary-nav .btn-ghost,
  .primary-nav a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  
  .header-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
  }
  
  .header-actions .btn-ghost,
  .header-actions button,
  .header-actions a {
    width: 100%;
    justify-content: center;
  }
  
  .header-actions input[type="search"] {
    width: 100%;
  }
  
  .logo {
    font-size: 1.25rem;
  }
  
  #searchInput {
    width: 100%;
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 16px !important;
    min-width: auto;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 12px;
  }
  
  .btn-ghost {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
  
  .progress-section {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
  
  .progress-bar-container {
    height: 10px;
  }
  
  .progress-label {
    font-size: 0.9rem;
    min-width: 35px;
  }
  
  .counts {
    font-size: 0.8rem;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
  }
  
  .filters {
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
  }
  
  .chip {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  
  .add-task {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .add-task input {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }
  
  .btn-primary {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .task-item {
    grid-template-columns: 24px 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  .todo-panel {
    max-height: none;
  }
  
  .task-list {
    max-height: none;
    overflow: visible;
  }
  
  .drag-handle {
    display: none;
  }
  
  .priority-chip {
    display: inline-flex;
    margin-left: 0;
  }
  
  .task-content {
    min-width: 0;
  }
  
  .task-title {
    font-size: 0.9rem;
  }
  
  .task-note {
    font-size: 0.8rem;
  }
  
  .btn-icon {
    font-size: 1.1rem;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  button, .btn-primary, .btn-ghost, .btn-icon, .chip, .pill {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    touch-action: manipulation;
  }
  
  /* Prevent zoom on iOS when focusing inputs */
  #taskTitle, #taskNote, #searchInput, 
  .settings-content input[type="number"],
  .pomo-heading[contenteditable="true"] {
    font-size: 16px !important;
  }
  
  .hero-content {
    padding: 1.5rem 1rem;
  }
  
  .pomo-heading {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    padding: 0.4rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .mode-pills {
    gap: 0.4rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .pill {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
  }
  
  .timer-display {
    font-size: 3rem;
    padding: 1.25rem 2rem;
    letter-spacing: -1px;
    border-radius: 20px;
    margin-bottom: 1.5rem;
  }
  
  .controls {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    width: 100%;
  }
  
  .btn-ghost {
    width: 100%;
    padding: 0.75rem 1.25rem;
  }
  
  .pomo-info {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  
  .attached-task {
    font-size: 0.8rem;
  }
  
  .rounds-counter {
    font-size: 0.85rem;
  }
  
  .settings {
    padding: 0.75rem;
  }
  
  .settings-content {
    gap: 0.75rem;
  }
  
  .settings-content label {
    font-size: 0.85rem;
  }
  
  .settings-content input[type="number"] {
    padding: 0.5rem;
    font-size: 0.85rem;
  }
  
  .footer {
    padding: 0.75rem 1rem;
  }
  
  .shortcuts {
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.75rem;
    align-items: center;
  }
  
  kbd {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .main-grid {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .panel {
    padding: 1rem;
  }
  
  .header {
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .header-left {
    width: 100%;
  }
  
  .header-right {
    width: 100%;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .header-right .btn-ghost,
  .header-right a {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: center;
    justify-content: center;
    font-size: 0.9rem;
  }
  
  #searchInput {
    width: 100%;
    margin: 0;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .section-title {
    font-size: 1.1rem;
  }
  
  .add-task {
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .task-time-estimate {
    width: 100%;
    min-width: auto;
  }
  
  .time-inputs {
    width: 100%;
    justify-content: center;
  }
  
  .time-inputs input[type="number"] {
    flex: 1;
    max-width: none;
    min-width: 60px;
  }
  
  .add-task input {
    width: 100% !important;
    padding: 0.875rem 1rem !important;
    font-size: 16px !important;
    min-width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
  }
  
  [data-theme="dark"] .add-task input {
    background: rgba(20, 20, 20, 0.95);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.95);
  }
  
  .add-task input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
  }
  
  .add-task input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(30, 30, 30, 1);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  }
  
  [data-theme="dark"] .add-task input:focus {
    background: rgba(30, 30, 30, 1);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  }
  
  #addTaskBtn {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
  }
  
  /* Ensure task inputs are always visible on mobile */
  #taskTitle,
  #taskNote {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1;
  }
  
  .progress-bar-container {
    height: 8px;
  }
  
  .progress-label {
    font-size: 0.85rem;
    min-width: 30px;
  }
  
  .counts {
    font-size: 0.75rem;
  }
  
  .total-estimated-time-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  
  .time-display-item {
    width: 100%;
    justify-content: space-between;
  }
  
  .chip {
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
  }
  
  .add-task input {
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
  }
  
  .btn-primary {
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .task-item {
    padding: 0.65rem 0.875rem;
    gap: 0.4rem;
  }
  
  .task-title {
    font-size: 0.85rem;
  }
  
  .task-note {
    font-size: 0.75rem;
  }
  
  .hero-content {
    padding: 1.25rem 0.75rem;
  }
  
  .pomo-heading {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.35rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .mode-pills {
    margin-bottom: 1.5rem;
  }
  
  .pill {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
  }
  
  .timer-display {
    font-size: 2.5rem;
    padding: 1rem 1.5rem;
    letter-spacing: -0.5px;
    border-radius: 18px;
    margin-bottom: 1.25rem;
  }
  
  .btn-large {
    padding: 0.8rem 1.75rem;
    font-size: 0.95rem;
  }
  
  .btn-ghost {
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
  }
  
  .pomo-info {
    font-size: 0.8rem;
  }
  
  .settings {
    padding: 0.65rem;
  }
  
  .settings-content label {
    font-size: 0.8rem;
  }
  
  .shortcuts {
    font-size: 0.7rem;
  }
  
  kbd {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
  }
}

/* Very small mobile devices (iPhone SE, etc.) */
@media (max-width: 360px) {
  .main-grid {
    padding: 0.5rem;
  }
  
  .panel {
    padding: 0.75rem;
  }
  
  .timer-display {
    font-size: 2rem;
    padding: 0.875rem 1.25rem;
  }
  
  .hero-content {
    padding: 1rem 0.5rem;
  }
  
  .pomo-heading {
    font-size: 0.9rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .pill {
    padding: 0.4rem 0.85rem;
    font-size: 0.75rem;
  }
}

input:focus-visible,
button:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ====== CUSTOM MODAL ====== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
  position: relative;
  background: var(--surface-elevated);
  border-radius: 20px;
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 
              0 0 1px rgba(0, 0, 0, 0.2);
  transform: scale(0.9) translateY(20px);
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border: 1px solid var(--border);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  to {
    transform: scale(1) translateY(0);
  }
}

.modal-icon {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 1rem;
  animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

@keyframes iconBounce {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.modal-message {
  font-size: 1rem;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 2rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.btn-modal {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-system);
  min-width: 120px;
}

.btn-cancel {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-cancel:hover {
  background: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-cancel:active {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #ff6b6b 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 59, 48, 0.4);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

/* ====== CELEBRATION OVERLAY ====== */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
}

.celebration-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.celebration-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
  border-radius: 24px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 100px rgba(10, 132, 255, 0.6),
    0 0 150px rgba(52, 199, 89, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: celebrationSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             celebrationPulse 2s ease-in-out infinite 0.6s;
  transform: scale(0.5) translateY(-50px);
  opacity: 0;
}

.celebration-overlay.active .celebration-content {
  animation: celebrationSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             celebrationPulse 2s ease-in-out infinite 0.6s;
}

.celebration-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: celebrationBounce 0.8s ease-out 0.3s both,
             celebrationRotate 2s ease-in-out infinite 1.1s;
  display: inline-block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.celebration-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 1rem 0;
  background: linear-gradient(135deg, #0a84ff 0%, #34c759 50%, #0a84ff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: celebrationTextShine 3s ease-in-out infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.celebration-message {
  font-size: 1.25rem;
  color: #333;
  margin: 0;
  font-weight: 500;
  animation: celebrationFadeIn 0.8s ease-out 0.5s both;
}

[data-theme="dark"] .celebration-content {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.9) 100%);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(10, 132, 255, 0.5),
    0 0 150px rgba(52, 199, 89, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .celebration-message {
  color: #e0e0e0;
}

@keyframes celebrationSlideIn {
  0% {
    transform: scale(0.5) translateY(-50px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

@keyframes celebrationPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.3),
      0 0 100px rgba(10, 132, 255, 0.6),
      0 0 150px rgba(52, 199, 89, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 
      0 30px 80px rgba(0, 0, 0, 0.4),
      0 0 150px rgba(10, 132, 255, 0.8),
      0 0 200px rgba(52, 199, 89, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}

@keyframes celebrationBounce {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.2) rotate(10deg);
  }
  80% {
    transform: scale(0.9) rotate(-5deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes celebrationRotate {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-10deg) scale(1.1);
  }
  75% {
    transform: rotate(10deg) scale(1.1);
  }
}

@keyframes celebrationTextShine {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes celebrationFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark theme adjustments */
[data-theme="dark"] .modal-content {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 
              0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 
                0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  :root:not([data-theme="light"]) .btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  :root:not([data-theme="light"]) .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
  }
}

@media (max-width: 640px) {
  .modal-content {
    padding: 1.5rem;
    max-width: 90%;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .btn-modal {
    width: 100%;
  }
}

.matrix-container {
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.matrix-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  border-radius: 28px;
  background: linear-gradient(140deg, rgba(20, 21, 25, 0.95), rgba(26, 27, 32, 0.9));
  padding: 2rem 2.5rem;
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(64, 64, 75, 0.3);
}

[data-theme="dark"] .matrix-hero {
  background: linear-gradient(140deg, rgba(14, 14, 18, 0.96), rgba(18, 19, 24, 0.92));
  border-color: rgba(82, 82, 90, 0.25);
}

.matrix-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 700;
  opacity: 0.7;
  margin-bottom: 0.75rem;
}

.matrix-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.matrix-subtitle {
  max-width: 520px;
  color: rgba(226, 232, 240, 0.75);
  font-size: 1rem;
  line-height: 1.6;
}

[data-theme="dark"] .matrix-subtitle {
  color: rgba(255, 255, 255, 0.65);
}

.matrix-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  align-content: start;
}

.matrix-legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.8);
}

[data-theme="dark"] .matrix-legend-item {
  color: rgba(255, 255, 255, 0.78);
}

.matrix-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.35);
}

.matrix-dot.IU {
  background: linear-gradient(135deg, #f43f5e, #f97316);
}

.matrix-dot.IBNU {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
}

.matrix-dot.NIBU {
  background: linear-gradient(135deg, #fbbf24, #a3e635);
}

.matrix-dot.NINU {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
}

.matrix-quadrant {
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15, 16, 20, 0.95), rgba(27, 28, 33, 0.92));
  padding: 1.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  box-shadow: 0 26px 70px rgba(8, 9, 12, 0.55);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(72, 72, 82, 0.35);
  min-height: 340px;
}

[data-theme="dark"] .matrix-quadrant {
  background: linear-gradient(145deg, rgba(10, 11, 15, 0.97), rgba(18, 19, 25, 0.94));
  border-color: rgba(82, 82, 92, 0.3);
}

.matrix-quadrant-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.matrix-quadrant-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #fafafa;
  position: relative;
  padding-left: 1.25rem;
}

.matrix-quadrant-header h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(100, 116, 139, 0.2));
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.matrix-quadrant-header p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .matrix-quadrant-header p {
  color: rgba(255, 255, 255, 0.6);
}

.matrix-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: rgba(38, 39, 45, 0.9);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(229, 231, 235, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .matrix-count {
  background: rgba(45, 46, 52, 0.95);
  color: rgba(231, 233, 238, 0.85);
}

.matrix-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
  max-height: clamp(280px, 38vh, 420px);
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.6) rgba(15, 23, 42, 0.45);
  scroll-behavior: smooth;
}

.matrix-list::-webkit-scrollbar {
  width: 8px;
}

.matrix-list::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
}

.matrix-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(14, 165, 233, 0.7));
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.matrix-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.85), rgba(59, 130, 246, 0.85));
}

.matrix-empty {
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.05);
}

.matrix-task-card {
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(18, 18, 22, 0.96), rgba(25, 26, 32, 0.92));
  padding: 1.45rem;
  display: grid;
  gap: 1rem;
  box-shadow: 0 26px 75px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(66, 66, 74, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: rgba(248, 250, 252, 0.9);
}

[data-theme="dark"] .matrix-task-card {
  background: linear-gradient(155deg, rgba(8, 8, 12, 0.96), rgba(16, 17, 23, 0.94));
  border-color: rgba(72, 73, 82, 0.35);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
}

.matrix-task-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6);
}

.matrix-task-card.status-done {
  opacity: 0.85;
}

.matrix-task-card.status-cancelled {
  opacity: 0.65;
}

.matrix-task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.matrix-task-header h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.matrix-status {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.35);
  color: rgba(15, 23, 42, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.matrix-status-done {
  background: rgba(34, 197, 94, 0.25);
  color: #0f5132;
}

.matrix-status-cancelled {
  background: rgba(244, 63, 94, 0.25);
  color: #7f1d1d;
}

.matrix-note {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(226, 232, 240, 0.78);
}

[data-theme="dark"] .matrix-note {
  color: rgba(226, 232, 240, 0.75);
}

.matrix-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.matrix-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(38, 39, 45, 0.85), rgba(58, 59, 65, 0.8));
  color: rgba(229, 231, 235, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.matrix-chip.overdue {
  background: rgba(244, 63, 94, 0.2);
  color: #7f1d1d;
}

.matrix-chip.due-today {
  background: rgba(251, 191, 36, 0.25);
  color: #78350f;
}

.matrix-chip.future {
  background: rgba(34, 197, 94, 0.2);
  color: #064e3b;
}

.matrix-chip.tag {
  background: linear-gradient(135deg, rgba(38, 39, 45, 0.65), rgba(58, 59, 65, 0.6));
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.matrix-action {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(36, 37, 44, 0.9), rgba(54, 55, 64, 0.85));
  color: rgba(236, 239, 244, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 22px rgba(24, 24, 28, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}

.matrix-action:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(54, 55, 64, 0.95), rgba(86, 88, 100, 0.9));
}

.matrix-action.danger {
  background: linear-gradient(135deg, rgba(142, 38, 39, 0.85), rgba(185, 51, 52, 0.75));
  color: rgba(254, 226, 226, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 14px 24px rgba(110, 27, 34, 0.45);
}

.matrix-action.danger:hover {
  background: linear-gradient(135deg, rgba(185, 51, 52, 0.9), rgba(217, 60, 62, 0.85));
}

[data-theme="dark"] .matrix-action {
  background: linear-gradient(135deg, rgba(26, 27, 34, 0.95), rgba(44, 45, 53, 0.86));
}

[data-theme="dark"] .matrix-action:hover {
  background: linear-gradient(135deg, rgba(44, 45, 53, 0.95), rgba(70, 72, 82, 0.9));
}

@media (max-width: 720px) {
  .matrix-container {
    padding: 0 1rem 3rem;
  }
  .matrix-quadrant {
    padding: 1.5rem;
  }
  .matrix-footer {
    gap: 0.5rem;
  }
}

.matrix-add {
  display: grid;
  gap: 0.6rem;
  background: linear-gradient(135deg, rgba(18, 19, 24, 0.9), rgba(28, 29, 36, 0.88));
  border-radius: 22px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(66, 66, 76, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .matrix-add {
  background: linear-gradient(135deg, rgba(12, 12, 16, 0.92), rgba(20, 20, 26, 0.9));
  border-color: rgba(72, 72, 82, 0.35);
}

.matrix-input,
.matrix-textarea {
  width: 100%;
  border: 1px solid rgba(82, 82, 90, 0.35);
  border-radius: 16px;
  background: rgba(19, 20, 25, 0.85);
  color: rgba(236, 239, 244, 0.9);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.matrix-input::placeholder,
.matrix-textarea::placeholder {
  color: rgba(236, 239, 244, 0.4);
}

.matrix-input:focus,
.matrix-textarea:focus {
  outline: none;
  border-color: rgba(120, 113, 198, 0.6);
  box-shadow: 0 0 0 3px rgba(147, 144, 216, 0.25);
  background: rgba(21, 22, 28, 0.95);
}

.matrix-textarea {
  resize: vertical;
  min-height: 72px;
}

.matrix-add-btn {
  justify-self: end;
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(129, 140, 248, 0.85));
  color: #f4f4f5;
  box-shadow: 0 18px 36px rgba(99, 102, 241, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.matrix-add-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px rgba(129, 140, 248, 0.4);
}

.matrix-date-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(16, 17, 22, 0.9), rgba(25, 26, 32, 0.88));
  padding: 1rem 1.5rem;
  border-radius: 22px;
  border: 1px solid rgba(70, 70, 80, 0.32);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.matrix-date-nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.matrix-nav-btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  background: linear-gradient(135deg, rgba(38, 38, 45, 0.92), rgba(55, 56, 64, 0.9));
  color: rgba(236, 239, 244, 0.88);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 22px rgba(12, 12, 16, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}

.matrix-nav-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(55, 56, 64, 0.95), rgba(74, 75, 86, 0.92));
}

.matrix-date-display {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(231, 233, 238, 0.82);
}

@media (max-width: 1024px) {
  .matrix-grid {
    grid-template-columns: 1fr;
  }

  .matrix-legend {
    grid-template-columns: 1fr;
  }

  .matrix-hero {
    padding: 1.75rem;
  }

  .matrix-date-toolbar {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .matrix-date-nav {
    justify-content: center;
  }

  .matrix-date-display {
    text-align: center;
  }
}

.motivation-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(20, 20, 24, 0.95), #030303 55%);
  color: #f1f5f9;
}

.motivation-layout {
  max-width: 1280px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.motivation-hero {
  padding: 2rem 2.6rem;
  border-radius: 28px;
  background: linear-gradient(140deg, rgba(15, 16, 22, 0.93), rgba(31, 33, 40, 0.88));
  border: 1px solid rgba(68, 68, 78, 0.35);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px) saturate(150%);
}

.motivation-kicker {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.6;
}

.motivation-title {
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 700;
  margin: 0.9rem 0 0.6rem;
}

.motivation-subtitle {
  max-width: 600px;
  font-size: 1.05rem;
  color: rgba(226, 232, 240, 0.7);
}

.motivation-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1280px) {
  .motivation-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 600px) {
  .motivation-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.motivation-card {
  position: relative;
  border-radius: 26px;
  padding: 0.85rem;
  background: linear-gradient(160deg, rgba(18, 20, 24, 0.9), rgba(30, 31, 36, 0.88));
  border: 1px solid rgba(69, 70, 80, 0.35);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  outline: none;
}

.motivation-card:focus,
.motivation-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.6);
}

.motivation-thumb {
  position: relative;
  border-radius: 20px;
  width: 100%;
  padding-top: calc(16 / 9 * 100%);
  background: linear-gradient(135deg, #111318, #1c1d24);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.motivation-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.6));
}

.motivation-thumb-fallback {
  background: radial-gradient(circle at top, rgba(36, 38, 46, 0.8), rgba(20, 21, 25, 0.9));
}

.motivation-badge {
  position: absolute;
  left: 1rem;
  bottom: 0.9rem;
  z-index: 1;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(12, 12, 16, 0.85);
  color: rgba(247, 250, 252, 0.85);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
}

.motivation-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 10, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.motivation-modal.open {
  display: flex;
}

.motivation-modal-layer {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.motivation-modal-inner {
  position: relative;
  width: min(65vw, 520px);
  background: #050506;
  border-radius: 28px;
  overflow: visible;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.motivation-modal-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.motivation-modal-stage {
  position: relative;
  flex: 1;
  background: #000;
  display: flex;
  border-radius: 20px;
  overflow: hidden;
}

.motivation-modal-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.motivation-modal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.05), rgba(5, 5, 7, 0.75));
  pointer-events: none;
}

.motivation-modal-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.motivation-modal-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.95), rgba(238, 87, 155, 0.9));
  transition: none;
  will-change: width;
}

.motivation-modal-buttons {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  pointer-events: auto;
  background: rgba(6, 6, 10, 0.65);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
}

.motivation-modal-btn {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: linear-gradient(135deg, rgba(38, 39, 48, 0.9), rgba(64, 65, 74, 0.85));
  color: rgba(236, 239, 244, 0.92);
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.motivation-modal-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(64, 65, 74, 0.95), rgba(84, 85, 96, 0.9));
}

.motivation-modal-volume {
  width: 100%;
  accent-color: #7b61ff;
  height: 4px;
  border-radius: 999px;
  background: transparent;
}

.motivation-modal-volume::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.motivation-modal-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7b61ff;
  margin-top: -6px;
}

.motivation-modal-volume::-moz-range-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.motivation-modal-volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7b61ff;
}

.motivation-modal-time {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(236, 239, 244, 0.75);
  text-align: right;
}

.motivation-modal-caption {
  padding: 0.9rem 1.4rem 1.2rem;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.9), rgba(5, 5, 7, 0.85));
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.7);
}

@media (max-width: 768px) {
  .motivation-modal-inner {
    width: min(85vw, 420px);
  }

  .motivation-hero {
    padding: 1.6rem 1.8rem;
  }

  .motivation-modal-content {
    gap: 0.5rem;
  }

  .motivation-nav-btn {
    font-size: 2.5rem;
    padding: 0.25rem;
  }
}

.motivation-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: none;
  z-index: 2;
  transition: transform 0.2s ease, color 0.2s ease;
  padding: 0.5rem;
}

.motivation-close:hover {
  transform: scale(1.15);
  color: rgba(255, 255, 255, 1);
}

.motivation-close:focus-visible {
  outline: 2px solid rgba(123, 97, 255, 0.75);
  outline-offset: 3px;
}

.motivation-nav-btn {
  position: relative;
  width: auto;
  height: auto;
  border: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 3.5rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: none;
  z-index: 2;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
  user-select: none;
  flex-shrink: 0;
  padding: 0.5rem;
}

.motivation-nav-btn:hover:not(:disabled) {
  transform: scale(1.15);
  color: rgba(255, 255, 255, 1);
}

.motivation-nav-btn:active:not(:disabled) {
  transform: scale(0.9);
  color: rgba(255, 255, 255, 0.8);
}

.motivation-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.motivation-nav-btn:focus-visible {
  outline: 2px solid rgba(123, 97, 255, 0.75);
  outline-offset: 3px;
}

[data-theme="dark"] .motivation-nav-btn {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .motivation-nav-btn:hover:not(:disabled) {
  color: rgba(255, 255, 255, 1);
}

/* ====== COMPREHENSIVE MOBILE RESPONSIVE IMPROVEMENTS ====== */

/* Ensure all interactive elements are touch-friendly on mobile */
@media (max-width: 768px) {
  button:not(.btn-icon):not(.matrix-action):not(.chip):not(.matrix-chip),
  a.btn-ghost,
  input[type="button"],
  input[type="submit"],
  [role="button"]:not(.btn-icon) {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }
}

/* Prevent iOS zoom on input focus */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
  font-size: 16px !important;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 12px;
}

/* Calendar page mobile improvements */
@media (max-width: 768px) {
  .calendar-container {
    padding: 1rem;
  }
  
  .calendar-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
  }
  
  .calendar-day {
    min-height: 60px;
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
  }
  
  .calendar-day-number {
    font-size: 0.9rem;
  }
  
  .calendar-task-count {
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
  }
}

/* Matrix page mobile improvements */
@media (max-width: 768px) {
  .matrix-container {
    padding: 0 1rem 3rem;
    margin: 1rem auto 3rem;
  }
  
  .matrix-hero {
    flex-direction: column;
    padding: 1.5rem;
  }
  
  .matrix-date-toolbar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }
  
  .matrix-date-nav {
    width: 100%;
    justify-content: space-between;
  }
  
  .matrix-nav-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    min-height: 44px;
  }
  
  .matrix-date-display {
    text-align: center;
    font-size: 0.85rem;
  }
  
  .matrix-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .matrix-quadrant {
    padding: 1.25rem;
  }
  
  .matrix-quadrant-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .matrix-list {
    max-height: none;
    overflow: visible;
  }
  
  .matrix-add {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .matrix-input,
  .matrix-textarea {
    width: 100%;
    font-size: 16px !important;
    padding: 0.875rem 1rem;
    min-height: 44px;
  }
  
  .matrix-add-btn {
    width: 100%;
    min-height: 44px;
    padding: 0.875rem 1rem;
  }
  
  .matrix-task-card {
    padding: 1rem;
  }
  
  .matrix-action {
    min-height: 36px;
    min-width: 36px;
    padding: 0.5rem;
  }
}

/* Motivation page mobile improvements */
@media (max-width: 768px) {
  .motivation-layout {
    margin: 1rem auto 3rem;
    padding: 0 1rem 3rem;
    gap: 1.5rem;
  }
  
  .motivation-hero {
    padding: 1.5rem;
  }
  
  .motivation-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .motivation-card {
    padding: 0.75rem;
  }
  
  .motivation-modal-inner {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
    border-radius: 20px;
  }
  
  .motivation-modal-content {
    gap: 0.5rem;
  }
  
  .motivation-nav-btn {
    font-size: 2.5rem;
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
  }
  
  .motivation-close {
    font-size: 1.75rem;
    top: 12px;
    right: 12px;
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
  }
  
  .motivation-modal-buttons {
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .motivation-modal-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
  }
  
  .motivation-modal-volume {
    width: 100px;
  }
}

/* Small mobile devices (iPhone SE, small Android) */
@media (max-width: 480px) {
  .header {
    padding: 0.75rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }
  
  .main-grid {
    padding: 0.75rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  
  .calendar-day {
    min-height: 50px;
    font-size: 0.75rem;
  }
  
  .calendar-day-number {
    font-size: 0.8rem;
  }
  
  .matrix-quadrant {
    padding: 1rem;
  }
  
  .matrix-list {
    max-height: none;
    overflow: visible;
  }
  
  .motivation-modal-inner {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .motivation-nav-btn {
    font-size: 2rem;
  }
  
  .motivation-close {
    font-size: 1.5rem;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
}

/* Very small devices */
@media (max-width: 360px) {
  .header {
    padding: 0.5rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }
  
  .logo {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1rem;
  }
  
  .matrix-hero {
    padding: 1rem;
  }
  
  .matrix-quadrant {
    padding: 0.75rem;
  }
  
  .motivation-hero {
    padding: 1rem;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .motivation-modal-inner {
    height: 100vh;
  }
  
  .matrix-list {
    max-height: none;
    overflow: visible;
  }
  
  .calendar-day {
    min-height: 45px;
  }
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
  .header {
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
  }
  
  .main-grid {
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  
  .matrix-container,
  .motivation-layout,
  .calendar-container {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-bottom: max(4rem, env(safe-area-inset-bottom));
  }
}

/* Improve scrolling on mobile */
.matrix-list,
.task-list,
.calendar-grid {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Prevent text selection on buttons and interactive elements */
button,
.btn-primary,
.btn-ghost,
.matrix-action,
.motivation-modal-btn,
.motivation-nav-btn,
.motivation-close {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Improve tap targets for small interactive elements */
.chip,
.matrix-chip,
.matrix-action,
.btn-icon {
  min-height: 32px;
  min-width: 32px;
  touch-action: manipulation;
}

/* Fix iOS input styling */
input,
textarea,
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 12px;
}

/* Improve focus visibility on mobile */
@media (max-width: 768px) {
  *:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }
}

