:root {
  --bg: #ffffff;
  --fg: #050505;
  --muted: #9c9c9c;
  --line: #e3e3e3;
  --accent: #050505;
  --accent-muted: #f5f5f5;
  --event-color: #f28500;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px clamp(24px, 6vw, 80px);
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

button {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.label {
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 24px;
  font-size: 0.9rem;
  background: #ffffff;
}

.logo {
  font-weight: 700;
  background: #050505;
  color: #ffffff;
  padding: 8px 5px;
  border: 2px solid #050505;
  font-size: 1.45rem;
  display: inline-block;
  margin-left: 0px;
}

.primary-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.nav-pill {
  border: 1px solid var(--fg);
  border-radius: 999px;
  padding: 4px 18px;
}

.nav-pill[data-mode='now'] {
  background: var(--fg);
  color: var(--bg);
}

.user-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

.index-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--fg);
  border-top: 1px solid var(--fg);
  padding: 12px 0;
  margin-bottom: 48px;
  font-size: 0.85rem;
}

.index-item {
  border-right: 1px solid var(--line);
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.index-item:last-child {
  border-right: none;
}

.index-item.search input {
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 4px;
  font: inherit;
  text-transform: uppercase;
  flex: 1;
}

.index-item.search input:focus {
  outline: none;
  border-color: var(--fg);
}

.hero {
  margin-top: -15px;
  margin-bottom: 64px;
}

.hero h1 {
  font-size: clamp(2.5rem, 10vw, 6.5rem);
  margin: 0 0 12px;
}

.subtitle {
  max-width: 640px;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0.08em;
  margin-bottom: 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.hero-cell {
  border: 1px solid var(--fg);
  padding: 12px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.primary-value {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin: 0;
  transform: translateY(-5px);
}

.secondary-value {
  font-size: 1.2rem;
  margin: 0;
}

.calendar-label {
  font-size: 1.2rem;
  margin: 0 0 1px 0;
  color: var(--fg);
  text-transform: uppercase;
  background: transparent;
  border: none;
  padding: 8px 24px;
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s ease;
  display: inline-block;
  font-family: inherit;
  letter-spacing: inherit;
}

.calendar-label:hover {
  background: var(--fg);
  color: var(--bg);
}

.date-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

.date-search-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: inherit;
  font-size: 0.95rem;
}

.calendar-btn.small {
  padding: 10px 14px;
  flex: 0 0 auto;
}

.timeline {
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  padding: 24px 0 32px;
  margin-bottom: 48px;
  margin-top: -30px;
  position: relative;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.timeline-nav-container {
  position: relative;
  overflow: visible;
}

.timeline-carousel-clip {
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  width: 100%;
}

.timeline-track-wrapper {
  position: relative;
  width: 100%;
  overflow: visible;
}

.timeline-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--fg);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: visible;
}

.timeline-track.animating-out-left {
  animation: slideOutLeft 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

.timeline-track.animating-out-right {
  animation: slideOutRight 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

.timeline-track.animating-in-left {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  animation: slideInLeft 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

.timeline-track.animating-in-right {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  animation: slideInRight 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

@keyframes slideOutLeft {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(-100%, 0, 0);
    opacity: 0;
  }
}

@keyframes slideOutRight {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  100% {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
}

@keyframes slideInLeft {
  0% {
    transform: translate3d(-100%, 0, 0);
    opacity: 0;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  0% {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

.timeline-nav-arrows {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 100;
}

.timeline-nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  user-select: none;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
}

.timeline-nav-arrow:hover {
  color: var(--muted);
}

.timeline-nav-arrow:active {
  transform: scale(0.95);
}

.timeline-top-arrows {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  margin-top: -4px;
}

.timeline-nav-arrow.subtle {
  font-size: 0.9rem;
  padding: 6px 8px;
  opacity: 0.75;
  border: 1px solid var(--line);
  border-radius: 4px;
  line-height: 1;
}

.timeline-nav-arrow.subtle:hover {
  opacity: 1;
  border-color: var(--fg);
}

.timeline-day {
  border-right: 1px solid var(--line);
  padding: 12px 12px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  font-size: 0.85rem;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 1;
  height: 120px;
  overflow: hidden;
}

.timeline-day:hover {
  background-color: rgba(242, 133, 0, 0.05);
  z-index: 2000;
}

.timeline-day.today:hover {
  background-color: var(--fg);
}

.timeline-day:last-child {
  border-right: none;
}

.timeline-day.today {
  background: var(--fg);
  color: var(--bg);
}

.timeline-day span {
  font-size: 0.75rem;
  color: inherit;
}

.timeline-day-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 58px;
  flex-shrink: 0;
}

/* Event annotations */
.timeline-day.has-events::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--event-color);
  border-radius: 50%;
  pointer-events: none;
}

.timeline-day-events {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 100%;
  flex: 1;
  padding-right: 4px;
}

.timeline-event-label {
  font-size: 0.7rem;
  color: var(--event-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.timeline-day.today .timeline-event-label {
  color: var(--event-color);
  opacity: 0.9;
}

.timeline-event-popover {
  position: absolute;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--fg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 12px;
  min-width: 220px;
  max-width: 320px;
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.timeline-event-popover.visible {
  opacity: 1;
  pointer-events: auto;
}

.timeline-event-popover-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 700;
}

.timeline-event-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.timeline-event-popover-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-event-popover-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid var(--line);
  padding: 6px 8px;
  background: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.timeline-event-popover-item:hover {
  background-color: rgba(242, 133, 0, 0.08);
  border-color: var(--fg);
}

.timeline-event-popover-title-btn {
  flex: 1;
  text-align: left;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 2px;
}

.timeline-event-popover-title-btn:hover {
  text-decoration: underline;
}

.timeline-event-popover-delete {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  transition: all 0.15s ease;
}

.timeline-event-popover-delete:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.timeline-event-popover-confirm {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg);
  border: 1px solid var(--fg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 10px;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.timeline-event-popover-confirm-text {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.timeline-event-popover-confirm-btn {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.12s ease;
}

.timeline-event-popover-confirm-btn.bin:hover {
  border-color: var(--fg);
  background: var(--fg);
  color: var(--bg);
}

.timeline-event-popover-confirm-btn.keep:hover {
  border-color: var(--fg);
}

.timeline-event-popover-add {
  background: transparent;
  border: 1px solid var(--line);
  color: inherit;
  padding: 6px 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.timeline-event-popover-add:hover {
  border-color: var(--fg);
  background: rgba(242, 133, 0, 0.08);
}

.timeline-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.content-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  padding: 24px 0;
  margin-bottom: 64px;
}

.content-table li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

/* FAQ Section Styles */
.faq-section {
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--fg);
  padding: 48px 0;
  margin: 64px 0 48px;
}

.faq-section h2 {
  font-size: 2rem;
  margin: 0 0 32px;
  text-align: left;
  font-weight: 700;
}

.faq-section .faq-item {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.faq-section .faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-section .faq-item h3 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  font-weight: 600;
}

.faq-section .faq-item p {
  text-transform: none;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--fg);
  margin: 0;
}

.faq-section .faq-item code {
  background: var(--accent-muted);
  padding: 2px 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid var(--line);
}

.faq-section .faq-item strong {
  font-weight: 600;
}

/* Hidden SEO Content (accessible to crawlers but not visually displayed) */
.seo-content.visually-hidden,
.featured-snippet-content.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.seo-content h2,
.seo-content h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.seo-content p,
.seo-content li {
  font-size: 0.9rem;
  margin: 0 0 8px;
  text-transform: none;
}

/* Week Highlight in H1 */
.week-highlight {
  color: var(--event-color);
}

/* Skip to main content link */
.skip-to-main:focus {
  left: 10px;
  top: 10px;
  z-index: 9999;
}

.footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  font-size: 0.85rem;
  border-top: 1px solid var(--fg);
  padding-top: 16px;
}

/* Week Navigation Styles */
.week-navigator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.week-number-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.week-number-container .primary-value {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
}

.week-number-container .primary-value:hover {
  opacity: 0.7;
}

.week-arrow {
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 1.5rem;
  cursor: pointer;
  user-select: none;
  padding: 0 8px;
  line-height: 1;
}

.week-number-container:hover .week-arrow {
  opacity: 1;
}

.week-arrow:hover {
  color: var(--muted);
}

.week-arrow:active {
  transform: scale(0.95);
}

.week-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--fg);
  padding: 16px;
  min-width: 200px;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.week-dropdown.active {
  display: block;
}

.week-dropdown-header {
  font-size: 0.9rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.week-dropdown-days {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-day-item {
  padding: 8px 12px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.week-day-item:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.week-day-item .day-label {
  font-weight: 600;
}

.week-day-item .day-date {
  color: var(--muted);
}

.week-day-item:hover .day-date {
  color: var(--bg);
  opacity: 0.7;
}

.week-day-item.has-event {
  border-left: 3px solid var(--event-color);
}

.day-event-count {
  margin-left: 4px;
  color: var(--event-color);
  font-weight: 600;
}

.week-day-item:hover .day-event-count {
  color: var(--event-color);
  opacity: 1;
}

/* Calendar Entry Modal */
.calendar-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.calendar-modal-overlay.active {
  display: flex;
}

.calendar-modal {
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 32px;
  min-width: 400px;
  max-width: 90vw;
}

.calendar-modal-header {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.calendar-modal-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.calendar-modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-form-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.calendar-form-input,
.calendar-form-textarea {
  border: 1px solid var(--line);
  padding: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
  color: var(--fg);
}

.calendar-form-input:focus,
.calendar-form-textarea:focus {
  outline: none;
  border-color: var(--fg);
}

.calendar-form-textarea {
  resize: vertical;
  min-height: 100px;
  text-transform: none;
  line-height: 1.5;
  font-size: 0.9rem;
}

.calendar-time-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.calendar-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.delete-event-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}

.delete-event-wrapper .calendar-btn {
  width: 100%;
}

.calendar-btn {
  flex: 1;
  padding: 12px 24px;
  border: 1px solid var(--fg);
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-btn:hover {
  background: var(--fg);
  color: var(--bg);
}

.calendar-btn.primary {
  background: var(--fg);
  color: var(--bg);
}

.calendar-btn.primary:hover {
  background: var(--bg);
  color: var(--fg);
}

.calendar-btn.danger {
  background: var(--bg);
  color: #d32f2f;
  border-color: #d32f2f;
}

.calendar-btn.danger:hover {
  background: #d32f2f;
  color: var(--bg);
}

/* Day Events Popup Modal */
.day-events-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.day-events-overlay.active {
  display: flex;
}

.day-events-modal {
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 32px;
  min-width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}

.day-events-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.day-events-header {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.calendar-btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: inherit;
  padding: 8px 12px;
  flex: 0 0 auto;
}

.calendar-btn.ghost:hover {
  border-color: var(--fg);
}

.day-events-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.day-events-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  color: var(--fg);
}

.day-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.day-event-item {
  padding: 12px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.day-event-item:hover {
  border-color: var(--event-color);
  background: rgba(242, 133, 0, 0.05);
}

.day-event-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.day-event-delete-wrapper {
  position: relative;
  flex-shrink: 0;
}

.day-event-delete {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--fg);
  width: 24px;
  height: 24px;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.day-event-delete:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.delete-confirm-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 12px;
  z-index: 10000;
  min-width: 160px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.delete-confirm-text {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--fg);
  letter-spacing: 0.5px;
}

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

.delete-confirm-btn {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: all 0.15s ease;
  letter-spacing: 0.5px;
}

.delete-confirm-btn.bin-it:hover {
  background: var(--fg);
  color: var(--bg);
}

.delete-confirm-btn.keep:hover {
  background: var(--event-color);
  color: var(--bg);
  border-color: var(--event-color);
}

.day-event-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  text-transform: uppercase;
}

.day-event-time {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.day-event-desc {
  font-size: 0.85rem;
  color: var(--fg);
  line-height: 1.4;
  text-transform: none;
  margin-top: 4px;
}

.day-events-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Event List Styles */
.event-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.event-list-item {
  padding: 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}

.event-list-item:hover {
  border-color: var(--event-color);
  background: rgba(242, 133, 0, 0.05);
}

.event-list-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--event-color);
  text-transform: uppercase;
}

.event-list-time {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.event-list-desc {
  font-size: 0.9rem;
  color: var(--fg);
  line-height: 1.4;
  text-transform: none;
}

/* Notification animations */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* Year Calendar Modal */
.year-calendar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  transition: background 0.3s ease;
}

.year-calendar-overlay.active {
  display: flex;
  background: rgba(0, 0, 0, 0.7);
}

.year-calendar-modal {
  background: var(--bg);
  border: 2px solid var(--fg);
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

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

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

.year-calendar-close {
  background: transparent;
  border: 1px solid var(--fg);
  color: var(--fg);
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.year-calendar-close:hover {
  background: var(--fg);
  color: var(--bg);
}

.year-calendar-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.year-calendar-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.year-calendar-arrow {
  background: transparent;
  border: 1px solid var(--fg);
  color: var(--fg);
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.year-calendar-arrow:hover {
  background: var(--fg);
  color: var(--bg);
}

.year-calendar-arrow:active {
  transform: scale(0.95);
}

.year-calendar-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.08em;
}

.year-calendar-content {
  flex: 1;
  overflow: auto;
  position: relative;
  padding: 24px;
  scroll-behavior: smooth;
}

.year-calendar-track-wrapper {
  position: relative;
  width: 100%;
  min-height: 100%;
  overflow: visible;
}

.year-calendar-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 24px;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  position: relative;
}

.calendar-month-card {
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: all 0.45s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  position: relative;
}

/* Grid position classes */
.calendar-month-card[data-position="0"] { grid-column: 1; grid-row: 1; }
.calendar-month-card[data-position="1"] { grid-column: 2; grid-row: 1; }
.calendar-month-card[data-position="2"] { grid-column: 3; grid-row: 1; }
.calendar-month-card[data-position="3"] { grid-column: 1; grid-row: 2; }
.calendar-month-card[data-position="4"] { grid-column: 2; grid-row: 2; }
.calendar-month-card[data-position="5"] { grid-column: 3; grid-row: 2; }

/* Exiting animations */
.calendar-month-card.exiting {
  opacity: 0;
  pointer-events: none;
}

.calendar-month-card.exit-left {
  transform: translate3d(-130%, 0, 0) scale(0.85) !important;
  opacity: 0 !important;
}

.calendar-month-card.exit-right {
  transform: translate3d(130%, 0, 0) scale(0.85) !important;
  opacity: 0 !important;
}

/* Entering animations - initial state */
.calendar-month-card.entering-from-right {
  transform: translate3d(130%, 0, 0) scale(0.85);
  opacity: 0;
}

.calendar-month-card.entering-from-left {
  transform: translate3d(-130%, 0, 0) scale(0.85);
  opacity: 0;
}

.calendar-month-card {
  border: 1px solid var(--fg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.calendar-month-name {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.calendar-month-year {
  font-size: 0.85rem;
  color: var(--muted);
}

.calendar-weekdays-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.calendar-weekday-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  padding: 4px;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.calendar-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  position: relative;
  z-index: 1;
}

.calendar-day-cell .day-number {
  position: relative;
  z-index: 2;
}

/* Period strips container */
.calendar-day-cell .period-strips {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

/* Start cell needs higher z-index for label to show above other cells */
.calendar-day-cell.period-start-cell {
  position: relative;
  z-index: 10;
}

/* Individual period strip */
.calendar-day-cell .period-strip {
  position: absolute;
  left: -2px;
  right: -2px;
  height: 25%;
  opacity: 0.85;
  display: flex;
  align-items: center;
  overflow: visible;
  transition: all 0.15s ease;
  pointer-events: auto;
  cursor: pointer;
}

.calendar-day-cell .period-strip:hover {
  opacity: 1;
  box-shadow: inset 0 0 0 2px var(--fg);
}

/* Strip label (title) - with background to stay visible */
.calendar-day-cell .period-strip .strip-label {
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: inherit;
  border-radius: 3px 0 0 3px;
  z-index: 5;
  pointer-events: none;
}

/* Rounded edges for strip start/end */
.calendar-day-cell .period-strip.strip-start {
  left: 3px;
  border-radius: 3px 0 0 3px;
}

.calendar-day-cell .period-strip.strip-end {
  right: 3px;
  border-radius: 0 3px 3px 0;
}

.calendar-day-cell .period-strip.strip-start.strip-end {
  left: 3px;
  right: 3px;
  border-radius: 3px;
}

.calendar-day-cell:not(.empty):hover {
  background: var(--accent-muted);
  border-color: var(--fg);
}

.calendar-day-cell.empty {
  cursor: default;
}

.calendar-day-cell.today {
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
}

.calendar-day-cell.has-event {
  position: relative;
}

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

.calendar-day-cell.today.has-event::after {
  background: var(--event-color);
}

/* Period strips on calendar days */
.calendar-day-cell {
  position: relative;
}

.calendar-day-cell.has-period {
  background: rgba(135, 206, 235, 0.1);
}

/* Selection highlighting */
.calendar-day-cell.selected {
  background: rgba(5, 5, 5, 0.08);
  border-color: var(--fg);
}

.calendar-day-cell.today.selected {
  background: var(--fg);
  opacity: 0.9;
}

.year-calendar-modal.is-selecting .calendar-day-cell {
  cursor: crosshair;
}

/* Period Creation Modal */
.period-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
}

.period-modal-overlay.active {
  display: flex;
}

.period-modal {
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 32px;
  min-width: 400px;
  max-width: 90vw;
}

.period-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.period-modal-close {
  background: transparent;
  border: 1px solid var(--fg);
  color: var(--fg);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.period-modal-close:hover {
  background: var(--fg);
  color: var(--bg);
}

.period-date-range {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.period-modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.period-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.period-form-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
}

.period-form-input {
  border: 1px solid var(--line);
  padding: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
  color: var(--fg);
}

.period-form-input:focus {
  outline: none;
  border-color: var(--fg);
}

.period-form-textarea {
  border: 1px solid var(--line);
  padding: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
  min-height: 80px;
  text-transform: none;
  line-height: 1.5;
}

.period-form-textarea:focus {
  outline: none;
  border-color: var(--fg);
}

.period-color-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.period-color-option {
  width: 48px;
  height: 48px;
  border: 2px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.period-color-option:hover {
  border-color: var(--fg);
  transform: scale(1.1);
}

.period-color-option.selected {
  border-color: var(--fg);
  border-width: 3px;
  transform: scale(1.05);
}

.period-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.period-delete-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}

@media (max-width: 720px) {
  body {
    padding: 32px 16px;
  }

  .masthead {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .primary-nav {
    justify-content: flex-start;
  }

  .user-actions {
    justify-content: flex-start;
  }

  .index-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .timeline-header {
    flex-direction: column;
    gap: 8px;
  }
  
  .faq h2 {
    font-size: 1.5rem;
  }

  .faq-item h3 {
    font-size: 1.1rem;
  }
  
  .week-dropdown {
    min-width: 180px;
  }
  
  .calendar-modal {
    min-width: 300px;
    padding: 24px;
  }
  
  .calendar-time-group {
    grid-template-columns: 1fr;
  }
  
  .year-calendar-track {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .year-calendar-content {
    padding: 16px;
  }
  
  .year-calendar-header {
    padding: 16px;
    flex-direction: column;
    gap: 12px;
  }
  
  .year-calendar-nav {
    width: 100%;
    justify-content: space-between;
  }
  
  .period-modal {
    min-width: 300px;
    padding: 24px;
  }
  
  .period-color-picker {
    gap: 8px;
  }
  
  .period-color-option {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .year-calendar-track {
    grid-template-columns: 1fr;
  }
  
  .period-modal {
    min-width: 280px;
    padding: 20px;
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  pointer-events: auto;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

.toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.toast.hiding {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 0.85rem;
  line-height: 1.4;
  text-transform: none;
  color: var(--fg);
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.toast-close:hover {
  color: var(--fg);
}

.toast-action {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toast-action:hover {
  background: var(--fg);
  color: var(--bg);
}

/* Toast types */
.toast.reminder {
  border-color: var(--event-color);
}

.toast.reminder .toast-icon {
  color: var(--event-color);
}

.toast.success {
  border-color: #4caf50;
}

.toast.success .toast-icon {
  color: #4caf50;
}

.toast.error {
  border-color: #d32f2f;
}

.toast.error .toast-icon {
  color: #d32f2f;
}

/* Critical Toast - Slow Pulsing Animation */
.toast.critical {
  border-color: var(--event-color);
  animation: criticalPulse 2.5s ease-in-out infinite;
}

.toast.critical .toast-icon {
  color: var(--event-color);
}

@keyframes criticalPulse {
  0%, 100% {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    border-color: var(--event-color);
  }
  50% {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1), 0 0 0 6px rgba(242, 133, 0, 0.15), 0 0 20px rgba(242, 133, 0, 0.3);
    border-color: #ff9d2e;
  }
}

/* ============================================
   REMINDER MODAL
   ============================================ */
.reminder-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10002;
}

.reminder-modal-overlay.active {
  display: flex;
}

.reminder-modal {
  background: var(--bg);
  border: 2px solid var(--fg);
  padding: 32px;
  min-width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}

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

.reminder-modal-header span {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reminder-modal-close {
  background: transparent;
  border: 1px solid var(--fg);
  color: var(--fg);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reminder-modal-close:hover {
  background: var(--fg);
  color: var(--bg);
}

.reminder-modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reminder-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.reminder-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reminder-form-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
}

.reminder-form-input {
  border: 1px solid var(--line);
  padding: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
  color: var(--fg);
}

.reminder-form-input:focus {
  outline: none;
  border-color: var(--fg);
}

.reminder-form-textarea {
  border: 1px solid var(--line);
  padding: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
  min-height: 60px;
  text-transform: none;
  line-height: 1.5;
}

.reminder-form-textarea:focus {
  outline: none;
  border-color: var(--fg);
}

.reminder-form-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: none;
}

/* Reminder Methods */
.reminder-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reminder-method {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reminder-method:hover {
  border-color: var(--fg);
  background: var(--accent-muted);
}

.reminder-method input[type="checkbox"] {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--fg);
  align-self: center;
}

.reminder-method-icon {
  grid-row: span 2;
  font-size: 1.2rem;
  align-self: center;
}

.reminder-method-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reminder-method-desc {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: none;
}

/* Critical checkbox */
.reminder-critical-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-wrap: wrap;
}

.reminder-critical-label:hover {
  border-color: var(--event-color);
  background: rgba(242, 133, 0, 0.05);
}

.reminder-critical-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--event-color);
}

.reminder-critical-icon {
  font-size: 1rem;
}

.reminder-critical-label span:nth-child(3) {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.reminder-critical-desc {
  width: 100%;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: none;
  padding-left: 30px;
  margin-top: 4px;
}

/* Email section */
.reminder-email-section {
  padding: 16px;
  background: var(--accent-muted);
  border: 1px solid var(--line);
}

.reminder-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Reminder button in event modal */
.calendar-btn.reminder-btn {
  background: transparent;
  border: 1px solid var(--event-color);
  color: var(--event-color);
  width: 100%;
  margin-bottom: 12px;
}

.calendar-btn.reminder-btn:hover {
  background: var(--event-color);
  color: var(--bg);
}

@media (max-width: 720px) {
  .toast-container {
    right: 12px;
    left: 12px;
    max-width: none;
  }
  
  .reminder-modal {
    min-width: 300px;
    padding: 24px;
  }
  
  .reminder-form-row {
    grid-template-columns: 1fr;
  }
}

