/* =========================================
   🌫️  GLASS NAV + BACKGROUND
   ========================================= */
:root { color-scheme: only light; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(to bottom, #9ba0a8, #858b96);
  color: #111;
  min-height: 100vh;
}

/* Fixed glass nav wrapper */
.nav-wrap {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

/* Frosted glass nav bar */
.glass-nav {
  pointer-events: all;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 9999px;
  padding: 0.55rem 1rem;
  gap: 0.4rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* Nav tabs */
.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 9999px;
  padding: .4rem .75rem;
  transition: all 0.25s ease;
  opacity: 0.8;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

.nav-tab:hover { 
  opacity: 1; 
  transform: translateY(-2px); 
}

.nav-tab img {
  filter: grayscale(30%) brightness(0.95);
  transition: filter .25s ease;
}

.nav-tab.active img {
  filter: brightness(1.1) drop-shadow(0 0 6px rgba(255,215,0,0.5));
}

.nav-tab.active {
  background: rgba(255,255,255,0.9);
  opacity: 1 !important;
}

.nav-label {
  font-size: 0.75rem;
  color: #111;
  font-weight: 500;
  margin-top: 2px;
}

/* Ensure page content sits below nav with more space */
.nav-offset { 
  padding-top: 7.5rem;  /* Reduced from 10rem */
}

#tabList {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

/* =========================================
   🧊  MAIN CONTENT
   ========================================= */
.container {
  max-width: 600px;  /* Reduced from 680px for more compact cards */
  margin: 0 auto;
  padding: 0 1rem 3rem;  /* Only horizontal and bottom padding */
}

/* Container with nav offset - MUST come after .container */
.container.nav-offset {
  padding-top: 7.5rem !important;  /* Override with !important */
}

.glass-section {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 0.75rem;
  padding: 1.5rem 2rem;  /* Increased horizontal padding for centering */
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  margin-bottom: 2rem;
}

h2 {
  text-align: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #111;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

input, select {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: rgba(255,255,255,0.9);
  color: #111;
  box-sizing: border-box;  /* Ensure padding doesn't cause overflow */
}

/* Date/Time grid container - specific targeting */
form > div[style*="grid-template-columns"] {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem !important;
  margin-bottom: 1rem !important;
}

form > div[style*="grid-template-columns"] > div {
  min-width: 0;  /* Allow grid items to shrink */
}

form > div[style*="grid-template-columns"] input {
  margin-bottom: 0;  /* Remove bottom margin in grid */
  width: 100%;
}

/* Form row for date and time fields side by side */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row input {
  margin-bottom: 0;
}

button.btn-primary {
  background: #FFD700;
  color: #000;
  font-weight: 700;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 9999px;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

button.btn-primary:hover { 
  background: #ffea80; 
}

.hidden { 
  display: none; 
}

/* =========================================
   🧭  EVENT CARDS
   ========================================= */
.event-card {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.05);
  border-left: 4px solid #4A9EFF;  /* Blue left border like calendar cards */
  border-radius: 0.75rem;
  padding: 0.7rem;  /* Reduced from 0.85rem for more compact */
  margin-bottom: 1rem;
  transition: transform .2s;
}

.event-card:hover { 
  transform: translateY(-3px); 
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.35rem;  /* Reduced from 0.5rem */
}

.event-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.event-name {
  font-weight: 600;
  color: #111;
  font-size: 1rem;
}

/* Event details - multiple rows for readability */
.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;  /* Reduced from 0.4rem */
  font-size: 0.9em;
  color: #444;
  margin-top: 0.35rem;  /* Reduced from 0.5rem */
}

.event-detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;  /* Slightly reduced */
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.badge {
  border-radius: 9999px;
  padding: 0.2rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge.registered, .badge.going {
  background: rgba(16,185,129,0.25);
  color: #065f46;
}

.badge.not-registered {
  background: rgba(239,68,68,0.25);
  color: #7f1d1d;
}

.countdown {
  text-align: right;
  color: #000;
  font-weight: 500;
  margin-top: 0.35rem;  /* Reduced from 0.5rem */
  font-size: 0.9em;
}

.edit-link {
  font-size: 0.85em;
  margin-left: 8px;
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s ease;
}

.edit-link:hover {
  color: #fff;
  text-decoration: underline;
}

.delete-link {
  font-size: 0.85em;
  margin-left: 10px;
  cursor: pointer;
  color: #e57373;
  transition: color 0.2s ease;
}

.delete-link:hover {
  color: #d32f2f;
  text-decoration: underline;
}

/* ===== Registration Link Button ===== */
.reg-link-btn {
  display: inline-block;
  padding: 6px 12px;
  margin-top: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #00bfff;
  font-size: 0.9em;
  text-decoration: none;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
  word-break: break-all;
}

.reg-link-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.02);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
  color: #40cfff;
}

/* =========================================
   📊  FILTER BAR
   ========================================= */
.filter-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: -0.3rem;
}

.filter-btn {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 9999px;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255,255,255,0.85);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: #FFD700;
  color: #000;
  border-color: rgba(255,215,0,0.5);
  box-shadow: 0 2px 6px rgba(255,215,0,0.3);
}

/* =========================================
   📱  NOTIFICATION SETTINGS
   ========================================= */
.notification-section {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.notification-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1rem;
  color: #333;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: #ccc;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-switch.active {
  background: #4CAF50;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active::after {
  transform: translateX(24px);
}

.reminder-days {
  margin-bottom: 15px;
}

.reminder-days label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.day-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-checkbox {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.day-checkbox:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.day-checkbox input[type="checkbox"] {
  margin: 0 6px 0 0;
  width: auto;
  cursor: pointer;
}

.day-checkbox label {
  margin: 0;
  cursor: pointer;
  font-size: 0.85rem;
}

.recipients-section {
  margin-bottom: 10px;
}

.recipients-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.quick-recipient-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-recipient-btn {
  padding: 6px 12px;
  background: rgba(255, 215, 0, 0.3);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.quick-recipient-btn:hover {
  background: rgba(255, 215, 0, 0.5);
  transform: translateY(-1px);
}

.quick-recipient-btn.selected {
  background: #FFD700;
  border-color: #FFD700;
}

.recipient-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.recipient-input-group input {
  flex: 1;
  margin-bottom: 0;
}

.recipient-input-group button {
  padding: 0.6rem 1rem;
  background: #FFD700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.recipient-input-group button:hover {
  background: #ffea80;
}

.recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.recipient-tag {
  background: rgba(255, 215, 0, 0.3);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipient-tag .remove-btn {
  cursor: pointer;
  font-weight: bold;
  color: #d32f2f;
}

.recipient-tag .remove-btn:hover {
  color: #b71c1c;
}

.notification-hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 8px;
  font-style: italic;
}

.notification-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* =========================================
   ⏰  1-HOUR NOTIFICATION SECTION
   ========================================= */
.hour-notification-section {
  background: rgba(255, 255, 255, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  padding-top: 20px;
  border-top: 2px solid rgba(255,215,0,0.3);
}

.hour-notification-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hour-icon {
  font-size: 1.2rem;
}

.hour-label {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.hour-checkbox {
  margin-bottom: 12px;
  background: rgba(255,215,0,0.1);
}

.hour-info {
  margin-bottom: 12px;
}

.mentions-section {
  margin-top: 12px;
}

.mentions-section label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: block;
}

.mention-all-btn {
  margin-bottom: 8px;
  width: fit-content;
}

.mention-all-btn.selected {
  background: #25D366;
  border-color: #25D366;
  color: white;
}

.mention-tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.hour-preview {
  margin-top: 15px;
  background: rgba(7,94,84,0.1);
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #25D366;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hour-preview-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hour-preview-content {
  background: white;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.mention-tag-preview {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* =========================================
   🔐  PIN KEYPAD (ADMIN)
   ========================================= */
.pin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.pin-box {
  background: #fff;
  padding: 20px 25px;
  border-radius: 16px;
  width: 260px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.pin-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.pin-display {
  height: 40px;
  font-size: 28px;
  letter-spacing: 12px;
  margin-bottom: 15px;
  text-align: center;
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pin-btn {
  background: #e7e7e7;
  padding: 12px 0;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  user-select: none;
}

.pin-btn:active {
  background: #ccc;
}

.pin-delete {
  background: #ffb3b3 !important;
}

.pin-close {
  background: #b3d1ff !important;
}

/* =========================================
   📅  CALENDAR VIEWS
   ========================================= */

/* Calendar View Tabs */
.calendar-view-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.view-tab-btn {
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.view-tab-btn:hover {
  background: rgba(255, 255, 255, 0.85);
}

.view-tab-btn.active {
  background: #FFD700;
  color: #000;
  border-color: rgba(255, 215, 0, 0.5);
}

/* Day View */
.day-view {
  max-width: 600px;
  margin: 0 auto;
}

.day-header {
  text-align: center;
  margin-bottom: 20px;
}

.day-header h3 {
  font-size: 1.8rem;
  margin: 5px 0;
}

.day-header .day-name {
  font-size: 1rem;
  color: #666;
}

.day-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-event-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0.75rem;
  padding: 1rem;
  border-left: 4px solid #FFD700;
  transition: all 0.2s;
}

.day-event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.day-event-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #111;
}

.day-event-details {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9em;
  color: #444;
  line-height: 1.5;
}

/* Week View */
.week-view {
  max-width: 100%;  /* Changed from 800px to fit container */
  margin: 0 auto;
  overflow-x: auto;  /* Allow horizontal scroll on very small screens */
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;  /* Reduced from 8px */
  margin-bottom: 20px;
  min-width: 0;  /* Allow grid items to shrink */
}

.week-day {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 8px;  /* Reduced from 12px */
  text-align: center;
  border: 2px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  min-width: 0;  /* Allow content to shrink */
  overflow: hidden;  /* Prevent content overflow */
}

.week-day.today {
  border-color: #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.week-day-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

.week-day-date {
  font-size: 1.3rem;  /* Reduced from 1.5rem */
  font-weight: 700;
  color: #000;
  margin-bottom: 6px;  /* Reduced from 8px */
}

.week-events {
  text-align: left;
  font-size: 0.7rem;  /* Reduced from 0.75rem */
}

.week-event-item {
  background: rgba(255, 215, 0, 0.2);
  padding: 3px 6px;  /* Reduced from 4px 8px */
  border-radius: 6px;
  margin-bottom: 3px;  /* Reduced from 4px */
  cursor: pointer;
  font-size: 0.7rem;  /* Added explicit small font */
  line-height: 1.2;  /* Tighter line height */
  word-wrap: break-word;  /* Wrap long event names */
}

.week-event-item:hover {
  background: rgba(255, 215, 0, 0.4);
}

/* 6-Month Calendar View */
.year-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 15px auto;
  padding: 0 6px;
  max-width: 520px;
  color: #222;
  text-align: center;
  justify-content: center;
  justify-items: center;
}

.month-block {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  width: 160px;
  position: relative;
  overflow: visible;
}

.month-block h3 {
  margin: 3px 0 5px;
  font-size: 0.85em;
  font-weight: 600;
  color: #000;
}

.week-header,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  text-align: center;
}

.week-header div {
  font-weight: bold;
  color: #333;
  font-size: 0.65em;
}

.day,
.empty {
  height: 18px;
  line-height: 18px;
  border-radius: 3px;
  font-size: 0.65em;
  color: #333;
  background: rgba(0, 0, 0, 0.03);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  opacity: 0.8;
}

.lg-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
}

.lg-yellow { background: rgba(255,230,0,0.9); }
.lg-green  { background: rgba(0,200,100,0.9); }
.lg-orange { background: orange; }
.lg-blue   { background: rgba(0,150,255,0.9); }

/* Event Day Styles */
.day.event-day.not-registered {
  background: rgba(255, 230, 0, 0.9);
  color: #000;
  font-weight: bold;
  border: 1px solid rgba(255, 200, 0, 0.6);
  box-shadow: 0 0 3px rgba(255, 220, 0, 0.3);
}

.day.event-day.registered {
  background: rgba(0, 200, 100, 0.9);
  color: #fff;
  font-weight: bold;
  border: 1px solid rgba(0, 150, 70, 0.6);
  box-shadow: 0 0 3px rgba(0, 200, 100, 0.3);
}

.day.event-day:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

.overlap-event {
  background: orange !important;
  color: #000 !important;
  font-weight: bold;
}

.holiday-day {
  background: rgba(0, 150, 255, 0.9) !important;
  color: #fff !important;
  font-weight: bold;
  border: 1px solid rgba(0, 120, 220, 0.7);
  box-shadow: 0 0 3px rgba(0, 140, 255, 0.3);
}

.calendar-tooltip {
  position: absolute;
  background: white;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 200px;
  line-height: 1.3;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 99999;
  white-space: normal;
}

/* =========================================
   📦  ARCHIVE
   ========================================= */
.archive-list {
  max-height: 600px;
  overflow-y: auto;
}

.archive-item {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-left: 4px solid #10B981;  /* Green left border */
  border-radius: 0.75rem;
  padding: 0.7rem;  /* Match event card padding */
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s ease;
}

.archive-item:hover {
  transform: translateY(-3px);  /* Match event card hover */
}

.archive-item-main {
  flex: 1;
}

.archive-item-name {
  font-weight: 600;
  font-size: 1rem;
  color: #111;
  margin-bottom: 4px;
}

.archive-item-details {
  font-size: 0.85rem;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.archive-item-date {
  color: #999;
  font-size: 0.85rem;
  white-space: nowrap;
}

.archive-empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-style: italic;
}

/* =========================================
   📱  RESPONSIVE - MOBILE
   ========================================= */
@media (max-width: 768px) {
  .year-calendar {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 100%;
    padding: 0 8px;
  }

  .month-block {
    width: 100%;
    padding: 4px;
  }

  .month-block h3 {
    font-size: 0.8em;
  }

  .day, .empty {
    height: 16px;
    line-height: 16px;
    font-size: 0.6em;
  }

  .week-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }

  .week-day {
    padding: 8px 4px;
  }

  .week-day-date {
    font-size: 1.2rem;
  }
}

@media (max-width: 420px) {
  .year-calendar {
    grid-template-columns: repeat(3, 1fr);
    column-gap: 14px;
    row-gap: 14px;
  }

  .month-block {
    padding: 3px;
  }

  .month-block h3 {
    font-size: 0.75em;
  }

  .day, .empty {
    height: 15px;
    line-height: 15px;
    font-size: 0.58em;
  }

  .week-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .day-event-card {
    padding: 12px;
  }
}