/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f4f6fb;
  --sidebar-bg: #1e1e2e;
  --sidebar-text: #cdd6f4;
  --sidebar-active: #cba6f7;
  --surface: #ffffff;
  --text: #1e1e2e;
  --text-secondary: #6c7086;
  --border: #e6e9ef;
  --accent: #7c3aed;
  --accent-light: #ede9fe;
  --accent-hover: #6d28d9;
  --today-bg: #7c3aed;
  --today-text: #ffffff;
  --high: #ef4444;
  --medium: #f59e0b;
  --low: #22c55e;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html {
  font-size: 15px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

/* ===== App Layout ===== */
.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.year-badge {
  background: var(--sidebar-active);
  color: var(--sidebar-bg);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.month-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}

.month-nav::-webkit-scrollbar {
  width: 4px;
}

.month-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.month-nav ul {
  list-style: none;
}

.month-nav li {
  margin-bottom: 2px;
}

.month-nav li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  transition: all var(--transition);
  cursor: pointer;
}

.month-nav li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.month-nav li a.active {
  background: rgba(203, 166, 247, 0.15);
  color: var(--sidebar-active);
  font-weight: 600;
}

.month-nav li a .month-num {
  font-size: 0.7rem;
  font-weight: 600;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text);
  flex-shrink: 0;
}

.month-nav li a.active .month-num {
  background: var(--sidebar-active);
  color: var(--sidebar-bg);
}

.month-nav li a .task-count {
  margin-left: auto;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.upcoming-section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 10px;
  font-weight: 600;
}

.upcoming-list {
  list-style: none;
  max-height: 160px;
  overflow-y: auto;
}

.upcoming-list::-webkit-scrollbar {
  width: 3px;
}

.upcoming-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.upcoming-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.upcoming-list li:last-child {
  border-bottom: none;
}

.upcoming-list .upcoming-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.upcoming-list .upcoming-dot.high { background: var(--high); }
.upcoming-list .upcoming-dot.medium { background: var(--medium); }
.upcoming-list .upcoming-dot.low { background: var(--low); }

.upcoming-list .upcoming-info {
  flex: 1;
  min-width: 0;
}

.upcoming-list .upcoming-info .upcoming-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.8);
}

.upcoming-list .upcoming-info .upcoming-date {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
}

.upcoming-empty {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  padding: 16px 0;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
}

/* Menu Toggle (hidden on desktop) */
.menu-toggle {
  display: none;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.current-month-title {
  font-size: 1.35rem;
  font-weight: 700;
  min-width: 220px;
  text-align: center;
  letter-spacing: -0.3px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-today {
  margin-left: auto;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-today:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Import/Export Buttons */
.io-buttons {
  display: flex;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}

.btn-io {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-io:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-io svg {
  flex-shrink: 0;
}

/* ===== Calendar Grid ===== */
.calendar-wrapper {
  flex: 1;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.weekday-header span {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  padding: 8px 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  flex: 1;
}

.day-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.day-cell:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.day-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

.day-cell.empty:hover {
  transform: none;
  box-shadow: none;
}

.day-cell.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.day-cell.today .day-number {
  background: var(--today-bg);
  color: var(--today-text);
}

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

.day-number {
  font-size: 0.85rem;
  font-weight: 600;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.day-cell.sunday .day-number {
  color: var(--high);
}

.day-cell.today.sunday .day-number {
  color: var(--today-text);
}

.day-tasks {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-task-pill {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  line-height: 1.4;
}

.day-task-pill.high {
  background: #fef2f2;
  color: #dc2626;
}

.day-task-pill.medium {
  background: #fffbeb;
  color: #d97706;
}

.day-task-pill.low {
  background: #f0fdf4;
  color: #16a34a;
}

.day-task-pill.completed {
  opacity: 0.5;
  text-decoration: line-through;
}

.day-more {
  font-size: 0.6rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 1px;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 480px;
  max-width: 92vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: all 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  border: none;
  background: none;
  color: var(--text-secondary);
}

.modal-close:hover {
  color: var(--high);
  background: #fef2f2;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Task Form */
.task-form {
  margin-bottom: 20px;
}

.task-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-size: max(0.9rem, 16px);
  outline: none;
  transition: border-color var(--transition);
  background: var(--bg);
}

.task-form input:focus {
  border-color: var(--accent);
}

.task-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.priority-select {
  display: flex;
  align-items: center;
  gap: 6px;
}

.priority-select label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.priority-btn {
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.priority-btn:hover {
  border-color: var(--accent);
}

.priority-btn.active[data-priority="low"] {
  background: #f0fdf4;
  border-color: var(--low);
  color: #16a34a;
}

.priority-btn.active[data-priority="medium"] {
  background: #fffbeb;
  border-color: var(--medium);
  color: #d97706;
}

.priority-btn.active[data-priority="high"] {
  background: #fef2f2;
  border-color: var(--high);
  color: #dc2626;
}

.btn-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

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

/* Task List */
.task-list {
  list-style: none;
}

.task-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: background var(--transition);
  border: 1px solid var(--border);
}

.task-list li:hover {
  background: var(--bg);
}

.task-list li.completed .task-text {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  margin-top: 1px;
}

.task-checkbox:hover {
  border-color: var(--accent);
}

.task-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.task-checkbox.checked svg {
  display: block;
}

.task-checkbox svg {
  display: none;
  width: 12px;
  height: 12px;
  stroke: #fff;
  stroke-width: 3;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-text {
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-word;
}

.task-priority-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
  display: inline-block;
}

.task-priority-badge.high {
  background: #fef2f2;
  color: #dc2626;
}

.task-priority-badge.medium {
  background: #fffbeb;
  color: #d97706;
}

.task-priority-badge.low {
  background: #f0fdf4;
  color: #16a34a;
}

.task-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  flex-shrink: 0;
}

.task-list li:hover .task-delete {
  opacity: 1;
}

.task-delete:hover {
  background: #fef2f2;
  color: var(--high);
}

/* Empty State */
.empty-tasks {
  text-align: center;
  padding: 32px 0;
  color: var(--text-secondary);
}

.empty-tasks svg {
  opacity: 0.2;
  margin-bottom: 12px;
}

.empty-tasks p {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.empty-tasks span {
  font-size: 0.8rem;
  opacity: 0.6;
}

.empty-tasks.hidden {
  display: none;
}

/* ===== Scrollbar ===== */
.modal-body::-webkit-scrollbar {
  width: 5px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

/* ===== Selection ===== */
::selection {
  background: var(--accent-light);
  color: var(--accent);
}

/* ===========================================================
   RESPONSIVE BREAKPOINTS
   =========================================================== */

/* ----- Large Tablets / Small Desktops (<=1024px) ----- */
@media (max-width: 1024px) {
  .sidebar {
    width: 230px;
  }

  .calendar-wrapper {
    padding: 20px 24px;
  }

  .top-bar {
    padding: 16px 24px;
  }

  .current-month-title {
    font-size: 1.2rem;
    min-width: 180px;
  }
}

/* ----- Tablets (<=768px) — Sidebar becomes slide-over ----- */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }

  .sidebar-overlay.active {
    pointer-events: auto;
  }

  .top-bar {
    padding: 14px 16px;
    gap: 8px;
  }

  .current-month-title {
    font-size: 1.1rem;
    min-width: 0;
    flex: 1;
    text-align: center;
  }

  .btn-today {
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .btn-io {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .calendar-wrapper {
    padding: 14px 16px;
  }

  .calendar-grid {
    gap: 4px;
  }

  .weekday-header {
    gap: 4px;
    margin-bottom: 6px;
  }

  .day-cell {
    padding: 6px;
    border-radius: 6px;
  }

  .day-number {
    font-size: 0.8rem;
    width: 26px;
    height: 26px;
  }

  .day-task-pill {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .day-more {
    font-size: 0.55rem;
  }

  /* Modal: wider on tablets */
  .modal {
    max-width: 95vw;
    max-height: 85vh;
  }

  /* Touch: always show delete on tablets (no hover) */
  .task-delete {
    opacity: 0.6;
  }
}

/* ----- Small Tablets / Large Phones (<=600px) ----- */
@media (max-width: 600px) {
  html {
    font-size: 14px;
  }

  .top-bar {
    padding: 12px;
    gap: 6px;
  }

  .current-month-title {
    font-size: 1rem;
  }

  .btn-icon {
    width: 34px;
    height: 34px;
  }

  .calendar-wrapper {
    padding: 10px 12px;
  }

  .calendar-grid {
    gap: 3px;
  }

  .weekday-header {
    gap: 3px;
    margin-bottom: 4px;
  }

  .weekday-header span {
    font-size: 0.65rem;
    padding: 6px 0;
    letter-spacing: 0.5px;
  }

  .day-cell {
    padding: 4px;
    border-radius: 5px;
  }

  .day-number {
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
  }

  .day-tasks {
    gap: 1px;
  }

  .day-task-pill {
    font-size: 0.55rem;
    padding: 1px 3px;
    border-radius: 3px;
  }

  .day-more {
    font-size: 0.5rem;
  }

  /* Modal adjustments */
  .modal {
    max-width: 96vw;
    max-height: 90vh;
    border-radius: 14px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .task-form-options {
    gap: 8px;
  }

  .priority-btn {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .task-delete {
    opacity: 0.7;
  }

  .task-list li {
    padding: 10px;
    gap: 8px;
  }
}

/* ----- Mobile Phones (<=480px) ----- */
@media (max-width: 480px) {
  html {
    font-size: 13.5px;
  }

  .sidebar {
    width: 260px;
  }

  .sidebar-footer {
    display: none;
  }

  .top-bar {
    padding: 10px 12px;
    gap: 6px;
  }

  .current-month-title {
    font-size: 0.95rem;
  }

  .btn-icon {
    width: 32px;
    height: 32px;
  }

  .btn-today {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .io-buttons {
    margin-left: 4px;
    gap: 4px;
  }

  .btn-io span-text {
    display: none;
  }

  .btn-io {
    padding: 6px 8px;
    font-size: 0;
  }

  .btn-io svg {
    width: 16px;
    height: 16px;
  }

  .calendar-wrapper {
    padding: 8px 8px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .weekday-header {
    gap: 2px;
    margin-bottom: 3px;
  }

  /* Single-letter weekday labels */
  .weekday-header span {
    font-size: 0.6rem;
    padding: 5px 0;
  }

  .weekday-header span::after {
    content: attr(data-short);
  }

  .weekday-header span {
    font-size: 0;
  }

  .weekday-header span::after {
    font-size: 0.65rem;
  }

  .day-cell {
    padding: 3px;
    border-radius: 4px;
  }

  .day-number {
    font-size: 0.7rem;
    width: 22px;
    height: 22px;
    margin-bottom: 1px;
  }

  /* Hide task pills, show dot indicator */
  .day-tasks {
    display: none;
  }

  .day-cell.has-tasks::after {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
  }

  /* Full-screen modal on phones */
  .modal {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    height: 100%;
    border-radius: 0;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal-overlay.active .modal {
    transform: translateY(0);
  }

  .modal {
    transform: translateY(100%);
    border-radius: 20px 20px 0 0;
    height: auto;
    max-height: 92vh;
    max-height: 92dvh;
  }

  .modal-header {
    padding: 18px 16px 14px;
  }

  .modal-header h3 {
    font-size: 1rem;
  }

  .modal-body {
    padding: 14px 16px 24px;
  }

  .task-form input {
    padding: 11px 14px;
  }

  .task-form-options {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .priority-select {
    justify-content: center;
  }

  .btn-add {
    justify-content: center;
    padding: 10px 18px;
  }

  .task-delete {
    opacity: 0.8;
    width: 32px;
    height: 32px;
  }

  .task-checkbox {
    width: 22px;
    height: 22px;
  }

  .empty-tasks {
    padding: 24px 0;
  }

  .empty-tasks svg {
    width: 36px;
    height: 36px;
  }
}

/* ----- Very Small Phones (<=360px) ----- */
@media (max-width: 360px) {
  html {
    font-size: 13px;
  }

  .top-bar {
    padding: 8px 8px;
    gap: 4px;
  }

  .current-month-title {
    font-size: 0.85rem;
  }

  .btn-icon {
    width: 30px;
    height: 30px;
  }

  .btn-today {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .calendar-wrapper {
    padding: 6px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .weekday-header {
    gap: 2px;
  }

  .day-cell {
    padding: 2px;
  }

  .day-number {
    font-size: 0.65rem;
    width: 20px;
    height: 20px;
  }

  .day-cell.today {
    box-shadow: 0 0 0 1.5px rgba(124, 58, 237, 0.25);
  }

  .day-cell.has-tasks::after {
    width: 4px;
    height: 4px;
    bottom: 2px;
  }

  .sidebar {
    width: 240px;
  }

  .modal-header {
    padding: 14px 12px;
  }

  .modal-body {
    padding: 12px;
  }

  .priority-btn {
    padding: 4px 8px;
    font-size: 0.65rem;
  }
}

/* ----- Landscape phones ----- */
@media (max-height: 500px) and (orientation: landscape) {
  .calendar-wrapper {
    padding: 6px 12px;
  }

  .top-bar {
    padding: 8px 12px;
  }

  .weekday-header span {
    padding: 4px 0;
  }

  .day-cell {
    padding: 2px;
  }

  .day-number {
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    margin-bottom: 0;
  }

  .day-tasks {
    display: none;
  }

  .day-cell.has-tasks::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
  }

  .modal {
    max-height: 98vh;
    max-height: 98dvh;
  }
}
