/* =========================
   0) FOUNDATIONS & TOKENS
   ========================= */

/* Load font FIRST */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Design Tokens (easy to tweak) ---------- */
:root {
  --igc-bg: #ffffff;
  --igc-surface: #ffffff;
  --igc-border: #e6e6e6;
  --igc-muted: #6b7280;
  --igc-text: #1f2937;

  --igc-link: #1b6ac9;
  --igc-link-hover: #0f56a9;

  --igc-shadow: 0 2px 6px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);

  /* GH = red family (lighter tint to match tag hue) */
  --igc-gh-bg: #fde8e8;
  --igc-gh-border: #f5b5b5;
  --igc-gh-text: #9f1d1d;

  /* RH = green family (lighter tint to match tag hue) */
  --igc-rh-bg: #e6f7ed;
  --igc-rh-border: #a8e0bf;
  --igc-rh-text: #166f3c;

  /* TN = amber */
  --igc-tn-bg: #fff6d9;
  --igc-tn-border: #f3c878;
  --igc-tn-text: #8a5b00;

  /* Weekends align with GH red */
  --igc-wknd-bg: var(--igc-gh-bg);

  --igc-today: #ff9a2b;   /* today outline + tag */
  --igc-focus: #2563eb;

  --igc-radius-lg: 16px;
  --igc-radius-md: 12px;
  --igc-radius-sm: 10px;
  --igc-tag-minw: 2.8ch;
  --igc-gap: 12px;
  --igc-pad: 14px;

  --igc-title-size: 22px;
  --igc-daynum-size: 19px;
  --igc-daytitle-size: 14px;
  --igc-daydesc-size: 12.5px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* =========================
   1) GLOBAL LAYOUT GUARDS
   ========================= */
*, *::before, *::after { box-sizing: border-box; }
.igc-grid > .day-card { min-width: 0; }
.day-title { overflow-wrap: anywhere; word-break: break-word; }

/* =========================
   2) CORE WRAPPER & HEADER
   ========================= */

/* ---------- Wrapper ---------- */
.igc-calendar-wrap {
  border: 1px solid var(--igc-border);
  border-radius: var(--igc-radius-lg);
  padding: var(--igc-pad);
  background:
    radial-gradient(1200px 600px at 100% -20%, rgba(27,106,201,.06), transparent 40%),
    radial-gradient(900px 400px at -10% 120%, rgba(46,124,81,.06), transparent 45%),
    var(--igc-surface);
  box-shadow: var(--igc-shadow);
  color: var(--igc-text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- Header ---------- */
.igc-calendar-header {
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center;
  margin-bottom: 14px;
}
.igc-nav-left   { justify-self: start;  text-align: left; }
.igc-month-title{ justify-self: center; text-align: center; font-weight: 700; font-size: var(--igc-title-size); letter-spacing: .2px; }
.igc-nav-right  { justify-self: end;    text-align: right; }

.igc-nav-link, .igc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 1;
  transition: all .15s ease;
}
/* Header nav links use tokens */
.igc-nav-link{ color: var(--igc-text); }
.igc-nav-link:hover{ color: var(--igc-link); }

.igc-btn--primary { background: #1b6ac9; color: #fff; border-color: #1b6ac9; }
.igc-btn--primary:hover { background: #15579f; border-color: #15579f; }
.igc-btn--ghost { background: #f9fafb; border-color: #d1d5db; color: #374151; }
.igc-btn--ghost:hover { background: #f3f4f6; }

/* =========================
   3) LEGENDS & PILLS (CORE)
   ========================= */
.pill {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,.05) inset;
}
.pill-gh { background: var(--igc-gh-bg); color: var(--igc-gh-text); border-color: var(--igc-gh-border); }
.pill-rh { background: var(--igc-rh-bg); color: var(--igc-rh-text); border-color: var(--igc-rh-border); }
.pill-neutral { background:#f4f4f4; color:#555; border-color:#ddd; }
/* =========================
   4) WEEKDAY HEADER & GRID
   ========================= */
.igc-weekdays {
  display:grid; grid-template-columns: repeat(7,1fr);
  gap: var(--igc-gap); margin: 4px 0 8px;
}
.igc-weekdays > div {
  text-align:center; font-size:13px; font-weight:600; text-transform:uppercase;
  letter-spacing:.5px; color: var(--igc-muted); padding: 4px 0;
}
.igc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--igc-gap);
}


/* =========================
   5) DAY CARDS (BASE & TYPES)
   ========================= */
.day-card {
  position:relative;
  min-height: 98px;
  padding: 10px;
  border-radius: var(--igc-radius-md);
  border: 1px solid var(--igc-border);
  background: var(--igc-bg);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease, background .18s ease;
}
.day-card.elevated { box-shadow: 0 1px 0 rgba(0,0,0,.04) inset, var(--igc-shadow); }
.day-card.blank { background: transparent; border: none; box-shadow: none; }

.day-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}
.day-card:focus-within { outline: 3px solid var(--igc-focus); outline-offset: 2px; }

.day-num { font-weight: 800; font-size: var(--igc-daynum-size); color: var(--igc-text); position: relative; z-index: 1; }
.day-card.today .day-num { margin-top: 16px; }

.day-title {
  margin-top: 6px;
  font-size: var(--igc-daytitle-size);
  font-weight: 600;
  letter-spacing: .2px;
  line-height: 1.3;
  color: var(--igc-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.day-card.gh { background: var(--igc-gh-bg); border-color: var(--igc-gh-border); color: var(--igc-gh-text); }
.day-card.rh { background: var(--igc-rh-bg); border-color: var(--igc-rh-border); color: var(--igc-rh-text); }
.day-card.tn { background: var(--igc-tn-bg); border: 2px dashed var(--igc-tn-border); color: var(--igc-tn-text); }

.day-card.wknd { background: var(--igc-gh-bg); border-color: var(--igc-gh-border); color: var(--igc-gh-text); }

.day-card.today { box-shadow: 0 0 0 2px var(--igc-today) inset, var(--igc-shadow); border-color: var(--igc-today); --today-accent: var(--igc-today); }

.parliament-logo {
  position:absolute; right:8px; top:8px;
  width:22px; height:22px; object-fit:contain;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.2));
  z-index: 10;
  pointer-events: none; /* NEW: don't block clicks */
}
/* =========================
   6) UPCOMING CARDS (UNDER NAV) — LAYOUT ONLY
   ========================= */
.igc-upcoming-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;   /* fixed three columns */
  margin: 10px 0 16px;
  align-items: start;
  gap: var(--igc-gap);
}
.igc-up-left  { justify-self: start; }
.igc-up-center{ }
.igc-up-right { justify-self: end; }

/* (All card-level styles live in css/next.css now) */

/* =========================
   7) RESPONSIVE (CORE LAYOUT)
   ========================= */
@media (max-width: 720px) {
  :root { --igc-gap: 10px; --igc-pad: 12px; }
  .igc-month-title { font-size: 20px; }
  .day-card { min-height: 92px; padding: 9px; }
}
@media (max-width: 480px) {
  :root { --igc-gap: 8px; --igc-pad: 10px; --igc-daynum-size: 16px; }
  .day-card { min-height: 86px; padding: 8px; }
  .day-title { -webkit-line-clamp: 2; }
}

/* =========================
   8) PRINT
   ========================= */
@media print {
  .igc-calendar-wrap { box-shadow: none; background:#fff; }
  .igc-nav-left, .igc-nav-right, .igc-upcoming-grid { display:none !important; }
  .igc-grid { gap: 6px; }
  .day-card { break-inside: avoid; }
}

/* =========================
   9) STATES
   ========================= */
.day-card.is-active { transform: translateY(0); box-shadow: 0 0 0 2px var(--igc-focus) inset; }

/* =========================
   10) MICRO-TAGS (DESKTOP BASE)
   ========================= */
.micro-tag {
  position: absolute;
  font-size: 0.65rem;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  z-index: 3;
  line-height: 1.2;
  white-space: nowrap;
}
.micro-tag.micro-gh { background: #b30000; color: #fff; border: 1px solid #b30000; }
.micro-tag.micro-rh { background: #28a745; color: #fff; border: 1px solid #28a745; }
.micro-tag.micro-tn { background: #fffaf0; color: #8a5b00; border: 1px solid #f3c878; }
.micro-tag.micro-dual { background: #111; color: #fff; }
.micro-tag.micro-top { top: 5px; right: 5px; }
.micro-tag.micro-bottom { bottom: 5px; right: 5px; }

.day-card.wknd-has-rh { box-shadow: inset 3px 0 0 rgba(22,101,52,0.85), var(--igc-shadow); }
.day-card.gh-wknd     { box-shadow: inset 3px 0 0 rgba(127,29,29,0.9), var(--igc-shadow); }

.micro-tag.micro-today {
  top: 4px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  background: var(--today-accent, var(--igc-today));
  color: #fff;
  border: 1px solid var(--today-accent, var(--igc-today));
}

/* =========================
   11) MOBILE — CORE (≤ 560px)
   ========================= */
@media (max-width: 560px) {
  :root {
    --igc-gap: 10px;
    --igc-pad: 12px;
    --igc-daynum-size: 16px;
    --igc-day-height-mobile: 84px;
  }

  .igc-upcoming-grid { grid-template-columns: 1fr; row-gap: 8px; }
  .igc-up-left, .igc-up-right { justify-self: center; }

  .day-card {
    height: var(--igc-day-height-mobile);
    min-height: 0;
    padding: 8px 8px 24px;
    overflow: visible;
  }

  .day-card .day-num { margin-bottom: 2px; }

  .day-title {
    font-size: 12px;
    line-height: 1.2;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* =========================
   12) LEGENDS — LAYOUT OVERRIDES & WEEKEND PILL
   ========================= */
.igc-legends-left { display: flex; gap: 8px; flex-wrap: wrap; }

.pill-weekend {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #b0b0b0;
  font-weight: 500;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* Weekend Overlap label: desktop vs mobile */
.igc-legends .pill-weekend .wknd-long { display: inline; }
.igc-legends .pill-weekend .wknd-short { display: none; }

@media (max-width: 560px) {
  .igc-legends .pill-weekend .wknd-long { display: none !important; }
  .igc-legends .pill-weekend .wknd-short { display: inline !important; font-size: 13px; }
}

/* =========================
   14) CALENDAR FOOTER (TRIVIA LINK)
   ========================= */
.igc-calendar-footer {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.igc-calendar-footer .pill-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  background: #f9fafb;
  color: #374151;
  border: 1px solid #b0b0b0;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.igc-calendar-footer .pill-link:hover { background: #f3f4f6; }
.igc-calendar-footer .pill-icon { flex-shrink: 0; }

/* =========================
   15) LEGENDS — NEUTRAL & CE
   ========================= */
.igc-legends .pill-neutral {
  background: #f3f4f6; color: #374151; border: 1px solid #b0b0b0;
  font-weight: 500; font-size: 13px; padding: 5px 12px;
  border-radius: 999px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* =========================
   MICRO-TAG (MOBILE ≤560px)
   ========================= */
@media (max-width: 560px) {
  .day-card .micro-tag {
    position: absolute !important;
    top: auto !important;
    bottom: 6px !important;
    left: 0 !important;
    right: 0 !important;
    margin-inline: auto !important;   /* ✅ center horizontally */
    transform: none !important;
    display: inline-block !important;
    box-sizing: border-box !important;

    /* ✅ fit content but keep margins inside card */
    min-width: fit-content !important;
    max-width: calc(100% - 30px) !important;

    font-size: 10px !important;
    line-height: 1.1 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    text-align: center !important;

    background-clip: padding-box !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


  /* RH always bottom when present */
  .day-card .micro-tag.micro-rh:not(.micro-today) {
    bottom: 6px !important;
  }

  /* GH only (no RH, no TN) → treat like RH and center bottom */
  .day-card .micro-tag.micro-gh:not(.micro-today):only-of-type {
    bottom: 6px !important;
  }

  /* GH when RH also exists → stack above */
  .day-card .micro-tag.micro-gh:not(.micro-today):not(:only-of-type) {
    bottom: 24px !important;
  }

  /* TN alone → center bottom */
  .day-card .micro-tag.micro-tn:not(.micro-today):only-of-type {
    bottom: 6px !important;
  }

  /* Today tag always top center */
  .day-card .micro-tag.micro-today {
    top: 4px !important;
    bottom: auto !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
    padding: 2px 6px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    text-align: center !important;
    max-width: calc(100% - 15px) !important; /* ✅ same margin for Today */
  }
}

/* --- Optional: hide TODAY tag on small & mid widths --- */
@media (max-width: 720px) {
  .micro-tag.micro-today { display: none !important; }
  .day-card.today .day-num { margin-top: 0 !important; }
}


/* =========================
   17) LEGENDS — CUSTOM EVENT PILL (MATCH WEEKEND)
   ========================= */
.igc-legends .pill-ce {
  background: #f3f4f6; color: #374151; border: 1px solid #b0b0b0;
  font-weight: 500; font-size: 13px; padding: 5px 12px;
  border-radius: 999px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: inline-flex; align-items: center; gap: 6px;
}
.igc-legends .pill-ce .pill-logo { width: 16px; height: 16px; object-fit: contain; }

/* =========================
   18) PARLIAMENT LOGO + RH/TN INTERACTIONS
   ========================= */
@media (max-width: 560px) {
  .parliament-logo {
    top: auto !important; bottom: 6px !important;
    left: 50% !important; right: auto !important;
    transform: translateX(-50%) !important;
    width: 20px; height: 20px; display: block; z-index: 10;
  }
}

@media (min-width: 561px) {
  /* Modern browsers with :has() */
  .day-card:has(.parliament-logo):has(.micro-tag.micro-rh) .parliament-logo {
    top: auto !important; bottom: 6px !important;
    right: 8px !important; left: auto !important;
    transform: none !important; z-index: 10;
  }

  /* Lift RH/TN tag so it doesn’t collide with the logo */
  .day-card:has(.parliament-logo) .micro-tag.micro-bottom.micro-rh,
  .day-card:has(.parliament-logo) .micro-tag.micro-bottom.micro-tn {
    bottom: 34px !important;
  }

  /* Fallback if :has() isn’t supported and you add .has-parliament in markup */
  .day-card.has-parliament .parliament-logo {
    top: auto !important; bottom: 6px !important;
    right: 8px !important; left: auto !important;
    transform: none !important; z-index: 10;
  }
  .day-card.has-parliament .micro-tag.micro-bottom.micro-rh,
  .day-card.has-parliament .micro-tag.micro-bottom.micro-tn {
    bottom: 34px !important;
  }
}


/* =========================
   19) LEGENDS — MOBILE COMPACT COUNTS
   ========================= */
@media (max-width: 560px) {
  .igc-legends .pill { position: relative; display: inline-flex; align-items: center; gap: 6px; }

  /* Only compress these pills; leave .pill-ce alone so its text shows */
  .igc-legends .pill-gh,
  .igc-legends .pill-rh,
  .igc-legends .pill-tn,
  .igc-legends .pill-neutral { font-size: 0; }

  /* SHOW the CE title text (from PHP) */
  .igc-legends .pill-ce { font-size: 13px; }

  .igc-legends .pill img,
  .igc-legends .pill svg { transform: none; }

  .igc-legends .pill .pill-count { font-size: 13px; }

  .igc-legends .pill-gh::before { content: "GH · "; font-size: 13px; }
  .igc-legends .pill-rh::before { content: "RH · "; font-size: 13px; }
  .igc-legends .pill-tn::before { content: "Tent · "; font-size: 13px; }
  .igc-legends .pill-neutral::after { content: "No GH/RH"; font-size: 13px; }
}
/* =========================
   20) TENTATIVE PILL (GLOBAL)
   ========================= */
.pill-tn {
  background: var(--igc-tn-bg);
  color: var(--igc-tn-text);
  border: 1px solid var(--igc-tn-border);
  font-weight: 500;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
/* =========================
   21) MOBILE — HEADER ROW COMPACT
   ========================= */
@media (max-width: 560px) {
  .igc-calendar-header{
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    row-gap: 0 !important;
  }
  .igc-nav-left{
    grid-column: 1 !important;
    justify-self: start !important;
    text-align: left !important;
  }
  .igc-month-title{
    grid-column: 2 !important;
    justify-self: center !important;
    text-align: center !important;
  }
  .igc-nav-right{
    grid-column: 3 !important;
    justify-self: end !important;
    text-align: right !important;
  }
  .igc-btn { padding: 6px 10px; font-size: 13px; }
}

/* =========================
   22) SPACING — TITLE / LEGENDS / WEEKDAYS
   ========================= */
.igc-month-title { margin-bottom: 50px; }
.igc-legends {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;                 /* or var(--igc-gap) if you prefer tokenized */
  margin-top: 50px;
  margin-bottom: 25px;
}


/* =========================
   25) JUMP BAR (YEAR/MONTH SELECT)
   ========================= */
.igc-jumpbar{
  display:flex;
  justify-content:flex-end;  /* keep on the right */
  width:100%;
  margin-bottom:8px;
}
.igc-jump-form{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:nowrap;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  max-width:100%;
}
.igc-jump-form select{
  padding:6px 8px;
  border:1px solid var(--igc-border);
  border-radius:8px;
  font-size:14px;
  background:var(--igc-bg);
  color:var(--igc-text);
}
.igc-jump-form .igc-btn{ white-space:nowrap; }
.igc-jump-form::-webkit-scrollbar{ height:6px; }
.igc-jump-form::-webkit-scrollbar-thumb{ background:#c7d2fe; border-radius:4px; }

/* =========================
   26) MOBILE HOLIDAY LIST (BELOW GRID)
   ========================= */
/* Hide titles ONLY on mobile (keep them on desktop) */
@media (max-width: 560px) {
  .igc-grid .day-title { display: none; }
}

/* Show list on ALL devices (desktop + mobile) */
.igc-mobile-list {
  display: block;
  margin: 10px 0 14px;
}
  .ml-date {
    border: 1px solid var(--igc-border); background: var(--igc-bg);
    border-radius: 10px; padding: 10px; margin-bottom: 8px; box-shadow: var(--igc-shadow);
    transition: box-shadow 0.3s ease;
  }
  .ml-date-badge { font-weight: 700; font-size: 14px; color: var(--igc-text); margin-bottom: 6px; }
  .ml-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 6px 0; border-top: 1px dashed #e5e7eb;
  }
  .ml-row:first-of-type { border-top: none; padding-top: 0; }
  .ml-title { font-size: 14px; color: var(--igc-text); line-height: 1.35; flex: 1 1 auto; min-width: 0; }

  .ml-row .micro-tag.micro-inline {
    position: static !important; display: inline-block !important; margin-left: 8px;
  }
  .ml-row .ml-title + .micro-tag.micro-inline { margin-left: 8px; }

.ml-date.ml-flash { animation: mlPulse 5000ms ease-out 1; }
@keyframes mlPulse {
  0% { box-shadow: 0 0 0 3px rgba(59,130,246,0.6); }
  30% { box-shadow: 0 0 0 4px rgba(59,130,246,0.8); }
  70% { box-shadow: 0 0 0 4px rgba(59,130,246,0.8); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

/* =========================
   27) DESKTOP — PARLIAMENT LOGO ON TN DAYS
   ========================= */


/* PATCH — micro-tag placement fixes */
@media (max-width: 560px) {
  /* Center RH/TN tags above the bottom when a Parliament logo is present */
  .day-card:has(.parliament-logo) .micro-tag.micro-rh:not(.micro-today),
  .day-card:has(.parliament-logo) .micro-tag.micro-tn:not(.micro-today),
  .day-card.has-parliament .micro-tag.micro-rh:not(.micro-today),
  .day-card.has-parliament .micro-tag.micro-tn:not(.micro-today) {
    top: auto !important;
    bottom: 34px !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    transform: none !important;
  }

  /* Keep GH tag bottom-right when it’s the only one */
  .day-card:has(.parliament-logo) .micro-tag.micro-gh:not(.micro-today):only-of-type,
  .day-card.has-parliament .micro-tag.micro-gh:not(.micro-today):only-of-type {
    right: 9px !important;
    left: auto !important;
    bottom: 6px !important;
    margin: 0 !important;
    transform: none !important;
  }
}

.micro-tag.micro-gh,
.micro-tag.micro-rh,
.micro-tag.micro-tn { min-width: var(--igc-tag-minw); text-align: center; }

@media (max-width: 560px) {
  .micro-tag.micro-gh,
  .micro-tag.micro-rh,
  .micro-tag.micro-tn { min-width: 3ch; }
}

/* MICRO-TAGS — EXTRA SMALL SCREENS */
@media (max-width: 420px) {
  .day-card .micro-tag.micro-gh,
  .day-card .micro-tag.micro-rh,
  .day-card .micro-tag.micro-tn {
    font-size: 9.5px !important;
    line-height: 1.05 !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    letter-spacing: 0 !important;
    min-width: 2.5ch;
    text-align: center;
  }
  .day-card { padding-bottom: 22px; }
}
@media (max-width: 360px) {
  .day-card .micro-tag.micro-gh,
  .day-card .micro-tag.micro-rh,
  .day-card .micro-tag.micro-tn {
    font-size: 8px !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    min-width: 2.4ch;
  }
  .day-card { padding-bottom: 20px; }
}
@media (max-width: 320px) {
  .day-card .micro-tag.micro-gh,
  .day-card .micro-tag.micro-rh,
  .day-card .micro-tag.micro-tn {
    font-size: 7.5px !important;
    padding: 1px 4px !important;
    border-radius: 2.5px !important;
    min-width: 2.3ch;
  }
  .day-card { padding-bottom: 18px; }
}

/* Links inside day tiles and mobile list (keep holiday color scheme) */
.day-title-link,
.ml-title-link {
  text-decoration: none;
  text-underline-offset: 2px;
  color: inherit;
}

/* Keep tokenized borders for core components (up-card border is handled in next.css) */
.day-card,
.ml-date {
  border-color: var(--igc-border);
}

/* Neutralize any stray margins that might shift the header buttons/title */
.igc-nav-left, .igc-nav-right, .igc-month-title { margin: 0; }


/* Calendar — header + jump + wrapper spacing (LIGHT) */
.igc-jump-form{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
#igc-month{ width:auto; min-width:12ch; max-width:100%; white-space:nowrap; }
#igc-year{  width:auto; min-width:6ch; }

/* Calendar links & helpers */
.igc-toggle__label{ white-space:normal; overflow-wrap:anywhere; min-width:0; }
.igc-info::after, .igc-info::before{ max-width:min(260px, 80vw); contain:layout; }
.igc-cal-link{ display:inline; overflow-wrap:anywhere; word-break:break-word; }

/* Home page: space the calendar from the footer */
.home .igc-calendar-wrap{ margin-bottom:clamp(20px, 3vw, 40px); }
.home .igc-calendar-wrap::after{ content:""; display:block; height:12px; }

@media (max-width: 560px) {
  .day-card .day-num {
    font-size: 15px !important;   /* slightly smaller than desktop */
    white-space: nowrap !important;
  }
}
/* =========================
   PATCH — Force tighter GH·N / RH·N chip width
   ========================= */
@media (max-width: 560px) {
  .micro-tag.has-count {
    display: inline-block !important;   /* shrink to text */
    padding: 2px 3px !important;        /* control side spacing */
    width: -moz-fit-content !important; /* Firefox */
    width: fit-content !important;      /* Chrome + others */
    min-width: unset !important;        /* remove inherited min */
    max-width: unset !important;        /* avoid expansion */
    letter-spacing: -0.2px;             /* tighter dot spacing */
  }
}
