:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #e9eef8;
  --ink: #111827;
  --muted: #586374;
  --line: #d6deea;
  --blue: #2457f5;
  --blue-dark: #1535a7;
  --lime: #c6f432;
  --lime-soft: #f1ffc9;
  --aqua-soft: #e8fbff;
  --aqua-deep: #006b76;
  --coral: #ff5a3d;
  --coral-deep: #9f2d1d;
  --shadow: 0 18px 46px rgba(17, 24, 39, 0.12);
  --shadow-soft: 0 10px 24px rgba(17, 24, 39, 0.08);
  --radius: 16px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.calendar-page {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Aptos, "Segoe UI", Arial, system-ui, sans-serif;
  line-height: 1.5;
}

body.calendar-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(198, 244, 50, 0.18) 0 22%, transparent 22% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(243, 246, 251, 0.82));
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(36, 87, 245, 0.35);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-140%);
  border-radius: 12px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  padding: 10px 12px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.calendar-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.calendar-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(243, 246, 251, 0.88);
  border-bottom: 1px solid rgba(214, 222, 234, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner,
.calendar-brand,
.calendar-nav,
.feed-actions,
.feed-url-row,
.next-topline,
.next-actions,
.agenda-header,
.agenda-item,
.agenda-actions,
.footer-inner,
.footer-links {
  display: flex;
  align-items: center;
}

.header-inner {
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}

.calendar-brand {
  min-width: 0;
  gap: 12px;
  text-decoration: none;
}

.calendar-brand img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  color: var(--ink);
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-text small,
.calendar-intro p,
.feed-url-label,
.copy-status,
.agenda-count,
.agenda-main span,
.calendar-footer {
  color: var(--muted);
}

.brand-text small {
  font-size: 0.88rem;
  font-weight: 700;
}

.calendar-nav {
  justify-content: flex-end;
  gap: 8px;
}

.calendar-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--blue-dark);
  font-weight: 800;
  padding: 0 14px;
  text-decoration: none;
}

.calendar-nav a:hover,
.calendar-nav a:focus-visible,
.calendar-nav a[aria-current="page"] {
  background: #ffffff;
  border-color: var(--line);
}

.calendar-hero {
  padding: 34px 0 20px;
}

.hero-grid,
.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(390px, 1.15fr);
  gap: 18px;
  align-items: stretch;
}

.calendar-intro,
.feed-panel,
.next-panel,
.agenda-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-intro {
  min-height: 360px;
  display: grid;
  align-content: end;
  padding: 34px;
}

.calendar-intro h1,
.feed-panel h2,
.next-panel h2,
.agenda-panel h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Aptos Display", Aptos, "Segoe UI", Arial, system-ui, sans-serif;
  font-weight: 850;
  letter-spacing: 0;
}

.calendar-intro h1 {
  max-width: 640px;
  font-size: 4rem;
  line-height: 0.95;
}

.calendar-intro p {
  max-width: 560px;
  margin: 18px 0 0;
  font-size: 1.12rem;
  line-height: 1.55;
}

.feed-panel {
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 28px;
}

.feed-label {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  margin: 0 0 14px;
  border-radius: 999px;
  background: var(--lime);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
  padding: 0 10px;
}

.feed-panel h2 {
  font-size: 2.35rem;
  line-height: 1;
}

.feed-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.feed-actions a,
.next-actions a,
.feed-url-row button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
  padding: 0 14px;
  text-align: center;
  text-decoration: none;
}

.feed-primary {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.feed-secondary {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--blue-dark);
}

.feed-url-label {
  font-size: 0.86rem;
  font-weight: 900;
}

.feed-url-row {
  gap: 8px;
}

.feed-url-row input {
  min-width: 0;
  min-height: 48px;
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  padding: 0 12px;
}

.feed-url-row button {
  flex: 0 0 auto;
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.copy-status {
  min-height: 1.4em;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.calendar-board {
  padding: 0 0 72px;
}

.next-panel {
  position: sticky;
  top: 92px;
  overflow: hidden;
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 28px;
  background: var(--blue);
  color: #ffffff;
}

.next-panel::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -76px;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  background: var(--lime);
  opacity: 0.22;
}

.next-panel > * {
  position: relative;
  z-index: 1;
}

.next-topline {
  justify-content: space-between;
  gap: 12px;
}

.next-topline span,
.agenda-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
  padding: 0 10px;
  white-space: nowrap;
}

.next-topline span:first-child {
  background: var(--lime);
  color: var(--ink);
}

.next-topline span:last-child {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.next-panel p {
  margin: 0;
}

#nextModule {
  width: fit-content;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.24);
  color: #ffffff;
  font-weight: 900;
  padding: 0 10px;
}

.next-panel h2 {
  color: #ffffff;
  font-size: 2.8rem;
  line-height: 1;
}

#nextSummary {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  line-height: 1.6;
}

.next-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 8px;
}

.next-actions a {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.next-actions a:first-child {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
}

.agenda-panel {
  padding: 24px;
  box-shadow: var(--shadow-soft);
}

.agenda-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.agenda-panel h2 {
  font-size: 2.4rem;
  line-height: 1;
}

#agendaCount {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.agenda-list {
  display: grid;
  gap: 10px;
}

.agenda-month {
  margin: 18px 0 4px;
  color: var(--blue-dark);
  font-size: 0.95rem;
  font-weight: 900;
}

.agenda-month:first-child {
  margin-top: 0;
}

.agenda-item {
  min-height: 112px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(92px, auto);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 16px;
}

.agenda-date {
  width: 58px;
  height: 64px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--blue-dark);
}

.agenda-date span {
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.agenda-date small {
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.agenda-main {
  min-width: 0;
}

.agenda-main p,
.agenda-main h4,
.agenda-main span {
  margin: 0;
}

.agenda-main p {
  color: var(--blue-dark);
  font-weight: 900;
}

.agenda-main h4 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.2;
}

.agenda-main span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.agenda-actions {
  align-self: stretch;
  justify-content: space-between;
  flex-direction: column;
  gap: 10px;
}

.agenda-actions.no-link {
  justify-content: center;
}

.agenda-status {
  background: var(--aqua-soft);
  color: var(--aqua-deep);
}

.agenda-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--blue-dark);
  font-weight: 900;
  padding: 0 12px;
  text-decoration: none;
}

.agenda-empty {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
  padding: 18px;
  text-align: center;
}

.calendar-footer {
  padding: 28px 0;
  background: #ffffff;
}

.footer-inner {
  justify-content: space-between;
  gap: 20px;
}

.footer-inner p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
}

.footer-links {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.footer-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 980px) {
  .hero-grid,
  .board-grid {
    grid-template-columns: 1fr;
  }

  .calendar-intro {
    min-height: 0;
  }

  .next-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 680px) {
  .calendar-shell {
    width: min(100% - 28px, 1180px);
  }

  .header-inner {
    flex-wrap: wrap;
    min-height: 64px;
    gap: 8px;
    padding: 10px 0 12px;
  }

  .brand-text small {
    display: none;
  }

  .calendar-brand,
  .calendar-nav {
    width: 100%;
  }

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

  .calendar-nav a {
    flex: 1 1 0;
    padding: 0 8px;
  }

  .calendar-intro,
  .feed-panel,
  .next-panel,
  .agenda-panel {
    padding: 18px;
    border-radius: 16px;
  }

  .calendar-intro h1 {
    font-size: 2.55rem;
  }

  .calendar-intro p {
    font-size: 1rem;
  }

  .feed-panel h2,
  .next-panel h2,
  .agenda-panel h2 {
    font-size: 2rem;
  }

  .feed-actions,
  .next-actions,
  .agenda-item {
    grid-template-columns: 1fr;
  }

  .feed-url-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agenda-header {
    display: grid;
    gap: 8px;
  }

  #agendaCount {
    text-align: left;
  }

  .agenda-actions {
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Keep every header destination available on phones and narrow tablets. */
@media (max-width: 960px) {
  .calendar-header {
    position: static;
  }

  .calendar-header .header-inner {
    display: flex !important;
    flex-wrap: wrap;
    min-height: 0;
    gap: 8px;
    padding-block: 10px 12px;
  }

  .calendar-header .calendar-brand {
    width: 100%;
    min-width: 0;
  }

  .calendar-header .calendar-nav {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)) !important;
    align-items: stretch !important;
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  .calendar-header .calendar-nav a {
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .calendar-header .calendar-brand strong {
    white-space: normal;
  }
}
