:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(10, 23, 42, 0.78);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e5eefc;
  --muted: #aac0e0;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  /* Align with embedded report bundle pages */
  --report-canvas: #0d1927;
  --report-surface-alt: #112133;
  --report-border: #334155;
  --report-text-primary: #ffffff;
  --report-text-secondary: #cbd5e1;
  --report-text-muted: #64748b;
  --report-accent: #789cc4;
  --report-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.2), transparent 30%),
    linear-gradient(180deg, #081120 0%, #040914 100%);
  color: var(--text);
}

body.index-page {
  background: var(--report-canvas);
  color: var(--report-text-primary);
  font-size: 13px;
  line-height: 1.5;
}

.shell {
  width: min(1100px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.shell--report {
  width: min(1400px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 24px 32px 48px;
}

.page-header--compact {
  padding: 1.75rem 2rem;
}

.page-header--compact h1 {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  margin-bottom: 0.75rem;
}

.report-list-heading {
  margin-top: 0;
}

.redirect-fallback {
  margin: 0;
  line-height: 1.7;
}

.hero,
.page-header,
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero,
.page-header {
  padding: 2.5rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
}

h1,
h2 {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.95;
  margin-bottom: 1rem;
}

.lede,
.page-header p,
.card p,
li,
ol,
.site-footer p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button {
  padding: 0.95rem 1.35rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.button:hover,
.back-link:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.back-link:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.28);
}

.primary {
  color: #04111d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.ghost,
.back-link {
  color: var(--text);
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.55);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.stack {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  padding: 1.5rem;
}

.card.span-full {
  grid-column: 1 / -1;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
  color: var(--accent);
}

.report-archive-intro,
.report-archive-empty {
  margin-top: 0;
}

.report-archive-list {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

.report-archive-list a {
  color: var(--accent-strong);
}

.no-reports-pill {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
}

ul,
ol {
  margin: 0;
  padding-left: 1.2rem;
}

.back-link {
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
}

.site-footer {
  margin-top: 1.5rem;
  padding: 0 0.75rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 1rem, 100%);
    padding-top: 1rem;
  }

  .shell--report {
    padding: 16px 16px 32px;
  }

  .hero,
  .page-header,
  .card {
    border-radius: 20px;
  }

  .hero,
  .page-header {
    padding: 1.5rem;
  }
}

/* --- Report index (mirrors bundle header + calendar) --- */

.report-index {
  max-width: 100%;
}

.bundle-page-header {
  margin-bottom: 8px;
}

.bundle-page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.25;
  color: var(--report-text-primary);
}

.bundle-hero {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.35));
  border: 1px solid rgba(51, 65, 85, 0.55);
}

.bundle-hero-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.bundle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.12);
  color: var(--report-text-primary);
  font-size: 11px;
  font-family: var(--report-mono);
}

.bundle-chip-muted {
  border-color: rgba(100, 116, 139, 0.35);
  background: rgba(100, 116, 139, 0.14);
  color: var(--report-text-secondary);
}

.bundle-subtle {
  color: var(--report-text-secondary);
  font-size: 12px;
  margin: 0;
}

.bundle-subtle code {
  font-size: 11px;
  color: var(--report-accent);
}

.bundle-toolbar--index {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.bundle-toolbar-hint {
  font-size: 12px;
  color: var(--report-text-muted);
}

.button--bundle-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--report-text-primary);
  background: rgba(120, 156, 196, 0.18);
  border: 1px solid rgba(120, 156, 196, 0.45);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.button--bundle-primary:hover {
  background: rgba(120, 156, 196, 0.28);
  border-color: rgba(120, 156, 196, 0.65);
}

.report-index-main {
  margin-top: 8px;
}

.report-index .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  margin: 28px 0 14px;
  color: var(--report-text-primary);
}

.report-index .section-title::before {
  content: "";
  display: block;
  width: 3px;
  height: 14px;
  background: var(--report-accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.report-index .section-title:nth-of-type(2) {
  margin-bottom: 10px;
}

.bundle-note {
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(100, 116, 139, 0.12);
  border: 1px solid rgba(100, 116, 139, 0.22);
  color: var(--report-text-secondary);
  font-size: 11px;
}

.calendar-wrap {
  max-width: min(1280px, 100%);
}

.calendar-carousel-shell {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.calendar-carousel-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  margin-top: 18px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(100, 116, 139, 0.35);
  background: rgba(15, 23, 42, 0.45);
  color: var(--report-text-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.calendar-carousel-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(125, 211, 252, 0.45);
}

.calendar-carousel-btn:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.85);
  outline-offset: 2px;
}

.calendar-carousel-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.calendar-carousel {
  --cal-month-gap: 12px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  gap: var(--cal-month-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  container: calendar-track / inline-size;
}

@media (prefers-reduced-motion: reduce) {
  .calendar-carousel {
    scroll-behavior: auto;
  }
}

.calendar-carousel .calendar-month {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding-right: 2px;
}

/* Wider track: show 2 or 3 month grids per row (carousel still scrolls horizontally). */
@container calendar-track (min-width: 720px) {
  .calendar-carousel .calendar-month {
    flex: 0 0 calc((100% - var(--cal-month-gap)) / 2);
    min-width: calc((100% - var(--cal-month-gap)) / 2);
  }
}

@container calendar-track (min-width: 1100px) {
  .calendar-carousel .calendar-month {
    flex: 0 0 calc((100% - 2 * var(--cal-month-gap)) / 3);
    min-width: calc((100% - 2 * var(--cal-month-gap)) / 3);
  }
}

.calendar-month-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--report-text-secondary);
}

.cal-grid {
  --cal-cell-gap: 2px;
  --cal-day-min: 28px;
  display: grid;
  grid-template-columns: repeat(7, minmax(var(--cal-day-min), 1fr));
  gap: var(--cal-cell-gap);
  row-gap: var(--cal-cell-gap);
  max-width: min(400px, 100%);
}

.cal-dow {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--report-text-muted);
  text-align: center;
  padding: 2px 1px;
}

.cal-cell {
  min-height: var(--cal-day-min);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-cell--empty {
  min-height: 0;
}

.cal-day-link,
.cal-day-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--cal-day-min);
  height: var(--cal-day-min);
  min-width: var(--cal-day-min);
  min-height: var(--cal-day-min);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--report-mono);
  box-sizing: border-box;
}

.cal-day-link {
  text-decoration: none;
  color: var(--report-text-primary);
}

.cal-day-btn {
  cursor: pointer;
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  font: inherit;
  color: var(--report-text-primary);
}

.cal-day-link--has,
.cal-day-btn--has {
  color: #ecfdf5;
  background: linear-gradient(150deg, rgba(16, 185, 129, 0.58), rgba(6, 182, 212, 0.48));
  border: 1px solid rgba(110, 231, 183, 0.88);
  box-shadow:
    0 0 18px rgba(34, 197, 94, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.cal-day-link--has:hover,
.cal-day-btn--has:hover {
  color: #ffffff;
  background: linear-gradient(150deg, rgba(52, 211, 153, 0.72), rgba(34, 211, 238, 0.55));
  border-color: rgba(167, 243, 208, 0.95);
  box-shadow:
    0 0 22px rgba(52, 211, 153, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.cal-day-link--today,
.cal-day-btn--today {
  box-shadow:
    0 0 0 2px rgba(94, 234, 212, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cal-day-link--has.cal-day-link--today,
.cal-day-btn--has.cal-day-btn--today {
  box-shadow:
    0 0 0 2px rgba(52, 211, 153, 0.95),
    0 0 16px rgba(34, 197, 94, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cal-day-muted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--cal-day-min);
  height: var(--cal-day-min);
  min-width: var(--cal-day-min);
  min-height: var(--cal-day-min);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--report-mono);
  color: var(--report-text-muted);
}

.cal-day-muted--today {
  color: var(--report-text-primary);
  font-weight: 700;
  background: rgba(94, 234, 212, 0.16);
  border: 1px solid rgba(94, 234, 212, 0.5);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.35);
}

.report-picker-dialog {
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  max-width: calc(100vw - 2rem);
}

.report-picker-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
}

.report-picker-inner {
  background: var(--report-surface-alt);
  border: 1px solid var(--report-border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1rem;
  min-width: min(320px, 92vw);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.report-picker-title {
  margin: 0 0 0.35rem;
  font-size: 15px;
  font-weight: 600;
  color: var(--report-text-primary);
}

.report-picker-date {
  margin: 0 0 0.75rem;
  font-size: 12px;
  font-family: var(--report-mono);
  color: var(--report-accent);
}

.report-picker-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--report-text-muted);
  margin-bottom: 0.35rem;
}

.report-picker-select {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.5rem 0.6rem;
  font-size: 12px;
  font-family: var(--report-mono);
  color: var(--report-text-primary);
  background: var(--report-canvas);
  border: 1px solid var(--report-border);
  border-radius: 8px;
}

.report-picker-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.report-picker-cancel,
.report-picker-open {
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--report-border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--report-text-secondary);
}

.report-picker-open {
  background: rgba(120, 156, 196, 0.22);
  border-color: rgba(120, 156, 196, 0.55);
  color: var(--report-text-primary);
}

.report-picker-open:hover,
.report-picker-cancel:hover {
  filter: brightness(1.08);
}

.day-sections {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 280px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.5) rgba(15, 23, 42, 0.65);
  padding: 12px 14px;
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(22, 36, 54, 0.85), rgba(12, 22, 36, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 1px 2px rgba(2, 6, 23, 0.35);
}

.day-sections::-webkit-scrollbar {
  width: 8px;
}

.day-sections::-webkit-scrollbar-track {
  margin: 6px 0;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 4px;
}

.day-sections::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.day-sections::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
  background-clip: padding-box;
}

.day-report-block {
  background: rgba(17, 33, 51, 0.92);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 8px;
  padding: 8px 10px;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.day-report-block:hover {
  border-color: rgba(71, 85, 105, 0.75);
  background: rgba(19, 38, 58, 0.95);
}

.day-report-block-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0 0 6px;
  font-family: var(--report-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--report-text-primary);
}

.day-report-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--report-text-secondary);
  background: rgba(100, 116, 139, 0.14);
  border: 1px solid rgba(100, 116, 139, 0.28);
}

.report-index .report-archive-list {
  margin: 0;
  padding-left: 1.05rem;
  font-size: 11px;
  line-height: 1.45;
}

.report-index .report-archive-list li {
  margin: 0 0 3px;
}

.report-index .report-archive-list li:last-child {
  margin-bottom: 0;
}

.report-index .report-archive-list a {
  font-family: var(--report-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--report-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.report-index .report-archive-list a:hover {
  color: #9cb4d4;
  border-bottom-color: rgba(156, 180, 212, 0.45);
}

.report-index .report-archive-list a:focus-visible {
  outline: 2px solid rgba(120, 156, 196, 0.75);
  outline-offset: 2px;
  border-radius: 2px;
  border-bottom-color: transparent;
}

.site-footer--report {
  margin-top: 36px;
  padding: 0;
  text-align: left;
}

.site-footer--report p {
  font-size: 11px;
  color: var(--report-text-muted);
}
