/* ============================================================
   YD × TWC Recruitment Hub — design-enhancement layer (P1)
   Scope: /en/twc/* only. Loads AFTER twc.css; builds on
   css/design-system.css tokens. Approved 2026-08-25 (Thomson,
   via Albert) per DESIGN-ENHANCEMENT-REVIEW-AY2027-28.md.
   Rules: existing palette only (functional colour roles), no
   new fonts, zero third-party requests, CLS ≈ 0.
   ============================================================ */

/* ------------------------------------------------------------
   Functional colour roles on EXISTING tokens (§1.1)
   facts = teal tint · journey = amber · guardrail = warning border
   ------------------------------------------------------------ */
body[data-twc-content-id] {
  --twc-fact-bg: var(--color-primary-bg);
  --twc-fact-border: var(--color-primary-light);
  --twc-fact-text: var(--color-primary-dark);
  --twc-journey-bg: var(--color-accent-bg);
  --twc-journey-marker: var(--color-accent-dark);
  --twc-guard-border: var(--color-warning);
  /* R2-C v3 (Thomson 2026-08-27 15:16) — HK-row semester colours:
     dark green / light green / light brown, drawn from the same
     Chakra palette family as the rest of the site (green-700,
     green-300, yellow-600). No text renders inside the 10 px
     cells; legend text stays on the white panel. */
  --twc-sem1-bg: #2F855A; /* Semester 1 (Sept–Dec) — dark green */
  --twc-sem2-bg: #9AE6B4; /* Semester 2 (Jan–May) — light green */
  --twc-sem3-bg: #D69E2E; /* Semester 3 (June–July) — light brown */
}

/* ------------------------------------------------------------
   Icon base — inline SVG, currentColor (§1.4)
   ------------------------------------------------------------ */
.twc-icon {
  flex: 0 0 auto;
  color: var(--twc-fact-text);
  vertical-align: middle;
}

.twc-icon--lg { width: 32px; height: 32px; }

/* ------------------------------------------------------------
   Stat / fact voice (§1.2): big tabular number + eyebrow label
   ------------------------------------------------------------ */
.twc-stat {
  background: var(--twc-fact-bg);
  border: 1px solid var(--twc-fact-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  min-width: 0;
}

.twc-stat .twc-stat-number {
  display: block;
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-tight);
  color: var(--twc-fact-text);
  /* Long single-token values (e.g. HKCAAVQ) must never escape the
     card at intermediate widths — wrap rather than overflow. */
  overflow-wrap: anywhere;
}

@media (min-width: 768px) {
  .twc-stat .twc-stat-number { font-size: var(--text-3xl); }
}

.twc-stat .twc-stat-label {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.twc-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-6);
}

@media (min-width: 640px) { .twc-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .twc-stat-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.twc-stat .twc-icon { margin-bottom: var(--space-2); }

/* ------------------------------------------------------------
   Eyebrow heading used above graphic beats
   ------------------------------------------------------------ */
.twc-eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--twc-fact-text);
  margin-bottom: var(--space-2);
}

/* ------------------------------------------------------------
   Guardrail / compliance panel (§1.1)
   ------------------------------------------------------------ */
.twc-guardrail {
  background: var(--color-gray-100);
  border-left: 3px solid var(--twc-guard-border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-4) var(--space-5);
  margin: var(--space-4) 0 var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.twc-guardrail strong { color: var(--color-text-primary); }

/* ------------------------------------------------------------
   Journey line — signature element (§1.8)
   Vertical timeline: thin teal line, amber markers, icons.
   Must always wrap a real <ol> (plain-list fallback = truth).
   ------------------------------------------------------------ */
.twc-journey {
  list-style: none;
  counter-reset: twc-journey;
  margin: var(--space-8) 0 var(--space-6);
  padding: 0;
  position: relative;
  max-width: 820px;
}

.twc-journey::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--color-primary-light);
  border-radius: 1px;
}

.twc-journey > li {
  counter-increment: twc-journey;
  position: relative;
  padding: 0 0 var(--space-8) calc(var(--space-12) + var(--space-2));
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.twc-journey > li:last-child { padding-bottom: var(--space-2); }

.twc-journey > li::before {
  content: counter(twc-journey);
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--twc-journey-bg);
  border: 2px solid var(--twc-journey-marker);
  color: var(--twc-journey-marker);
  font-weight: var(--font-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.twc-journey .twc-journey-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.twc-journey .twc-journey-title .twc-icon { color: var(--twc-journey-marker); }

.twc-journey .twc-journey-note {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ------------------------------------------------------------
   Fact chips — small icon+text pills (§2 apply/costs)
   ------------------------------------------------------------ */
.twc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  padding: 0;
  list-style: none;
}

.twc-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--twc-fact-bg);
  border: 1px solid var(--twc-fact-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--twc-fact-text);
  line-height: var(--leading-normal);
}

.twc-chip .twc-icon { color: var(--twc-fact-text); width: 18px; height: 18px; }

/* Route chips link variant (hub/entry index) */
a.twc-chip {
  text-decoration: none;
  transition: all var(--transition-fast);
}

a.twc-chip:hover {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------
   Card grids — programme tiles, route cards (§2)
   ------------------------------------------------------------ */
.twc-tile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

@media (min-width: 640px) { .twc-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .twc-tile-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .twc-tile-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.twc-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-decoration: none;
  transition: all var(--transition-fast);
  height: 100%;
}

.twc-tile:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-warm);
  transform: translateY(-2px);
}

.twc-tile .twc-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--twc-fact-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.twc-tile h3 {
  margin: 0;
  font-size: var(--text-lg);
  color: var(--color-text-primary);
}

.twc-tile p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

.twc-tile .twc-tile-link {
  margin-top: auto;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--twc-fact-text);
}

.twc-tile .twc-tile-badge {
  display: inline-block;
  align-self: flex-start;
  background: var(--twc-journey-bg);
  color: var(--twc-journey-marker);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

/* Route card (entry pages) — icon + title + subtitle + arrow */
.twc-route-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-decoration: none;
  transition: all var(--transition-fast);
  height: 100%;
}

.twc-route-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-warm);
  transform: translateY(-2px);
}

.twc-route-card .twc-route-flag {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--twc-fact-bg);
  border: 1px solid var(--twc-fact-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--twc-fact-text);
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.twc-route-card h3 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-base);
  color: var(--color-text-primary);
}

.twc-route-card p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-normal);
}

.twc-route-card .twc-route-go {
  margin-left: auto;
  align-self: center;
  color: var(--twc-fact-text);
  font-weight: var(--font-bold);
}

/* ------------------------------------------------------------
   Academic calendar strip (§3-G): Sep→Jul year bar
   Pure CSS grid; months labelled in DOM (translation-ready).
   ------------------------------------------------------------ */
.twc-calendar {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
}

.twc-calendar h3 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text-primary);
}

.twc-calendar-bar {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  margin-bottom: var(--space-2);
}

.twc-calendar-bar span {
  height: 10px;
  border-radius: 2px;
  background: var(--color-gray-100);
}

.twc-calendar-bar span.sem1 { background: var(--color-primary); }
.twc-calendar-bar span.sem2 { background: var(--color-primary-light); }
.twc-calendar-bar span.sem3 { background: var(--twc-journey-marker); }

.twc-calendar-months {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

/* Semester-start months (Sep, Jan) are bold per Thomson round-2 review. */
.twc-calendar-months strong {
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
}

@media (max-width: 639px) {
  /* Declutter small screens, but always keep the anchor months visible:
     Aug (bar start) and Sep / Jan (semester starts, bold). */
  .twc-calendar-months span:nth-child(3),
  .twc-calendar-months span:nth-child(5),
  .twc-calendar-months span:nth-child(7),
  .twc-calendar-months span:nth-child(9),
  .twc-calendar-months span:nth-child(11),
  .twc-calendar-months span:nth-child(12) { visibility: hidden; }
}

.twc-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  list-style: none;
  padding: 0;
}

.twc-calendar-legend li { display: inline-flex; align-items: center; gap: var(--space-2); }

.twc-calendar-legend .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}

/* ------------------------------------------------------------
   Data viz note: the horizontal CSS-bar view that lived here was
   removed from the costs page per Thomson's round-2 review
   (comprehensive table kept as the single source of truth).
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   Photo card + hero illustration (§1.5/1.6)
   Explicit aspect-ratio everywhere → CLS ≈ 0.
   ------------------------------------------------------------ */
.twc-hero-figure {
  margin: var(--space-8) 0 0;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-warm);
}

.twc-hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

@media (max-width: 767px) {
  .twc-hero-figure img { aspect-ratio: 4 / 5; object-position: center; }
}

.twc-photo-card {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.twc-photo-card img {
  display: block;
  width: 100%;
  height: auto;
}

.twc-photo-card figcaption {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ------------------------------------------------------------
   Photo carousel — one-row scroll-snap strip (hub partner
   section, Thomson round-2). Vanilla CSS + twc.js arrows;
   swipe works natively on touch. No third-party libraries.
   ------------------------------------------------------------ */
.twc-carousel { margin-top: var(--space-6); }

.twc-carousel-track {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.twc-carousel-track::-webkit-scrollbar { display: none; }

.twc-carousel-slide {
  flex: 0 0 62%;
  scroll-snap-align: start;
  min-width: 0;
}

@media (max-width: 767px) {
  .twc-carousel-slide { flex-basis: 88%; }
}

.twc-carousel-controls {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-3);
}

.twc-carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-gray-300);
  background: #fff;
  color: var(--twc-fact-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.twc-carousel-btn:hover:not([disabled]) {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.twc-carousel-btn[disabled] {
  opacity: 0.35;
  cursor: default;
}

/* ------------------------------------------------------------
   About-panel logo (hub, Thomson round-2): official TWC
   lockup inside the About twc-panel box.
   ------------------------------------------------------------ */
.twc-about-logo {
  display: block;
  width: min(260px, 60%);
  height: auto;
  margin-bottom: var(--space-4);
}

/* ------------------------------------------------------------
   Partnership placeholder slots (§2 gate 6)
   Clean one-step-swap slots for the TWC logo + partnership
   photos (assets not yet delivered by TWC). Swap = replace
   .twc-partner-slot contents with <img>; CSS unchanged.
   ------------------------------------------------------------ */
.twc-partner-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

@media (min-width: 768px) {
  .twc-partner-strip { grid-template-columns: minmax(200px, 280px) 1fr; align-items: stretch; }
}

.twc-partner-slot {
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-xl);
  background: var(--color-gray-50);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-6);
  min-height: 140px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.twc-partner-slot .twc-icon { color: var(--color-gray-300); width: 28px; height: 28px; }

.twc-partner-slot strong {
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.twc-partner-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.twc-partner-photos .twc-partner-slot { min-height: 100%; padding: var(--space-4); }

/* ------------------------------------------------------------
   Key-figure highlight (amber, ≤2 per page — §1.1)
   ------------------------------------------------------------ */
.twc-key-figure {
  display: inline-flex;
  flex-direction: column;
  background: var(--twc-journey-bg);
  border: 1px solid var(--color-accent-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  text-align: center;
}

.twc-key-figure .twc-stat-number { color: var(--twc-journey-marker); }

/* ------------------------------------------------------------
   Motion discipline (§4)
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .twc-tile, .twc-route-card, a.twc-chip,
  .twc-tile:hover, .twc-route-card:hover {
    transition: none;
    transform: none;
  }
  .twc-carousel-track { scroll-behavior: auto; }
}

/* ------------------------------------------------------------
   Chip country badge + verified-note (P1-1 hub)
   Country initials render in DOM text beside the glyph —
   never inside an SVG (no flag politics, translation-safe).
   ------------------------------------------------------------ */
.twc-chip-flag {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--twc-fact-text);
  color: #fff;
  font-size: 10px;
  font-weight: var(--font-bold);
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.twc-verified-note {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

/* ------------------------------------------------------------
   R2-C PROTOTYPE — dual-track academic-year comparison bar
   (staging; drafts: entry/indonesia.html + entry/malaysia.html).
   v3 (Thomson review 2026-08-27 15:16):
     top    = home-country school year with its OWN month-label
              row on the shared Jan→Dec axis (same mobile
              declutter as the HK axis); a dot marks the
              term-start month — Malaysia January / Indonesia
              July, labelled "Start of Term"; ONLY academic-year
              months are filled (Malaysia Jan–Nov, Dec neutral;
              Indonesia Jul→Jun = the full axis).
     bottom = HK / TWC academic year recoloured by semester:
              Sept–Dec dark green (Sem 1), Jan–May light green
              (Sem 2), June–July light brown (Sem 3 — selected
              majors only); September = start of school year AND
              only intake (amber pin + label). No August legend
              entry. TWC intake September ONLY.
   The visual offset between the two rows IS the message.
   Facts: only claims already in each page's calendar prose.
   Pure CSS grid, no JS. Remove this whole block to revert CSS.
   ------------------------------------------------------------ */
.twc-calcmp {
  background: #fff;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
}

.twc-calcmp-tracklabel {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
}

.twc-calcmp-tracklabel small {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-normal);
  color: var(--color-text-secondary);
}

/* Home-country row — same geometry as .twc-calendar-bar. */
.twc-calcmp-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  margin-bottom: var(--space-2);
}

.twc-calcmp-row span {
  height: 10px;
  border-radius: 2px;
  background: var(--color-gray-100);
}

/* Indonesia: school year runs July→June (page prose), i.e. the
   full Jan→Dec axis is inside the school year. v3: the July start
   cell keeps the dark-amber treatment and also carries the white
   pin dot + "Start of Term" label chip. */
.twc-calcmp-row span.id-year { background: var(--color-accent); }
.twc-calcmp-row span.id-start { background: var(--color-accent-dark); }

/* Malaysia: schools/pre-U programmes usually start in January; most
   secondary schools + STPM run roughly January to November/December
   (page prose). December is left neutral — the page hedges the end
   month, so it is not coloured. */
.twc-calcmp-row span.my-year { background: var(--color-accent); }
.twc-calcmp-row span.my-start { background: var(--color-accent-dark); }

/* India: school year typically runs June→May (page prose), i.e. the
   full Jan→Dec axis is inside the school year. June start cell gets
   the dark-amber treatment + white pin dot + "Start of Term" chip. */
.twc-calcmp-row span.in-year { background: var(--color-accent); }
.twc-calcmp-row span.in-start { background: var(--color-accent-dark); }

/* Pakistan: academic year typically runs June to May (page prose) —
   same full-axis shape as India; June start cell. */
.twc-calcmp-row span.pk-year { background: var(--color-accent); }
.twc-calcmp-row span.pk-start { background: var(--color-accent-dark); }

/* Singapore: academic year usually starts in January (junior
   colleges / A-Levels; page prose); polytechnic years differ and the
   end month is not stated — the page gives only "typically a few
   months" before the HK September start. Jan–May are filled (known
   in-year) and June–December stay neutral — same hedge treatment as
   Malaysia's December. */
.twc-calcmp-row span.sg-year { background: var(--color-accent); }
.twc-calcmp-row span.sg-start { background: var(--color-accent-dark); }

/* Milestone chip row — sits above the country row, same 12-col grid
   so grid-column aligns chips with month cells (no JS, no offsets). */
.twc-calcmp-chiprow {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  margin-bottom: var(--space-1);
}

.twc-calcmp-chip {
  grid-column: 5 / span 2; /* May + Jun cells on the Jan→Dec axis */
  font-size: var(--text-xs);
  line-height: var(--leading-tight);
  text-align: center;
  color: var(--color-text-primary); /* ≥ 4.5:1 on the amber tint */
  background: var(--color-accent-bg);
  border: 1px solid var(--color-accent-light);
  border-radius: var(--radius-full);
  padding: 2px var(--space-2);
  font-weight: var(--font-semibold);
}

/* Responsive label swap (CSS-only): shorter text on small screens. */
.twc-calcmp-chip .chip-sm { display: none; }

/* v3: "Start of Term" / "Start of school year" label chips above
   the marked month. Position modifiers place each chip on its
   month of the Jan→Dec axis; the dot itself sits inside the start
   cell (see the .pin rules). --start also opts the chip out of the
   milestone-chip widening rule on mobile. */
.twc-calcmp-chip--jan { grid-column: 1 / span 2; }
.twc-calcmp-chip--jun { grid-column: 6 / span 2; }
.twc-calcmp-chip--jul { grid-column: 7 / span 2; }
.twc-calcmp-chip--sep { grid-column: 9 / span 2; }

/* v3: dot on the term-start month of the country row — white dot
   on the dark-amber start cell (id-start / my-start); the label
   chip above names it "Start of Term". */
.twc-calcmp-row span.pin { position: relative; }

.twc-calcmp-row span.pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-white);
  box-shadow: 0 0 0 1.5px rgba(45, 55, 72, 0.3);
  transform: translate(-50%, -50%);
}

/* Intake pin on the HK row: amber dot with white ring inside the
   existing bar cell (Sep only — TWC intake is September only).
   Legend explains the marker. */
.twc-calendar-bar span.pin { position: relative; }

.twc-calendar-bar span.pin::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 1.5px #fff;
  transform: translate(-50%, -50%);
}

/* Space between the two track groups. */
.twc-calcmp-gap { margin-top: var(--space-4); }

/* v3: HK-row semester colour coding — replaces the old amber body
   treatment (including the former hk-start dark-amber September
   cell): Sept–Dec dark green (Semester 1), Jan–May light green
   (Semester 2), June–July light brown (Semester 3 — selected majors
   only). Scoped to .twc-calcmp so the hidden single-bar fallback
   and the other pages' Aug→Jul bars keep their original colours.
   September keeps the amber intake pin: start of school year AND
   only intake. Declared after the .sem* rules above so the scoped
   colours win the tie. */
.twc-calcmp .twc-calendar-bar span.sem1 { background: var(--twc-sem1-bg); }
.twc-calcmp .twc-calendar-bar span.sem2 { background: var(--twc-sem2-bg); }
.twc-calcmp .twc-calendar-bar span.sem3 { background: var(--twc-sem3-bg); }

@media (max-width: 639px) {
  .twc-calcmp { padding: var(--space-4); }
  /* Widen the milestone chip to three cells so the label wraps to
     two lines max (start-label chips keep their month anchor). */
  .twc-calcmp-chip:not(.twc-calcmp-chip--start) { grid-column: 4 / span 3; font-size: 0.625rem; padding: 2px var(--space-1); }
  .twc-calcmp-chip .chip-lg { display: none; }
  .twc-calcmp-chip .chip-sm { display: inline; }
  .twc-calcmp-chip--start { font-size: 0.625rem; padding: 2px var(--space-1); }
  .twc-calcmp-chip--jan { grid-column: 1 / span 3; }
  .twc-calcmp-chip--jun { grid-column: 6 / span 3; }
  .twc-calcmp-chip--jul { grid-column: 7 / span 3; }
  .twc-calcmp-chip--sep { grid-column: 9 / span 3; }
  /* Jan→Dec axis inside the prototype: keep the anchor months visible
     on small screens — Jan (Sem 2 start), May (country-row milestone),
     Jun (India/Pakistan term start), Jul + Sep (HK year start / intake)
     plus Mar + Nov for rhythm. Scoped to .twc-calcmp so the hidden
     fallback and the other pages' Aug→Jul single bars keep the
     original declutter rule. */
  .twc-calcmp .twc-calendar-months span { visibility: visible; }
  .twc-calcmp .twc-calendar-months span:nth-child(even) { visibility: hidden; }
  .twc-calcmp .twc-calendar-months span:nth-child(6) { visibility: visible; }
}
