/* Queer & trans pride theme */
:root {
  --trans-blue: #5BCEFA;
  --trans-pink: #F5A9B8;
  --trans-white: #FFFFFF;
  --pride-red: #E40303;
  --pride-orange: #FF8C00;
  --pride-yellow: #FFED00;
  --pride-green: #008026;
  --pride-blue: #24408E;
  --pride-violet: #732982;
  --bg: #0f1218;
  --bg-elevated: #181c24;
  --bg-card: #1e2430;
  --text: #f1f5f9;
  --text-muted: #9aa7bd;
  --accent: #5BCEFA;
  --accent-hover: #7dd4fc;
  --accent-soft: rgba(91, 206, 250, 0.18);
  --partner: #F5A9B8;
  --partner-soft: rgba(245, 169, 184, 0.18);
  --danger: #e57373;
  --success: #66bb6a;
  --border: rgba(91, 206, 250, 0.2);
  --now-line: #FFED00;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.2);
  --rainbow: linear-gradient(90deg, var(--pride-red), var(--pride-orange), var(--pride-yellow), var(--pride-green), var(--pride-blue), var(--pride-violet));
  --trans-gradient: linear-gradient(180deg, var(--trans-blue), var(--trans-pink), var(--trans-white), var(--trans-pink), var(--trans-blue));
  --accent-fab: #7c3aed;
  --theme-glow-a: rgba(91, 206, 250, 0.18);
  --theme-glow-b: rgba(245, 169, 184, 0.14);
  --theme-glow-c: rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01' on, 'ss02' on;
  transition: background-color 0.45s ease, color 0.35s ease;
}

.hidden { display: none !important; }

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45); }
  50% { box-shadow: 0 6px 28px rgba(124, 58, 237, 0.58); }
}

@keyframes birthday-soft-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.2)); }
  50% { filter: drop-shadow(0 0 12px rgba(236, 72, 153, 0.28)); }
}

.icon-svg {
  display: block;
  flex-shrink: 0;
}

/* Login screen */
#login-screen {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 18% 16%, rgba(112, 145, 103, 0.16), transparent 22%),
    radial-gradient(circle at 82% 14%, rgba(210, 184, 138, 0.08), transparent 24%),
    radial-gradient(circle at 50% 110%, rgba(71, 103, 64, 0.42), transparent 32%),
    linear-gradient(180deg, rgba(244, 236, 220, 0.04), transparent 24%),
    linear-gradient(145deg, #07110c 0%, #0d1912 32%, #183125 62%, #0b1510 100%);
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 12, 9, 0.46), rgba(6, 12, 9, 0.68)),
    radial-gradient(circle at 50% 0%, rgba(255, 247, 232, 0.08), transparent 30%),
    url('/images/login-forest-mushrooms.jpg') center center / cover no-repeat;
  filter: saturate(0.84) brightness(0.72) contrast(1.04);
  opacity: 0.9;
}

#login-screen::after {
  content: '';
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -10%;
  height: 240px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 35%, rgba(244, 238, 225, 0.11), transparent 16%),
    radial-gradient(circle at 72% 28%, rgba(244, 238, 225, 0.09), transparent 18%),
    linear-gradient(180deg, rgba(11, 20, 14, 0), rgba(11, 20, 14, 0.78));
  filter: blur(10px);
}

/* Progress Pride flag (muted) behind login — June or global theme "Pride Month" */
body[data-pride-month="1"] #login-screen {
  position: relative;
  isolation: isolate;
  background: var(--bg);
  overflow: hidden;
}

body[data-pride-month="1"] #login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('/images/progress-pride-flag.png') center center / cover no-repeat;
  filter: brightness(0.58) saturate(0.8) contrast(0.92);
  pointer-events: none;
}

body[data-pride-month="1"] #login-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    165deg,
    rgba(15, 18, 24, 0.72) 0%,
    rgba(15, 18, 24, 0.82) 42%,
    rgba(15, 18, 24, 0.88) 100%
  );
  pointer-events: none;
}

body[data-pride-month="1"] #login-screen > * {
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: linear-gradient(180deg, rgba(21, 35, 26, 0.9), rgba(12, 21, 16, 0.96));
  border: 1px solid rgba(142, 177, 128, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 244, 222, 0.04);
  animation: fade-rise 0.55s ease-out both;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 247, 232, 0.06), transparent 32%);
}

.login-card::after {
  content: none;
}

.login-festive-accent {
  display: block;
  height: 7px;
  margin: -2.5rem -2.5rem 1.25rem -2.5rem;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #5f7d56 0%, #9db18a 34%, #c67a4b 68%, #784b34 100%);
}

/* Full-screen flag replaces the thin card accent during Pride */
body[data-pride-month="1"] .login-festive-accent {
  display: none;
}

.login-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #f2ebd7;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
}

.login-subtitle {
  color: #c7d1bc;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.secret-link-hint {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: #b4c0a8;
  text-align: center;
}

.btn-google {
  width: 100%;
  padding: 0.875rem 1.25rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(180deg, #f5eedf 0%, #efe4cf 100%);
  border: 1px solid rgba(149, 115, 74, 0.28);
  border-radius: 14px;
  color: #213024;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-google:active {
  transform: scale(0.99);
}

.btn-google:hover {
  background: linear-gradient(180deg, #f8f2e6 0%, #f1e8d6 100%);
  border-color: rgba(104, 136, 91, 0.55);
  box-shadow: 0 0 0 2px rgba(121, 157, 108, 0.14);
}

.btn-google:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-google::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path fill="%234285F4" d="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"/><path fill="%2334A853" d="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.16 7.09-10.29 7.09-17.65z"/><path fill="%23FBBC05" d="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"/><path fill="%23EA4335" d="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"/></svg>') center/contain no-repeat;
}

.login-status {
  font-size: 0.82rem;
  text-align: center;
  margin-top: 0.5rem;
  color: #c7d1bc;
  min-height: 1.2em;
}
.login-status.error { color: #ef4444; }

.login-divider {
  text-align: center;
  color: #aab7a0;
  font-size: 0.85rem;
  margin: 1rem 0 0.75rem;
}

/* Calendar screen */
#calendar-screen {
  min-height: 100vh;
  padding-bottom: 80px;
}

#calendar-screen:not(.hidden) main {
  animation: fade-rise 0.4s ease-out both;
}

.festive-strip {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.1rem;
}

.festive-pride-block,
.festive-birthday-block {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  animation: fade-rise 0.45s ease-out both;
}

body[data-pride-month="1"] .festive-pride-block {
  display: flex;
}

body[data-birthday-season="1"] .festive-birthday-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: var(--radius-sm);
}

.progress-pride-bar {
  height: 12px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  background: linear-gradient(
    to bottom,
    #E40303 0,
    #E40303 16.66%,
    #FF8C00 16.66%,
    #FF8C00 33.33%,
    #FFED00 33.33%,
    #FFED00 50%,
    #008026 50%,
    #008026 66.66%,
    #24408E 66.66%,
    #24408E 83.33%,
    #732982 83.33%
  );
  position: relative;
}

.progress-pride-bar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(42%, 220px);
  background: repeating-linear-gradient(
    -118deg,
    #000 0 5px,
    #784F17 5px 10px,
    #74D7EE 10px 15px,
    #FFAFC8 15px 20px,
    #fff 20px 25px
  );
  clip-path: polygon(0 0, 100% 0, 72% 50%, 100% 100%, 0 100%);
}

.festive-pride-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.festive-birthday-icon {
  color: var(--accent);
  flex-shrink: 0;
  display: flex;
}

.festive-birthday-text {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}

body[data-birthday-season="1"] #calendar-screen:not(.hidden) header h1 {
  animation: birthday-soft-glow 5s ease-in-out infinite;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  transition: border-color 0.35s ease, background-color 0.35s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

#user-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

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

#logout-btn {
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#logout-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
  background: var(--bg-card);
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.btn-icon:active {
  transform: scale(0.94);
}

.btn-secondary {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--bg-card);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

main {
  padding: 1rem 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}

/* Social battery */
.social-battery-section {
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(155deg, rgba(28, 36, 48, 0.95) 0%, rgba(24, 28, 36, 0.9) 100%);
  border-radius: 16px;
  border: 1px solid rgba(91, 206, 250, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.social-battery-section .section-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.social-batteries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1.25rem;
  width: 100%;
  max-width: 420px;
  align-items: stretch;
}

@media (max-width: 500px) {
  .social-batteries-grid {
    max-width: 100%;
  }
}

.social-battery-card {
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  min-width: 0;
  max-width: none;
  width: 100%;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

.social-battery-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.social-battery-card.you {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--accent-soft) 100%);
}

.social-battery-card.partner {
  border-color: var(--partner);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--partner-soft) 100%);
}

.social-battery-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.social-battery-card h3 span:first-child {
  min-width: 0;
}

.social-battery-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-inline: 0.35rem;
}

.social-battery-emoji {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.social-battery-slider {
  width: 100%;
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
}

.social-battery-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--border);
}

.social-battery-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 3px solid var(--bg-card);
}

.social-battery-card.readonly .social-battery-slider {
  pointer-events: none;
  opacity: 0.8;
}

.social-battery-card.readonly .social-battery-slider::-webkit-slider-thumb {
  cursor: default;
}

.social-battery-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding-inline: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.social-battery-labels span {
  flex: 1;
  text-align: center;
}

.social-battery-error {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

/* Push notifications settings */
.push-notifications-section .push-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.push-ios-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.push-unregister-btn {
  margin-left: 0.25rem;
}

.push-row {
  margin-bottom: 0.75rem;
}

.push-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.push-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.push-thresholds {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.push-threshold-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.push-user-threshold {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.push-user-threshold label {
  min-width: 80px;
  font-size: 0.9rem;
}

.push-user-threshold select {
  padding: 0.4rem 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
}

.push-register-btn {
  margin-left: 0.5rem;
}

.push-actions {
  margin-top: 0.75rem;
}

.push-status {
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.push-status-ok {
  color: var(--success, #22c55e);
}

.push-status-error {
  color: var(--danger, #ef4444);
}

.view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 0.85rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.tab .tab-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.tab:hover {
  color: var(--text);
}

.tab:hover .tab-icon {
  opacity: 1;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.tab.active .tab-icon {
  opacity: 1;
}

.tab:active {
  transform: scale(0.98);
}

/* Upcoming section */
.upcoming-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.upcoming-section:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.upcoming-section h2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.upcoming-item:hover {
  background: var(--bg-elevated);
}

.upcoming-item.upcoming-item--now {
  border-left: 3px solid var(--accent);
  padding-left: calc(0.5rem - 3px);
}

.upcoming-item .date-badge {
  flex-shrink: 0;
  width: 48px;
  text-align: center;
}

.upcoming-item .date-badge .day {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.upcoming-item .date-badge .month {
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.upcoming-item .event-title {
  font-weight: 500;
}

.upcoming-item .event-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upcoming-item .event-creator {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Calendar section */
.visible-days-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.visible-days-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.visible-days-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.visible-days-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
}

.visible-days-checkboxes input {
  cursor: pointer;
}

.calendar-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.calendar-header button {
  padding: 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.calendar-header button:hover {
  color: var(--accent);
}

#today-btn {
  padding: 0.5rem 0.75rem;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
}

#today-btn:hover {
  background: var(--accent);
  color: white;
}

#current-date-label {
  font-size: 1rem;
  font-weight: 600;
}

/* Day view - timeline layout */
#day-view {
  padding: 0 0 0.5rem;
}

.arrange-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent);
  padding: 0.5rem;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  margin: 0.5rem 0.75rem 0;
}

.day-timeline {
  position: relative;
  display: flex;
  margin-top: 8px;
}

.time-gutter {
  position: relative;
  width: 56px;
  flex-shrink: 0;
}

.time-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.day-content {
  flex: 1;
  position: relative;
  border-left: 1px solid var(--border);
}

.hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
  pointer-events: none;
}

.events-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* Current time line */
.now-line {
  position: absolute;
  left: 52px;
  right: 0;
  height: 2px;
  background: var(--now-line);
  z-index: 10;
  pointer-events: none;
}

.now-line::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  background: var(--now-line);
  border-radius: 50%;
}

/* Event blocks */
.event-block {
  position: absolute;
  left: 4px;
  right: 4px;
  padding: 6px 8px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  font-size: 0.85rem;
  border-left: 3px solid;
}

.event-block .event-block-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-block .event-block-time {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Day view event blocks - column layout for overlaps */
.day-event-block {
  right: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 6px;
  box-sizing: border-box;
  transition: box-shadow 0.15s ease, opacity 0.15s ease;
}

.day-event-block .event-block-title {
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-event-block .event-block-time {
  font-size: 0.7rem;
  line-height: 1.1;
  opacity: 0.85;
  white-space: nowrap;
}

.day-event-block.single-col {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.day-event-block.single-col .event-block-title {
  flex: 1;
  min-width: 0;
}

.day-event-block.single-col .event-block-time {
  flex-shrink: 0;
}

/* Arrange mode */
#arrange-btn {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#arrange-btn.active {
  background: var(--accent-fab);
  border-color: var(--accent-fab);
  color: white;
}

.day-event-block.draggable {
  cursor: grab;
  touch-action: none;
}

.day-event-block.dragging {
  cursor: grabbing;
  opacity: 0.92;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  z-index: 20;
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* Week view */
#week-view {
  padding: 1rem;
}

.week-day-cell {
  min-width: 0;
}

#week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

@media (max-width: 600px) {
  #week-grid {
    grid-template-columns: 1fr;
  }
}

.week-day-header {
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

.week-day-header.today {
  color: var(--accent);
}

.week-day-column {
  min-height: 300px;
  padding: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

/* Week view event blocks: title on left, time on right */
.week-event-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 4px;
  padding: 6px 8px;
  position: static;
  cursor: pointer;
  border-radius: 6px;
  border-left: 3px solid;
  min-height: auto;
}

.week-event-block:last-child {
  margin-bottom: 0;
}

.week-event-title {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-event-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* FAB */
#add-event-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-fab);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.45);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fab-pulse 4s ease-in-out infinite;
}

#add-event-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.55);
}

#add-event-fab:active {
  transform: scale(0.96);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 480px) {
  .modal {
    align-items: center;
    padding: 20px;
  }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 1.75rem 1.5rem;
  border: 1px solid rgba(91, 206, 250, 0.12);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  animation: modal-in 0.3s ease-out both;
}

@media (min-width: 480px) {
  .modal-content {
    border-radius: 20px;
    padding: 2rem;
  }
}

.modal-content h3 {
  margin-bottom: 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.modal-content h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 1rem 0 0.5rem;
}
.modal-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}
.secret-link-section {
  margin-bottom: 0.5rem;
}
.secret-link-section label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.secret-link-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.secret-link-box input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  font-size: 0.85rem;
}
.secret-link-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.import-calendar-section .import-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.theme-section .theme-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.import-url-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.import-url-box input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  font-size: 0.9rem;
}
.import-result {
  font-size: 0.85rem;
  padding: 0.5rem;
  border-radius: 6px;
}
.import-result.success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success, #22c55e);
}
.import-result.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger, #ef4444);
}

.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 100%;
  max-width: 100%;
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(91, 206, 250, 0.15);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
  outline: none;
  border-color: var(--trans-blue);
  box-shadow: 0 0 0 3px rgba(91, 206, 250, 0.15);
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.modal-content label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.4rem;
}

.modal-content label:first-of-type,
#event-form label:first-of-type {
  margin-top: 0;
}

#event-form {
  overflow: hidden;
}

/* Date/datetime pickers */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  border: 1px solid rgba(91, 206, 250, 0.15) !important;
  padding: 0.75rem 1rem !important;
  font-size: 1rem !important;
  min-height: 48px;
  max-width: 100%;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75);
  opacity: 0.9;
  cursor: pointer;
}


.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 0.75rem;
}

.modal-actions-right {
  display: flex;
  gap: 0.5rem;
}

.modal-actions button {
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.modal-actions button[type="submit"] {
  background: linear-gradient(135deg, var(--trans-blue), rgba(91, 206, 250, 0.85));
  border: none;
  color: #0f1218;
}

.modal-actions button[type="submit"]:hover {
  filter: brightness(1.08);
}

.modal-actions button[type="button"]:not(.btn-danger) {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(91, 206, 250, 0.25);
  color: var(--text);
}

.modal-actions button[type="button"]:not(.btn-danger):hover {
  background: rgba(91, 206, 250, 0.1);
  border-color: rgba(91, 206, 250, 0.4);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.ics-url-box {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.ics-url-box input {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
}

.ics-url-box button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
}

.ics-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Tasks */
.tasks-section {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid rgba(91, 206, 250, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.tasks-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#tasks-project-select {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
}

.task-form input,
.task-form textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid rgba(91, 206, 250, 0.15);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.task-form input:focus,
.task-form textarea:focus {
  outline: none;
  border-color: var(--trans-blue);
  box-shadow: 0 0 0 3px rgba(91, 206, 250, 0.12);
}

.task-form > .task-form-field {
  margin-bottom: 1.25rem;
}

.task-form #task-content {
  margin-bottom: 1.25rem;
}

.task-form input[type="date"],
.task-form input[type="datetime-local"] {
  min-height: 44px;
}

.task-form input[type="date"]::-webkit-calendar-picker-indicator,
.task-form input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  opacity: 0.8;
}

.task-form-row {
  display: flex;
  gap: 0.5rem;
}

.task-form-row input {
  flex: 1;
}

.task-form-row .task-form-field {
  flex: 1;
}

.task-form-row .task-form-field input {
  width: 100%;
}

.task-form-extras-details {
  margin: 0.75rem 0;
}

.task-form-extras-details summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--accent);
  padding: 0.35rem 0;
  user-select: none;
}

.task-form-extras-details summary:hover {
  text-decoration: underline;
}

.task-form-extras-details[open] summary {
  margin-bottom: 0.5rem;
}

.task-form-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.task-form-field {
  min-width: 120px;
}

.task-form-field label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.task-form-field select {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.task-form-labels {
  flex: 1;
  min-width: 160px;
}

.task-labels-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.task-labels-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.task-priority-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-card);
}

.task-priority-badge.p1 { color: #ef4444; }
.task-priority-badge.p2 { color: #f59e0b; }
.task-priority-badge.p3 { color: #eab308; }
.task-priority-badge.p4 { color: var(--text-muted); }

.task-labels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 2px;
}

.task-label-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

.task-form-actions {
  display: flex;
  justify-content: flex-end;
}

.task-form-actions button,
.tasks-controls button,
.tasks-subheader button {
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

.task-form-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease;
}

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

.task-item.completed {
  opacity: 0.85;
}

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

.task-title {
  font-weight: 600;
}

.task-due {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.task-relation {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

.task-parent-of {
  color: var(--accent);
}

.task-has-subtasks {
  color: var(--text-muted);
}

.task-note {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.task-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.task-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 0.35rem 0.55rem;
  min-height: 40px;
  min-width: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

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

.task-btn[data-action="delete"]:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.task-empty, .task-error {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem;
  text-align: center;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.tasks-completed {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tasks-completed summary {
  list-style: none;
  cursor: pointer;
}

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

.tasks-completed summary::before {
  content: '▸ ';
  display: inline-block;
  margin-right: 0.25rem;
  transition: transform 0.15s ease;
}

.tasks-completed[open] summary::before {
  transform: rotate(90deg);
}

.tasks-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text-muted);
}

.tasks-completed summary.tasks-subheader {
  padding: 0.5rem 0;
}

.tasks-list .task-item + .task-item {
  margin-top: 2px;
}

/* Safe area for mobile */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #add-event-fab {
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: calc(24px + env(safe-area-inset-right));
  }
}

/* =========================================================
   Modern UI refresh - Pride theme
   ========================================================= */
:root {
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
}

body {
  background:
    radial-gradient(1400px 900px at -15% -10%, var(--theme-glow-a), transparent 55%),
    radial-gradient(1100px 700px at 105% 15%, var(--theme-glow-b), transparent 50%),
    radial-gradient(600px 400px at 50% 105%, var(--theme-glow-c), transparent 45%),
    var(--bg);
  color: var(--text);
}

#calendar-screen {
  padding-bottom: 96px;
}

header {
  background: rgba(15, 18, 24, 0.9);
  border-bottom: 1px solid rgba(91, 206, 250, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
}

header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#user-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.btn-icon,
#logout-btn,
.btn-secondary,
.tab,
.calendar-header button,
#today-btn,
.task-btn,
.task-form-actions button,
.tasks-controls button,
.tasks-subheader button,
.ics-url-box button {
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-icon:hover,
#logout-btn:hover,
.btn-secondary:hover,
.tab:hover,
.calendar-header button:hover,
#today-btn:hover,
.task-btn:hover,
.task-form-actions button:hover,
.tasks-controls button:hover,
.tasks-subheader button:hover,
.ics-url-box button:hover {
  transform: translateY(-1px);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.1rem 1.1rem 1.25rem;
  display: grid;
  gap: 1rem;
}

.social-battery-section,
.upcoming-section,
.calendar-section,
.tasks-section {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.social-battery-section {
  padding: 1rem 1.2rem;
  align-items: stretch;
}

.social-battery-section .section-label {
  margin-bottom: 0.8rem;
  text-align: left;
}

.social-batteries-grid {
  max-width: none;
  gap: 0.8rem;
}

.social-battery-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-left-width: 4px;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.24);
}

.social-battery-card h3 {
  margin-bottom: 0.85rem;
}

.social-battery-slider-wrap {
  padding-inline: 0.4rem;
}

.social-battery-labels {
  padding-inline: 0.25rem;
}

.social-battery-slider {
  height: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.social-battery-slider::-webkit-slider-thumb,
.social-battery-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.view-tabs {
  margin-bottom: 0;
  gap: 0.55rem;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  background: rgba(24, 28, 36, 0.5);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.tab .tab-icon {
  flex-shrink: 0;
  opacity: 0.88;
}

.tab:hover .tab-icon,
.tab.active .tab-icon {
  opacity: 1;
}

.tab.active {
  background: linear-gradient(135deg, rgba(91, 206, 250, 0.25), rgba(245, 169, 184, 0.2));
  box-shadow: 0 4px 16px rgba(91, 206, 250, 0.25);
  border: 1px solid rgba(91, 206, 250, 0.35);
}

.upcoming-section {
  padding: 1rem;
  background: linear-gradient(155deg, rgba(28, 36, 51, 0.98), rgba(22, 29, 41, 0.98));
}

#upcoming-list {
  gap: 0.6rem;
}

.upcoming-item {
  padding: 0.65rem;
  border: 1px solid transparent;
}

.upcoming-item:hover {
  border-color: var(--border);
  background: rgba(15, 20, 29, 0.52);
}

.calendar-section {
  overflow: clip;
}

.visible-days-row {
  background: rgba(22, 29, 41, 0.85);
}

.calendar-header {
  gap: 0.45rem;
}

.calendar-header button {
  border-radius: 10px;
}

#current-date-label {
  text-align: center;
  font-size: 1rem;
}

.event-block {
  border-radius: 10px;
  border-left-width: 4px;
  box-shadow: 0 5px 14px rgba(2, 6, 23, 0.2);
}

#week-grid {
  gap: 0.75rem;
}

.week-day-column {
  min-height: 260px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(28, 36, 51, 0.9), rgba(22, 29, 41, 0.9));
}

#add-event-fab {
  width: 58px;
  height: 58px;
  box-shadow: 0 14px 28px rgba(124, 58, 237, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fab-pulse 4s ease-in-out infinite;
}

#add-event-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 18px 32px rgba(124, 58, 237, 0.5);
}

.modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-content input,
.modal-content textarea,
.task-form input,
.task-form-field select,
#tasks-project-select,
.push-user-threshold select {
  border-color: rgba(91, 206, 250, 0.18);
  background: rgba(24, 28, 36, 0.6);
}

.task-item {
  background: rgba(24, 28, 36, 0.6);
}

.task-item:hover {
  border-color: rgba(91, 206, 250, 0.3);
}

.tasks-subheader {
  margin-top: 1.2rem;
}

@media (min-width: 980px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "battery"
      "tabs"
      "upcoming"
      "calendar"
      "tasks";
    align-items: start;
  }

  .social-battery-section {
    grid-area: battery;
    position: static;
    top: auto;
  }

  .view-tabs {
    grid-area: tabs;
    align-self: start;
  }

  .upcoming-section {
    grid-area: upcoming;
  }

  .calendar-section {
    grid-area: calendar;
  }

  .tasks-section {
    grid-area: tasks;
  }

  #week-grid {
    grid-template-columns: 1fr;
  }

  .week-day-column {
    min-height: 0;
  }
}

@media (max-width: 740px) {
  header {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  header h1 {
    font-size: 1.08rem;
  }

  #logout-btn {
    padding: 0.45rem 0.6rem;
  }

  main {
    padding: 0.8rem;
    gap: 0.8rem;
  }

  .calendar-header {
    flex-wrap: wrap;
    justify-content: center;
  }

  #current-date-label {
    width: 100%;
    order: -1;
  }
}

/* Global theme variants */
body[data-theme="spring"] {
  --bg: #0f1712;
  --bg-elevated: #152219;
  --bg-card: #1b2d21;
  --accent: #7ccf8a;
  --accent-hover: #97dca4;
  --accent-soft: rgba(124, 207, 138, 0.2);
  --border: rgba(124, 207, 138, 0.24);
  --accent-fab: #4b9b62;
  --theme-glow-a: rgba(124, 207, 138, 0.2);
  --theme-glow-b: rgba(167, 243, 208, 0.14);
  --theme-glow-c: rgba(230, 255, 244, 0.06);
}

body[data-theme="summer"] {
  --bg: #0b1320;
  --bg-elevated: #112035;
  --bg-card: #172a43;
  --accent: #4cc9f0;
  --accent-hover: #72d7f3;
  --accent-soft: rgba(76, 201, 240, 0.2);
  --border: rgba(76, 201, 240, 0.24);
  --accent-fab: #0284c7;
  --theme-glow-a: rgba(76, 201, 240, 0.2);
  --theme-glow-b: rgba(253, 224, 71, 0.12);
  --theme-glow-c: rgba(255, 255, 255, 0.06);
}

body[data-theme="autumn"] {
  --bg: #1b120b;
  --bg-elevated: #2a1b12;
  --bg-card: #352217;
  --accent: #d97706;
  --accent-hover: #f59e0b;
  --accent-soft: rgba(217, 119, 6, 0.2);
  --border: rgba(251, 146, 60, 0.25);
  --accent-fab: #b45309;
  --theme-glow-a: rgba(251, 146, 60, 0.2);
  --theme-glow-b: rgba(248, 113, 113, 0.12);
  --theme-glow-c: rgba(254, 215, 170, 0.08);
}

body[data-theme="winter"] {
  --bg: #0b1220;
  --bg-elevated: #111b2e;
  --bg-card: #17253b;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.2);
  --border: rgba(147, 197, 253, 0.24);
  --accent-fab: #3b82f6;
  --theme-glow-a: rgba(96, 165, 250, 0.2);
  --theme-glow-b: rgba(192, 219, 255, 0.14);
  --theme-glow-c: rgba(226, 240, 255, 0.08);
}

body[data-theme="valentine"] {
  --bg: #1d0f18;
  --bg-elevated: #2a1622;
  --bg-card: #351c2b;
  --accent: #ec4899;
  --accent-hover: #f472b6;
  --accent-soft: rgba(236, 72, 153, 0.2);
  --border: rgba(244, 114, 182, 0.24);
  --accent-fab: #db2777;
  --theme-glow-a: rgba(244, 114, 182, 0.22);
  --theme-glow-b: rgba(251, 113, 133, 0.14);
  --theme-glow-c: rgba(255, 228, 236, 0.08);
}

body[data-theme="stpatrick"] {
  --bg: #0f1a12;
  --bg-elevated: #16281b;
  --bg-card: #1e3425;
  --accent: #16a34a;
  --accent-hover: #22c55e;
  --accent-soft: rgba(22, 163, 74, 0.2);
  --border: rgba(74, 222, 128, 0.24);
  --accent-fab: #15803d;
  --theme-glow-a: rgba(34, 197, 94, 0.2);
  --theme-glow-b: rgba(250, 204, 21, 0.12);
  --theme-glow-c: rgba(236, 253, 245, 0.08);
}

body[data-theme="pride"] {
  --bg: #0f1218;
  --bg-elevated: #181c24;
  --bg-card: #1e2430;
  --accent: #5BCEFA;
  --accent-hover: #7dd4fc;
  --accent-soft: rgba(91, 206, 250, 0.18);
  --partner: #F5A9B8;
  --partner-soft: rgba(245, 169, 184, 0.18);
  --border: rgba(91, 206, 250, 0.2);
  --now-line: #FFED00;
  --accent-fab: #7c3aed;
  --theme-glow-a: rgba(91, 206, 250, 0.22);
  --theme-glow-b: rgba(245, 169, 184, 0.18);
  --theme-glow-c: rgba(255, 255, 255, 0.06);
}

body[data-theme="pride"] .festive-pride-caption {
  color: rgba(226, 232, 240, 0.88);
}

body[data-theme="pride"] .social-battery-section {
  border-color: rgba(91, 206, 250, 0.22);
  box-shadow: 0 4px 28px rgba(91, 206, 250, 0.08);
}

body[data-theme="birthday"] {
  --bg: #1a1108;
  --bg-elevated: #27180d;
  --bg-card: #332013;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-soft: rgba(245, 158, 11, 0.2);
  --border: rgba(251, 191, 36, 0.24);
  --accent-fab: #ea580c;
  --theme-glow-a: rgba(251, 191, 36, 0.26);
  --theme-glow-b: rgba(236, 72, 153, 0.18);
  --theme-glow-c: rgba(254, 243, 199, 0.1);
}

body[data-theme="birthday"] .festive-birthday-block {
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.12);
}

body[data-theme="halloween"] {
  --bg: #140d1a;
  --bg-elevated: #1f1428;
  --bg-card: #291a34;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-soft: rgba(249, 115, 22, 0.2);
  --border: rgba(251, 146, 60, 0.24);
  --accent-fab: #c2410c;
  --theme-glow-a: rgba(249, 115, 22, 0.22);
  --theme-glow-b: rgba(168, 85, 247, 0.12);
  --theme-glow-c: rgba(255, 237, 213, 0.07);
}

body[data-theme="thanksgiving"] {
  --bg: #1b130d;
  --bg-elevated: #281b12;
  --bg-card: #332217;
  --accent: #92400e;
  --accent-hover: #b45309;
  --accent-soft: rgba(146, 64, 14, 0.2);
  --border: rgba(180, 83, 9, 0.24);
  --accent-fab: #78350f;
  --theme-glow-a: rgba(180, 83, 9, 0.2);
  --theme-glow-b: rgba(251, 191, 36, 0.12);
  --theme-glow-c: rgba(254, 243, 199, 0.07);
}

body[data-theme="christmas"] {
  --bg: #0f1a13;
  --bg-elevated: #15251a;
  --bg-card: #1d2f24;
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --accent-soft: rgba(220, 38, 38, 0.2);
  --border: rgba(239, 68, 68, 0.24);
  --accent-fab: #15803d;
  --theme-glow-a: rgba(22, 163, 74, 0.2);
  --theme-glow-b: rgba(220, 38, 38, 0.14);
  --theme-glow-c: rgba(220, 252, 231, 0.07);
}

body[data-theme="newyear"] {
  --bg: #11121d;
  --bg-elevated: #191b2b;
  --bg-card: #22253a;
  --accent: #eab308;
  --accent-hover: #facc15;
  --accent-soft: rgba(234, 179, 8, 0.2);
  --border: rgba(250, 204, 21, 0.24);
  --accent-fab: #a855f7;
  --theme-glow-a: rgba(250, 204, 21, 0.2);
  --theme-glow-b: rgba(168, 85, 247, 0.14);
  --theme-glow-c: rgba(254, 249, 195, 0.07);
}

/* Accessibility and interaction polish */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(124, 144, 255, 0.92);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(124, 144, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
