/* ==========================================================================
   Today · Meridian — student dashboard redesign ("the day is the interface")
   Fresh markup (tm-*) + fresh stylesheet: nothing here overrides legacy DOM,
   so no !important is needed. Scoped to the student dashboard body.
   Direction/spec: docs/student-today-meridian.html (approved mockup).
   ========================================================================== */

body.app-dashboard .tm-shell {
  --tm-brand: #1f6fd6;
  --tm-brand-2: #1559b0;
  --tm-brand-tint: #eaf2fd;
  --tm-navy-0: #081f47;
  --tm-navy-2: #12489e;
  --tm-ink: #16233f;
  --tm-slate: #5d6b84;
  --tm-mist: #8a97ad;
  --tm-line: #e9edf4;
  --tm-line-soft: #f1f4f9;
  --tm-surface: #fff;
  --tm-ward: #7c5cff;
  --tm-clinic: #0d9488;
  --tm-teach: #1f6fd6;
  --tm-theatre: #e0493b;
  --tm-amber: #e08a1e;
  --tm-amber-ink: #b96f0c;
  --tm-amber-t: #fdf1df;
  --tm-green: #1a9e54;
  --tm-green-t: #e4f5eb;
  --tm-site-accent: #3fc1b4;
  --tm-r: 14px;
  --tm-sh: 0 1px 2px rgba(20, 33, 64, 0.04), 0 2px 8px rgba(20, 33, 64, 0.05);
  --tm-sh-pop: 0 12px 40px rgba(20, 33, 64, 0.16);
  --tm-display: var(--font-application-display);
  display: block;
  color: var(--tm-ink);
  letter-spacing: -0.011em;
}
/* If the local application faces do not settle inside the bounded first-view
   allowance, commit one fixed system stack beneath the opaque veil. Keeping
   that choice for the document prevents a late font swap from moving the
   greeting, primary card or bottom navigation directly after reveal. The
   in-flow page header and notices also determine the first view's position:
   freezing only .tm-shell lets a late banner font swap move the whole page. */
html.pf-first-view-font-fallback body.app-dashboard {
  --font-application-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-application-display: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html.pf-first-view-font-fallback body.app-dashboard .tm-shell {
  --tm-display: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html.pf-first-view-font-fallback body.app-dashboard .today-mobile-header,
html.pf-first-view-font-fallback body.app-dashboard .student-mobile-nav {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.tm-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---- programme phase: compact route into the existing Year roadmap ---- */
.tm-programme {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  margin: 12px 0 0;
  padding: 10px 13px 10px 15px;
  color: var(--tm-ink);
  text-decoration: none;
  background: var(--tm-surface);
  border: 1px solid var(--tm-line);
  border-left: 3px solid var(--tm-brand);
  border-radius: var(--tm-r);
  box-shadow: var(--tm-sh);
}
.tm-programme[hidden] { display: none; }
.tm-programme-current,
.tm-programme-next {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 8px;
  min-width: 0;
}
.tm-programme-next {
  padding-left: 14px;
  border-left: 1px solid var(--tm-line);
}
.tm-programme small {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--tm-mist);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tm-programme strong {
  min-width: 0;
  overflow: hidden;
  color: var(--tm-ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-programme-range {
  color: var(--tm-slate);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.tm-programme-open {
  color: var(--tm-brand);
  font-size: 18px;
  font-weight: 600;
  text-align: right;
}
.tm-programme:active { background: #f6f8fc; }

/* ---- whisper row ---- */
.tm-whisper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 2px 14px;
}
.tm-whisper-main {
  min-width: 0;
}
.tm-whisper-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.tm-eyebrow {
  margin: 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tm-mist);
}
.tm-whisper p#tm-greeting {
  margin: 1px 0 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--tm-ink);
}
.tm-whisper p#tm-greeting b {
  color: var(--tm-ink);
  font-weight: 700;
}
.tm-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(160deg, #1f6fd6, #7c5cd6);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(20, 33, 64, 0.18);
  flex: none;
}
.tm-clock {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tm-slate);
  border: 1px solid var(--tm-line);
  background: var(--tm-surface);
  border-radius: 999px;
  padding: 4px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
}
.tm-clock i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tm-green);
  animation: tm-pulse 2.2s infinite;
}

/* ---- arrival hero ---- */
.tm-hero {
  position: relative;
  border-radius: var(--tm-r);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px 28px 30px;
  isolation: isolate;
  background: linear-gradient(118deg, var(--tm-navy-0) 0%, var(--tm-navy-2) 52%, var(--tm-brand) 100%);
}
.tm-hero-photo {
  position: absolute;
  inset: 0;
  z-index: -4;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.tm-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: linear-gradient(115deg, rgba(8, 31, 71, 0.84) 0%, rgba(18, 72, 158, 0.48) 55%, rgba(31, 111, 214, 0.14) 100%);
}
.tm-hero--dusk .tm-hero-scrim {
  background: linear-gradient(115deg, rgba(4, 13, 33, 0.93) 0%, rgba(8, 31, 71, 0.72) 55%, rgba(18, 72, 158, 0.36) 100%);
}
/* With a PHOTOGRAPH behind it the diagonal wash is at its lightest exactly
   where the "Site info & directions" pill and the photograph's credit sit, and
   a bright façade or sky can leave both close to the floor. A second, vertical
   wash along the bottom edge carries them without touching the treatment: the
   diagonal gradient, the hatch and the grain are unchanged, and a site with no
   photograph (.tm-hero--plate) does not pay for it. */
.tm-hero:not(.tm-hero--plate) .tm-hero-scrim {
  background:
    linear-gradient(to top, rgba(4, 13, 33, 0.62) 0%, rgba(4, 13, 33, 0.22) 26%, rgba(4, 13, 33, 0) 52%),
    linear-gradient(115deg, rgba(8, 31, 71, 0.84) 0%, rgba(18, 72, 158, 0.48) 55%, rgba(31, 111, 214, 0.14) 100%);
}
.tm-hero--dusk:not(.tm-hero--plate) .tm-hero-scrim {
  background:
    linear-gradient(to top, rgba(4, 13, 33, 0.66) 0%, rgba(4, 13, 33, 0.26) 26%, rgba(4, 13, 33, 0) 52%),
    linear-gradient(115deg, rgba(4, 13, 33, 0.93) 0%, rgba(8, 31, 71, 0.72) 55%, rgba(18, 72, 158, 0.36) 100%);
}
/* Photograph attribution, in the guide hero's own treatment (.sgv-credit):
   bottom-right, quiet, and legible against the scrim at its lightest. */
.tm-hero-credit {
  position: absolute;
  right: 14px;
  bottom: 8px;
  z-index: 3;
  margin: 0;
  font-size: 10.5px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 2px rgba(4, 13, 33, 0.55);
}
.tm-hero-credit a { color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; }
.tm-hero-credit[hidden] { display: none; }
/* Screen-reader-only, matching the guide's .sgv-sr. */
.tm-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.tm-hero-hatch {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, rgba(255, 255, 255, 0) 2px 26px);
}
.tm-hero-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}
/* livery-plate fallback: ghost monogram for photo-less sites */
.tm-hero-ghost {
  position: absolute;
  right: 18px;
  bottom: -26px;
  z-index: -1;
  font-family: var(--tm-display);
  font-size: 150px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  display: none;
}
.tm-hero--plate .tm-hero-ghost {
  display: block;
}
.tm-hero--plate .tm-hero-photo,
.tm-hero--plate .tm-hero-scrim {
  display: none;
}
.tm-hero-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.tm-hero-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tm-site-accent);
  animation: tm-blip 2.6s infinite;
  flex: none;
}
.tm-hero-title {
  margin: 10px 0 8px;
  font-family: var(--tm-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.028em;
  line-height: 1.05;
}
.tm-hero-sub {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}
.tm-hero-sub b {
  color: #fff;
}
.tm-hero-pill {
  position: absolute;
  right: 24px;
  bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}
.tm-hero-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
/* the day ticker: today in miniature on the hero's top edge */
.tm-ticker {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  display: flex;
  background: rgba(255, 255, 255, 0.14);
}
.tm-ticker i {
  height: 100%;
}
.tm-hero--dusk .tm-ticker i {
  opacity: 0.4;
}
.tm-ticker-caret {
  position: absolute;
  top: -1px;
  width: 2px;
  height: 7px;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.9);
}
/* ---- now card ---- */
.tm-now {
  position: relative;
  /* Reserve the eyebrow/body/action rows while timetable data is unresolved.
     Live sessions can fill those rows without pushing the glance strip down.
     A minimum (not a fixed height) preserves wrapping and enlarged text. */
  min-block-size: 10.5rem;
  /* sits cleanly below the hero — no overlap */
  margin: 14px 0 0;
  /* state colour lives in a soft tint wash + the eyebrow (native card
     conventions), not a web-callout left accent bar */
  background: linear-gradient(180deg, var(--tm-now-tint, var(--tm-surface)) 0%, var(--tm-surface) 76%);
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-r);
  box-shadow: var(--tm-sh);
  padding: 15px 18px 15px 19px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  z-index: 5;
  overflow: hidden;
}
.tm-now-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--tm-now-color, var(--tm-brand));
}
.tm-now-eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tm-now-color, var(--tm-brand));
  animation: tm-pulse 2.2s infinite;
}
.tm-now-eyebrow span {
  color: var(--tm-mist);
  letter-spacing: 0.02em;
}
.tm-now-prog {
  height: 4px;
  border-radius: 2px;
  background: var(--tm-now-tint, var(--tm-brand-tint));
  margin: 2px 0;
}
.tm-now-prog i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--tm-now-color, var(--tm-brand));
}
.tm-now-time {
  padding-left: 8px;
}
.tm-now-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--tm-now-tint, var(--tm-brand-tint));
  color: var(--tm-now-color, var(--tm-brand));
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  border-radius: 999px;
  padding: 3px 10px;
  text-transform: uppercase;
}
.tm-now-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: tm-pulse 2.2s infinite;
}
.tm-now-big {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 6px;
  white-space: nowrap;
}
.tm-now-big span {
  font-size: 17px;
  font-weight: 600;
  color: var(--tm-mist);
}
.tm-now-sub {
  display: block;
  font-size: 11px;
  color: var(--tm-mist);
  font-weight: 600;
  margin-top: 3px;
}
.tm-now-body h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--tm-ink);
}
.tm-now-body p {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--tm-slate);
}
.tm-now-chips {
  display: flex;
  gap: 7px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.tm-chip {
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  padding: 3.5px 10px;
  border: 1px solid var(--tm-line);
  color: var(--tm-slate);
  background: var(--tm-surface);
}
.tm-chip--mand {
  background: var(--tm-amber-t);
  border-color: #f3ddb8;
  color: var(--tm-amber-ink);
}
.tm-chip--done {
  background: var(--tm-green-t);
  border-color: #cdeeda;
  color: var(--tm-green);
}
.tm-now-cta {
  text-align: right;
}
.tm-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(180deg, #3585e6, var(--tm-brand) 48%, var(--tm-brand-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 20px rgba(31, 111, 214, 0.32);
}
.tm-btn-primary:hover {
  color: #fff;
  filter: brightness(1.05);
}
.tm-btn-primary svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  flex: none;
}
.tm-now-cta small {
  display: block;
  font-size: 11.5px;
  color: var(--tm-mist);
  font-weight: 600;
  margin-top: 7px;
}
.tm-now--recap {
  --tm-now-color: var(--tm-green);
  --tm-now-tint: var(--tm-green-t);
}

/* ---- glance line ---- */
.tm-glance {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--tm-slate);
  font-weight: 600;
}
.tm-g-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--tm-surface);
  border: 1px solid var(--tm-line);
  border-radius: 14px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--tm-slate);
  min-width: 0;
}
.tm-g-tile:active {
  background: #f4f7fc;
}
.tm-g-lab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tm-mist);
}
.tm-g-lab i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}
.tm-g-tile > b {
  color: var(--tm-ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-g-tile > b small {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--tm-slate);
  letter-spacing: 0;
}
.tm-skeleton-tile {
  height: 62px;
  border-radius: 14px;
}
/* ---- dayline spine ---- */
.tm-spine {
  margin: 26px 2px 0;
  max-width: 860px;
}
.tm-srow {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  column-gap: 22px;
}
.tm-rail {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  position: relative;
}
.tm-rail-time {
  width: 44px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--tm-mist);
  padding-top: 2px;
}
.tm-rail-track {
  width: 10px;
  position: relative;
  flex: none;
}
.tm-seg {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: var(--tm-seg, var(--tm-brand));
}
.tm-seg--past {
  opacity: 0.34;
}
.tm-rail-dot {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  width: 2px;
  /* solid hairline at reduced opacity — dashes read as web wireframe */
  background: #c3cfe2;
  opacity: 0.45;
  border-radius: 1px;
}
.tm-caret {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tm-brand);
  box-shadow: 0 2px 8px rgba(20, 33, 64, 0.25);
  z-index: 2;
}
.tm-caret::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--tm-brand);
  animation: tm-pulse 2.2s infinite;
}
.tm-caret-chip {
  position: absolute;
  right: calc(100% + 10px);
  top: -4px;
  background: var(--tm-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  border-radius: 7px;
  padding: 3px 8px;
  white-space: nowrap;
}
.tm-snode {
  padding: 2px 0 24px;
}
.tm-stub {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--tm-mist);
  font-weight: 600;
  padding-top: 1px;
  flex-wrap: wrap;
}
.tm-stub b {
  color: var(--tm-slate);
  font-weight: 700;
}
.tm-stub .tm-tick {
  color: var(--tm-green);
  font-weight: 600;
}
.tm-stub .tm-miss {
  color: var(--tm-theatre);
  font-weight: 600;
}
.tm-snode-head {
  font-size: 13px;
  font-weight: 600;
  color: var(--tm-slate);
}
.tm-snode-head .tm-until {
  font-weight: 600;
  color: var(--tm-mist);
}
.tm-snode h4 {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.014em;
  color: var(--tm-ink);
}
.tm-snode h4 a {
  color: inherit;
  text-decoration: none;
}
.tm-snode h4 a:hover {
  color: var(--tm-brand-2);
}
.tm-snode-meta {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--tm-slate);
}
.tm-snode-chips {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.tm-gap {
  font-size: 12px;
  color: var(--tm-mist);
  font-weight: 600;
  padding: 8px 0 24px;
  margin: 0;
}
/* woven moment */
.tm-weave {
  position: relative;
  margin-top: 12px;
  border: 1px solid var(--tm-line);
  border-radius: 12px;
  background: var(--tm-surface);
  box-shadow: var(--tm-sh);
  padding: 12px 15px 11px;
  max-width: 540px;
}
.tm-weave::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 100%;
  width: 22px;
  height: 3px;
  background: var(--tm-wv, var(--tm-clinic));
}
.tm-weave-kicker {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tm-wv, var(--tm-clinic));
}
.tm-weave p {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--tm-ink);
  line-height: 1.5;
}
.tm-weave p span {
  color: var(--tm-slate);
}
.tm-btn-ghost {
  display: inline-block;
  margin-top: 9px;
  border: 1px solid var(--tm-line);
  border-radius: 999px;
  background: var(--tm-surface);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tm-brand-2);
  text-decoration: none;
  cursor: pointer;
}
.tm-btn-ghost:hover {
  background: var(--tm-brand-tint);
  color: var(--tm-brand-2);
}
.tm-endcap {
  border-top: 1px solid var(--tm-line);
  margin-top: 4px;
  padding: 13px 2px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.tm-endcap p {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--tm-slate);
}
.tm-endcap span {
  font-size: 12.5px;
  color: var(--tm-mist);
  font-weight: 600;
}
/* empty day */
.tm-empty {
  border: 1px dashed #c9d4e6;
  border-radius: var(--tm-r);
  padding: 26px 24px;
  text-align: center;
  margin-top: 26px;
}
.tm-empty p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--tm-slate);
}
.tm-empty small {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--tm-mist);
  font-weight: 600;
}

/* ---- ledger band ---- */
.tm-ledger {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  border: 1px solid var(--tm-line);
  border-radius: var(--tm-r);
  background: var(--tm-surface);
  box-shadow: var(--tm-sh);
  margin-top: 30px;
  overflow: hidden;
}
.tm-ledge {
  padding: 17px 20px 19px;
  min-width: 0;
}
.tm-ledge + .tm-ledge {
  border-left: 1px solid var(--tm-line-soft);
}
.tm-ledge-kicker {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tm-mist);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.tm-ledge-kicker a {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--tm-brand-2);
  font-weight: 500;
  text-decoration: none;
  flex: none;
}
.tm-ledge-kicker a:hover {
  text-decoration: underline;
}
.tm-ledge-stat {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--tm-ink);
}
.tm-meter {
  height: 2px;
  background: var(--tm-line);
  border-radius: 2px;
  margin-top: 9px;
  position: relative;
  overflow: hidden;
}
.tm-meter i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--tm-ink);
  border-radius: 2px;
}
.tm-ledge-list {
  margin: 12px 0 0;
  display: grid;
  gap: 9px;
}
.tm-ledge-item {
  font-size: 13px;
  line-height: 1.45;
  color: var(--tm-ink);
}
.tm-ledge-item b {
  font-weight: 700;
}
.tm-ledge-item span {
  color: var(--tm-mist);
  font-size: 12px;
  display: block;
}
.tm-ledge-runon {
  font-size: 12.5px;
  color: var(--tm-slate);
  margin: 13px 0 0;
  line-height: 1.55;
  border-top: 1px solid var(--tm-line-soft);
  padding-top: 11px;
}
.tm-ledge-runon b {
  font-weight: 700;
  color: var(--tm-ink);
}
.tm-ledge-note {
  font-size: 11px;
  color: var(--tm-mist);
  margin: 12px 0 0;
  font-weight: 600;
}
.tm-notice-row {
  display: flex;
  gap: 9px;
  align-items: baseline;
  font-size: 13px;
}
.tm-notice-row .tm-pin {
  flex: none;
  font-size: 11px;
}
.tm-notice-row .tm-nd {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tm-brand);
  position: relative;
  top: -1px;
}
.tm-notice-row p {
  margin: 0;
  font-weight: 400;
  line-height: 1.4;
  color: var(--tm-ink);
}
.tm-notice-row p span {
  display: block;
  font-size: 11px;
  color: var(--tm-mist);
  font-weight: 600;
  margin-top: 1px;
}
.tm-week-rows {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}
.tm-week-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tm-slate);
}
.tm-week-row em {
  font-style: normal;
  width: 30px;
  color: var(--tm-mist);
}
.tm-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}
.tm-dot--in {
  background: var(--tm-green);
}
.tm-dot--noqr {
  background: transparent;
  border: 1.5px solid #b7c3d7;
  box-sizing: border-box;
}
.tm-dot--up {
  background: #dbe3ef;
}
.tm-dot--miss {
  background: transparent;
  border: 1.5px solid var(--tm-theatre);
  box-sizing: border-box;
}

@keyframes tm-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@keyframes tm-blip {
  0% {
    box-shadow: 0 0 0 0 rgba(63, 193, 180, 0.5);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(63, 193, 180, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(63, 193, 180, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tm-caret::after,
  .tm-now-chip i,
  .tm-clock i,
  .tm-hero-kicker i {
    animation: none;
  }
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .tm-ledger {
    grid-template-columns: 1fr;
  }
  .tm-ledge + .tm-ledge {
    border-left: 0;
    border-top: 1px solid var(--tm-line-soft);
  }
  .tm-now {
    gap: 8px;
    margin: 12px 0 0;
  }
  .tm-now-cta {
    text-align: left;
  }
  .tm-glance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 12px 0 0;
  }
}
@media (max-width: 640px) {
  .tm-programme {
    grid-template-columns: minmax(0, 1fr) 18px;
    gap: 8px;
    padding-block: 11px;
  }
  .tm-programme-next {
    grid-column: 1;
    margin-top: 7px;
    padding: 7px 0 0;
    border-top: 1px solid var(--tm-line);
    border-left: 0;
  }
  .tm-programme-open {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .tm-hero {
    min-height: 156px;
    padding: 14px 16px 18px;
  }
  /* A photograph's credit sits on its own line under the dates. */
  .tm-hero:has(> .tm-hero-credit:not([hidden])) {
    padding-bottom: 30px;
  }
  .tm-hero-title {
    font-size: 21px;
  }
  /* the hero is a place, not a menu: on phones its actions live in the
     Now card (Map), and the spine replaces the ticker */
  .tm-hero-pill,
  .tm-ticker {
    display: none;
  }
  .tm-srow {
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 14px;
  }
  .tm-rail-time {
    width: auto;
  }
  .tm-caret-chip {
    display: none;
  }
  .tm-now-big {
    font-size: 30px;
  }
}

/* ============ loading skeletons (shimmer instead of placeholder text) ============ */
@keyframes tm-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.tm-skeleton {
  color: transparent !important;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #e8ecf4 25%, #f6f8fc 45%, #e8ecf4 65%);
  background-size: 200% 100%;
  animation: tm-skeleton-shimmer 1.2s ease-in-out infinite;
}
/* hero sits on deep navy — shimmer in white alpha there */
.tm-hero .tm-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.14) 25%, rgba(255,255,255,.30) 45%, rgba(255,255,255,.14) 65%);
  background-size: 200% 100%;
}
.tm-skeleton-chip {
  display: inline-block;
  height: 20px;
  width: 132px;
  vertical-align: middle;
}
.tm-skeleton-chip--short { width: 92px; }
.tm-skeleton-card { height: 64px; margin-bottom: 10px; }
.tm-skeleton-card--short { width: 78%; }
@media (prefers-reduced-motion: reduce) {
  .tm-skeleton { animation: none; }
}

/* On phones the Meridian Today hides the app navbar (body.today-mobile-mock),
   which normally carries the notch padding — reapply it here so the greeting
   row doesn't sit under the iOS status bar. */
@media (max-width: 768px) {
  html.is-capacitor body.app-dashboard.today-mobile-mock .tm-shell {
    padding-top: calc(env(safe-area-inset-top, 0px) + 4px);
  }
}

/* ============ phone-first refinements (design board 2026-07) ============ */
/* week-progress hairline along the hero base */
.tm-hero-wk {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.16);
  z-index: 1;
}
.tm-hero-wk i {
  display: block;
  height: 100%;
  background: var(--tm-site-accent);
}

/* Now-card action row: primary action + compact Map ghost side by side */
.tm-now-cta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tm-now-cta .tm-btn-primary {
  flex: 1;
  justify-content: center;
}
.tm-now-cta .tm-chip--done {
  flex: 1;
  text-align: center;
}
.tm-btn-map {
  flex: none;
  margin-top: 0 !important;
}

/* uniform header: search button on Today (same component as shell views) */
.tm-search-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--tm-line);
  background: var(--tm-surface);
  color: var(--tm-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.tm-search-btn svg {
  width: 19px;
  height: 19px;
}
@media (min-width: 769px) {
  /* desktop keeps the navbar search — avoid doubled affordances */
  .tm-search-btn {
    display: none;
  }
  /* Desktop WEB only (scoped :not(.is-capacitor) so the native phone app keeps
     the full Meridian layout): the top nav already carries the profile + clock,
     and the ledger's Today/Sign-offs/Notices strip just echoes the glance tiles
     — so drop the redundant in-page profile/clock cluster and that ledger strip
     on the web Today, keeping the hero → NOW card → tiles → time-spine. */
  html:not(.is-capacitor) .tm-whisper-side,
  html:not(.is-capacitor) #tm-ledger {
    display: none;
  }
}

/* ---- rest-day spine preview (the next timetabled day, grayed) ---- */
.tm-spine-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 2px 10px;
}
.tm-spine-preview-head b {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tm-mist);
}
.tm-spine-preview-head a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tm-brand);
  text-decoration: none;
}
.tm-srow--preview {
  opacity: 0.74;
}
.tm-seg--preview {
  background: #ccd7e8;
  opacity: 0.6;
}
.tm-scard {
  flex: 1;
  min-width: 0;
  background: var(--tm-surface);
  border: 1px solid var(--tm-line);
  border-radius: 13px;
  padding: 10px 13px;
  margin-bottom: 9px;
}
.tm-scard b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tm-scard span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--tm-mist);
  font-weight: 600;
}

/* ---- stroked SVG glyphs (replacing platform-emoji ✓ / 📌) ---- */
.tm-svg-check {
  width: 12px;
  height: 12px;
  vertical-align: -1.5px;
}
.tm-svg-pin {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  color: var(--tm-brand);
}


/* 44px-class hit areas (design review 2026-07-13): keep the compact visuals,
   extend the touch zone invisibly. */
.tm-btn-ghost,
.tm-ledger .tm-ledge-kicker a,
.tm-progress-link,
.tm-spine-preview-head a {
  position: relative;
}
.tm-btn-ghost::after,
.tm-ledger .tm-ledge-kicker a::after,
.tm-progress-link::after,
.tm-spine-preview-head a::after {
  content: "";
  position: absolute;
  inset: -12px -8px;
}

/* ===== declutter: glance tiles -> one quiet brief strip =====
   The hero is the page's one identity moment; the glance drops to native
   grammar — a single hairline row of tappable stats. The ledger band is
   retired entirely (today-meridian.js renderLedger). */
.tm-glance.tm-glance--brief{display:block;grid-template-columns:none;gap:0}
.tm-brief{
  display:flex;align-items:stretch;flex-wrap:wrap;
  background:#fff;border:1px solid var(--tm-line,#e9edf4);border-radius:14px;
  overflow:hidden;
}
.tm-brief-seg{
  flex:1;min-height:46px;min-width:0;
  display:flex;align-items:center;justify-content:center;gap:7px;
  padding:8px 6px;text-decoration:none;
  border-left:1px solid var(--tm-line,#e9edf4);
  transition:background .12s;
}
.tm-brief-seg:first-child{border-left:none}
.tm-brief-seg:active{background:#f6f8fc}
.tm-brief-seg b{
  font-size:15px;font-weight:700;color:var(--tm-ink,#16233f);
  font-variant-numeric:tabular-nums;letter-spacing:-.01em;white-space:nowrap;
}
.tm-brief-seg span{
  font-size:11.5px;font-weight:600;color:var(--tm-ink-2,#5d6b84);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.tm-brief-seg--preparation{
  flex:0 0 100%;justify-content:space-between;
  border-left:0;border-top:1px solid var(--tm-line,#e9edf4);
  padding-inline:12px;
}
.tm-brief-seg--preparation b{
  white-space:normal;text-align:right;
}
/* The label keeps its width. Without this a wrapping value squeezes "Coming up"
   to "Comi…" at 390px, because .tm-brief-seg span already ellipsises. */
.tm-brief-seg--preparation span{flex-shrink:0}
/* Same programme-date row: left-aligned content, secondary review status. */
.tm-brief-seg--upcoming{justify-content:flex-start;gap:12px;padding-block:10px}
.tm-brief-seg--upcoming .tm-upcoming-label{white-space:normal;max-width:108px}
.tm-brief-seg--upcoming .tm-upcoming-copy{
  flex:1;flex-shrink:1;min-width:0;white-space:normal;overflow:visible;
}
.tm-brief-seg--upcoming b{display:block;text-align:left;overflow-wrap:anywhere;line-height:1.4}
.tm-upcoming-status{display:block;margin-top:2px;font-size:11.5px;font-weight:500;color:var(--tm-ink-2,#5d6b84);line-height:1.4}
.tm-upcoming-chevron{width:16px;height:16px;flex:0 0 16px;color:var(--tm-ink-2,#5d6b84)}
.tm-brief-seg--today{background:#f6f8fd}
.tm-brief-seg--today .tm-upcoming-label{color:#275ca6}
.tm-brief-seg--upcoming:focus-visible{outline:2px solid #246be8;outline-offset:-3px;border-radius:0 0 13px 13px}
.tm-skeleton-brief{display:block;height:46px;border-radius:14px}
@media(prefers-reduced-motion:reduce){.tm-brief-seg{transition:none}}
