/* ==========================================================================
   Focus Timer (Android-First & Responsive Web) - Stylesheet
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-main: #0c0e14;
  --bg-surface: #141822;
  --bg-surface-elevated: #1c2230;
  --bg-surface-highlight: #252d40;
  
  --primary: #00ff88;          /* Vivid electric emerald matching logo */
  --primary-glow: rgba(0, 255, 136, 0.4);
  --primary-hover: #00e57a;

  --accent-cyan: #00f0ff;      /* Electric cyan matching logo */
  --warning: #f59e0b;
  --danger: #ef4444;
  --locked-color: #f59e0b;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 255, 136, 0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-main: #f4f6f9;              /* Soft off-white */
  --bg-surface: #ffffff;           /* Clean white surface */
  --bg-surface-elevated: #ffffff;
  --bg-surface-highlight: #e8ecf2;
  
  --primary: #00ff88;              /* Same vivid electric green */
  --primary-glow: rgba(0, 255, 136, 0.25);
  --primary-hover: #00e57a;

  --accent-cyan: #00f0ff;          /* Same vivid electric blue */
  --warning: #b45309;
  --danger: #b91c1c;
  --locked-color: #d97706;

  --text-main: #000000;            /* True Black for optimal readability */
  --text-muted: #111827;           /* Very dark slate */
  --text-dim: #374151;             /* Dark slate */

  --border-subtle: rgba(0, 0, 0, 0.14);
  --border-focus: rgba(0, 255, 136, 0.5);
}

[data-theme="light"] body,
[data-theme="light"] .digital-clock,
[data-theme="light"] .digital-time,
[data-theme="light"] .task-card-title,
[data-theme="light"] .pipeline-header h2,
[data-theme="light"] .section-title,
[data-theme="light"] .drawer-title,
[data-theme="light"] .setting-label,
[data-theme="light"] .calendar-block-title,
[data-theme="light"] .modal-title,
[data-theme="light"] .hard-stop-input,
[data-theme="light"] .nav-item,
[data-theme="light"] .input-task-title,
[data-theme="light"] .edit-task-input,
[data-theme="light"] .btn-label {
  color: #000000 !important;
}

[data-theme="light"] body {
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 50% 20%, rgba(5, 150, 105, 0.07) 0%, transparent 70%);
}

[data-theme="light"] .hard-stop-pill {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .hard-stop-input {
  color: #000000 !important;
}

[data-theme="light"] .hard-stop-input::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.75;
}

[data-theme="light"] .status-banner {
  background: rgba(15, 23, 42, 0.05);
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .btn-notif-pill {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .bezel-rim {
  display: none !important;
}

[data-theme="light"] .track-bg {
  stroke: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .dial-tick {
  stroke: rgba(15, 23, 42, 0.28);
}

[data-theme="light"] .dial-tick.major {
  stroke: #00f0ff !important;
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.6)) !important;
}

[data-theme="light"] .digital-time {
  color: #0f172a;
}

[data-theme="light"] .task-tag {
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .task-card {
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .task-card.task-completed {
  background: rgba(5, 150, 105, 0.08) !important;
  border-color: #059669 !important;
  border-left: 5px solid #059669 !important;
}

[data-theme="light"] .task-card.task-completed .task-card-title {
  color: #065f46;
}

[data-theme="light"] .task-card.task-current {
  background: rgba(217, 119, 6, 0.1) !important;
  border-color: #d97706 !important;
  border-left: 5px solid #d97706 !important;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.15);
}

[data-theme="light"] .task-card.task-current .task-card-title {
  color: #92400e;
}

[data-theme="light"] .task-card.task-pending {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  border-left: 5px solid #dc2626 !important;
}

[data-theme="light"] .task-card.task-pending .task-card-title {
  color: #0f172a;
}

[data-theme="light"] .duration-badge {
  background: rgba(15, 23, 42, 0.07);
  color: #0f172a;
}

[data-theme="light"] .task-emoji-btn {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .task-category-chip {
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
}

[data-theme="light"] .task-drawer {
  background: #ffffff;
  border-top-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .drawer-handle {
  background: rgba(15, 23, 42, 0.2);
}

[data-theme="light"] .form-input {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

[data-theme="light"] .nav-drawer {
  background: #ffffff;
  border-right-color: rgba(15, 23, 42, 0.12);
  box-shadow: 8px 0 32px rgba(15, 23, 42, 0.15);
}

[data-theme="light"] .nav-item {
  color: #475569;
}

[data-theme="light"] .nav-item:hover, [data-theme="light"] .nav-item:active {
  background: rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

[data-theme="light"] .nav-item.active {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.25);
}

[data-theme="light"] .settings-modal, [data-theme="light"] .calendar-modal, [data-theme="light"] .emoji-picker-modal {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
}

[data-theme="light"] .setting-row {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .setting-label {
  color: #0f172a;
}

[data-theme="light"] .setting-desc {
  color: #64748b;
}

[data-theme="light"] .theme-segmented-control {
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .theme-segment-btn {
  color: #475569;
}

[data-theme="light"] .theme-segment-btn.active {
  background: #059669;
  color: #ffffff;
}

[data-theme="light"] .calendar-block {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .calendar-block.completed {
  background: #f0fdf4;
  border-left: 3.5px solid #059669;
}

[data-theme="light"] .calendar-block.current {
  background: #fffbeb;
  border-left: 3.5px solid #d97706;
}

[data-theme="light"] .calendar-block.pending {
  background: #fef2f2;
  border-left: 3.5px solid #dc2626;
}

[data-theme="light"] .calendar-block-title {
  color: #0f172a;
}

[data-theme="light"] .edit-task-input {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

[data-theme="light"] .emoji-pick-btn {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .time-bank-pill {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .time-bank-amount {
  color: #d97706; /* rich warm amber gold */
}

[data-theme="light"] .edit-task-emoji-badge {
  background: #ffffff;
}

[data-theme="light"] .duration-chip {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #334155;
}

[data-theme="light"] .duration-chip.active {
  background: rgba(5, 150, 105, 0.15);
  border-color: #059669;
  color: #059669;
}

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

html {
  overflow-x: hidden;
  max-width: 100vw;
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  display: flex;
  justify-content: center;
  max-width: 100vw;
  background-image: radial-gradient(circle at 50% 20%, rgba(16, 185, 129, 0.07) 0%, transparent 65%);
}

/* Container constrained to mobile phone aspect ratio or centered on tablet/desktop */
.app-container {
  width: 100%;
  max-width: 440px;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 8px 16px 56px 16px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* ==========================================================================
   Header: Brand, Menu & Notifications
   ========================================================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
}

.app-brand {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(
    90deg,
    #00ff88 0%,
    #00f0ff 22%,
    #ffffff 45%,
    #ffffff 55%,
    #00f0ff 78%,
    #00ff88 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
  display: inline-block;
  line-height: 1.1;
  animation: brandShimmer 5s linear infinite;
}

@keyframes brandShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: 0% 0;
  }
}

.btn-menu {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  margin-right: 2px;
}

.btn-menu:active {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.92);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-notif-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-notif-pill:hover, .btn-notif-pill:active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-notif-pill.granted {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

/* ==========================================================================
   Schedule Control Bar: Hard Stop & Status Banner
   ========================================================================== */

.schedule-control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2px;
  width: 100%;
}

.hard-stop-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.hard-stop-pill:active {
  transform: scale(0.97);
}

.hard-stop-pill.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.calendar-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-hard-stop-pill {
  padding: 3px 8px;
  gap: 4px;
}

.calendar-hard-stop-pill .pill-label {
  font-size: 0.58rem;
}

.calendar-hard-stop-pill .hard-stop-input {
  font-size: 0.82rem;
  max-width: 68px;
}

.btn-clear-schedule {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: var(--radius-sm);
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-clear-schedule:active {
  background: rgba(239, 68, 68, 0.28);
  transform: scale(0.94);
}

.pill-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  white-space: nowrap;
}

.hard-stop-input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 88px;
  padding: 0;
}

.hard-stop-input::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
}

/* Time Bank Pill */
.time-bank-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.time-bank-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.time-bank-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.time-bank-amount {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fbbf24;
}

.time-bank-pill.is-active-overrun {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  animation: pulseOverrun 1.2s infinite alternate;
}

@keyframes pulseOverrun {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

/* Simple, elegant schedule concept explainer */
.schedule-concept-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
}

.concept-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
}

[data-theme="light"] .schedule-concept-bar {
  background: rgba(15, 23, 42, 0.04);
  color: #64748b;
}

/* ==========================================================================
   Focus Timer Hero & Rotary Wheel
   ========================================================================== */

.timer-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* Centers timer vertically so space above hard stop and below today's tasks tab are equal */
  padding: 4px 0;
}

.wheel-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none; /* Crucial for Android rotary wheel touch dragging */
  cursor: grab;
}

.wheel-container:active {
  cursor: grabbing;
}

.rotary-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Outer rotatable bezel - physically turns when dragged */
.rotary-dial-group {
  cursor: grab;
}

.rotary-dial-group:active {
  cursor: grabbing;
}

.bezel-rim {
  display: none !important;
}

.dial-tick {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 2.8;
  stroke-linecap: round;
}

.dial-tick.major {
  stroke: var(--accent-cyan);
  stroke-width: 4.8;
  filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.45));
}

.track-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 10;
}

.track-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 816.81; /* 2 * PI * 130 */
  stroke-dashoffset: 0;
  transition: stroke 0.25s ease; /* Instant 60fps/120fps continuous progress tracking without step latency */
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

/* The Revolving Circle that rotates 360 deg around timer */
.revolving-circle-group {
  cursor: grab;
  pointer-events: auto;
}

.revolving-circle-group:active {
  cursor: grabbing;
}

.revolving-glow {
  fill: var(--primary);
  opacity: 0.55;
  filter: blur(6px);
  transition: none; /* Instant tracking to eliminate cursor lag */
}

.revolving-circle {
  fill: var(--primary);
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 10px var(--primary));
  transition: none; /* Instant tracking to eliminate cursor lag */
}

/* Scrubbing & Dragging overrides: completely disable transitions */
.is-scrubbing .revolving-circle,
.is-scrubbing .revolving-glow,
.is-scrubbing .track-progress,
.is-dragging-dial .rotary-dial-group {
  transition: none !important;
}

/* Center Display inside circle */
.timer-center-display {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  text-align: center;
  padding: calc(50% - 66px) 15px 0;
  box-sizing: border-box;
  z-index: 10;
}

.task-category-chip {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
}

.digital-clock {
  font-family: var(--font-mono);
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text-main);
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.12);
  margin-bottom: 4px;
  pointer-events: auto;
  cursor: pointer;
}

[data-theme="light"] .digital-clock {
  color: #000000 !important;
  text-shadow: none !important;
}

.active-task-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  pointer-events: auto;
}
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Rotary Wheel Delta Preview Badge */
.rotary-preview-badge {
  position: absolute;
  bottom: 35px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #0c0e14;
  box-shadow: 0 4px 12px var(--primary-glow);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* Rotary Confirmation Pill */
.rotary-confirm-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  margin-top: 12px;
  gap: 12px;
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.btn-confirm-yes, .btn-confirm-no {
  border: none;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-confirm-yes {
  background: var(--primary);
  color: #0c0e14;
}

.btn-confirm-no {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* Warning Alert Card */
.warning-alert-card {
  width: 100%;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 10px;
  text-align: center;
}

.warning-title {
  color: #fca5a5;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

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

/* ==========================================================================
   Primary Control Buttons
   ========================================================================== */

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 14px;
  width: 100%;
}

.control-btn {
  border: none;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:active {
  transform: scale(0.92);
  background: var(--bg-surface-highlight);
  color: var(--text-main);
}

.control-btn.btn-exit-mode {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.control-btn.btn-exit-mode:active {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.btn-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.4px;
}

.btn-primary {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--primary);
  color: #0c0e14;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-primary:active {
  transform: scale(0.94);
  background: var(--primary-hover);
}

/* Finished Early Action */
.secondary-actions {
  margin-top: 10px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.btn-finish-early {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  color: #34d399;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-finish-early:hover, .btn-finish-early:active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
  transform: scale(0.98);
}

.finish-early-icon {
  font-size: 0.9rem;
}

/* ==========================================================================
   Task Pipeline Drawer / Bottom Sheet (Smooth Slide from Bottom)
   ========================================================================== */

.task-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 800;
  transition: opacity 0.3s ease;
}

.task-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 440px;
  height: 82vh; /* Expands to ~4/5ths of screen so all events are visible */
  max-height: 85vh;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -8px 36px rgba(0, 0, 0, 0.55);
  z-index: 850;
  transform: translateY(0);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  will-change: transform;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-drawer.collapsed {
  transform: translateY(calc(100% - 56px));
  box-shadow: 0 -3px 18px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.task-drawer.collapsed .drawer-header {
  pointer-events: auto;
}

.task-drawer.collapsed .drawer-content {
  pointer-events: none !important;
  visibility: hidden !important;
}

.drawer-header {
  display: flex;
  flex-direction: column;
  padding: 8px 18px 12px;
  cursor: pointer;
  background: var(--bg-surface-elevated);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  user-select: none;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.drawer-pull-pill {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.22);
  margin: 2px auto 8px;
  transition: background 0.2s ease;
}

[data-theme="light"] .drawer-pull-pill {
  background: rgba(15, 23, 42, 0.2);
}

.drawer-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.drawer-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: left;
}

.task-count-badge {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

[data-theme="light"] .task-count-badge {
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
}

.btn-drawer-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.drawer-arrow-icon {
  transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1);
  transform-origin: center center;
}

.task-drawer.collapsed .drawer-arrow-icon {
  transform: rotate(180deg);
}

.task-drawer.collapsed.will-open .drawer-arrow-icon {
  transform: rotate(0deg);
}

.task-drawer:not(.collapsed) .drawer-arrow-icon {
  transform: rotate(0deg);
}

.task-drawer:not(.collapsed).will-minimise .drawer-arrow-icon {
  transform: rotate(180deg);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 30px;
  -webkit-overflow-scrolling: touch;
}

.btn-add-task {
  background: var(--primary);
  color: #0c0e14;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn-add-task:hover {
  background: var(--primary-hover);
}

/* Task Item List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  max-height: none; /* No artificial capping - tasks fill the drawer and scroll naturally */
  overflow: visible;
  padding-bottom: 30px;
}

.task-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.task-card.active {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
}

/* Explicit Status Highlights */
.task-card.task-completed {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: #10b981 !important;
  border-left: 5px solid #10b981 !important;
}

.task-card.task-completed .task-card-title {
  color: #a7f3d0;
  text-decoration: line-through;
  opacity: 0.85;
}

.task-card.task-current {
  background: #142329 !important;
  border-color: #00f0ff !important;
  border-left: 5px solid #00f0ff !important;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
}

.task-card.task-current .task-card-title {
  color: #7dd3fc;
  font-weight: 700;
}

.task-card.task-pending {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  border-left: 5px solid #2563eb;
}

.task-card.task-pending .task-card-title {
  color: var(--text-main);
}

.task-card.is-locked-task {
  border-right: 3px solid var(--locked-color);
}

/* 1. Top Row: Status badge on top left, Actions on top right */
.task-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.task-card-status-wrap {
  display: flex;
  align-items: center;
}

.task-status-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.task-status-pill.completed {
  background: rgba(16, 185, 129, 0.22);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.task-status-pill.current {
  background: rgba(0, 240, 255, 0.18) !important;
  color: #00f0ff !important;
  border: 1px solid rgba(0, 240, 255, 0.45) !important;
}

.task-status-pill.pending {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.task-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-icon-action {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.btn-icon-action:hover, .btn-icon-action:active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-icon-action.locked {
  color: #f59e0b !important;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.45));
}

.btn-icon-action.time-bank-btn {
  color: var(--text-dim);
  opacity: 0.6;
  transition: all 0.18s ease;
}

.btn-icon-action.time-bank-btn.active {
  color: #f472b6;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(244, 114, 182, 0.45));
}

.btn-icon-action.time-bank-btn.cracked {
  color: #f59e0b;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.65));
  animation: crackJiggle 0.45s ease, overrunGlow 1.2s infinite alternate;
}

@keyframes crackJiggle {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.18) rotate(-7deg); }
  50% { transform: scale(1.18) rotate(7deg); }
  75% { transform: scale(1.1) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes overrunGlow {
  0% { filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4)); }
  100% { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.85)); }
}

/* 2. Middle Row: 3x2 dots drag handle on far left, Emoji underneath status, full Task Name next to emoji */
.task-card-middle-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  cursor: pointer;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -4px;
  margin-right: -2px;
  color: var(--text-dim);
  cursor: grab;
  touch-action: none !important;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s;
  user-select: none;
}

@media (hover: hover) {
  .drag-handle:hover {
    opacity: 1;
    color: var(--primary);
  }
}

.drag-handle:active,
.drag-handle.is-holding {
  opacity: 1;
  color: var(--primary) !important;
  cursor: grabbing;
}

.drag-handle-locked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -4px;
  margin-right: -2px;
  opacity: 0.45;
  cursor: not-allowed;
  flex-shrink: 0;
  touch-action: none !important;
}


/* Circular Emoji Badge for Modal */
.edit-task-emoji-badge {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px dashed var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  flex-shrink: 0;
}

.edit-task-emoji-badge:hover, .edit-task-emoji-badge:active {
  transform: scale(1.12);
  border-style: solid;
  background: rgba(0, 255, 136, 0.12);
}

.emoji-edit-hint {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 0.62rem;
  background: var(--primary);
  color: #0c0e14;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Quick Duration Chips */
.quick-duration-chips {
  display: flex;
  gap: 6px;
  margin-top: -6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.duration-chip {
  background: var(--bg-surface-highlight);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.duration-chip:hover, .duration-chip.active {
  background: rgba(0, 255, 136, 0.16);
  border-color: var(--primary);
  color: var(--primary);
}

.task-emoji-btn {
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.task-emoji-btn:hover, .task-emoji-btn:active {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.12);
}

.task-card-title-wrap {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.task-card-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.34;
  word-break: break-word;
  white-space: normal;
  display: block;
}

/* 3. Bottom Row: Timing duration in blue text on a single line */
.task-card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .task-card-bottom-row {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.task-timing-blue {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.task-category-chip {
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Live Interactive Drag & Drop Reordering */
.task-card.is-live-dragging, .calendar-block.is-live-dragging {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.8), 0 0 0 2.5px var(--primary), 0 0 24px rgba(16, 185, 129, 0.45) !important;
  opacity: 1 !important;
  border-color: var(--primary) !important;
  background: #1e2638 !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease !important;
  user-select: none;
}

.task-card.is-drag-sibling, .calendar-block.is-drag-sibling {
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1) !important;
  will-change: transform;
}

/* Break Button in Pipeline */
.btn-add-break {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-add-break:hover, .btn-add-break:active {
  background: rgba(245, 158, 11, 0.28);
  transform: scale(0.97);
}

[data-theme="light"] .btn-add-break {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.btn-icon-action.locked {
  color: #f59e0b !important;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.45));
}

/* Theme Segmented Control */
.theme-segmented-control {
  display: flex;
  background: var(--bg-surface-highlight);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.theme-segment-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.18s ease;
}

.theme-segment-btn:hover {
  color: var(--text-main);
}

.theme-segment-btn.active {
  background: var(--primary);
  color: #0c0e14;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Task Edit Modal Styles */
.edit-task-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.edit-task-row {
  display: flex;
  gap: 10px;
}

.edit-task-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.edit-task-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.edit-task-input:focus {
  border-color: var(--primary);
}

.edit-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.btn-modal-delete {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-modal-delete:active {
  background: rgba(239, 68, 68, 0.25);
}

.btn-modal-save {
  background: var(--primary);
  border: none;
  color: #0c0e14;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.18s;
  flex: 1;
}

.btn-modal-save:active {
  background: var(--primary-hover);
}

/* Emoji Picker Modal */
.emoji-picker-modal {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  animation: modalEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 10px 6px;
}

.emoji-pick-btn {
  font-size: 1.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.emoji-pick-btn:hover, .emoji-pick-btn:active {
  transform: scale(1.18);
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--primary);
}

.emoji-pick-btn.active {
  background: rgba(0, 255, 136, 0.25) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--primary) !important;
  transform: scale(1.14);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Slide-out Navigation Drawer
   ========================================================================== */

.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 82vw;
  background: var(--bg-surface-elevated);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  border-right: 1px solid var(--border-subtle);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.6);
  transform: translateX(-100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.28s ease;
}

.nav-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.app-brand-drawer {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-close-drawer {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-close-drawer:active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.nav-menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
  text-align: left;
}

.nav-item:hover, .nav-item:active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.nav-drawer-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  margin-top: auto;
}

.nav-settings-item {
  color: var(--text-muted);
}

.nav-settings-item:hover {
  color: #38bdf8;
}

/* ==========================================================================
   Modals (Settings & Calendar)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#taskEditModalBackdrop,
#addTaskModalBackdrop {
  z-index: 1200 !important;
}

#emojiPickerModalBackdrop {
  z-index: 1300 !important;
}

#durationDialModalBackdrop {
  z-index: 2500 !important;
}

.settings-modal, .calendar-modal {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  animation: modalEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.btn-close-modal:hover, .btn-close-modal:active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.setting-row.setting-row-clickable {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.setting-row.setting-row-clickable:hover,
.setting-row.setting-row-clickable:active {
  background: var(--bg-surface-elevated);
  border-color: var(--primary);
}

.setting-chevron {
  color: var(--text-dim);
  flex-shrink: 0;
}

.settings-sub-panel {
  display: flex;
  flex-direction: column;
}

.btn-sub-back {
  background: transparent;
  border: none;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-sub-back:active {
  transform: translateX(-3px);
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.setting-desc {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.35;
}

/* iOS/Android Style Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.14);
  transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-full);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

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

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

/* Calendar Timeline View */
.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Condensed Calendar Block (Shows maximum tasks on screen with zero wasted space) */
.calendar-block {
  position: relative;
  z-index: 2;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #141822; /* 100% opaque solid background so red delete action underneath is completely hidden */
  transition: all 0.18s ease;
  user-select: none;
}

.calendar-block:hover {
  background: #1c2230;
}

.calendar-block.completed {
  border-left: 3.5px solid var(--primary);
  background: #142022; /* 100% opaque solid tint */
}

.calendar-block.current {
  border-left: 3.5px solid #00f0ff !important;
  background: #142329 !important; /* 100% opaque solid cyan tint */
}

.calendar-block.pending {
  border-left: 3.5px solid var(--border-subtle);
  background: #151924; /* 100% opaque solid tint */
}

[data-theme="light"] .calendar-block {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .calendar-block:hover {
  background: #f8fafc;
}

[data-theme="light"] .calendar-block.completed {
  border-left-color: #059669;
  background: #f0fdf4;
}

[data-theme="light"] .calendar-block.current {
  border-left-color: #0284c7 !important;
  background: #f0f9ff !important;
}

[data-theme="light"] .calendar-block.pending {
  border-left-color: rgba(0, 0, 0, 0.15);
  background: #ffffff;
}

.calendar-block-left {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.drag-handle-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 26px;
  color: var(--text-dim);
  cursor: grab;
  touch-action: none !important;
  opacity: 0.7;
  transition: opacity 0.15s, color 0.15s;
}

@media (hover: hover) {
  .drag-handle-compact:hover {
    opacity: 1;
    color: var(--primary);
  }
}

.drag-handle-compact:active,
.drag-handle-compact.is-holding,
.calendar-block-left.is-holding .drag-handle-compact {
  opacity: 1 !important;
  color: var(--primary) !important;
  cursor: grabbing;
}

.drag-handle-locked-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 26px;
  font-size: 0.75rem;
  opacity: 0.45;
}

.calendar-emoji-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.calendar-emoji-btn:hover, .calendar-emoji-btn:active {
  transform: scale(1.18);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-subtle);
}

.calendar-block-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  margin-right: 4px;
}

.calendar-main-line1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.calendar-main-line1 .calendar-block-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.calendar-main-line1 .calendar-duration-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.28);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  white-space: nowrap;
  text-align: right;
  margin-left: auto;
}

[data-theme="light"] .calendar-main-line1 .calendar-duration-badge {
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
}

.calendar-main-line2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.calendar-main-line2 .calendar-time-range {
  font-family: var(--font-mono);
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.calendar-category-pill {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  text-align: right;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Break Tag & Task Block Styling in Yellow / Orange */
.task-status-pill.break-pill {
  background: rgba(245, 158, 11, 0.18) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  color: #fbbf24 !important;
}

[data-theme="light"] .task-status-pill.break-pill {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
  color: #b45309 !important;
}

.calendar-block.is-break-task:not(.completed) {
  border-left: 3.5px solid #f59e0b !important;
  background: #221f1c !important;
}

[data-theme="light"] .calendar-block.is-break-task:not(.completed) {
  border-left: 3.5px solid #f59e0b !important;
  background: #fffbeb !important;
}

.task-card.is-break-task:not(.task-completed) {
  border-left: 5px solid #f59e0b !important;
  background: #221f1c !important;
}

[data-theme="light"] .task-card.is-break-task:not(.task-completed) {
  border-left: 5px solid #f59e0b !important;
  background: #fffbeb !important;
}

.calendar-block-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  margin-left: 2px;
}

.calendar-block-actions .btn-icon-action {
  padding: 1px 2px;
  min-width: 20px;
  height: 22px;
}

/* Authentic Racing Checkered Pattern */
.finish-line-checkered {
  height: 8px;
  width: 100%;
  background-image: 
    linear-gradient(45deg, #000 25%, transparent 25%), 
    linear-gradient(-45deg, #000 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #000 75%), 
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  background-color: #ffffff;
}

[data-theme="light"] .finish-line-checkered {
  background-color: #f1f5f9;
  background-image: 
    linear-gradient(45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(-45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #0f172a 75%), 
    linear-gradient(-45deg, transparent 75%, #0f172a 75%);
}

/* Thin Checkered Finish Line in Today's Tasks Drawer */
.today-finish-line {
  margin: 10px 4px 6px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(245, 158, 11, 0.08));
  border: 1.5px dashed rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
  transition: all 0.25s ease;
}

.today-finish-line.is-disabled {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  opacity: 0.45;
}

.today-finish-line .finish-line-checkered {
  height: 8px;
  width: 100%;
  background-image: 
    linear-gradient(45deg, #000000 25%, transparent 25%), 
    linear-gradient(-45deg, #000000 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #000000 75%), 
    linear-gradient(-45deg, transparent 75%, #000000 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  background-color: #ffffff;
}

.today-finish-line-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.today-finish-line.is-disabled .today-finish-line-content {
  color: var(--text-dim);
}

.today-finish-line-content .finish-flag {
  font-size: 0.88rem;
}

.today-finish-line-content .finish-text {
  letter-spacing: 0.4px;
}

/* Calendar Finish Line / Bottom Hard Stop */
.calendar-finish-line {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  margin-bottom: 6px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1.5px dashed rgba(255, 255, 255, 0.22);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.calendar-finish-line:hover, .calendar-finish-line:active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: var(--accent-cyan);
}

.calendar-finish-line.is-disabled {
  opacity: 0.45;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.1);
}

.finish-line-stripe {
  height: 6px;
  width: 100%;
  background: repeating-linear-gradient(
    45deg,
    #ffffff 0,
    #ffffff 8px,
    #0c0e14 8px,
    #0c0e14 16px
  );
  opacity: 0.85;
}

[data-theme="light"] .finish-line-stripe {
  background: repeating-linear-gradient(
    45deg,
    #0f172a 0,
    #0f172a 8px,
    #cbd5e1 8px,
    #cbd5e1 16px
  );
}

.finish-line-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
}

.finish-line-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finish-line-flag {
  font-size: 1.35rem;
  line-height: 1;
}

.finish-line-labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.finish-line-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--text-main);
  text-transform: uppercase;
}

.finish-line-sub {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.finish-line-right {
  display: flex;
  align-items: center;
}

.finish-line-time-input {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}

[data-theme="light"] .finish-line-time-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Category Input Group & Remembered Chips */
.category-input-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-add-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary);
  color: #0c0e14;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

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

.category-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  max-height: 80px;
  overflow-y: auto;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-chip.active {
  background: rgba(0, 255, 136, 0.16);
  border-color: var(--primary);
  color: var(--primary);
}

.category-chip .chip-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-chip .chip-delete:hover {
  color: #ef4444;
}

[data-theme="light"] .category-chip {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #475569;
}

[data-theme="light"] .category-chip.active {
  background: #e6fcf5;
  border-color: #059669;
  color: #047857;
}

/* Work / Break Segmented Control */
.task-type-segment-control {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
  margin-bottom: 16px;
}

.type-segment-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  color: var(--text-dim);
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.type-segment-btn.active[data-type="work"] {
  background: rgba(0, 255, 136, 0.18);
  border-color: rgba(0, 255, 136, 0.4);
  color: var(--primary);
  box-shadow: 0 2px 10px rgba(0, 255, 136, 0.2);
}

.type-segment-btn.active[data-type="break"] {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

[data-theme="light"] .type-segment-btn.active[data-type="work"] {
  background: rgba(5, 150, 105, 0.15);
  border-color: #059669;
  color: #047857;
}

[data-theme="light"] .type-segment-btn.active[data-type="break"] {
  background: rgba(217, 119, 6, 0.15);
  border-color: #d97706;
  color: #b45309;
}

.btn-modal-save.is-break-btn {
  background: #f59e0b !important;
  color: #0c0e14 !important;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45) !important;
}

.btn-modal-save.is-break-btn:active {
  background: #d97706 !important;
}

.modal-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}

/* Calendar & Drawer Footer Buttons */
.drawer-footer {
  display: flex;
  gap: 10px;
  padding: 10px 16px 20px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Calendar Modal Footer */
.calendar-modal-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  z-index: 20;
}

/* Calendar Swipe-to-Delete Container */
.calendar-item-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  user-select: none;
  touch-action: pan-y;
  background: transparent;
}

.calendar-item-wrapper.is-live-dragging {
  position: relative !important;
  z-index: 9999 !important;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.8), 0 0 0 2.5px var(--primary), 0 0 24px rgba(16, 185, 129, 0.45) !important;
  opacity: 1 !important;
}

.calendar-item-wrapper.is-live-dragging .calendar-block {
  border-color: var(--primary) !important;
  box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.25) !important;
  background: #1e2638 !important;
}

.calendar-item-wrapper.is-drag-sibling {
  transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1) !important;
  will-change: transform;
}

.calendar-swipe-delete-action {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 25%;
  background: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  z-index: 1; /* Always underneath .calendar-block (z-index: 2) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.calendar-item-wrapper.has-swiped-open .calendar-swipe-delete-action,
.calendar-item-wrapper.is-swiping .calendar-swipe-delete-action,
.calendar-item-wrapper:has(.swiped-open) .calendar-swipe-delete-action,
.todo-item-wrapper.has-swiped-open .calendar-swipe-delete-action,
.todo-item-wrapper.is-swiping .calendar-swipe-delete-action,
.todo-item-wrapper:has(.swiped-open) .calendar-swipe-delete-action {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1 !important;
}

.btn-swipe-delete {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
}

.btn-swipe-delete:active {
  background: rgba(0, 0, 0, 0.2);
}

/* Compact Add Task Modal (Fits all fields and toggles on screen without scrolling) */
.add-task-modal {
  max-height: 90vh;
}

.add-task-modal .modal-body {
  padding: 10px 16px 14px;
  max-height: calc(90vh - 56px);
  gap: 5px;
}

.add-task-modal .task-type-segment-control {
  margin-bottom: 6px;
  padding: 2px;
}

.add-task-modal .type-segment-btn {
  padding: 7px 12px;
  font-size: 0.88rem;
}

.add-task-modal .edit-task-form-group {
  margin-bottom: 6px;
}

.add-task-modal .edit-task-label {
  font-size: 0.74rem;
  margin-bottom: 2px;
}

.add-task-modal .edit-task-input {
  padding: 7px 10px;
  font-size: 0.85rem;
}

.add-task-modal .quick-duration-chips {
  margin-top: 2px;
  margin-bottom: 6px;
  gap: 5px;
}

.add-task-modal .duration-chip {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.add-task-modal .category-chips-list {
  margin-top: 4px;
}

.add-task-modal .setting-row {
  padding: 6px 10px;
  margin-top: 4px;
}

.add-task-modal .edit-modal-footer {
  margin-top: 8px;
  padding-top: 4px;
}

.add-task-modal .btn-modal-save {
  padding: 10px;
  font-size: 0.92rem;
}

/* Compact Edit Task Modal (Fits all fields and toggles on screen without scrolling) */
#taskEditModal {
  max-height: 90vh;
  max-height: 90dvh;
}

#taskEditModal .modal-body {
  padding: 8px 16px 12px;
  max-height: calc(90vh - 56px);
  max-height: calc(90dvh - 56px);
  gap: 4px;
  overflow-y: auto;
}

#taskEditModal .edit-task-form-group {
  margin-bottom: 5px;
}

#taskEditModal .edit-task-label {
  font-size: 0.72rem;
  margin-bottom: 2px;
}

#taskEditModal .edit-task-input {
  padding: 6px 10px;
  font-size: 0.84rem;
}

#taskEditModal .quick-duration-chips {
  margin-top: 2px;
  margin-bottom: 4px;
  gap: 4px;
}

#taskEditModal .duration-chip {
  padding: 3px 8px;
  font-size: 0.74rem;
}

#taskEditModal .category-chips-list {
  margin-top: 2px;
}

#taskEditModal .setting-row {
  padding: 5px 10px;
  margin-top: 4px;
}

#taskEditModal .setting-label {
  font-size: 0.82rem;
}

#taskEditModal .setting-desc {
  font-size: 0.70rem;
}

#taskEditModal .edit-modal-footer {
  margin-top: 6px;
  padding-top: 4px;
}

#taskEditModal .btn-modal-save,
#taskEditModal .btn-modal-delete {
  padding: 8px 14px;
  font-size: 0.88rem;
}

/* Duration Input & Time Inputs with Clock Button Inside */
.duration-input-wrapper,
.time-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.duration-input-wrapper .edit-task-input,
.time-input-wrapper .edit-task-input {
  width: 100%;
  padding-right: 36px !important;
  box-sizing: border-box;
}

.duration-clock-addon-btn,
.time-clock-addon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-dim, #94a3b8);
  cursor: pointer;
  transition: color 0.18s ease, transform 0.15s ease;
  padding: 0;
  box-shadow: none;
}

.duration-clock-addon-btn:hover,
.duration-clock-addon-btn:active,
.time-clock-addon-btn:hover,
.time-clock-addon-btn:active {
  background: transparent;
  border: none;
  color: var(--primary, #38bdf8);
  transform: translateY(-50%) scale(1.08);
}

.time-picker-native-hidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
  margin: 0;
}

/* Modal Setting Toggle Icons */
.modal-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-dim, #64748b);
  opacity: 0.5;
}

.modal-toggle-icon.piggy-toggle-icon.active {
  color: #f472b6;
  filter: drop-shadow(0 0 6px rgba(244, 114, 182, 0.55));
  opacity: 1;
}

.modal-toggle-icon.lock-toggle-icon.active {
  color: #f59e0b;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
  opacity: 1;
}

#calEventToggleLock:checked + .toggle-slider,
#addModalIsLocked:checked + .toggle-slider,
#editTaskIsLocked:checked + .toggle-slider {
  background-color: #f59e0b !important;
}

/* Volume Slider in Settings */
.volume-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}

.volume-range-input {
  flex: 1;
  accent-color: var(--primary, #38bdf8);
  height: 6px;
  cursor: pointer;
}

.volume-percent-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #38bdf8);
  min-width: 36px;
  text-align: right;
}

.calendar-block {
  position: relative;
  z-index: 2;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease;
  will-change: transform;
}

.calendar-block.swiped-open,
.todo-block.swiped-open {
  transform: translateX(-25%) !important;
}

/* Today's Tasks drawer header clear button: hidden when collapsed, pops up when fully displayed */
#btnClearDrawerSchedule {
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.task-drawer.collapsed #btnClearDrawerSchedule {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.75);
}

.task-drawer:not(.collapsed) #btnClearDrawerSchedule {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: scale(1);
}

.btn-calendar-add-todo {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: #38bdf8;
  color: #082f49;
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-calendar-add-todo:active {
  background: #0284c7;
  color: #ffffff;
  transform: scale(0.97);
}

[data-theme="light"] .btn-calendar-add-todo {
  background: #7dd3fc;
  color: #0369a1;
  border-color: #38bdf8;
}

.btn-calendar-add-task {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--primary);
  color: #0c0e14;
  border: none;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-calendar-add-task:active {
  background: var(--primary-hover);
  transform: scale(0.97);
}

.btn-calendar-add-break {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  padding: 10px 10px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-calendar-add-break:active {
  background: rgba(245, 158, 11, 0.28);
  transform: scale(0.97);
}

[data-theme="light"] .btn-calendar-add-break {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* Toast Notification Banner - Sleek App-Themed Neon Green */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(14, 28, 22, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #10b981;
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 16px rgba(16, 185, 129, 0.25);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  cursor: pointer;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .toast-notification {
  background: rgba(236, 253, 245, 0.96);
  color: #047857;
  border-color: rgba(5, 150, 105, 0.4);
  box-shadow: 0 10px 25px rgba(5, 150, 105, 0.15);
}

/* Custom Themed Confirmation Modal */
.confirm-modal-card {
  background: #151923;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .confirm-modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
}

.confirm-modal-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.confirm-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.confirm-modal-desc {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 8px;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-confirm-cancel {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-theme="light"] .btn-confirm-cancel {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-confirm-danger {
  flex: 1;
  background: #ef4444;
  border: none;
  color: #ffffff;
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all 0.15s ease;
}

.btn-confirm-danger:hover, .btn-confirm-danger:active {
  background: #dc2626;
  transform: scale(0.98);
}

/* ==========================================================================
   Active Task Time Span & Dynamic Break Theme on Rotary Dial
   ========================================================================== */
.active-task-time-span-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
  margin-bottom: 2px;
  line-height: 1.2;
}

.active-task-time-span {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.4px;
  transition: color 0.25s ease;
}

.active-task-total-duration {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  transition: color 0.25s ease;
}

[data-theme="light"] .active-task-time-span {
  color: #0284c7;
}

[data-theme="light"] .active-task-total-duration {
  color: #64748b;
}

.is-break-mode .active-task-time-span {
  color: #fbbf24 !important;
}

.is-break-mode .active-task-total-duration {
  color: #94a3b8 !important;
}

[data-theme="light"].is-break-mode .active-task-total-duration,
[data-theme="light"] .is-break-mode .active-task-total-duration {
  color: #64748b !important;
}

.timer-quick-toggles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  pointer-events: auto !important;
  z-index: 25;
}

.timer-quick-btn {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
  min-width: 36px;
  min-height: 36px;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.timer-quick-btn:active {
  transform: scale(0.88);
}

.timer-piggy-btn {
  color: #94a3b8;
  opacity: 0.38;
}

.timer-piggy-btn:hover {
  opacity: 0.8;
}

.timer-piggy-btn.active {
  color: #f472b6;
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(244, 114, 182, 0.45));
}

.timer-piggy-btn.cracked {
  color: #f59e0b;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7));
  animation: pulse-overrun 1s infinite alternate ease-in-out;
}

.timer-lock-indicator {
  color: #f59e0b;
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.45));
}

.timer-lock-indicator.unlocked {
  color: #94a3b8;
  opacity: 0.38;
  filter: none;
}

.timer-lock-indicator.unlocked:hover {
  opacity: 0.8;
}

.is-break-mode .dial-tick-active,
.is-break-mode .dial-tick.major {
  stroke: #f59e0b !important;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.55)) !important;
}

.is-break-mode .revolving-active-line {
  stroke: #fbbf24 !important;
}

/* ==========================================================================
   Quick Duration Chips (Fits on a single line) & Duration Inputs
   ========================================================================== */
.quick-duration-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 0 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-duration-chips::-webkit-scrollbar {
  display: none;
}

.duration-chip {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.duration-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

.duration-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #0c0e14;
}

.duration-chip.duration-clock-btn {
  padding: 4px 10px;
  font-size: 0.88rem;
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(16, 185, 129, 0.12);
}

.duration-interactive-input {
  cursor: pointer;
  background-image: url("data:svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2338bdf8' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}

.time-span-row {
  display: flex;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  overflow-x: hidden;
}

.time-span-row .edit-task-form-group {
  flex: 1 1 0;
  min-width: 0;
  width: 50%;
  box-sizing: border-box;
}

.duration-chip-add-btn {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.2));
  color: var(--accent-cyan, #00e5ff);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.duration-chip-add-btn:hover,
.duration-chip-add-btn:active {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--accent-cyan, #00e5ff);
  color: #ffffff;
  transform: scale(1.05);
}

/* ==========================================================================
   Duration Dial Picker Modal
   ========================================================================== */
.duration-dial-modal {
  max-width: 380px;
  width: 92%;
  overflow-x: hidden;
  box-sizing: border-box;
}

.duration-dial-sub {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-top: 2px;
  display: block;
}

.duration-dial-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 16px;
  overflow-x: hidden;
  box-sizing: border-box;
}

.dial-picker-container {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  user-select: none;
  touch-action: none;
}

.picker-rotary-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  touch-action: none;
}

.picker-center-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  text-align: center;
  width: 160px;
}

.picker-digital-input {
  font-family: var(--font-mono);
  font-size: 2.3rem;
  font-weight: 800;
  color: #ffffff;
  background: transparent;
  border: none;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.25);
  width: 130px;
  text-align: center;
  padding: 2px;
  outline: none;
  cursor: text;
  pointer-events: auto;
  letter-spacing: -0.5px;
}

.picker-digital-input:focus {
  border-bottom-color: var(--accent-cyan);
}

.picker-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
  max-width: 160px;
  margin-top: 6px;
  line-height: 1.3;
}

.picker-quick-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Themed Hard Stop Modal
   ========================================================================== */
.hard-stop-modal {
  max-width: 360px;
  width: 92%;
}

.hard-stop-header-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
  align-self: center;
  line-height: 1;
}

.hard-stop-header-toggle .toggle-switch {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.toggle-status-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.hard-stop-description {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-dim);
  margin-bottom: 16px;
  text-align: center;
}

.custom-clock-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 18px;
}

.clock-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.clock-arrow-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  width: 52px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.clock-arrow-btn:active {
  background: var(--primary);
  color: #0c0e14;
}

.clock-digit-input {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 72px;
  height: 60px;
  text-align: center;
  outline: none;
}

.clock-colon {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: -18px;
}

.clock-col-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hard-stop-presets {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-pill {
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover, .preset-pill:active {
  background: var(--primary);
  color: #0c0e14;
  border-color: var(--primary);
}

/* ==========================================================================
   Time Bank Info Modal & Icon Guide
   ========================================================================== */
.time-bank-info-card {
  max-width: 380px;
}

.time-bank-info-balance {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fb7185;
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin: 6px 0 10px;
}

.time-bank-info-desc {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 14px;
}

.time-bank-icon-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.icon-guide-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.guide-icon {
  font-size: 1.3rem;
  line-height: 1.1;
  flex-shrink: 0;
}

.guide-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.guide-text strong {
  font-size: 0.82rem;
  color: var(--text-main);
}

.guide-text span {
  font-size: 0.74rem;
  color: var(--text-dim);
  line-height: 1.35;
}

/* ==========================================================================
   Themed Alerts & Notifications Modal
   ========================================================================== */
.alerts-modal-card {
  max-width: 360px;
  width: 90%;
  text-align: center;
}

.alerts-modal-desc {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-dim);
  margin: 6px 0 16px;
}

.alerts-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 6px;
}

/* ==========================================================================
   To-Do List Tab & Modal Styles
   ========================================================================== */
.todo-modal {
  max-width: 440px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.todo-item-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-md, 12px);
  user-select: none;
  touch-action: pan-y;
  background: transparent;
}

.todo-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface, #1e222d);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  padding: 12px 14px;
  position: relative;
  z-index: 2;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, opacity 0.2s ease;
  min-height: 52px;
  box-sizing: border-box;
  width: 100%;
  gap: 10px;
}

.todo-block.completed {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.03);
}

.todo-block.completed .todo-title {
  text-decoration: line-through;
  color: var(--text-muted, #94a3b8);
}

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

.todo-emoji {
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.todo-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main, #ffffff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.todo-checkbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid var(--border-focus, #38bdf8);
  background: transparent;
  cursor: pointer;
  color: transparent;
  transition: all 0.18s ease;
  padding: 0;
  flex-shrink: 0;
}

.todo-checkbox-btn.checked {
  background: var(--accent-cyan, #00e5ff);
  border-color: var(--accent-cyan, #00e5ff);
  color: #0b0f19;
}

.todo-checkbox-btn:hover {
  transform: scale(1.08);
}

.todo-checkbox-btn:active {
  transform: scale(0.92);
}

.todo-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  gap: 10px;
}

.todo-empty-icon {
  font-size: 2.2rem;
  opacity: 0.8;
}

.todo-empty-text {
  font-size: 0.9rem;
  line-height: 1.4;
}

.btn-add-todo {
  background: var(--primary, #38bdf8);
  color: #0b0f19;
  font-weight: 700;
}

/* ==========================================================================
   Select To-Do Task Modal
   ========================================================================== */
.select-todo-modal {
  max-width: 400px;
  width: 92%;
}

#selectTodoModalBackdrop {
  z-index: 1200 !important;
}

.select-todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.select-todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.select-todo-item:hover,
.select-todo-item:active {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--primary);
  transform: translateX(3px);
}

.select-todo-emoji {
  font-size: 1.25rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.select-todo-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-todo-item.completed {
  opacity: 0.6;
}

.select-todo-item.completed .select-todo-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.select-todo-arrow {
  color: var(--text-dim);
  transition: transform 0.18s ease, color 0.18s ease;
}

.select-todo-item:hover .select-todo-arrow,
.select-todo-item:active .select-todo-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

.select-todo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px;
  gap: 10px;
}

/* ==========================================
   Full Multi-View Calendar (Day / Week / Month)
   ========================================== */

.full-calendar-modal {
  max-width: 840px;
  width: 95vw;
  height: 90vh;
  max-height: 840px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  will-change: transform;
}

/* Short Drag Handle Bar (Indicates swipe down to minimise) */
.cal-drag-handle-bar {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  margin: 6px auto 2px auto;
  cursor: grab;
  flex-shrink: 0;
}

[data-theme="light"] .cal-drag-handle-bar {
  background: rgba(15, 23, 42, 0.25);
}

/* Header Row 1: Centered Date, Top Right Close Button */
.full-calendar-header {
  padding: 4px 14px 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
  touch-action: pan-y;
  user-select: none;
  background: var(--bg-surface);
}

.cal-header-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.cal-header-center {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 6px;
}

.cal-current-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.cal-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Controls Row 2: Sits Below Date and Above Calendar View (Strictly centered Today/Arrows nav) */
.cal-sub-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 6px 6px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  min-height: 40px;
}

.cal-sub-left {
  display: flex;
  align-items: center;
  z-index: 1;
}

.cal-sub-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.cal-sub-right {
  display: flex;
  align-items: center;
  z-index: 1;
}

.cal-nav-buttons-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.cal-nav-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .cal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
  }
}

.cal-nav-btn:active,
.cal-nav-btn.is-active-nav {
  background: rgba(0, 255, 136, 0.15) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.35) !important;
}

.cal-nav-btn:focus,
.cal-nav-btn:focus-visible {
  outline: none;
}

.cal-nav-today-btn {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.cal-nav-today-btn:hover, .cal-nav-today-btn:active {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
}

.cal-toolbar-icon {
  font-size: 0.76rem;
}

.cal-res-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0;
  padding: 0;
}

/* Resolution Dropdown Selector with No Empty Space and Full Click Area */
.cal-res-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  height: 28px;
  cursor: pointer;
  user-select: none;
}

.cal-res-icon {
  font-size: 0.74rem;
  line-height: 1;
}

.cal-res-val {
  color: var(--accent-cyan);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.cal-view-val {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.cal-dropdown-arrow {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-left: 1px;
}

/* Native select overlay covering whole wrapper to capture clicks anywhere */
.cal-dropdown-select-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  border: none;
  background: transparent;
  -webkit-appearance: menulist-button;
}

.cal-dropdown-select-overlay option {
  background: #141822;
  color: var(--text-main);
}

/* View Switcher Dropdown (Day / Week / Month) with Full Click Area */
.cal-view-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  height: 28px;
  cursor: pointer;
  user-select: none;
}

.cal-view-select {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  padding: 0 2px;
}

.cal-view-select option {
  background: #141822;
  color: var(--text-main);
}

[data-theme="light"] .cal-view-select option,
[data-theme="light"] .cal-dropdown-select-overlay option {
  background: #ffffff;
  color: #0f172a;
}

.full-calendar-body,
.full-calendar-modal .modal-body.full-calendar-body {
  flex: 1 1 auto !important;
  overflow: hidden !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
}

.calendar-view-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Bottom Floating Action Bar (Far Bottom Right of calendar box) */
.cal-bottom-bar {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  z-index: 50 !important; /* Strictly above fade overlay */
  pointer-events: auto;
}

.cal-bottom-bar .cal-res-wrapper {
  height: 38px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 51 !important;
}

/* Floating Green Add Event Button */
.btn-float-add-event {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #10b981;
  color: #0c0e14;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.55);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 52 !important; /* Strictly above fade overlay so button never fades */
  transition: transform 0.18s ease, background 0.15s ease, box-shadow 0.18s ease;
}

.btn-float-add-event:hover {
  transform: scale(1.08);
  background: #059669;
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.7);
}

.btn-float-add-event:active {
  transform: scale(0.92);
}

/* Bottom Fade Overlay for Smooth Edge Falloff - Strictly behind floating controls */
.calendar-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 72px;
  background: linear-gradient(to bottom, transparent 0%, rgba(20, 24, 34, 0.5) 30%, var(--bg-surface) 75%, var(--bg-surface) 100%);
  pointer-events: none;
  z-index: 10 !important; /* Below floating controls (z-index: 50) */
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

[data-theme="light"] .calendar-bottom-fade {
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.5) 30%, var(--bg-surface) 75%, var(--bg-surface) 100%);
}

/* Month view: no scroll needed, remove bottom fade overlay */
.full-calendar-body.is-month-view .calendar-bottom-fade,
.calendar-view-container:not(.hidden)#calendarMonthView ~ .calendar-bottom-fade {
  display: none !important;
}

/* 1. Day View Timeline with Hidden Scrollbar */
.day-timeline-scroll {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  touch-action: pan-y;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.day-timeline-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.day-timeline-body {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 14px; /* Move first line down so 00:00 label is completely visible */
  padding-bottom: 120px; /* Extended to use all grey space without truncation */
}

/* Day timeline hour slot */
.day-timeline-hour-slot {
  position: relative;
  display: flex;
  height: var(--cal-day-hour-height, 60px);
  min-height: var(--cal-day-hour-height, 60px);
  box-sizing: border-box;
}

/* Time label on the left: mid-point is aligned exactly with the horizontal line at y=0 */
.day-time-label {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: auto;
  line-height: 1;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-align: right;
  padding-right: 6px;
  transform: translateY(-50%); /* EXACT geometric mid-point aligns with bold line */
  z-index: 3;
  user-select: none;
  pointer-events: none;
}

/* Shortened line on the left side: starts after hour number and is bolder */
.day-slot-content {
  flex: 1;
  margin-left: 42px;
  position: relative;
  height: var(--cal-day-hour-height, 60px);
  box-sizing: border-box;
  cursor: pointer;
  border-top: 1.5px solid rgba(255, 255, 255, 0.16);
}

[data-theme="light"] .day-slot-content {
  border-top: 1.5px solid rgba(0, 0, 0, 0.16);
}

/* Sub-interval dashed lines (15m, 10m, 5m, 30m) inside slotContent span 100% of slotContent */
.day-sub-interval-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .day-sub-interval-line {
  border-top-color: rgba(0, 0, 0, 0.09);
}

/* Current time light-blue line with time badge in LEFT gutter */
.day-current-time-line {
  position: absolute;
  left: 42px;
  right: 0;
  height: 2px;
  background: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.85);
  z-index: 15;
  pointer-events: none;
}

.day-current-time-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 6px #00f0ff;
}

.day-current-time-badge {
  position: absolute;
  left: -42px;
  top: -9px;
  font-size: 0.63rem;
  font-family: var(--font-mono);
  font-weight: 800;
  background: #00f0ff;
  color: #0c0e14;
  padding: 1px 4px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  z-index: 20;
}

/* Day Event Card: Starts immediately at content edge, permits smooth scrolling on touch */
.day-event-card {
  position: absolute;
  left: 44px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 5;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: pan-y; /* Allows smooth scrolling when finger starts on event card */
}

/* Subtle solid opaque status backgrounds for day event cards */
.day-event-card.is-event-completed {
  background: #142a22 !important;
  border-color: #059669 !important;
}

.day-event-card.is-event-completed:hover {
  background: #19352b !important;
}

[data-theme="light"] .day-event-card.is-event-completed {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
}

[data-theme="light"] .day-event-card.is-event-completed:hover {
  background: #d1fae5 !important;
}

.day-event-card.is-event-current {
  background: #122938 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.22);
}

.day-event-card.is-event-current:hover {
  background: #163346 !important;
}

[data-theme="light"] .day-event-card.is-event-current {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
}

[data-theme="light"] .day-event-card.is-event-current:hover {
  background: #e0f2fe !important;
}

/* Overlapping Event Card Positioning */
.day-event-card.is-overlapping-earlier {
  left: 44px;
  right: 48%;
  z-index: 5;
}

.day-event-card.is-overlapping-later {
  left: calc(44px + 45%);
  right: 6px;
  z-index: 7;
  box-shadow: -3px 4px 14px rgba(0, 0, 0, 0.45);
}

/* Week View Overlapping Event Card Positioning */
.week-event-card.is-overlapping-earlier {
  left: 2px !important;
  right: 48% !important;
  z-index: 5 !important;
}

.week-event-card.is-overlapping-later {
  left: calc(2px + 45%) !important;
  right: 2px !important;
  z-index: 7 !important;
  box-shadow: -2px 3px 10px rgba(0, 0, 0, 0.45) !important;
}

/* Calendar Task Resize Circles (Top & Bottom Border Handles) */
.day-event-card.has-resize-handles,
.week-event-card.has-resize-handles {
  overflow: visible !important;
  z-index: 80 !important;
  box-shadow: 0 0 0 2px var(--accent-cyan, #00f0ff), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.event-resize-handle {
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2.5px solid var(--accent-cyan, #00f0ff);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 100;
  cursor: ns-resize;
  touch-action: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.12s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Invisible 40px touch hitbox for smooth mobile finger grabbing */
.event-resize-handle::after {
  content: '';
  position: absolute;
  top: -13px;
  bottom: -13px;
  left: -13px;
  right: -13px;
}

.event-resize-handle.handle-top {
  top: 0;
  transform: translate(-50%, -50%);
}

.event-resize-handle.handle-bottom {
  bottom: 0;
  transform: translate(-50%, 50%);
}

.event-resize-handle:active,
.event-resize-handle.is-active-dragging {
  background: var(--accent-cyan, #00f0ff) !important;
  border-color: #ffffff !important;
  transform: translate(-50%, -50%) scale(1.35) !important;
  box-shadow: 0 0 12px var(--accent-cyan, #00f0ff), 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

.event-resize-handle.handle-bottom:active,
.event-resize-handle.handle-bottom.is-active-dragging {
  transform: translate(-50%, 50%) scale(1.35) !important;
}

[data-theme="light"] .event-resize-handle {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .day-event-card.has-resize-handles,
[data-theme="light"] .week-event-card.has-resize-handles {
  box-shadow: 0 0 0 2px #0284c7, 0 6px 18px rgba(0, 0, 0, 0.2) !important;
}

.day-event-card.is-dragging-cal-event,
.week-event-card.is-dragging-cal-event {
  z-index: 99999 !important;
  opacity: 0.92 !important;
  transition: none !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 0 2px var(--accent-cyan) !important;
}

.day-event-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Day view locked cards retain standard category border; padlock icon indicates lock state */
.day-event-card.is-locked {
  /* No static orange border - padlock icon is sufficient */
}

.day-event-card .day-event-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.day-event-card .day-event-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  line-height: 1.2;
}

.day-event-card .day-event-emoji {
  font-size: 0.88rem;
  flex-shrink: 0;
}

.day-event-card .day-event-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip; /* NO ellipsis ..., just display maximum characters that fit */
  line-height: 1.2;
  width: 100%;
}

.day-event-card.is-event-completed .day-event-title {
  text-decoration: line-through;
  opacity: 0.82;
}

.btn-toggle-timespans {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

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

.btn-toggle-timespans.is-plan-mode {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

.day-event-card .day-event-meta-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip; /* NO ellipsis */
  line-height: 1.2;
}

.day-event-card .event-time-range {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.day-event-card .event-duration-pill {
  opacity: 0.9;
  font-weight: 600;
  flex-shrink: 0;
}

.day-event-card .event-cat-pill {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

/* Squeeze styles for 15-minute / squashed compact cards (Single Row Layout) */
.day-event-card.is-single-row {
  padding: 1px 6px;
  gap: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-event-card.is-single-row .day-event-emoji {
  font-size: 0.78rem;
  flex-shrink: 0;
}

.day-event-card.is-single-row .day-event-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  overflow: hidden;
  width: 100%;
}

.day-event-card.is-single-row .day-event-title-line {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  width: auto;
  max-width: none;
}

.day-event-card.is-single-row .day-event-title {
  font-size: 0.74rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  width: 100%;
}

.day-event-card.is-single-row .day-event-meta-line {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  line-height: 1.1;
  white-space: nowrap;
}

.day-event-card.is-single-row .event-cat-pill {
  display: none !important; /* Category hidden in squashed view to maximize title space */
}

.day-event-card.is-single-row .cal-event-lock-btn {
  flex-shrink: 0;
  padding: 2px;
}

/* Squeeze styles for 30-minute cards (Compact Two-Line Layout with No Top/Bottom Truncation) */
.day-event-card.is-compact-two-line {
  padding: 2px 6px;
}

.day-event-card.is-compact-two-line .day-event-content {
  gap: 1px;
}

.day-event-card.is-compact-two-line .day-event-title {
  font-size: 0.76rem;
  line-height: 1.15;
}

.day-event-card.is-compact-two-line .day-event-meta-line {
  font-size: 0.64rem;
  line-height: 1.15;
  gap: 3px;
}

/* Pulsing Glow Animation for Padlock and Event Border when Dragging is Prevented */
@keyframes lockPulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 0px #f59e0b); }
  25% { transform: scale(1.35); filter: drop-shadow(0 0 10px #f59e0b); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 4px #f59e0b); }
  75% { transform: scale(1.3); filter: drop-shadow(0 0 8px #f59e0b); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0px #f59e0b); }
}

@keyframes eventBorderLockPulse {
  0% {
    box-shadow: 0 0 0px transparent;
    border-color: inherit;
  }
  25% {
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.85), inset 0 0 8px rgba(245, 158, 11, 0.4);
    border-color: #f59e0b;
  }
  50% {
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
    border-color: #f59e0b;
  }
  75% {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.8), inset 0 0 6px rgba(245, 158, 11, 0.35);
    border-color: #f59e0b;
  }
  100% {
    box-shadow: 0 0 0px transparent;
    border-color: inherit;
  }
}

.cal-event-lock-btn.pulse-glow {
  animation: lockPulseGlow 1s ease-in-out;
  color: #f59e0b !important;
}

.day-event-card.lock-pulse-glow {
  animation: eventBorderLockPulse 0.95s ease-in-out !important;
  z-index: 50 !important;
}

.day-event-card.is-compact {
  padding: 2px 6px;
}

.day-event-card.is-compact .day-event-content {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

/* Clickable padlock icon */
.cal-event-lock-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  transition: all 0.15s ease;
}

.cal-event-lock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.15);
}

.cal-event-lock-btn.is-locked {
  color: #f59e0b;
}

/* 2. Week View Grid */
.week-header-row {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

.week-col-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.week-col-day-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}

.week-col-day-num {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.week-col-header.today .week-col-day-num {
  background: var(--accent-cyan);
  color: #0c0e14;
}

.week-grid-scroll {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  touch-action: pan-y;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.week-grid-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.week-grid-body {
  display: grid;
  grid-template-columns: 50px repeat(7, 1fr);
  gap: 4px;
  position: relative;
  padding-top: 14px; /* Move top down so start time label is completely visible */
  padding-bottom: 120px; /* Extended to prevent bottom truncation */
}

.week-time-col {
  position: relative;
  width: 50px;
  flex-shrink: 0;
}

.week-hour-label {
  position: absolute;
  right: 6px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-align: right;
  line-height: 1;
  transform: translateY(-50%); /* Exactly in line with the horizontal week line */
  user-select: none;
  pointer-events: none;
}

.week-day-col {
  border-left: 1px solid var(--border-subtle); /* Solid vertical lines */
  position: relative;
  box-sizing: border-box;
}

.week-day-col:last-child {
  border-right: 1px solid var(--border-subtle);
}

/* Horizontal Hour Lines in Week View (Thick Bold SOLID at every hour, matching Day view) */
.week-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1.5px solid rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .week-hour-line {
  border-top: 1.5px solid rgba(0, 0, 0, 0.16);
}

/* Subtle Dashed Sub-Interval Lines in Week View (15m / 30m steps) matching Day view */
.week-sub-interval-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 1;
}

[data-theme="light"] .week-sub-interval-line {
  border-top-color: rgba(0, 0, 0, 0.08);
}

.week-day-col.drag-target-over {
  background: rgba(0, 240, 255, 0.08) !important;
  border-color: var(--accent-cyan) !important;
}

.cal-mini-lock-svg {
  display: inline-block;
  vertical-align: -1px;
  flex-shrink: 0;
}

/* Week Event Card: Solid Category Background, No Emoji */
.week-event-card {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 3px 5px;
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  font-weight: 700;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: pan-y; /* Permits smooth scrolling when touching week card */
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  z-index: 5;
}

.week-event-card .week-event-title {
  font-weight: 800;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip; /* NO ellipsis */
  color: #ffffff;
  line-height: 1.2;
}

.week-event-card .week-event-time {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* Squeeze styling for 15m, 30m, 45m cards in week view so timespan fits below title */
.week-event-card.is-compact-short {
  padding: 1px 3px !important;
  justify-content: center;
}

.week-event-card.is-compact-short .week-event-title {
  font-size: 0.65rem !important;
  line-height: 1.05 !important;
}

.week-event-card.is-compact-short .week-event-time {
  font-size: 0.58rem !important;
  line-height: 1 !important;
  margin-top: 0 !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

.week-event-card:hover {
  transform: scale(1.02);
  z-index: 10;
}

/* 3. Month View Grid */
.month-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding-bottom: 8px;
}

.month-grid-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  flex: 1;
}

.month-day-cell {
  min-height: 85px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.month-day-cell:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.month-day-cell:active,
.month-day-cell:focus {
  background: var(--bg-surface-elevated) !important;
  border-color: var(--border-subtle) !important;
  outline: none !important;
  box-shadow: none !important;
}

.month-day-cell.today:active,
.month-day-cell.today:focus {
  border-color: var(--accent-cyan) !important;
  background: rgba(0, 240, 255, 0.05) !important;
}

.month-day-cell.other-month {
  opacity: 0.35;
  background: transparent;
}

.month-day-cell.today {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.month-day-cell.today .cell-day-num {
  background: var(--accent-cyan);
  color: #0c0e14;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cell-events-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

/* Month Event Pill: Solid Category Background, Prioritize Task Name */
.month-event-pill {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip; /* NO ellipsis */
  cursor: grab;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease;
  min-width: 0;
}

.month-event-pill:hover {
  transform: translateY(-1px);
}

/* Thin outer orange border for locked cards in week view */
.week-event-card.is-locked {
  box-shadow: 0 0 0 1.5px #f59e0b;
  outline: 1.5px solid #f59e0b;
}

/* Internal orange border for locked pills in month view to prevent clipping */
.month-event-pill.is-locked {
  box-shadow: inset 0 0 0 1.5px #f59e0b;
  outline: none;
}

/* Pulsing Glow Animation for Locked Event Cards / Pills when Dragging is Prevented */
@keyframes cardLockPulseGlow {
  0% {
    box-shadow: 0 0 0 1.5px #f59e0b;
    outline: 1.5px solid #f59e0b;
    filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0));
    transform: scale(1);
  }
  25% {
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.95), 0 0 0 2.5px #f59e0b;
    outline: 2.5px solid #f59e0b;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.9));
    transform: scale(1.04);
  }
  50% {
    box-shadow: 0 0 5px rgba(245, 158, 11, 0.5), 0 0 0 1.5px #f59e0b;
    outline: 1.5px solid #f59e0b;
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.4));
    transform: scale(1.02);
  }
  75% {
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.9), 0 0 0 2.5px #f59e0b;
    outline: 2.5px solid #f59e0b;
    filter: drop-shadow(0 0 7px rgba(245, 158, 11, 0.8));
    transform: scale(1.04);
  }
  100% {
    box-shadow: 0 0 0 1.5px #f59e0b;
    outline: 1.5px solid #f59e0b;
    filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0));
    transform: scale(1);
  }
}

@keyframes monthPillLockPulseGlow {
  0% {
    box-shadow: inset 0 0 0 1.5px #f59e0b;
    filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0));
    transform: scale(1);
  }
  25% {
    box-shadow: inset 0 0 0 2px #f59e0b, 0 0 8px rgba(245, 158, 11, 0.85);
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.8));
    transform: scale(1.03);
  }
  50% {
    box-shadow: inset 0 0 0 1.5px #f59e0b, 0 0 3px rgba(245, 158, 11, 0.4);
    filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4));
    transform: scale(1.01);
  }
  75% {
    box-shadow: inset 0 0 0 2px #f59e0b, 0 0 7px rgba(245, 158, 11, 0.8);
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.75));
    transform: scale(1.03);
  }
  100% {
    box-shadow: inset 0 0 0 1.5px #f59e0b;
    filter: drop-shadow(0 0 0 rgba(245, 158, 11, 0));
    transform: scale(1);
  }
}

.week-event-card.lock-pulse-glow {
  animation: cardLockPulseGlow 0.95s ease-in-out !important;
  z-index: 50 !important;
}

.month-event-pill.lock-pulse-glow {
  animation: monthPillLockPulseGlow 0.95s ease-in-out !important;
  z-index: 50 !important;
}

.day-event-card.lock-pulse-glow .cal-event-lock-btn,
.day-event-card.lock-pulse-glow .cal-event-lock-btn svg,
.week-event-card.lock-pulse-glow .cal-mini-lock-svg,
.month-event-pill.lock-pulse-glow .cal-mini-lock-svg,
.cal-mini-lock-svg.pulse-glow {
  animation: lockPulseGlow 0.95s ease-in-out !important;
  color: #f59e0b !important;
}

/* Day View Drop Preview Silhouette: Blue / Cyan Outline Stuck to Timeline */
.day-drop-preview-silhouette {
  position: absolute;
  left: 42px;
  right: 4px;
  border-radius: var(--radius-md);
  border: 2.5px dashed var(--accent-cyan);
  background: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.55), inset 0 0 10px rgba(0, 240, 255, 0.25);
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
  transition: none !important;
}

/* Week View Drop Preview Silhouette: Blue / Cyan Outline Stuck to Grid */
.week-drop-preview-silhouette {
  position: absolute;
  left: 0px;
  right: 0px;
  border-radius: var(--radius-sm);
  border: 2.5px dashed var(--accent-cyan);
  background: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.55), inset 0 0 10px rgba(0, 240, 255, 0.25);
  pointer-events: none;
  z-index: 10;
  box-sizing: border-box;
  transition: none !important;
}

/* Pull Down to Minimise Indicator for Full Calendar Modal & Today's Schedule Modal */
.cal-close-icon-arrow {
  display: none;
}

.cal-close-icon-x {
  display: inline-block;
  line-height: 1;
}

.modal-full-calendar.will-minimise .cal-close-icon-x,
.calendar-modal.will-minimise .cal-close-icon-x {
  display: none !important;
}

.modal-full-calendar.will-minimise .cal-close-icon-arrow,
.calendar-modal.will-minimise .cal-close-icon-arrow {
  display: inline-flex !important;
  color: var(--accent-cyan);
  transform: translateY(1px);
}

.month-event-pill .event-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip; /* NO ellipsis */
  white-space: nowrap;
}

.month-more-pill {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 700;
  padding: 1px 4px;
}

/* Dragging States */
.is-dragging-cal-event {
  opacity: 0.88 !important;
  z-index: 9999 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 0 2px var(--accent-cyan) !important;
  cursor: grabbing !important;
  touch-action: none !important;
  transition: none !important;
}

.month-day-cell.drag-target-over {
  border-color: var(--accent-cyan) !important;
  background: rgba(0, 240, 255, 0.12) !important;
}

/* Event Inspector & Edit Modal: Compact layout to fit on screen without scrolling */
.calendar-event-modal {
  max-width: 460px;
  max-height: 94vh;
  max-height: 94dvh;
  overflow: hidden;
}

.calendar-event-modal .modal-body {
  max-height: calc(94vh - 54px);
  max-height: calc(94dvh - 54px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 8px 16px 12px;
  gap: 3px;
}

.calendar-event-modal .modal-body::-webkit-scrollbar {
  display: none;
}

.calendar-event-modal .task-type-segment-control {
  margin-bottom: 4px;
  padding: 2px;
}

.calendar-event-modal .type-segment-btn {
  padding: 6px 10px;
  font-size: 0.84rem;
}

.calendar-event-modal .edit-task-form-group {
  margin-bottom: 3px;
}

.calendar-event-modal .edit-task-label {
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.calendar-event-modal .edit-task-input {
  padding: 5px 10px;
  font-size: 0.84rem;
}

.calendar-event-modal .quick-duration-chips {
  margin-top: 1px;
  margin-bottom: 3px;
  gap: 4px;
}

.calendar-event-modal .duration-chip {
  padding: 3px 7px;
  font-size: 0.72rem;
}

.calendar-event-modal .category-chips-list {
  margin-top: 2px;
  gap: 4px;
}

.calendar-event-modal .setting-row {
  padding: 4px 0;
  margin-top: 2px;
}

/* Red Round Cancel Button */
.btn-modal-cancel-danger {
  padding: 9px 18px;
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-modal-cancel-danger:hover {
  background: #dc2626;
  transform: scale(1.02);
}

.btn-modal-cancel-danger:active {
  transform: scale(0.96);
}

.calendar-event-modal .btn-modal-save {
  border-radius: var(--radius-full);
  padding: 9px 18px;
  font-size: 0.88rem;
}

.calendar-event-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.btn-delete-cal-event {
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-delete-cal-event:hover, .btn-delete-cal-event:active {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

/* ==========================================================================
   Schedule Overlap Indentation & Conflict Resolution Modal
   ========================================================================== */

#scheduleConflictModalBackdrop {
  z-index: 3000 !important;
}

.task-card.is-schedule-overlap {
  margin-left: 20px !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.18);
  position: relative;
}

.task-card.is-schedule-overlap::before {
  content: '⚠️ Overlap';
  position: absolute;
  top: -9px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: #f59e0b;
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  z-index: 2;
}

.schedule-conflict-card {
  max-width: 420px;
  width: 90%;
  text-align: left;
}

.schedule-conflict-subtitle {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin: 6px 0 16px 0;
  line-height: 1.4;
  text-align: center;
}

.conflict-tasks-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.conflict-task-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.18s ease;
}

.conflict-task-option.active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

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

.conflict-task-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.conflict-task-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #38bdf8;
}

.conflict-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-conflict-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
}

.btn-conflict-action .btn-conflict-main {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.btn-conflict-action .btn-conflict-sub {
  font-size: 0.75rem;
  opacity: 0.8;
  line-height: 1.35;
}

.btn-conflict-shift {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.btn-conflict-shift:hover, .btn-conflict-shift:active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

.btn-conflict-keep {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.btn-conflict-keep:hover, .btn-conflict-keep:active {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

[data-theme="light"] .btn-conflict-keep {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.35);
  color: #047857;
}

[data-theme="light"] .btn-conflict-keep:hover,
[data-theme="light"] .btn-conflict-keep:active {
  background: rgba(5, 150, 105, 0.2);
  border-color: #047857;
}

.conflict-cascade-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  color: #fbbf24;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
}

.conflict-cascade-warning.hidden {
  display: none !important;
}

.conflict-cascade-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.conflict-cascade-text {
  flex: 1;
}

/* Today's Schedule Mode Segmented Control (Chronological vs Sequential) */
.schedule-mode-segment-control {
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  margin: 10px 14px 10px;
}

.mode-segment-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-segment-btn.active[data-mode="chronological"] {
  background: rgba(0, 240, 255, 0.16);
  border-color: rgba(0, 240, 255, 0.45);
  color: var(--accent-cyan);
  box-shadow: 0 2px 10px rgba(0, 240, 255, 0.2);
}

.mode-segment-btn.active[data-mode="sequential"] {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  color: #c084fc;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2);
}

[data-theme="light"] .schedule-mode-segment-control {
  background: #f8fafc;
  border-color: #cbd5e1;
}

[data-theme="light"] .mode-segment-btn.active[data-mode="chronological"] {
  background: rgba(2, 132, 199, 0.12);
  border-color: #0284c7;
  color: #0284c7;
}

[data-theme="light"] .mode-segment-btn.active[data-mode="sequential"] {
  background: rgba(147, 51, 234, 0.12);
  border-color: #9333ea;
  color: #7e22ce;
}

/* ==========================================================================
   PWA Browser Installation UI (Nav Item, Setting Row & Guidance Modal)
   ========================================================================== */

.nav-install-item {
  color: var(--accent-cyan);
}

.nav-install-item:hover, .nav-install-item:active {
  background: rgba(0, 240, 255, 0.1);
  color: #00f0ff;
}

[data-theme="light"] .nav-install-item {
  color: #0284c7;
}

[data-theme="light"] .nav-install-item:hover, [data-theme="light"] .nav-install-item:active {
  background: rgba(2, 132, 199, 0.08);
  color: #0369a1;
}

.btn-setting-action {
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-setting-action:active {
  background: rgba(0, 240, 255, 0.28);
  transform: scale(0.96);
}

.btn-setting-action.is-installed {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--primary);
  cursor: default;
}

[data-theme="light"] .btn-setting-action {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

[data-theme="light"] .btn-setting-action.is-installed {
  background: rgba(5, 150, 105, 0.12);
  border-color: rgba(5, 150, 105, 0.3);
  color: #059669;
}

/* Install Modal */
.install-app-modal {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  animation: modalEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.install-modal-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.install-app-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.install-preview-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.install-preview-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.install-preview-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.install-preview-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-preview-url {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

[data-theme="light"] .install-app-preview {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .install-preview-url {
  color: #0284c7;
}

.install-instructions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-main);
}

.install-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
  font-size: 0.74rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

[data-theme="light"] .install-step-badge {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0284c7;
}

.install-step-text strong {
  color: var(--primary);
}

[data-theme="light"] .install-step-text strong {
  color: #059669;
}

.btn-install-prompt-action {
  background: var(--primary);
  border: none;
  color: #0c0e14;
  font-weight: 700;
  font-size: 0.94rem;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  width: 100%;
  transition: all 0.18s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-install-prompt-action:active {
  background: var(--primary-hover);
  transform: scale(0.98);
}


