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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3248;
  --text: #e8eaf0;
  --text-muted: #7a7f99;
  --primary: #6c63ff;
  --primary-hover: #5a52e0;
  --danger: #e05252;
  --danger-hover: #c44040;

  /* Status colors — colorblind-safe, high-contrast across all five states */
  --status-done:   #22C55E;  /* green       — on time           */
  --status-late-1: #FF8C00;  /* bright orange — 1–12 hrs late   */
  --status-late-2: #CC5500;  /* burnt orange  — 12–24 hrs late  */
  --status-missed: #EF4444;  /* bright red    — missed           */
  --status-none:   #6B7280;  /* medium gray   — no data          */

  /* Green tint — DO / done / check-in complete */
  --tint-green-bg:     #1a3a2a;
  --tint-green-border: #22C55E;
  --tint-green-text:   #4ade80;

  /* Red tint — DON'T / missed */
  --tint-red-bg:     #3a1a1a;
  --tint-red-border: #EF4444;
  --tint-red-text:   #f87171;

  --radius: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --transition: 0.18s ease;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg:          #f0f2fa;
  --surface:     #ffffff;
  --surface2:    #e8eaf5;
  --border:      #c8cce0;
  --text:        #1a1d2e;
  --text-muted:  #6b7094;
  --shadow:      0 4px 20px rgba(0,0,0,0.10);

  --tint-green-bg:     #dcfce7;
  --tint-green-border: #22C55E;
  --tint-green-text:   #14532d;

  --tint-red-bg:     #fee2e2;
  --tint-red-border: #dc2626;
  --tint-red-text:   #7f1d1d;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  /* Smooth color transition when theme changes */
  transition: background var(--transition), color var(--transition);
}

/* Small square icon button (theme toggle) */
.btn-icon-sm {
  padding: 0.4rem 0.55rem;
  font-size: 0.95rem;
  line-height: 1;
}

/* ===== HEADER ===== */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.header-controls {
  display: flex;
  gap: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.btn-icon {
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.btn-icon:hover { color: var(--text); border-color: var(--text-muted); }

/* ===== MAIN ===== */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 1.25rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* EN/ES divider inside the privacy modal */
.privacy-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.1rem 0;
}

.toolbar {
  margin-bottom: 1.25rem;
  display: flex;
  gap: 0.75rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 1rem;
  font-size: 1rem;
}

/* ===== HABIT CARD ===== */
.habit-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.habit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  transition: border-color var(--transition);
}

/* Status indicator bar on left */
.habit-status-bar {
  width: 5px;
  border-radius: 3px;
  align-self: stretch;
  min-height: 48px;
  background: var(--status-none);
  transition: background 0.4s ease;
}
.status-done      { background: var(--status-done) !important; }
.status-late-1    { background: var(--status-late-1) !important; }
.status-late-2    { background: var(--status-late-2) !important; }
.status-missed    { background: var(--status-missed) !important; }
.status-none      { background: var(--status-none) !important; }

.habit-info { min-width: 0; }

.habit-name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.habit-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.2rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-do   { background: var(--tint-green-bg); color: var(--tint-green-text); }
.badge-dont { background: var(--tint-red-bg);   color: var(--tint-red-text); }

.habit-streak {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.habit-streak strong { color: var(--text); }

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

.habit-note-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* ===== HABIT ACTIONS ===== */
.habit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.checkin-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.checkin-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.checkin-btn:active { transform: scale(0.95); }
.checkin-btn.checked-in { background: var(--tint-green-bg); border-color: var(--status-done); color: var(--tint-green-text); cursor: default; }

.habit-icon-row {
  display: flex;
  gap: 0.3rem;
}

/* ===== SETTINGS PANEL ===== */
.panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.panel-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.panel h2 { font-size: 1rem; font-weight: 700; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}
.setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  /* Respect device safe areas (notches, home bar) */
  padding: max(1rem, env(safe-area-inset-top))
           max(1rem, env(safe-area-inset-right))
           max(1rem, env(safe-area-inset-bottom))
           max(1rem, env(safe-area-inset-left));
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.5);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  /* Clamp to viewport — dvh accounts for mobile browser chrome resize */
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  /* Clip overflow so the internal scroll region works correctly */
  overflow: hidden;
}
.modal-wide { max-width: 640px; }
.modal-sm   { max-width: 360px; }

/* Non-calendar modals: let the whole modal body scroll if content is tall */
.modal:not(.modal-wide) {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal h2 {
  font-size: 1.1rem;
  font-weight: 700;
  /* Prevent title from shrinking when modal is height-constrained */
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
  /* Keep Close/Save buttons always visible at the bottom */
  flex-shrink: 0;
}

/* ===== FORM ===== */
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: -0.4rem;
}

.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); }

/* ===== TYPE TOGGLE ===== */
.type-toggle {
  display: flex;
  gap: 0.5rem;
}
.type-btn {
  flex: 1;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.type-btn.active[data-type="DO"]   { background: var(--tint-green-bg); border-color: var(--tint-green-border); color: var(--tint-green-text); }
.type-btn.active[data-type="DONT"] { background: var(--tint-red-bg);   border-color: var(--tint-red-text);   color: var(--tint-red-text); }

/* ===== CALENDAR ===== */
.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Scroll only the grid; title + close button stay pinned */
  overflow-y: auto;
  overflow-x: hidden;
  /* min-height: 0 is required — flex children default to min-height: auto
     which prevents them from shrinking below content size */
  min-height: 0;
  flex: 1 1 auto;
  /* iOS momentum scrolling */
  -webkit-overflow-scrolling: touch;
  /* Subtle scrollbar inside the grid area */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Webkit scrollbar scoped to calendar grid only */
.calendar-grid::-webkit-scrollbar { width: 4px; }
.calendar-grid::-webkit-scrollbar-track { background: transparent; }
.calendar-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cal-month-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
}

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

.cal-day {
  aspect-ratio: 1;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--text-muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: default;
  position: relative;
  padding: 2px 1px;
  /* Clip content that won't fit (very small cells) */
  overflow: hidden;
}
.cal-day.empty { background: transparent; border-color: transparent; }
.cal-day.cal-done   { background: var(--tint-green-bg); border-color: var(--status-done); color: var(--tint-green-text); }
.cal-day.cal-missed { background: var(--tint-red-bg);   border-color: var(--tint-red-border);   color: var(--tint-red-text); }
.cal-day.cal-future { background: transparent; border-color: transparent; color: var(--border); }
.cal-day.cal-today  { border-color: var(--primary); }

/* Day number — slightly smaller when an emoji is also shown */
.cal-day-num {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}
.cal-day.has-mood .cal-day-num { font-size: 0.6rem; }

/* Mood emoji inside calendar cell */
.cal-day-mood {
  font-size: 0.72rem;
  line-height: 1;
  display: block;
}

.cal-dow-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 2px;
}
.cal-dow-header span {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ===== EMOJI ===== */
/* Force color (Emoji Presentation) rendering cross-browser.
   font-variant-emoji: emoji is Chrome 131+/Firefox 116+;
   the font-family fallback covers Safari and older browsers. */
.emoji {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji',
               'Twemoji Mozilla', sans-serif;
  font-style: normal;
  font-variant-emoji: emoji;
  line-height: 1;
}

/* ===== MOOD PICKER ===== */
.mood-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.mood-prompt {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.mood-options {
  display: flex;
  gap: 0.25rem;
}

.mood-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition);
  /* Prevent text selection on double-tap (mobile) */
  user-select: none;
  -webkit-user-select: none;
}
.mood-btn .emoji { font-size: 1.15rem; }
.mood-btn:hover  { background: var(--border); border-color: var(--text-muted); }
.mood-btn:active { transform: scale(0.88); }

/* Larger tap target on touch devices */
@media (hover: none) {
  .mood-btn { width: 2.6rem; height: 2.6rem; }
  .mood-btn .emoji { font-size: 1.3rem; }
}

.mood-skip {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mood-skip:hover { color: var(--text); }

/* ===== JOURNAL ===== */

/* Header button — hide the text label on narrow screens, keep emoji */
.journal-btn { gap: 0.2rem; }
.journal-btn-text { /* visible by default on desktop */ }

/* Modal header: title left, formatted date right */
.journal-modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
}
.journal-modal-header h2 { flex-shrink: 0; }

.journal-date-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Textarea — taller than default form fields, bounded so buttons stay visible */
.journal-textarea {
  min-height: 8rem;
  max-height: 35vh;
  resize: vertical;
  flex-shrink: 0;
}

/* Action row: Clear on left, Cancel+Save grouped on right */
.journal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-top: 0.25rem;
}
.journal-actions-right {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

/* Read-only view content — preserves whitespace/line-breaks, scrolls if long */
.journal-view-content {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text);
  max-height: 55vh;
  overflow-y: auto;
  min-height: 2rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  flex: 1 1 auto;
  min-height: 0;
}
.journal-view-content::-webkit-scrollbar { width: 4px; }
.journal-view-content::-webkit-scrollbar-track { background: transparent; }
.journal-view-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Calendar journal dot — absolute top-right of cell */
.cal-journal-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  pointer-events: none; /* clicks pass through to cell */
  flex-shrink: 0;
}

.cal-day.has-journal { cursor: pointer; }
.cal-day.has-journal:hover { filter: brightness(1.15); }

/* Calendar legend — sits between the grid and the Close button, always visible */
.cal-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Matches the dot rendered inside calendar cells */
.cal-legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* About modal — paragraph spacing */
.about-content { line-height: 1.6; }
.about-content p + p { margin-top: 0.9rem; }

/* ===== WEEKLY VIEW ===== */

/* Full-screen modal variant — overrides .modal's max-width and overflow */
.modal.modal-fullscreen {
  width: 100%;
  max-width: none;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: hidden; /* keep internal sections responsible for their own scroll */
}

/* Title row with X close button */
.weekly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* X close button */
.btn-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.btn-close:hover { color: var(--text); background: var(--surface2); }

/* Scrollable table wrapper — scrolls both axes, fills remaining modal height */
.weekly-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Table base */
.weekly-table {
  border-collapse: collapse;
  width: 100%;
}

/* Sticky header row — stays visible when scrolling many habits */
.weekly-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  z-index: 3;
}

/* Corner cell sticky in both directions */
.wk-corner {
  position: sticky;
  left: 0;
  top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  z-index: 4;
  min-width: 100px;
}

/* Day column headers */
.wk-day-header {
  text-align: center;
  padding: 0.4rem 0.5rem;
  min-width: 48px;
}
.wk-day-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}
.wk-date-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}
/* Highlight today's column header */
.wk-today-header .wk-day-name,
.wk-today-header .wk-date-label {
  color: var(--primary);
}

/* Sticky habit name column */
.wk-habit-name {
  position: sticky;
  left: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 1;
  text-align: left;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}
/* Subtle row hover */
.weekly-table tbody tr:hover .wk-habit-name,
.weekly-table tbody tr:hover .wk-cell {
  background: var(--surface2);
}
/* Keep the sticky cell background in sync on hover */
.weekly-table tbody tr:hover .wk-habit-name {
  background: var(--surface2);
}

/* Data cells */
.wk-cell {
  text-align: center;
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--border);
}
/* Subtle column highlight for today */
.wk-today { background: rgba(108,99,255,0.06); }

/* Colored status squares */
.wk-square {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  vertical-align: middle;
}
.wk-done    { background: var(--status-done); }
.wk-late-1  { background: var(--status-late-1); }
.wk-late-2  { background: var(--status-late-2); }
.wk-missed  { background: var(--status-missed); }
/* Gray "no data" — same gray as status-none; clearly distinct from the red missed square */
.wk-none    { background: var(--status-none); }

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

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

/* Two-row header on mobile — title row + controls row */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start; /* override desktop space-between; prevents controls being pushed off-screen in sticky context */
    padding: 0.6rem 1rem;
    gap: 0.4rem;
  }

  .app-title {
    text-align: center;
  }

  .header-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* 44 px minimum touch target for all header buttons */
  .header-controls .btn {
    min-height: 44px;
  }

  /* Toolbar buttons share the full row equally on mobile */
  .toolbar .btn {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 500px) {
  .habit-card { grid-template-columns: auto 1fr; }
  .habit-actions { flex-direction: row; align-items: center; grid-column: 1 / -1; }
  .habit-note-preview { max-width: 180px; }

  /* Collapse journal button to icon-only on small screens */
  .journal-btn-text { display: none; }

  /* Tighter modal padding on small screens gives the calendar more room */
  .modal {
    padding: 1.1rem;
    gap: 0.65rem;
    border-radius: var(--radius);
  }

  /* On portrait mobile, use almost full height for the calendar modal */
  .modal-wide {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
  }
}
