
  :root {
    --off-white: #FAF7F2;
    --white: #FFFFFF;
    --navy: #2B5482;
    --charcoal: #1A1A1A;
    --border: #E4DFD4;
    --gold: #C9922A;
    --light-blue: #6399BB;
    --tan: #AC9D83;
    --burgundy: #984B47;
    --orange: #EB8B3D;

    /* System color families */
    --sys-blue: #6399BB;
    --sys-tan: #AC9D83;
    --sys-burgundy: #984B47;
    --sys-navy: #2B5482;
    --sys-orange: #EB8B3D;
    --sys-gold: #C9922A;
  }

  * { box-sizing: border-box; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    color: var(--charcoal);
    margin: 0;
    padding: 48px 24px 64px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
  }

  .page {
    width: 100%;
    max-width: 1100px;
    position: relative;
    z-index: 2;
  }

  /* ===== Header ===== */
  .header {
    text-align: center;
    margin-bottom: 32px;
  }

  .brand-logo {
    display: inline-block;
    margin-bottom: 18px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .brand-logo img {
    display: block;
    width: 72px;
    height: auto;
  }

  .brand-logo:hover {
    transform: translateY(-1px);
    opacity: 0.85;
  }

  .eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--navy);
    margin-bottom: 14px;
  }

  .eyebrow a,
  .footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, opacity 0.2s ease;
  }

  .eyebrow a:hover,
  .footer a:hover {
    border-bottom-color: var(--gold);
    opacity: 0.85;
  }

  h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(40px, 5.5vw, 64px);
    line-height: 1.05;
    color: var(--navy);
    margin: 0 0 14px;
    letter-spacing: -0.01em;
  }

  h1 em {
    font-style: italic;
    color: var(--gold);
    font-weight: 700;
  }

  .subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: var(--charcoal);
    opacity: 0.75;
    margin: 0 auto;
    max-width: 620px;
    line-height: 1.5;
  }

  /* ===== Status bar ===== */
  .status-bar {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 28px;
    margin: 32px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
  }

  .status-left {
    flex: 1 1 280px;
    min-width: 0;
  }

  .status-eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--navy);
    opacity: 0.55;
    margin-bottom: 6px;
  }

  .status-headline {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--navy);
    line-height: 1.2;
    margin: 0 0 12px;
  }

  .progress-track {
    position: relative;
    height: 8px;
    background: var(--off-white);
    border-radius: 4px;
    overflow: hidden;
  }

  .progress-fill {
    position: absolute;
    inset: 0 100% 0 0;
    background: linear-gradient(90deg, var(--gold) 0%, #E0AB47 100%);
    border-radius: 4px;
    transition: right 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--charcoal);
    opacity: 0.6;
  }

  .milestones {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .milestone {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--off-white);
    border: 1px solid var(--border);
    color: var(--charcoal);
    opacity: 0.4;
    transition: all 0.4s ease;
  }
  .milestone.hit {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
    opacity: 1;
    transform: scale(1);
  }
  .milestone.just-hit {
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  @keyframes popIn {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }

  .countdowns {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
  }

  .countdown {
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    text-align: center;
    min-width: 120px;
  }

  .countdown.exam-cd { border-color: var(--navy); }
  .countdown.review-cd { border-color: var(--gold); }

  .countdown-number {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
    color: var(--navy);
  }

  .countdown.review-cd .countdown-number { color: var(--gold); }

  .countdown-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--charcoal);
    opacity: 0.7;
    margin-top: 4px;
    line-height: 1.3;
  }

  .countdown.passed {
    opacity: 0.4;
  }

  /* ===== Ornament ===== */
  .ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 24px;
  }

  .ornament .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--navy);
    opacity: 0.3;
  }

  /* ===== Weekday header ===== */
  .weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
  }

  .weekday {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--navy);
    opacity: 0.6;
    text-align: center;
    padding: 6px 0;
  }

  /* ===== Calendar grid ===== */
  .week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
  }

  .day {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: 6px;
    min-height: 148px;
    padding: 14px 14px 28px 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
    opacity: 0;
    transform: translateY(8px);
  }

  .day.loaded {
    opacity: 1;
    transform: translateY(0);
  }

  .day:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(43, 84, 130, 0.08);
  }

  .day.empty {
    background: transparent;
    border: 1px dashed var(--border);
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
  }

  .day.empty:hover {
    transform: none;
    box-shadow: none;
  }

  /* System color bars (3px left border) */
  .day.sys-blue { border-left-color: var(--sys-blue); }
  .day.sys-tan { border-left-color: var(--sys-tan); }
  .day.sys-burgundy { border-left-color: var(--sys-burgundy); }
  .day.sys-navy { border-left-color: var(--sys-navy); }
  .day.sys-orange { border-left-color: var(--sys-orange); }
  .day.sys-gold { border-left-color: var(--sys-gold); }

  .day-number {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 26px;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 10px;
  }

  .day-number .month-tag {
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-left: 4px;
    vertical-align: middle;
  }

  .topic {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--charcoal);
    line-height: 1.35;
    margin-top: auto;
  }

  .holiday-note {
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 4px;
  }

  .split {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
  }

  .split .seg {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }

  .split .label {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--gold);
    min-width: 20px;
  }

  .split .topic {
    margin-top: 0;
    font-size: 13px;
    line-height: 1.3;
  }

  .split-divider {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
  }

  /* ===== Special day treatments ===== */
  .day.exam {
    background: var(--navy);
    border-color: var(--navy);
    border-left-color: var(--gold) !important;
  }

  .day.exam .day-number,
  .day.exam .topic {
    color: var(--white);
  }

  .day.exam .day-number { color: var(--gold); }

  .day.exam .badge {
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
  }

  .day.review {
    background: var(--off-white);
    border: 2px solid var(--gold);
    border-left: 4px solid var(--gold);
  }

  .day.review .badge {
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
  }

  /* ===== TODAY highlight ===== */
  .day.today {
    box-shadow: 0 0 0 2px var(--gold), 0 6px 22px rgba(201, 146, 42, 0.18);
    transform: translateY(-2px);
  }

  .today-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 0 rgba(201, 146, 42, 0.7);
    animation: pulse 2s infinite;
  }

  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(201, 146, 42, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(201, 146, 42, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 146, 42, 0); }
  }

  /* ===== Completed state ===== */
  .day.complete {
    background: #F3EFE6;
    opacity: 0.78;
  }

  .day.complete.exam { background: #1F3F66; }
  .day.complete.review { background: #F0E8D4; }

  .check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--border);
    color: transparent;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.18s ease;
    z-index: 3;
  }

  .check:hover {
    border-color: var(--gold);
    background: rgba(201, 146, 42, 0.08);
  }

  .day.complete .check {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
  }

  .day.exam .check { border-color: rgba(255, 255, 255, 0.35); }
  .day.exam.complete .check { border-color: var(--gold); }

  /* When TODAY is also complete, hide today-dot since check takes the corner */
  .day.complete .today-dot { display: none; }
  /* When showing check button, today-dot moves to top-left */
  .today-dot { left: 8px; right: auto; }

  /* Cell hover affordance: subtle arrow appears bottom-right to signal click-to-open */
  .day .open-hint {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    transform: translateX(-4px);
    pointer-events: none;
    white-space: nowrap;
  }
  .day:not(.empty):hover .open-hint {
    opacity: 0.7;
    transform: translateX(0);
  }
  .day.exam .open-hint { color: var(--gold); }
  .day.review .open-hint { color: var(--gold); }

  /* ===== Legend ===== */
  .legend {
    margin-top: 40px;
    padding: 24px 28px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 28px 32px;
    justify-content: center;
  }

  .legend-section {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
  }

  .legend-section + .legend-section {
    border-left: 1px solid var(--border);
    padding-left: 32px;
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
  }

  .legend-stripe {
    width: 6px;
    height: 22px;
    border-radius: 2px;
  }

  .stripe-blue { background: var(--sys-blue); }
  .stripe-tan { background: var(--sys-tan); }
  .stripe-burgundy { background: var(--sys-burgundy); }
  .stripe-navy { background: var(--sys-navy); }
  .stripe-orange { background: var(--sys-orange); }
  .stripe-gold { background: var(--sys-gold); }

  .swatch-exam { background: var(--navy); }
  .swatch-review { background: var(--off-white); border: 2px solid var(--gold); }
  .swatch-today { background: var(--gold); border-radius: 50%; }

  .legend-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--charcoal);
  }

  .legend-label .key {
    color: var(--navy);
    font-weight: 600;
  }

  /* ===== Reset link ===== */
  .controls {
    margin-top: 20px;
    text-align: center;
  }

  .reset-link {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--navy);
    opacity: 0.5;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    transition: opacity 0.2s ease;
  }

  .reset-link:hover { opacity: 1; }

  /* ===== Footer ===== */
  .footer {
    margin-top: 24px;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--navy);
    opacity: 0.5;
  }

  /* ===== Confetti canvas ===== */
  #confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
  }

  /* ===== Reduced motion ===== */
  @media (prefers-reduced-motion: reduce) {
    .day { transition: none; opacity: 1; transform: none; }
    .today-dot { animation: none; }
    .progress-fill { transition: none; }
  }

  /* ===== Mobile tweaks ===== */
  @media (max-width: 720px) {
    body { padding: 24px 12px 48px; }
    .week, .weekdays { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .weekday { display: none; }
    .day { min-height: 84px; }
    .status-bar { flex-direction: column; align-items: stretch; }
    .countdowns { justify-content: center; }
  }

  @media print {
    body { padding: 0; background: var(--white); }
    .page { max-width: none; }
    .controls, #confetti-canvas { display: none; }
    .day { opacity: 1 !important; transform: none !important; }
  }

  /* Mariham fork additions */
  .day.off { background: #F2F2F2; }
  .day.off .topic { color: #6B6B6B; }
  .day.kenya { background: #FDF0E4; cursor: default; }
  .day.kenya .topic { color: var(--orange); }
  .split .label { white-space: nowrap; }
  .mt-how { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 28px 0 0; }
  .mt-box { background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--gold); padding: 18px 20px; border-radius: 8px; }
  .mt-box p { margin: 0 0 8px; line-height: 1.55; font-size: 15px; }
  .mt-eye { font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--navy); margin-bottom: 10px; }
