/* =============================================================================
   BILAL'S DASHBOARD — SENIOR ACCESSIBILITY DESIGN SYSTEM (v4: Modular
   2-Column Boxed Layout). Strict constraints: light background, white
   rounded boxed cards (16px radius), crisp outlines, modern system
   typography, 70-90px touch targets, fixed 2-column grid (iPad landscape)
   stacking to 1 column (iPhone portrait), zero on-load overlays/menus,
   zero internal "dual scroll" inside Box 1.
   ============================================================================= */

:root {
  /* ---- Core light palette ---- */
  --bg-page: #F8FAFC;        /* page background, per spec */
  --bg-card: #FFFFFF;        /* elevated white box cards */
  --bg-muted: #F1F5F9;       /* muted/light-gray background for paid bills, inset rows */
  --bg-tile: #EFF6FF;        /* pale blue contact row background */
  --border-color: #E2E8F0;   /* light card/row outline */
  --border-color-strong: #CBD5E1; /* slightly more visible divider */
  --text-primary: #0F172A;   /* deep slate/black — max contrast on white */
  --text-secondary: #475569; /* secondary text, still solidly readable on white */
  --text-tertiary: #94A3B8;  /* de-emphasized meta text */

  /* ---- Action accents ---- */
  --accent-blue: #2563EB;       /* audio / primary action buttons / Botim calls */
  --accent-blue-dark: #1D4ED8;  /* hover/active */
  --accent-green: #16A34A;      /* WhatsApp connect buttons, quick-action pills, "Awake", "Paid" */
  --accent-green-dark: #15803D;
  --accent-gold: #D97706;       /* mic FAB idle state, cricket highlight accents, "Due" badge */
  --accent-gold-dim: #B45309;   /* "Sleeping" badge text, due-badge text */
  --accent-teal: #0D9488;       /* contacts' "Call" button + accordion category headers */
  --accent-teal-dark: #0F766E;  /* hover/active */
  /* v14 §3: Medicine Tracker's own distinct Emerald/Medical Green — swapped
     in from the shared teal above so the tracker (bar + modal) reads as
     visually separate from the neutral gray/navy contact-category chrome,
     which keeps --accent-teal. */
  --accent-emerald: #065F46;        /* Medicine Tracker background/border */
  --accent-emerald-bright: #059669; /* Medicine Tracker hover/accent */
  --color-alert-red: #DC2626;

  /* ---- Category badge colors (To-Dos) ---- */
  --badge-family: #34D399;
  --badge-caregiver: #F472B6;
  --badge-self: #93C5FD;

  /* ---- Elevation ---- */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-card-lg: 0 2px 6px rgba(15, 23, 42, 0.06), 0 8px 20px rgba(15, 23, 42, 0.06);

  /* ---- Sizing ---- */
  --touch-min: 76px;         /* within the 70-90px mandated range */
  --border-width: 1px;
  --border-width-accent: 2px;
  --radius: 16px;

  /* ---- Typography ----
     Modern system-font stack: -apple-system/BlinkMacSystemFont/"SF Pro
     Display" match natively on Apple devices (zero network fetch — no
     external dependencies), "Inter" is a further fallback, ending in plain
     sans-serif. */
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Plus Jakarta Sans", sans-serif;
  --font-base: 24px;
  --line-height: 1.6;
  --letter-spacing: 0.01em;
  --letter-spacing-heading: -0.01em;

  font-size: var(--font-base);
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must always win over a class's own `display` rule. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-base);
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing);
  -webkit-text-size-adjust: 100%;
  overflow: hidden; /* the app itself never scrolls as a whole page */
}

h1, h2, h3, ul, ol, p {
  margin: 0;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: var(--letter-spacing-heading);
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid var(--accent-blue);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 14px;
}
::-webkit-scrollbar-track {
  background: var(--bg-page);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color-strong);
  border-radius: 8px;
  border: 2px solid var(--bg-page);
}

/* =============================================================================
   MAIN DASHBOARD — fixed 2-column grid (iPad landscape), stacking to 1
   column (iPhone portrait).
   ============================================================================= */

.dashboard {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  /* v24 "MASTER UI POLISH: Remove Full-Width White Microphone Bar" —
     there was never a `.voice-footer`/`.mic-bar`/`<footer>` element to
     make transparent (checked again this pass, same finding as v22 §4
     below); what actually READS as a "solid white bar" is THIS padding
     value — a big, page-background-colored dead zone the mic FAB used to
     float in. Cut from 190px to 96px (just enough to still clear the
     persistent utility bar's own ~76px height below it, re-measured with
     Playwright), so the mic now floats directly over real panel/contact
     content near the bottom, per spec, instead of a large empty margin.
     The clearance this used to also provide for Column 2's natural
     scroll-to-bottom is NOT simply lost — it's been moved onto
     .dash-column's own padding-bottom below (48px -> 190px), which only
     Column 2 uses now that .dash-column--left zeroes its own out; net
     effect is Column 1 gains ~94px of real usable grid height (helping
     the v24 §2 content-weighted grid actually fit), while Column 2's
     total scroll clearance stays effectively unchanged (96 + 190 = 286px,
     more than the previous 190 + 48 = 238px, if anything safer). */
  /* v26 §1: bottom reserve = the transparent dock (12px offset + 60px
     buttons) + 8px breathing room; top/gap tightened to hand the height back
     to Column 1 so its 4 panels fit with zero clipping. */
  padding: 12px clamp(16px, 2vw, 40px) 80px;
  gap: 12px;
}

/* =============================================================================
   v33 HEADER — fixed 75px bar in three groups:
     LEFT    2-line full date + time/zone stack
     CENTER  oversized orange hero mic + gleamy title + greeting
     RIGHT   stacked audio actions (Repeat Briefing / Read New Messages)
   Every rule in this block is scoped to `header.dash-header` (the one header
   element); nothing outside the header is touched. The old .dashboard-header
   grid rules and their children (.dashboard-header__titles / __clock,
   .dashboard-app-label, .dashboard-title, .action-btn--header) were only used
   by the previous header markup and are replaced by this block.
   ============================================================================= */

header.dash-header {
  height: 75px !important;
  max-height: 75px !important;
  margin: 0 0 10px 0 !important;
  padding: 0 16px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 16px;
  flex-shrink: 0;
  border-bottom: var(--border-width) solid var(--border-color-strong);
}

/* ---- LEFT: 2-line date & time stack ---- */
header.dash-header .header-datetime {
  /* equal-width side columns keep the center group truly centered */
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0; /* v35: line 2's own 2px margin-top is the spacer between the lines */
}

/* v35: date & time enlarged (were 14px/700 and 12px/600/#64748b) */
header.dash-header .header-datetime__date {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0f4c81 !important;
  line-height: 1.25;
  white-space: nowrap;
}

header.dash-header .header-datetime__time {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  margin-top: 2px !important;
  line-height: 1.25;
  white-space: nowrap;
}

/* v35: at iPad-portrait widths (781-899px) the side column (194-251px) is
   narrower than the one-line date at this size (~250px) and the text would
   run into the hero mic. Keep the requested size and let the date wrap onto
   two balanced lines there instead of shrinking it or covering the mic.
   (Wider screens keep it on one line; <=780px the header stacks anyway.) */
@media (min-width: 781px) and (max-width: 899px) {
  header.dash-header .header-datetime__date {
    white-space: normal;
    text-wrap: balance;
  }
}

/* ---- CENTER: hero mic + title & greeting ---- */
header.dash-header .header-center-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

header.dash-header .mic-btn {
  width: 56px !important;
  height: 56px !important;
  background: #f97316 !important;
  color: #ffffff !important;
  border-radius: 50% !important;
  border: none !important;
  font-size: 24px !important;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.45) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
}

header.dash-header .mic-btn:active {
  transform: scale(0.96);
}

header.dash-header .header-title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

header.dash-header .header-title {
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 1.5px;
  line-height: 1.2;
  white-space: nowrap;
  /* metallic blue gradient text; the highlight stays dark enough for 3:1 on white */
  color: #0f4c81;
  background: linear-gradient(90deg, #0f4c81 0%, #1e5bb8 35%, #3b7fd4 50%, #1e5bb8 65%, #0f4c81 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* ambient gold line */
  border-bottom: 3px solid #f59e0b;
  padding-bottom: 2px;
  margin-bottom: 2px;
}

/* v34: greeting scaled up (was 12px / 600 / slate) so it reads at a glance */
header.dash-header .header-subtitle {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #0f4c81 !important;
  margin-top: 2px !important;
  text-align: center;
  line-height: 1.25;
  white-space: nowrap;
}

/* v34: listening pulse, now carried by the single header mic (the floating
   mic that used to show it is gone). Overrides the orange fill above while
   voice.js has .mic-btn--listening on the button. */
header.dash-header .mic-btn.mic-btn--listening {
  background: #16a34a !important;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

/* transform, not box-shadow: the mic's shadow is !important, which beats animations */
@keyframes mic-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}

/* ---- RIGHT: audio action stack ---- */
header.dash-header .header-actions {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

header.dash-header .btn-repeat-briefing,
header.dash-header .btn-whatsapp-summary {
  font-weight: 700 !important;
  padding: 5px 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: uppercase; /* app.js swaps the Repeat label between mixed-case Pause / Resume / Repeat strings */
  cursor: pointer;
}

header.dash-header .btn-repeat-briefing {
  background: #e8f2ff !important;
  color: #1e5bb8 !important;
  border: 1.5px solid #b8d5ff !important;
}

header.dash-header .btn-whatsapp-summary {
  background: #e6f7ef !important;
  color: #0d6847 !important;
  border: 1.5px solid #b2e6ce !important;
}

header.dash-header .btn-repeat-briefing:active,
header.dash-header .btn-whatsapp-summary:active {
  transform: scale(0.97);
}

/* ---- v34: "Speaking... / Stop Audio" bar, anchored top-right in the header ----
   voice.js un-hides #speaking-badge and puts .is-speaking on .header-actions
   while audio plays; the two normal buttons are hidden for exactly that time
   and come back when the flag is removed. The bar no longer floats over the
   title and greeting. ---- */
header.dash-header .header-actions.is-speaking > .btn-repeat-briefing,
header.dash-header .header-actions.is-speaking > .btn-whatsapp-summary {
  display: none !important;
}

header.dash-header .speaking-badge {
  position: static;
  transform: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
  max-width: none;
}

header.dash-header .speaking-badge__text,
header.dash-header .speaking-badge__stop {
  background: #f0f9ff !important;
  border: 1.5px solid #0284c7 !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  line-height: 1.2;
  min-height: 0;
  min-width: 0;
  white-space: nowrap;
}

header.dash-header .speaking-badge__stop {
  cursor: pointer;
}

header.dash-header .speaking-badge__stop:hover,
header.dash-header .speaking-badge__stop:active {
  background: #e0f2fe !important;
}

/* iPad portrait widths (781-960px): the side columns are too narrow for the
   two pills in one row (they would run into the title), so they stack. */
@media (min-width: 781px) and (max-width: 960px) {
  header.dash-header .speaking-badge {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }
}

/* ---- Narrow screens (phones, iPad mini portrait) ----
   The three groups need ~760px side by side; below that a fixed 75px row
   would make the buttons collide with the title. The header reflows into
   stacked rows instead (mic + title, then date/time, then the two buttons),
   the same way the old header stacked on phones. ---- */
@media (max-width: 780px) {
  header.dash-header {
    height: auto !important;
    max-height: none !important;
    padding: 8px 16px !important;
    flex-wrap: wrap;
    justify-content: center !important;
    gap: 6px 16px;
  }

  header.dash-header .header-center-group {
    order: 1;
    flex: 1 1 100%;
    justify-content: center;
  }

  header.dash-header .header-datetime {
    order: 2;
    flex: 1 1 100%;
    align-items: center;
  }

  header.dash-header .header-actions {
    order: 3;
    flex: 1 1 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
}

.dashboard-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: 0;
}

.dash-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
  /* v11 "Viewport Bottom Padding Fix", value updated in v24: this base
     class is now effectively Column-2-only (.dash-column--left overrides
     padding-bottom back to 0 for Column 1's own rigid grid, which no
     longer scrolls and gets its clearance a different way — see that
     rule). Bumped 48px -> 190px in v24 specifically to make up for
     .dashboard's own bottom padding shrinking 190px -> 96px (the "white
     microphone bar" fix) — Column 2's total effective clearance before
     the fixed utility bar/mic FAB stays about the same (96+190=286px vs
     the old 190+48=238px) even though most of that reservation moved from
     the shared .dashboard padding onto this column-specific one. */
  overflow-y: auto;
  padding-bottom: 190px;
}

/* v25 "LAYOUT RECTIFICATION": reverted from v24's content-weighted CSS
   Grid back to a plain flex column with justify-content:space-between,
   per explicit request. Note for future passes: this is the same
   auto-sized-flex-items pattern that produced the original v23 clipping
   (447px/252px cut off on Panels 2/3) — v24's Grid + fr-ratios existed
   specifically to fix that. Reverting it trades that fix for an exact
   match to the requested CSS/reference screenshot; each panel's own
   internal content sizing (cricket banner, happening-item rows, staff
   salary banner, video card, bills card) is UNCHANGED from v24, so it's
   more compact than the original v23 content was, which helps offset
   the risk somewhat, but zero-clipping is no longer structurally
   guaranteed the way the Grid made it. */
.dash-column--left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* v23 §2 "Zero Scroll": the column is a hard-bounded box that never
     scrolls or clips-and-scrolls — the 4 panels below are sized so they all
     fit inside it (2 to-do rows max, 65px thumbnail, closed bills bar). */
  height: 100% !important;
  max-height: 100%;
  overflow: hidden !important;
  padding-bottom: 0;
  box-sizing: border-box;
}

/* Every one of Column 1's 4 panels keeps its natural content height; spare
   column height is shared out by the grow weights below (the master doc's
   0.5 : 2.0 : 1.2 : 0.4 fr split), with each panel's content centred so the
   extra space reads as even padding rather than a gap in the middle. */
.dash-column--left > div {
  min-height: 0;
  flex: 0 0 auto;
  overflow: visible;
  padding: 6px 12px !important;
  justify-content: center;
}

.dash-column--left > div:nth-child(1) { flex: 0.5 0 auto; }   /* Cricket ~60px  */
.dash-column--left > div:nth-child(2) { flex: 2 0 auto; }     /* To-Do   ~180px */
.dash-column--left > div:nth-child(3) { flex: 1.2 0 auto; }   /* YouTube ~140px */
.dash-column--left > div:nth-child(4) { flex: 0 0 auto; }     /* Bills   ~45px  */

/* Short tablet viewports (e.g. Safari with its toolbars on a 768px-tall iPad):
   tighten every panel a little more so all 4 still fit with zero clipping. */
@media (min-width: 821px) and (max-height: 700px) {
  .dash-column--left { gap: 4px; }
  .dash-column--left > div { padding: 3px 10px !important; }
  .dash-column--left .dash-box--panel .dash-box__title { font-size: 18px; }
  .dash-column--left .happening-item { padding: 1px 8px; }
  .dash-column--left .happening-item__listen-btn,
  .dash-column--left .happening-item__paid-btn { min-height: 40px; }
  .dash-column--left .youtube-video-card { padding: 3px 8px; gap: 3px; }
  .dash-column--left .youtube-video-card__watch-btn,
  .dash-column--left .youtube-video-card__listen-btn,
  .dash-column--left .youtube-video-card__see-all-btn { min-height: 40px; }
}

.dash-column.flash-highlight .dash-box:first-child {
  border-color: var(--accent-blue);
  border-width: var(--border-width-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), var(--shadow-card-lg);
}

/* v25 "LAYOUT RECTIFICATION" §1: Column 2 was previously sized to its own
   content with the whole column (title + list together) scrolling inside
   .dash-column's own overflow-y:auto — functional, but not strictly
   bounded to the viewport the way this asks for. Restructured so the
   column itself is a hard-bounded box (height/overflow clipped here) with
   the "Contacts" title pinned and only the list below it scrolling, in
   its own contained area, instead of the whole card. */
.dash-column--right {
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
}

.dash-column--right > .dash-box--contacts {
  min-height: 0;
  height: 100%;
  flex-shrink: 1;
  overflow: hidden;
}

/* ---- Modular boxed card — every "Box" in the spec is one of these ---- */

.dash-box {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

/* v19 "4-PANEL STACK SYSTEM" — Column 1's 4 low-height panels (Cricket,
   Daily To-Do, Family Video, Bills). Each is a plain .dash-box, just with
   a tighter internal gap/padding than the old 2-box layout, since a panel
   now holds one short piece of content (one match line, up to 3 items, one
   video card, one summary bar) instead of several stacked sections. The
   4 panels stack via .dash-column's existing flex gap — no new grid/scroll
   system needed; .dash-column's own overflow-y:auto remains the safety net
   if all 4 together ever exceed the viewport, same as before. */
.dash-box--panel {
  padding: 14px 18px;
  gap: 4px;
}

/* Same "section label, not content" reasoning already applied to
   .dash-box--contacts .dash-box__title (20px, down from the base 24px) —
   here it also keeps a panel's title + header button on one line more
   often, instead of wrapping to 2 lines and adding avoidable height to a
   panel that's supposed to stay low-height. */
.dash-box--panel .dash-box__title {
  font-size: 20px;
}

/* Panel 4 (Bills, closed card) has no title/header row at all — the
   summary bar itself says "Bills & Utilities," so the box shell collapses
   to just enough padding to frame that one button. */
.dash-box--panel-closed,
.dash-column--left > .dash-box--panel-closed {
  /* v23 §2: the ~45px closed summary bar is the card itself — the panel
     shell around it is see-through with no padding, so it adds no height. */
  padding: 0 !important;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* v24 "MASTER UI POLISH" — Panel 1 ("🇵🇰 Cricket", down from "🏏 Cricket &
   Live Sports"), "ultra-compact 1-row view". Tightens this panel's own
   header-to-content gap and, below, strips the banner's inherited
   --touch-min (76px) floor and most of its vertical padding — the banner
   itself has never been a tappable element (only the header's own ➕
   button, and one tap deeper the modal's rows, are), so there's no
   accessibility reason it needs to stay that tall. Text size (20px,
   .cricket-alert-banner__text) is untouched — the compactness comes
   entirely from removed whitespace, not smaller type. */
.dash-box--panel-cricket {
  gap: 2px;
}

.dash-box--panel-cricket .cricket-alert-banner {
  min-height: 0;
  padding: 2px 6px;
  gap: 4px 6px;
}

/* v24 §3 "Family YouTube" content-height pass, final trim: this panel's
   own header-to-card gap tightened the same way Panel 1's was. */
.dash-box--panel-video {
  gap: 2px;
}

.dash-box--panel-video .dash-box__title {
  font-size: 18px;
}

/* v11: the old "Vertical Expansion" negative-margin hack (pulling this box
   UP past the .dashboard bottom padding to hug the utility bar) is REMOVED
   — it fought against this pass's own "Viewport Bottom Padding Fix" (v11
   §1), which wants the opposite: guaranteed clearance below the lowest
   tile, not less of it. Column 2 behaves exactly like a plain .dash-box
   (flex-shrink:0, sized to its own content), scrolling (if ever needed)
   at the .dash-column level above.

   v13 §1: the exact override foreseen in the comment above IS reintroduced
   here — a few px of tighter box padding/title spacing, on this box only,
   so the 7-row primary section has the best real chance of clearing the
   fold at this app's tested 1180×820 iPad-landscape size before the 5
   secondary drawers below it need any scrolling to reach. */
.dash-box--contacts {
  padding: 8px 16px 14px;
  gap: 6px;
}

/* The "Contacts" heading is a section label, not actionable content, so a
   slightly smaller size here (still comfortably larger than normal body
   text) is traded for a few more px toward fitting all 7 primary rows
   before the fold — every OTHER heading and every row's own text stays at
   its normal, full senior-accessible size. */
.dash-box--contacts .dash-box__title {
  font-size: 20px;
}

.dash-box__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

/* =============================================================================
   BOX 1 — CRICKET ALERT BANNER
   ============================================================================= */

.cricket-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 14px;
  min-height: var(--touch-min);
  padding: 14px 18px;
  border-radius: var(--radius);
  border: var(--border-width-accent) solid var(--accent-gold);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.10), rgba(22, 163, 74, 0.08));
}

.cricket-alert-banner__text {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold-dim);
}

/* UI ACCESSIBILITY RULE (explicit tactile affordances): solid high-contrast
   fill by default — not just on hover/active, which a touch device never
   shows — so the button unambiguously "pops" as pressable at first glance. */
.cricket-alert-banner__more-btn {
  flex-shrink: 0;
  /* v24 §3 "ultra-compact 1-row view": shrunk from this app's 76px
     --touch-min down to the WCAG 2.5.5 (AA) 44px floor — same bounded,
     explicitly-flagged compromise already applied elsewhere in this pass
     (bills-closed-card, header icon buttons) purely to close the real
     content-vs-space gap the v24 fr-ratios alone couldn't. */
  min-height: 44px;
  background: var(--accent-green);
  border: var(--border-width-accent) solid var(--accent-green-dark);
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0 14px;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.cricket-alert-banner__more-btn:hover,
.cricket-alert-banner__more-btn:active {
  background: var(--accent-green-dark);
}

/* ---- Staff Salary Window Trigger (v9 spec §2.3) — same amber "money due"
   language already used for the bill due-badge, kept visually distinct
   from the cricket banner's green/gold gradient. Not counted against the
   Happening Today 4-item cap — see renderStaffSalaryBanner() in app.js. ---- */

.staff-salary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 6px;
  /* v24 §3 "Daily To-Do" content-height pass: same bounded 76px->44px
     WCAG-floor compromise as the rest of this panel's rows, needed to let
     the banner + up to 3 to-do rows actually fit the new 2.0fr share
     instead of clipping — see the .happening-item rule below for the
     full reasoning, which applies here identically. */
  min-height: 44px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: var(--border-width-accent) solid var(--accent-gold);
  background: rgba(217, 119, 6, 0.06);
}

.staff-salary-banner__body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.staff-salary-banner__icon {
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1.2;
}

.staff-salary-banner__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.staff-salary-banner__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-gold-dim);
  white-space: nowrap;
}

/* v24 §3 content-height pass: the staff name list is dynamic (grows with
   however many staff are due) and was the actual, data-dependent cause
   of this banner occasionally wrapping to a 2nd row — a single long
   line here could push the row wider than the icon+text+2-button
   combination has space for. Truncating with an ellipsis keeps this
   banner's own width predictable regardless of staff-list length; the
   full names are still read out in full by the Listen button's voice
   readout, unaffected. */
.staff-salary-banner__sub {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.staff-salary-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex-shrink: 0;
}

/* UI ACCESSIBILITY RULE (explicit tactile affordances): both buttons solid
   fill by default, not just on hover/active — same standard already
   applied everywhere else in this app. Heights bounded down to the WCAG
   44px floor per the v24 §3 content-height pass (see .staff-salary-banner
   above). */
.staff-salary-banner__listen-btn {
  min-height: 44px;
  background: var(--accent-blue);
  border: none;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  padding: 0 12px;
  box-shadow: var(--shadow-card);
}

.staff-salary-banner__listen-btn:hover,
.staff-salary-banner__listen-btn:active {
  background: var(--accent-blue-dark);
}

.staff-salary-banner__paid-btn {
  min-height: 44px;
  background: var(--accent-green);
  border: none;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  padding: 0 12px;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
}

.staff-salary-banner__paid-btn:hover,
.staff-salary-banner__paid-btn:active {
  background: var(--accent-green-dark);
}

/* ---- Happening Today list — capped to a max of 4 total items (including
   the cricket banner above), NEVER scrolls internally. ---- */

.happening-today-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* v24 §3 "Daily To-Do" content-height pass: the row itself is not a
   tappable control (only its own Listen/Call button is), so its former
   76px --touch-min floor was never an accessibility requirement, just
   headroom — shrunk here, along with tighter padding/type, specifically
   so up to 3 rows + the Staff Salary banner can actually fit the new
   2.0fr share of Column 1 without clipping, per the explicit v24 ask.
   The row's own Listen button (below) is bounded to the WCAG 44px floor,
   never smaller — same "bounded compromise, clearly flagged" precedent
   already used elsewhere in this file (Addendum 11, v22 §2). */
.happening-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 0;
  background: var(--bg-muted);
  border: var(--border-width) solid var(--border-color);
  border-radius: 10px;
  padding: 2px 8px;
}

.happening-item__icon {
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1.2;
}

.happening-item__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.happening-item__text {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
}

.happening-item__sub {
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-secondary);
}

/* v19 Panel 2 — a Birthday item (isBirthday) gets a warm gold accent
   border, matching the celebratory 🎉 icon and distinguishing it at a
   glance from an ordinary bill-alert/household item, without introducing
   a 4th accent color (reuses the existing gold token). */
.happening-item--birthday {
  border-color: var(--accent-gold);
  background: rgba(217, 119, 6, 0.08);
}

/* Wraps the optional Call button (Birthday items only, via
   actionButtonHtml — see buildTodoItems in app.js) + the Listen button
   that every item gets, so the two sit together on the row's trailing
   edge instead of the Listen button alone. */
.happening-item__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: center;
  gap: 4px;
  flex-shrink: 0;
}

.happening-item__listen-btn {
  flex-shrink: 0;
  min-height: 44px;
  min-width: 64px;
  background: var(--accent-blue);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  /* UI ACCESSIBILITY RULE: drop-shadow added for the "pop off the
     background as a pressable target" requirement — fill/color were
     already compliant. */
  box-shadow: var(--shadow-card);
}

.happening-item__listen-btn:hover,
.happening-item__listen-btn:active {
  background: var(--accent-blue-dark);
}

/* v23: the Staff Salaries item's own [ ✓ Mark Paid ] (formerly the separate
   salary banner's button) — same pill shape as Listen, green. */
.happening-item__paid-btn {
  flex-shrink: 0;
  min-height: 44px;
  min-width: 64px;
  background: var(--accent-green);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.happening-item__paid-btn:hover,
.happening-item__paid-btn:active {
  background: var(--accent-green-dark);
}

.empty-state {
  font-size: 19px;
  color: var(--text-secondary);
  font-style: italic;
  padding: 4px 2px;
}

/* v14 §1: box-header action buttons — "➕ EXPAND SCHEDULE" (Box 1) and "🔍
   VIEW ALL BILLS" (Box 2) both live directly in their box's header row now,
   replacing the old bottom-of-column orphan pill (.schedule-overflow-btn,
   removed) so the expansion trigger is never separated from the content it
   expands. UI ACCESSIBILITY RULE (explicit tactile affordances): solid blue
   fill by default, same standard as every other action button in this app. */
.dash-box__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dash-box__header-row .dash-box__title {
  flex: 1 1 auto;
}

/* v22 §2 "Compact Panel Header Buttons" — shrunk from a full-width
   labelled pill (min-height 76px, per this app's established touch-min)
   down to a 36×36px icon-only badge, per spec's exact figures.
   FLAGGED, NOT SILENTLY APPLIED: 36px sits below both this app's own
   70-90px accessible touch-target standard AND the WCAG 2.5.5 (AA) 44px
   floor it has never gone under in any earlier pass (see Addendum 11's
   explicit "bounded compromise, not a silent override" reasoning for
   contact rows) — and dropping the "EXPAND SCHEDULE" label text back to a
   bare icon is exactly the "subtle icon, not recognized as tappable"
   failure mode Addendum 7's UI Accessibility Rule was built to eliminate
   for Mr. Bilal. Implemented exactly as specified since the ask was
   explicit and precise (not ambiguous), not silently overridden to a
   larger size — but this is a real accessibility regression on these 2
   buttons specifically, worth a second look. The solid fill + shadow +
   circular shape at least keeps it visually "pop"-y per Addendum 7's
   other still-applicable rules. */
.dash-box__header-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 0;
  margin-left: auto;
  background: var(--accent-blue);
  border: none;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  padding: 0 0 3px;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
}

.dash-box__header-btn:hover,
.dash-box__header-btn:active {
  background: var(--accent-blue-dark);
}

/* =============================================================================
   v11 §5 — YOUTUBE RECOMMENDATIONS. Box 1 action card for the single
   newest unwatched video, same "not counted against the 4-item cap"
   precedent as the cricket/staff-salary banners above it — see
   renderYoutubeCard() in app.js. Purple accent (new to this palette,
   deliberately) so it's never confused with a bill/todo item or either
   banner while still reading as a normal, non-alarming card. */

/* v24 §3 "Family YouTube": every value below tightened from its v19
   original so the thumbnail + title + badge + all 3 buttons genuinely
   fit inside the new 1.2fr share of Column 1 with zero clipping, per the
   explicit v24 ask — content itself (thumbnail, title, 3 actions) is
   unchanged, only its whitespace/type sizing. */
.youtube-video-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius);
  border: var(--border-width-accent) solid #7C3AED;
  background: rgba(124, 58, 237, 0.06);
}

.youtube-video-card__badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #6D28D9;
  background: rgba(124, 58, 237, 0.14);
  padding: 1px 6px;
  border-radius: 999px;
}

.youtube-video-card__body {
  display: flex;
  align-items: center;
  gap: 8px;
}

.youtube-video-card__thumb {
  /* v23 §2: thumbnail capped at 65px tall and cropped — never stretched —
     with object-fit:cover, so thumbnail + badge + title + [ TAP TO WATCH ]
     all sit 100% inside the card. 116px wide keeps the 16:9 ratio at 65px. */
  width: 116px;
  height: 65px;
  max-height: 65px !important;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-muted);
}

.youtube-video-card__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.youtube-video-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: break-word;
  line-height: 1.25;
  /* at most 2 lines; the rest is cut with an ellipsis, so a long video title
     can never push the watch button out of the card */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Watch + Listen share one row (see-all is a separate full-width button
   below this row — see its own rule). */
.youtube-video-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
}

/* Primary action — kept the largest of this panel's 3 buttons, but still
   bounded down to the WCAG 44px floor (from 76px) like the rest of this
   pass's space-constrained buttons; never smaller than that floor. */
.youtube-video-card__watch-btn {
  flex: 1 1 140px;
  min-height: 44px;
  background: #7C3AED;
  border: none;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  padding: 0 12px;
  box-shadow: var(--shadow-card-lg);
}

.youtube-video-card__watch-btn:hover,
.youtube-video-card__watch-btn:active {
  background: #6D28D9;
}

.youtube-video-card__listen-btn {
  flex-shrink: 0;
  min-height: 44px;
  min-width: 64px;
  background: var(--accent-blue);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  box-shadow: var(--shadow-card);
}

.youtube-video-card__listen-btn:hover,
.youtube-video-card__listen-btn:active {
  background: var(--accent-blue-dark);
}

/* Now rendered INSIDE .youtube-video-card__actions (app.js) alongside
   Watch/Listen, so this row-flex context makes flex-basis a WIDTH again —
   the earlier ~90px-tall bug was this same rule applying to a column
   layout when this button was still a standalone sibling of the row. */
.youtube-video-card__see-all-btn {
  flex: 1 1 90px;
  min-height: 44px;
  background: var(--bg-card);
  border: var(--border-width-accent) solid #7C3AED;
  border-radius: 999px;
  color: #6D28D9;
  font-size: 12px;
  font-weight: 800;
  padding: 0 8px;
}

.youtube-video-card__see-all-btn:hover,
.youtube-video-card__see-all-btn:active {
  background: #7C3AED;
  color: #FFFFFF;
}

/* =============================================================================
   PANEL 4 — BILLS & UTILITIES (v19: closed card, replacing v14's 2
   consolidated DEWA/Etisalat preview blocks — see .bills-closed-card
   below). The original per-row styling (.bill-row and friends, further
   down) is KEPT AS-IS: it's still what renders inside the modal opened by
   tapping the closed card, so every bill's full detail/Listen-button
   styling is unchanged there.
   ============================================================================= */

.bills-list {
  display: flex;
  flex-direction: column;
}

/* The entire Panel 4 tap target — "💳 Bills & Utilities — N Active." Solid
   fill, full-width, per this app's UI ACCESSIBILITY RULE (every tappable
   element pops as pressable by default, not just on hover/active, which a
   touch device never shows anyway). Deliberately plain/neutral (not the
   amber "due" language .bill-row uses) since this card no longer says
   anything about paid/unpaid status at a glance — that detail lives one
   tap deeper, in the modal it opens.
   v24 "MASTER UI POLISH" ~45-50px height: shrunk from this app's own
   70-90px --touch-min standard down to 48px — the WCAG 2.5.5 (AA) floor,
   same bounded-compromise precedent Addendum 11 already set for the
   Column-2 compact rows (never below 44px) — since the card spans the
   panel's full width, its actual tap AREA stays enormous even at a
   shorter height; only the vertical dimension shrank. */
.bills-closed-card {
  /* v24 §1 follow-up: a few px short of full width on the right only, so
     this panel's own tap target clears the mic FAB's left edge (it
     floats centered in the 20px gutter between columns, right at this
     panel's own right edge) — confirmed with Playwright; the card is
     still the full remaining width and still the entire panel's tap
     target otherwise. */
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  padding: 4px 16px;
  box-shadow: var(--shadow-card);
}

.bills-closed-card:hover,
.bills-closed-card:active {
  background: var(--bg-muted);
}

.bills-closed-card__text {
  flex: 1 1 auto;
  text-align: left;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.bills-closed-card__chevron {
  flex-shrink: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-secondary);
}

.bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 12px;
  padding: 14px 16px 14px 18px;
  min-height: var(--touch-min);
  flex-shrink: 0;
}

/* Unpaid/due: bright white, dark text, bold amount, amber due badge, Listen button. */
.bill-row--due {
  background: var(--bg-card);
  border: var(--border-width) solid var(--border-color);
}

/* Paid: muted light-gray, green checkmark badge, no action button. */
.bill-row--paid {
  background: var(--bg-muted);
  border: var(--border-width) solid var(--border-color);
  opacity: 0.85;
}

.bill-row__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.bill-row__name {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
}

.bill-row--paid .bill-row__name {
  color: var(--text-secondary);
}

.bill-row__amount {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.due-badge,
.paid-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.due-badge {
  background: #FEF3C7;
  color: var(--accent-gold-dim);
}

.paid-badge {
  background: #DCFCE7;
  color: var(--accent-green-dark);
}

.bill-row__listen-btn {
  flex-shrink: 0;
  min-height: var(--touch-min);
  min-width: 130px;
  background: var(--accent-blue);
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  padding: 0 20px;
  /* UI ACCESSIBILITY RULE: drop-shadow added, same rationale as
     .happening-item__listen-btn above. */
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.bill-row__listen-btn:hover,
.bill-row__listen-btn:active {
  background: var(--accent-blue-dark);
}

/* =============================================================================
   CONTACTS — pinned "Immediate Family" tier + collapsible accordion groups
   ============================================================================= */

.contacts-column-body,
.contacts-list {
  display: flex;
  flex-direction: column;
  /* Tight row spacing (v9 spec, carried into v11, tightened again for v13
     §1's compact-row ask): trimmed from 22px, then from 14px, so the
     Primary tier and the 5 secondary drawers fit comfortably without
     wasted vertical gaps. */
  gap: 6px;
  /* v25 "LAYOUT RECTIFICATION" §1: this is now the actual scroll
     container (was .dash-column, scrolling the "Contacts" title along
     with it) — contained strictly within .dash-column--right's fixed
     bounds instead of letting the whole card grow past the viewport. */
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

/* ---- v24 "MASTER UI POLISH" §4 "Horizontal Group Buttons at Bottom" —
   REPLACES the v11 "Zero-Tab Hierarchy" vertical accordion-drawer stack
   (each secondary category its own full-width expand-in-place card,
   several could be open at once — see PHASE_2_BUILD_LOG.md Addendum 10)
   with a single horizontal row of compact category buttons: Grandchildren
   / Doctors / Property / Banks (In-Laws was already removed as its own
   category in v23 — see contacts.js). All 4 are always visible together,
   no vertical scrolling of this row ever required. Tapping one no longer
   expands anything in place — it opens that category's contacts in the
   shared #detail-modal (openContactCategoryModal in app.js), the same
   reused modal component every other tap-triggered overlay in this app
   already uses. ---- */

.contact-category-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

/* v26 §3 "Bottom Group Dock": the row of 4 buttons lives in its own
   container BELOW the scrolling contacts list (see index.html), so it is
   always visible at the bottom of Column 2, strictly above the page footer,
   while only the list above it scrolls. */
.contact-category-dock {
  flex: 0 0 auto;
  padding-top: 8px;
  border-top: var(--border-width) solid var(--border-color);
}

.contact-category-dock:empty {
  display: none;
}

/* UI ACCESSIBILITY RULE (explicit tactile affordances) still applies: solid
   high-contrast teal fill by default (not just on hover/active, which a
   touch device never shows), so each button unambiguously "pops" as
   pressable. min-height 48px — the same bounded WCAG-2.5.5(AA)-plus-margin
   compromise .bills-closed-card takes just above in this file, not this
   app's usual 70-90px --touch-min floor, since fitting 4 of these in one
   horizontal row with no scrolling is the whole point of this section;
   flex:1 1 0 splits the row's width evenly across however many render. */
.contact-category-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--accent-teal);
  border: none;
  border-radius: var(--radius);
  /* v23 §1 "Pinned 100% Readable Bottom Group Dock": 10px/6px padding,
     14px bold label, one line, never wrapped. */
  padding: 10px 6px;
  color: #FFFFFF;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.contact-category-btn:hover,
.contact-category-btn:active {
  background: var(--accent-teal-dark);
}

.contact-category-btn__icon {
  font-size: 17px;
  flex-shrink: 0;
}

.contact-category-btn__label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-row-list {
  display: flex;
  flex-direction: column;
  /* Tight row spacing (v9 spec): trimmed from 12px. */
  gap: 8px;
}

.contact-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--bg-tile);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  /* v14 §2a "Wide Contact Cards": a bit more breathing room than the v9
     10px/14px, now that Column 1 no longer needs Column 2 to stay quite
     so tight to balance the page visually. */
  padding: 12px 18px;
  min-height: var(--touch-min);
}

.contact-row__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 800;
  color: #FFFFFF;
}

/* =============================================================================
   v13 "MASTER REFRACTOR TASK" §1 — COMPACT ROW SPACING (CRITICAL FIX).
   ---------------------------------------------------------------------------
   FLAGGED, not silently done: this section intentionally shrinks the
   Primary-tier row/avatar/button sizing BELOW this file's own --touch-min
   (76px, "within the 70-90px mandated range" per the header comment at the
   top of this file) so the 2 WhatsApp group rows + Najma + 4 children (7
   rows total) fit on screen together without scrolling, per the spec's
   explicit "~56px-60px" row-height ask. Every button below still measures
   ≥44px tall — the WCAG 2.5.5 (AA) minimum target size — so this is a
   deliberate, bounded trade against this app's own stricter senior/MCI
   accessibility standard, not an ungoverned shrink. Everywhere ELSE in the
   app (the secondary drawers below, every modal, the mic FAB, the utility
   bar) keeps the full 76px --touch-min untouched. Worth a real-device check
   with Mr. Bilal specifically on whether these smaller targets are still
   comfortable for him to tap accurately — that's a judgment only he (or
   whoever's watching him use it) can make, not something to guess at here.
   Previously ".contact-row--primary" meant LARGER avatars (68px, "large
   avatar circles" per an earlier spec) — the opposite of this pass's own
   ask, so that rule is replaced outright rather than layered on top of.
   ============================================================================= */

.contact-row-list--compact {
  gap: 4px;
}

.contact-row-list--compact .contact-row {
  /* v14 §2a: nudged from 56px to fit the larger 22px inline name+time
     line (§2b) comfortably — still well inside the 66px/90px row-height
     budget this file's own test suite enforces for the Primary tier. */
  min-height: 62px;
  padding: 6px 10px;
  gap: 8px;
}

/* v26 §3: on tablet/desktop widths a row is ONE line of
   avatar | name+subtitle | buttons — the wrap that used to push a button-heavy
   row's name onto a second line is switched off. (Phones keep wrapping: there
   the buttons deliberately drop below the name at full width.) */
@media (min-width: 821px) {
  .contact-row-list--compact .contact-row {
    flex-wrap: nowrap;
  }
}

.contact-row-list--compact .contact-row__avatar {
  /* v14 §2a: bumped from 40px so the avatar still reads proportionate
     next to the larger 22px bold name. */
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.contact-row-list--compact .contact-row__actions {
  gap: 4px;
}

.contact-row-list--compact .contact-row__connect-btn {
  /* v23 §1: at most 2 pills per card ([ 📞 Call ] [ 💬 WhatsApp ]), so they
     can afford a readable 13px label while still leaving 60%+ of the card
     for the name / city line. */
  min-height: 44px;
  min-width: 88px;
  padding: 0 8px;
  font-size: 13px;
  gap: 3px;
}


/* v13 §2 — a Family WhatsApp Group row: same compact shell, but a fixed 💬
   icon avatar (a group has no name to initialize) rather than a colored
   initials circle. */
.contact-row--group .contact-row__avatar {
  font-size: 18px;
}

/* v14 §2b "Inline Local Times": name + clock now share ONE line (e.g.
   "Zuhair — 7:30 PM") instead of stacking on 2 — a wrapping flex row,
   baseline-aligned, with the clock's own "— " lead-in supplied by
   .contact-row__clock::before below so app.js's clock-tick code (which
   only ever writes the bare time/state text) needs no change. Falls back
   to wrapping onto its own line only if a row is too narrow to fit both
   (iPhone portrait, a long vacation label, etc.) rather than truncating
   or overlapping. */
.contact-row__info {
  /* v23 §1 "Single-Line Cap": the text block never wraps. min-width:0 is what
     lets this flex child shrink below its text width so the ellipsis can
     engage instead of the text wrapping onto a 2nd line. */
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  min-width: 0;
  flex: 1;
}

/* "<Name> — <City>, <time>" on ONE line: name (18px) then the 13px tail. */
.contact-row__line {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.contact-row__name {
  /* v23: 18px bold name (spec range 17-18px), one line, ellipsis. */
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-row__clock {
  /* v23: 13px "— City, 5:00 PM ☀️" tail (spec range 12-13px), same line as the
     name, one line, ellipsis. Awake / sleeping / vacation colours below. */
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-row__clock:empty {
  display: none;
}

/* the "—" between name and city: "Zuhair — Dubai, 5:00 PM" */
.contact-row__clock:not(:empty)::before {
  content: '— ';
}

/* v23: a 1024px-wide tablet gives Column 2 only ~450px — with two pills on the
   right there is not room for "Name — City, time" on one line without
   cutting text off. Between 821px and 1099px the same two pieces stack (name
   over "City, time", each still ONE line, no wrap, no ellipsis needed) and the
   pills tighten to their content. Wider screens keep the single line. */
@media (min-width: 821px) and (max-width: 1099px) {
  .contact-row__line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .contact-row__clock:not(:empty)::before {
    content: none;
  }

  .contact-row-list--compact .contact-row__connect-btn {
    min-width: 0;
    padding: 0 8px;
  }

  .contact-category-btn {
    gap: 4px;
    padding: 10px 4px;
  }

  .contact-category-btn__label {
    font-size: 13px;
  }
}

.contact-row__clock--awake {
  color: var(--accent-green);
}

.contact-row__clock--sleeping {
  color: var(--accent-gold-dim);
}

/* v11 §4 Vacation Mode: gold to match the mic FAB idle / due-badge accent
   already used elsewhere for "something temporary/attention-worthy," kept
   visually distinct from the green "Awake" / amber "Sleeping" pair above
   since a vacation badge isn't a wake/sleep state at all. */
.contact-row__clock--vacation {
  color: var(--accent-gold-dim);
  font-weight: 800;
}

/* v11 §3: Aaliyah's row (ButtonSet: 'None') — no action buttons at all,
   just her name and a soft explanatory note in place of the usual button
   row. Reuses .contact-row as its base so avatar/name sizing stays
   identical to every other row; this modifier only removes the
   space/alignment a button row would otherwise reserve. */
.contact-row--note-only {
  align-items: flex-start;
}

.contact-row__soft-note {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  /* v26 §3: .contact-row__info is a column again, so the note simply stacks
     under the name; kept to one line like every other subtitle. */
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-row__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  flex-shrink: 0;
  max-width: 40%;
}

.contact-row__connect-btn {
  min-height: var(--touch-min);
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  padding: 0 14px;
  color: #FFFFFF;
  text-decoration: none;
  /* UI ACCESSIBILITY RULE: drop-shadow added, same rationale as the
     listen buttons above. */
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* v23: the label sits in its own span so it can ellipsize inside the flex
   button — a button label never wraps to a 2nd line or spills out. */
.contact-row__btn-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-row__connect-btn--whatsapp {
  background: var(--accent-green);
}

.contact-row__connect-btn--whatsapp:hover,
.contact-row__connect-btn--whatsapp:active {
  background: var(--accent-green-dark);
}

.contact-row__connect-btn--botim {
  background: var(--accent-blue);
}

.contact-row__connect-btn--botim:hover,
.contact-row__connect-btn--botim:active {
  background: var(--accent-blue-dark);
}

/* v11 §3: Najma's single CALL button, and the "Local Call" (cellular)
   button Zuhair/Aman get alongside their WhatsApp/Botim pair. Deliberately
   its own solid color (not reused blue/green) so a cellular call is never
   visually confused with a Botim data call in the same row. */
.contact-row__connect-btn--call {
  background: var(--accent-teal);
}

.contact-row__connect-btn--call:hover,
.contact-row__connect-btn--call:active {
  background: var(--accent-teal-dark);
}

/* v11 §3: Sabine's Email-only button. */
.contact-row__connect-btn--email {
  background: var(--text-secondary);
}

.contact-row__connect-btn--email:hover,
.contact-row__connect-btn--email:active {
  background: var(--text-primary);
}

/* v13 §1 "No Placeholder Text Sprawl" FIX: a button whose underlying
   phone/email/link is still blank (every real family member, for now) used
   to render as a muted, dashed-outline "Number/Email not yet added"
   placeholder — text baked into the pill itself, stretching it taller than
   a working button. That variant (.contact-row__connect-btn--disabled) is
   REMOVED: app.js's actionButtonHtml() now reuses the exact same solid,
   active-looking, compact class as a real button of that kind (whatsapp/
   botim/call/email — see below), so nothing in Column 2 looks "broken" at a
   glance. Tapping it still can't reach a real number (the underlying safety
   choice from v11 §3 Q2 is unchanged) — it opens the shared detail modal
   via data-action="missing-contact-info" and explains what's missing there
   instead, see showMissingContactInfoModal() in app.js. */

/* v13 §2/§3 — the [🎙️ DICTATE] button: gold, matching the mic FAB's idle
   accent color, so anything voice-related reads as one consistent family of
   controls across the app rather than reusing whatsapp/botim/call's colors
   for an unrelated action. */
.contact-row__connect-btn--dictate {
  background: var(--accent-gold);
}

.contact-row__connect-btn--dictate:hover,
.contact-row__connect-btn--dictate:active {
  background: var(--accent-gold-dim);
}

/* =============================================================================
   v11 §2 — DEVICE-AWARE BOTIM GUARDRAIL. Content rendered inside the
   existing generic #detail-modal (see showBotimIphoneGuardrail() in
   app.js) — not a bespoke modal of its own, so only the inner content
   needs its own styling here; the modal chrome (panel, ✕ CLOSE, title) is
   already handled by .detail-modal__* above.
   ============================================================================= */

.botim-guardrail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 8px 4px 4px;
}

.botim-guardrail__icon {
  font-size: 48px;
}

.botim-guardrail__text {
  font-size: 21px;
  font-weight: 700;
  color: var(--text-primary);
}

/* =============================================================================
   v11 §4 — DYNAMIC VACATION MODE. The 2-step guided picker (contact, then
   city) also renders inside the generic #detail-modal — see
   openVacationModal()/vacationPickContactHtml()/vacationPickCityHtml() in
   app.js. A plain vertical list of oversized rows, matching every other
   tap-to-choose list in this app rather than inventing a new pattern.
   ============================================================================= */

.vacation-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vacation-picker__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--touch-min);
  width: 100%;
  background: var(--bg-tile);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius);
  padding: 0 18px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
}

.vacation-picker__row:hover,
.vacation-picker__row:active {
  background: var(--bg-muted);
  border-color: var(--border-color-strong);
}

.vacation-picker__row--clear {
  background: var(--bg-muted);
  border-style: dashed;
  color: var(--text-secondary);
  justify-content: center;
}

.vacation-picker__badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-gold-dim);
  background: #FEF3C7;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.vacation-picker__prompt {
  font-size: 19px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* =============================================================================
   v13 §3 — VOICE-DICTATED WHATSAPP MESSAGING. The read-back confirmation
   step ("Mr. Bilal, I heard: '...'. Should I send this to X?") also renders
   inside the generic #detail-modal — see showDictateReadback() in app.js —
   same reasoning as the Botim guardrail and Vacation Mode above: one modal
   shell, only the inner content differs.
   ============================================================================= */

.dictate-readback {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.dictate-readback__heard {
  font-size: 18px;
  color: var(--text-secondary);
}

.dictate-readback__quote {
  font-size: 23px;
  font-weight: 700;
  color: var(--text-primary);
  font-style: italic;
}

.dictate-readback__question {
  font-size: 19px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.dictate-readback__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dictate-readback__btn {
  min-height: var(--touch-min);
  width: 100%;
  border: none;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: var(--shadow-card-lg);
}

/* The spec names this one's height explicitly (80px) — honored precisely,
   same as the Medicine Tracker's "MARK AS TAKEN" button in an earlier pass. */
.dictate-readback__btn--send {
  min-height: 80px;
  font-size: 20px;
  background: var(--accent-green);
}

.dictate-readback__btn--send:hover,
.dictate-readback__btn--send:active {
  background: var(--accent-green-dark);
}

.dictate-readback__btn--again {
  background: var(--accent-gold);
  color: #FFFFFF;
}

.dictate-readback__btn--again:hover,
.dictate-readback__btn--again:active {
  background: var(--accent-gold-dim);
}

.dictate-readback__btn--cancel {
  background: var(--bg-muted);
  border: var(--border-width-accent) solid var(--border-color-strong);
  color: var(--text-primary);
}

.dictate-readback__btn--cancel:hover,
.dictate-readback__btn--cancel:active {
  background: var(--color-alert-red);
  border-color: var(--color-alert-red);
  color: #FFFFFF;
}

/* =============================================================================
   PERSISTENT BOTTOM UTILITY BAR — fixed outside the scroll area. Two
   side-by-side buttons (TV help + Medicine Tracker) sharing one fixed-
   position wrapper, added in the FEATURE ADDITION pass (previously just the
   single standalone TV bar).
   ============================================================================= */

.utility-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 130; /* above dashboard content, below the mic FAB (150) */
  display: flex;
  width: 100%;
}

.tv-help-bar,
.medicine-tracker-bar {
  flex: 1 1 50%;
  min-height: 76px;
  min-width: 0;
  color: #FFFFFF;
  border: none;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}

.tv-help-bar {
  background: var(--accent-green);
  border: var(--border-width-accent) solid var(--accent-green-dark);
}

.tv-help-bar:hover,
.tv-help-bar:active {
  background: var(--accent-green-dark);
}

/* v14 §3: Emerald/Medical Green — distinct from the teal contact-category
   headers and the green TV-help bar right next to it, so it reads
   instantly as its own, medically-flavored module. */
.medicine-tracker-bar {
  background: var(--accent-emerald);
  border: var(--border-width-accent) solid var(--accent-emerald-bright);
}

.medicine-tracker-bar:hover,
.medicine-tracker-bar:active {
  background: var(--accent-emerald-bright);
}

/* =============================================================================
   GENERIC DETAIL MODAL — reused for "+N Other Matches", "Full schedule",
   and the TV Instruction Modal. Opens only on a direct tap, never on load.
   ============================================================================= */

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 200; /* above the TV bar and mic FAB while open */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px clamp(20px, 4vw, 56px);
}

.detail-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);
}

.detail-modal__panel {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card-lg);
  max-width: 720px;
  width: 100%;
  max-height: min(85vh, 780px);
  overflow-y: auto;
  padding: 28px clamp(22px, 4vw, 44px) 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-modal__close {
  align-self: flex-end;
  min-height: var(--touch-min);
  min-width: 140px;
  background: var(--bg-muted);
  border: var(--border-width-accent) solid var(--border-color-strong);
  border-radius: 999px;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 800;
  padding: 0 20px;
}

.detail-modal__close:hover,
.detail-modal__close:active {
  background: var(--color-alert-red);
  border-color: var(--color-alert-red);
  color: #FFFFFF;
}

.detail-modal__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
}

.detail-modal__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 20px;
  color: var(--text-primary);
}

.detail-modal__body ol {
  margin: 0;
  padding-left: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Rows inside the "+N Other ICC Matches" modal body. */
.modal-fixture-row {
  padding: 12px 14px;
  border: var(--border-width) solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-muted);
}

.modal-fixture-row strong {
  font-size: 19px;
  color: var(--text-primary);
}

.item-card__meta {
  display: inline-block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-secondary);
}

/* ---- v11 §5: "Videos Suggested By Your Kids" modal — also rendered
   inside the generic #detail-modal (openVideosModal() in app.js), same
   pattern as the fixture-list rows above. ---- */

.video-modal__section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.video-modal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: var(--border-width) solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-muted);
}

.video-modal-row__thumb {
  width: 88px;
  height: 50px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-card);
}

.video-modal-row__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.video-modal-row__badge {
  font-size: 12px;
  font-weight: 800;
  color: #6D28D9;
}

.video-modal-row__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

.video-modal-row__watch-btn {
  flex-shrink: 0;
  min-height: var(--touch-min);
  min-width: 88px;
  background: #7C3AED;
  border: none;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  padding: 0 14px;
  box-shadow: var(--shadow-card);
}

.video-modal-row__watch-btn:hover,
.video-modal-row__watch-btn:active {
  background: #6D28D9;
}

/* ---- v11 §5: the actual embedded player (watchVideo() in app.js), opened
   with options.noAutoClose so the ~2-minute modal auto-close timer never
   cuts off a video Mr. Bilal is actively watching. Standard responsive
   16:9 wrapper since the iframe's own width/height attributes can't be
   made fluid directly. ---- */

.video-player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.video-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* =============================================================================
   MEDICINE TRACKER MODAL (FEATURE ADDITION, Addendum 6) — reuses the
   .detail-modal / .detail-modal__panel shell above for visual consistency
   (backdrop, close button, title) but is its own dedicated element; see
   app.js section 13 for why. Teal is this feature's accent color, kept
   distinct from the blue/green/gold already used elsewhere so its buttons
   are instantly recognizable as "the medicine ones."
   ============================================================================= */

.medicine-modal__panel {
  max-width: 760px;
  /* v14 §3: emerald top accent so the modal itself, not just the
     persistent bar button, reads as the medicine module at a glance. */
  border-top: 6px solid var(--accent-emerald);
}

.medicine-modal__vitals-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* UI ACCESSIBILITY RULE (explicit tactile affordances): solid teal fill —
   previously an outline button (light background, teal border/text) that
   only turned solid on :hover/:active, which touch devices never trigger.
   Same defect pattern already fixed for the cricket and schedule buttons. */
.vitals-pill-btn {
  flex: 1 1 220px;
  min-height: var(--touch-min);
  background: var(--accent-emerald);
  border: none;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 800;
  padding: 10px 18px;
  box-shadow: var(--shadow-card-lg);
}

.vitals-pill-btn:hover,
.vitals-pill-btn:active {
  background: var(--accent-emerald-bright);
}

.medicine-modal__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---- Slot checklist: every medicine due this slot, checked off as it's taken ---- */

.med-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-muted);
  border-radius: 12px;
}

.med-checklist__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  color: var(--text-secondary);
}

.med-checklist__row--done {
  color: var(--accent-green-dark);
  font-weight: 700;
}

.med-checklist__check {
  font-size: 20px;
  flex-shrink: 0;
}

/* ---- The oversized current-step card (the interactive routine's focal point) ---- */

.med-step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 24px 20px;
  background: var(--bg-card);
  border: var(--border-width-accent) solid var(--accent-emerald);
  border-radius: var(--radius);
}

.med-step-card__icon {
  font-size: 40px;
}

.med-step-card__name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.med-step-card__instructions {
  font-size: 19px;
  color: var(--text-secondary);
}

.med-step-card__taken-btn {
  min-height: 80px; /* spec explicitly calls out 80px for this control */
  width: 100%;
  max-width: 420px;
  background: var(--accent-green);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-card-lg);
}

.med-step-card__taken-btn:hover,
.med-step-card__taken-btn:active {
  background: var(--accent-green-dark);
}

.med-step-card__listening-hint {
  font-size: 16px;
  color: var(--accent-emerald);
  font-weight: 700;
}

.med-all-done {
  font-size: 21px;
  font-weight: 700;
  color: var(--accent-green-dark);
  text-align: center;
}

/* ---- Health Vitals Logger capture card ---- */

.vitals-capture {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: var(--border-width-accent) solid var(--accent-emerald);
  border-radius: var(--radius);
  text-align: center;
}

.vitals-capture__title {
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
}

.vitals-capture__hint {
  font-size: 17px;
  color: var(--accent-emerald);
  font-weight: 700;
}

.vitals-capture__manual {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.vitals-capture__manual-label {
  font-size: 15px;
  color: var(--text-secondary);
}

.vitals-capture__manual-input {
  min-height: var(--touch-min);
  border: var(--border-width-accent) solid var(--border-color-strong);
  border-radius: 12px;
  padding: 0 16px;
  font-size: 20px;
  font-family: inherit;
  color: var(--text-primary);
}

.vitals-capture__manual-input:focus-visible {
  outline: 4px solid var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.vitals-capture__manual-actions {
  display: flex;
  gap: 12px;
}

.vitals-capture__save-btn,
.vitals-capture__cancel-btn {
  flex: 1;
  min-height: var(--touch-min);
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 800;
}

.vitals-capture__save-btn {
  background: var(--accent-emerald);
  color: #FFFFFF;
  border: none;
  /* UI ACCESSIBILITY RULE: drop-shadow added, same rationale as the
     listen/connect buttons above. */
  box-shadow: var(--shadow-card);
}

.vitals-capture__save-btn:hover,
.vitals-capture__save-btn:active {
  background: var(--accent-emerald-bright);
}

.vitals-capture__cancel-btn {
  background: var(--bg-muted);
  border: var(--border-width-accent) solid var(--border-color-strong);
  color: var(--text-primary);
}

.vitals-capture__cancel-btn:hover,
.vitals-capture__cancel-btn:active {
  background: var(--color-alert-red);
  border-color: var(--color-alert-red);
  color: #FFFFFF;
}

/* =============================================================================
   RESPONSIVE: iPhone portrait — the 2 columns stack.
   ============================================================================= */

@media (max-width: 820px) {
  :root {
    --font-base: 20px;
  }

  /* On a phone the 2 columns stack into one long page instead of sharing a
     fixed-height viewport 50/50 — so the whole dashboard scrolls, and each
     column's row auto-sizes to its own content instead of both being
     forced into equal fixed-height halves (which was crushing/overlapping
     content that didn't fit its half). */
  .dashboard {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    flex: 1 0 auto;
  }

  /* v11: .dash-column's own overflow-y:auto/padding-bottom:48px (added for
     the desktop "Viewport Bottom Padding Fix") is switched off here — on
     mobile the whole .dashboard page scrolls instead (see above), so each
     column scrolling independently would just create a confusing nested
     double-scroll region. Neither .dash-box--contacts nor
     .contacts-column-body need their own overrides any more (both are now
     plain, un-flexed elements at every width), so this is the only mobile
     reset this section still needs for Column 2. */
  .dash-column {
    overflow-y: visible;
    padding-bottom: 0;
  }

  /* v23 §2: the zero-scroll lock is for the 2-column tablet layout; on a
     phone the columns stack and the whole page scrolls, so Column 1 grows
     to its content instead of being clipped. */
  .dash-column--left {
    height: auto !important;
    max-height: none;
    overflow: visible !important;
  }

  .dash-column--left > div,
  .dash-column--left > div:nth-child(n) {
    flex: 0 0 auto;
  }

  .contact-row__actions {
    max-width: none;
  }

  /* v23: 4 dock buttons across a ~360px phone are ~75px each — too narrow for
     icon + label side by side, so the icon sits above the label instead. */
  .contact-category-btn {
    flex-direction: column;
    gap: 2px;
    padding: 8px 2px;
  }

  .contact-category-btn__label {
    font-size: 13px;
  }

  .contact-row__actions {
    width: 100%;
  }

  .contact-row__connect-btn {
    flex: 1;
  }

  .tv-help-bar,
  .medicine-tracker-bar {
    font-size: 15px;
    padding: 8px 6px;
  }
}

/* =============================================================================
   PHASE 2 — VOICE UI
   ============================================================================= */

.action-btn {
  min-height: var(--touch-min);
  background: var(--bg-card);
  border: var(--border-width-accent) solid var(--accent-blue);
  border-radius: var(--radius);
  color: var(--accent-blue);
  font-size: 22px;
  font-weight: 700;
  padding: 12px 16px;
  box-shadow: var(--shadow-card);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.action-btn:hover,
.action-btn:active {
  background: var(--accent-blue);
  color: #FFFFFF;
}

/* v34: the floating mic (.mic-fab) and the free-floating speaking badge that
   used to be styled here are gone — the header mic is the only voice trigger
   and the Speaking / Stop Audio bar is styled inside the header block at the
   top of this file. */

.listening-overlay {
  position: fixed;
  inset: 0;
  z-index: 300; /* highest in the app: covers everything while recording */
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px clamp(24px, 4vw, 64px);
  text-align: center;
}

.listening-status {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-blue);
}

.listening-transcript {
  font-size: 28px;
  color: var(--text-primary);
  min-height: 3.2em;
  max-width: 900px;
  line-height: 1.6;
}

.listening-overlay__stop-btn {
  min-height: 80px;
  max-width: 420px;
  width: 100%;
}



/* =============================================================================
   v26 "v21 UI RECTIFICATION" §1 — FOOTER & MIC DOCK: NO FULL-WIDTH BAR.
   -----------------------------------------------------------------------------
   Every footer wrapper the spec names is forced transparent — no fill, no
   border, no shadow, no padding/margin. `.dash-footer`, `.voice-footer`,
   `.mic-bar` and a bare `footer` don't exist in this app's markup (same
   finding as v22 §4 / v24), so they are listed for safety; the wrapper that
   REALLY spans the screen width is `.utility-bar`, so it is included and is
   the one that actually changes: it used to be a solid green + emerald bar
   edge to edge. It is now an invisible layout-only dock holding two
   separate floating pill buttons. v34: the mic that used to float in the gap
   between them (v21 §4: 📺 TV | 🎤 MIC | 💊 MEDICINE) was removed — the header
   mic is the only voice trigger — so the dock is a clean 2-button row:
   📺 TV | 💊 MEDICINE.
   ============================================================================= */

.dash-footer,
.voice-footer,
.mic-bar,
footer,
.utility-bar {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.utility-bar {
  /* inset with left/right (not padding, which the rule above zeroes) so the
     pills float clear of the screen edges */
  left: clamp(16px, 2vw, 40px);
  right: clamp(16px, 2vw, 40px);
  bottom: 12px;
  width: auto;
  display: grid;
  grid-template-columns: 1fr 1fr; /* v34: two equal buttons, no mic slot in between */
  column-gap: clamp(10px, 1.6vw, 20px);
  align-items: center;
  /* the dock itself is inert and see-through: taps only ever land on the
     buttons, never on an invisible strip between them */
  pointer-events: none;
}

.utility-bar > button {
  pointer-events: auto;
}

.tv-help-bar,
.medicine-tracker-bar {
  min-height: 60px;
  font-size: 18px;
  padding: 6px 10px;
}

.tv-help-bar {
  grid-column: 1;
}

.medicine-tracker-bar {
  grid-column: 2;
}

@media (max-width: 820px) {
  /* Phone: same 2-button row, just a smaller label. */
  .tv-help-bar,
  .medicine-tracker-bar {
    font-size: 14px;
  }
}


/* =============================================================================
   v27 "DE-CLUTTERING" (MASTER_SYSTEM_ARCHITECTURE_v23 de-cluttering pass).
   -----------------------------------------------------------------------------
   Appended LAST on purpose: every rule here refines or overrides an earlier
   one of equal specificity, so the older sections above stay untouched.
     §1 Column 1 — ultra-light 4-panel stack (Cricket, To-Do, Bills, YouTube)
     §2 Column 2 — compact contact cards (3 pills in one row), dock unchanged
     §3 Footer   — sky-blue secondary buttons; the transparent-dock block above
                   (v26 §1) already matches the spec and is left as is.
   ============================================================================= */

:root {
  --ultra-light-bg: #F8FAFC;
  --ultra-light-border: #E2E8F0;
  --sky-bg: #F0F7FF;
  --sky-text: #2C6ECB;
  --sky-border: #D0E5FF;
  --listen-bg: #E8F2FF;
  --listen-text: #1E5BB8;
  --listen-border: #B8D5FF;
}

/* ---- §1 Column 1: grow weights (tablet/desktop only; phones stack) ---- */
@media (min-width: 821px) {
  .dash-column--left > div:nth-child(1) { flex: 1 0 auto; max-height: 160px; }   /* Cricket  80px+, first to receive spare height */
  .dash-column--left > div:nth-child(2) { flex: 0 0 auto; }                      /* To-Do    content height, 4px top/bottom padding */
  .dash-column--left > div:nth-child(3) { flex: 0 0 auto; }                      /* Bills    ~45px (closed bar) */
  .dash-column--left > div:nth-child(4) { flex: 1 0 auto; max-height: 260px; }   /* YouTube  ~130px+, takes what Cricket's cap leaves */
}

/* Slim, faint-blue [ 🔊 Listen ] button on the To-Do rows. */
.happening-item__listen-btn {
  flex-shrink: 0;
  min-height: 28px;
  min-width: 0;
  background: var(--listen-bg);
  color: var(--listen-text);
  border: 1px solid var(--listen-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.happening-item__listen-btn:hover,
.happening-item__listen-btn:active {
  background: #D6E8FF;
  color: var(--listen-text);
}

/* ---- Panel 1: Live Cricket Matches — no header text, 80px+ (v27c: room for the larger 17–18px match text) ---- */
.dash-column--left > .dash-box--panel-cricket {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 80px;
}

.cricket-panel__icon {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
}

/* the ultra-light container that spans the rest of the panel */
.dash-box--panel-cricket .cricket-alert-banner {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 6px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}

.cricket-match-lines {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cricket-match-line {
  min-width: 0;
  line-height: 1.25;
}

/* Match text hierarchy (v27c). Secondary match: 17px, regular weight, muted
   slate. The lead line of a day with no Pakistan match: 17px, semibold, full
   contrast. PRIORITY #1 (a Pakistan match, always listed first — see
   pickFeaturedFixtures): 18px, extra-bold, full contrast, on a soft green
   band with a Pakistan-green edge, so it is clearly the main line. */
.cricket-match-line .cricket-alert-banner__text {
  display: block;
  font-size: 17px;
  font-weight: 500;
  color: var(--text-secondary);
  /* wraps rather than ellipsizing, so a match's time is never cut off */
  white-space: normal;
  overflow-wrap: break-word;
}

.cricket-match-line:first-child .cricket-alert-banner__text {
  font-weight: 600;
  color: var(--text-primary);
}

.cricket-match-line--pakistan {
  padding: 3px 8px;
  background: rgba(22, 163, 74, 0.09);
  border-left: 4px solid var(--accent-green);
  border-radius: 6px;
}

.cricket-match-line.cricket-match-line--pakistan .cricket-alert-banner__text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.cricket-match-line--empty .cricket-alert-banner__text,
.cricket-match-line--empty:first-child .cricket-alert-banner__text {
  font-weight: 600;
  color: var(--text-secondary);
}

/* visually lighter circular [ + ] badge, right beside the match text */
.cricket-expand-badge {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  margin: 0;
  padding: 0 0 2px;
  background: #F0F7FF;
  color: #2C6ECB;
  border: 1px solid #D0E5FF;
  border-radius: 50%;
  opacity: 0.8;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

/* keep a generous invisible tap area around the small, light badge */
.cricket-expand-badge::after {
  content: '';
  position: absolute;
  inset: -8px;
}

.cricket-expand-badge:hover,
.cricket-expand-badge:active {
  background: #E1EFFF;
  opacity: 1;
}

/* ---- Panel 2: Daily To-Do & Action Items — rows max ~42px ----
   v27c padding trim: 4px above the header title and 4px below the last task
   box (the column rule sets 6px/12px with !important, so this needs the
   higher-specificity selector). Content sits at the top; the panel no longer
   grows, so the height it used to hold as whitespace goes to Panel 1. */
.dash-column--left > .dash-box--panel-todo {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
  justify-content: flex-start;
}

/* the [ + ] badge sits inline right after the title text, not at the far edge */
.dash-box__header-row--inline {
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 10px;
}

.dash-box__header-row--inline .dash-box__title {
  flex: 0 1 auto;
  min-width: 0;
}

.dash-box__header-row--inline .dash-box__header-btn {
  margin-left: 0;
}

.dash-box--panel-todo .happening-today-list {
  gap: 4px;
}

.dash-box--panel-todo .happening-item {
  align-items: center;
  min-height: 0;
  max-height: 42px;
  padding: 2px 8px;
  overflow: hidden;
}

.dash-box--panel-todo .happening-item__text,
.dash-box--panel-todo .happening-item__sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.happening-item__actions {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

/* a Birthday row's own 1-tap Call button and the Staff Salaries [ ✓ Mark Paid ]
   are slimmed to match the Listen button so the row stays under ~42px */
.happening-item__actions .contact-row__connect-btn,
.happening-item__paid-btn {
  min-height: 28px;
  min-width: 0;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
}

/* ---- Panel 3: Bills & Utilities — CLOSED summary bar (~45px), moved up ----
   The panel shell (.dash-box--panel-closed, earlier in this file) is see-through
   with no padding, so the bar itself is the ~45px card. */
.dash-column--left > .dash-box--panel-closed .bills-closed-card {
  min-height: 45px;
  padding: 4px 10px 4px 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: none;
}

.bills-closed-card__text {
  /* v28: hug the header text so the [ + ] badge sits inline right beside it
     (same alignment as the Daily To-Do header: title, 10px gap, badge) */
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-column--left > .dash-box--panel-closed .bills-closed-card {
  justify-content: flex-start;
  gap: 10px;
}

/* circular [ + ] expansion badge on the bar's right edge */
.bills-closed-card__badge {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding-bottom: 3px;
  background: var(--accent-blue);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow-card);
}

.bills-closed-card:hover .bills-closed-card__badge,
.bills-closed-card:active .bills-closed-card__badge {
  background: var(--accent-blue-dark);
}

/* ---- Panel 4: Family YouTube Recommendation — bottom, ~130px ---- */
/* no purple outline / tinted container: a plain ultra-light card */
.youtube-video-card {
  gap: 4px;
  padding: 4px 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
}

.youtube-video-card__thumb {
  width: 107px;
  height: 60px;
  max-height: 60px !important;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
}

.youtube-video-card__badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--listen-text);
  background: var(--listen-bg);
}

.youtube-video-card__actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.youtube-video-card__watch-btn {
  flex: 1 1 auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.youtube-video-card__next-btn,
.youtube-video-card__see-all-btn {
  flex: 0 0 auto;
  min-height: 34px;
  background: var(--sky-bg);
  color: var(--sky-text);
  border: 1px solid var(--sky-border);
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.youtube-video-card__next-btn:hover,
.youtube-video-card__next-btn:active,
.youtube-video-card__see-all-btn:hover,
.youtube-video-card__see-all-btn:active {
  background: #E1EFFF;
  color: var(--listen-text);
}

/* ---- §2 Column 2: reduced contact padding, 3 pills on one line ---- */
.contact-row-list--compact {
  gap: 0;
}

.contact-row-list--compact .contact-row {
  min-height: 0;
  padding: 6px 10px;
  margin-bottom: 6px;
  gap: 8px;
}

/* the name never gives way: only the "— City, time" tail may ellipsize */
.contact-row__line .contact-row__name {
  flex-shrink: 0;
}

.contact-row__line .contact-row__clock {
  flex-shrink: 1;
}

/* Tablet/desktop: 3 pills + avatar + "Name — City, time" share ONE line, and all
   10 rows (2 chat rows + 8 family) fit the list without scrolling. */
@media (min-width: 821px) {
  .contact-row-list--compact .contact-row {
    gap: 6px;
  }

  .contact-row-list--compact .contact-row__avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .contact-row-list--compact .contact-row__actions {
    flex: 0 0 auto;
    max-width: none;
    gap: 3px;
  }

  .contact-row-list--compact .contact-row__connect-btn {
    min-height: 32px;
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
    gap: 3px;
  }
}

/* ---- §3 Footer & mic dock: button restorations (v23 rectification) ----
   (The transparent .dash-footer/.voice-footer/.mic-bar/footer/.utility-bar
   block from v26 above already matches the spec and is left as is.)

   📺 HOW TO USE THE TV — prominent white button so it stands out to Mr. Bilal. */
.tv-help-bar {
  background: #ffffff !important;
  color: #1e5bb8 !important;
  border: 2px solid #b8d5ff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  opacity: 1;
}

.tv-help-bar:hover,
.tv-help-bar:active {
  background: #f0f7ff !important;
}

/* 💊 MEDICINE TRACKER — white text, white 1px border, weight 500, as specified.
   The specified fill (rgba(255,255,255,0.35)) is a frosted-glass fill meant to
   sit on a dark backdrop; over this page's near-white canvas it is
   effectively invisible (white text on ~white, contrast ≈1:1), which would
   hide the medicine button from Mr. Bilal. So it keeps the button's ORIGINAL
   emerald fill underneath (var(--accent-emerald), white text = 7.9:1). */
.medicine-tracker-bar {
  background: var(--accent-emerald) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  font-weight: 500 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
  opacity: 1;
}

.medicine-tracker-bar:hover,
.medicine-tracker-bar:active {
  background: var(--accent-emerald-bright) !important;
}

/* ---- v27 phone (≤820px): the columns stack, so the no-wrap/ellipsis rows
   above must be allowed to shrink with the screen (minmax(0,1fr) stops a
   long unbroken line from widening the whole page) and to wrap instead of
   cutting text off. ---- */
@media (max-width: 820px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dash-column,
  .dash-box,
  .dash-column--left > div {
    min-width: 0;
  }

  .dash-box--panel-todo .happening-item {
    max-height: none;
  }

  .dash-box--panel-todo .happening-item__text,
  .dash-box--panel-todo .happening-item__sub,
  .bills-closed-card__text,
  .cricket-match-line .cricket-alert-banner__text {
    white-space: normal;
  }

  .happening-item {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .youtube-video-card__actions {
    flex-wrap: wrap;
  }

  .youtube-video-card__watch-btn {
    flex: 1 1 100%;
  }

  .youtube-video-card__next-btn,
  .youtube-video-card__see-all-btn {
    flex: 1 1 0;
  }

  /* size the 3 pills by their labels so "💬 WhatsApp" is never cut to "Whats…" */
  .contact-row-list--compact .contact-row__connect-btn {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 0 8px;
  }
}


/* =============================================================================
   v24 "FAINTER BUTTON FILLS & RING-FENCED STYLING" (MASTER_SYSTEM_ARCHITECTURE_v24)
   -----------------------------------------------------------------------------
   Appended last so it wins the cascade. The spec's .btn-call / .btn-whatsapp /
   .btn-botim / .btn-tap-to-watch hooks are now on the real buttons (app.js);
   the existing BEM classes are listed too so no variant is missed.
   ============================================================================= */

/* ---- §1 Faint contact action buttons: names stay the focal point ---- */
.btn-call,
.contact-row__connect-btn--call {
  background: #e8f2ff !important;
  color: #1e5bb8 !important;
  border: 1px solid #b8d5ff !important;
}

.btn-whatsapp,
.contact-row__connect-btn--whatsapp {
  background: #e6f7ef !important;
  color: #0d6847 !important;
  border: 1px solid #b2e6ce !important;
}

.btn-botim,
.contact-row__connect-btn--botim {
  background: #eafaf1 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}

/* tap feedback stays faint (the older solid hover colours would flash dark) */
.btn-call:hover, .btn-call:active,
.contact-row__connect-btn--call:hover, .contact-row__connect-btn--call:active {
  background: #d6e8ff !important;
}
.btn-whatsapp:hover, .btn-whatsapp:active,
.contact-row__connect-btn--whatsapp:hover, .contact-row__connect-btn--whatsapp:active {
  background: #d3f0e2 !important;
}
.btn-botim:hover, .btn-botim:active,
.contact-row__connect-btn--botim:hover, .contact-row__connect-btn--botim:active {
  background: #d8f5e4 !important;
}

/* ---- YouTube panel: softer TAP TO WATCH ---- */
.btn-tap-to-watch,
.youtube-video-card__watch-btn {
  background: #e8f2ff !important;
  color: #1e5bb8 !important;
  border: 1px solid #b8d5ff !important;
  font-weight: 700 !important;
}

.btn-tap-to-watch:hover, .btn-tap-to-watch:active,
.youtube-video-card__watch-btn:hover, .youtube-video-card__watch-btn:active {
  background: #d6e8ff !important;
}

/* ---- §2 Panel 1: Pakistan match text = priority #1 (17–18px, bold, #0f4c81) ---- */
.cricket-match-line.cricket-match-line--pakistan .cricket-alert-banner__text {
  font-size: 18px;
  font-weight: 700;
  color: #0f4c81;
}

/* ---- §2 Footer: HOW TO USE THE TV — bright golden amber, dark navy text (v26) ---- */
.tv-help-bar,
.tv-guide-btn,
#btn-tv,
[data-action="tv"] {
  background: #f59e0b !important;
  color: #0f172a !important;
  border: 2px solid #d97706 !important;
  font-weight: 800 !important;
  font-size: 16px !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
  opacity: 1;
}

.tv-help-bar:hover, .tv-help-bar:active {
  background: #fbbf24 !important;
}

/* ---- §2 Footer: MEDICINE TRACKER — subtle translucent navy fill, white text ---- */
.medicine-tracker-bar,
.medicine-btn,
#btn-medicine,
[data-action="medicine"] {
  background: rgba(15, 76, 129, 0.35) !important;
  color: #ffffff !important;
  border: 1px solid rgba(15, 76, 129, 0.5) !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

.medicine-tracker-bar:hover, .medicine-tracker-bar:active {
  background: rgba(15, 76, 129, 0.5) !important;
}


/* =============================================================================
   v24 "SECTION RELABELING & WHITESPACE REBALANCING" (MASTER_SYSTEM_ARCHITECTURE_v24)
   -----------------------------------------------------------------------------
   Column 1: dead space inside the Action Items and YouTube panels is trimmed
   and handed to the gaps BETWEEN the 4 panels, so each reads as its own card.
   Bills & Utilities spacing is deliberately untouched.
   ============================================================================= */

/* ---- Inter-panel gap: 4 independent cards with breathing room ----
   Every panel hugs its content (YouTube no longer stretches into empty
   padding); spare column height is shared out evenly BETWEEN panels
   (space-between), never inside them. 14px is the minimum gap. */
.dash-column--left {
  gap: 14px;
  justify-content: space-between;
}

@media (min-width: 821px) {
  .dash-column--left > div:nth-child(4) { flex: 0 0 auto; max-height: none; }   /* YouTube hugs its content */
}

@media (min-width: 821px) and (max-height: 700px) {
  .dash-column--left { gap: 10px; }   /* short tablets: still no clipping */
}

/* ---- Action Items: tight header, tight task boxes, ~18% shorter Listen ---- */
.dash-column--left > .dash-box--panel-todo {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  gap: 2px;
}

.dash-box--panel-todo .happening-today-list {
  gap: 3px;
}

/* task box fits snugly around its text (its height follows the slimmer Listen pill) */
.dash-box--panel-todo .happening-item {
  padding: 1px 8px;
  min-height: 0;
  align-items: center;
}

.dash-box--panel-todo .happening-item__text {
  line-height: 1.2;
}

/* 28px -> 23px (~18%); font stays 13px */
.dash-column--left .happening-item__listen-btn,
.dash-column--left .happening-item__paid-btn,
.dash-column--left .happening-item__actions .contact-row__connect-btn {
  min-height: 23px;
  padding-top: 2px;
  padding-bottom: 2px;
  font-size: 13px;
  line-height: 1.15;
}

/* ---- YouTube: trimmed padding, ~20% shorter buttons, taller thumbnail ---- */
.dash-column--left > .dash-box--panel-video {
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}

.dash-column--left .youtube-video-card {
  padding: 2px 8px;
  gap: 3px;
}

/* 34px -> 27px (~20%); font stays 13px */
.dash-column--left .youtube-video-card__watch-btn,
.dash-column--left .youtube-video-card__next-btn,
.dash-column--left .youtube-video-card__see-all-btn {
  min-height: 27px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
  line-height: 1.15;
}

/* reclaimed height goes to the preview: 60px -> 78px (16:9 => 139px wide) */
.youtube-video-card__thumb {
  width: 139px;
  height: 78px;
  max-height: 78px !important;
}


/* =============================================================================
   v25 "CRICKET BOX TRIM" (MASTER_SYSTEM_ARCHITECTURE_v25)
   -----------------------------------------------------------------------------
   The outer Cricket card no longer stretches (it used to grow to 160px with the
   match text floating in the middle): 4px 10px padding, no min-height floor,
   no flex growth, so the frame hugs the match text. Spare column height now
   falls between the panels (v24 space-between), not inside this box.
   ============================================================================= */
.dash-column--left > .dash-box--panel-cricket {
  padding: 4px 10px !important;
  min-height: 0;
  gap: 8px;
}

.dash-box--panel-cricket .cricket-alert-banner {
  padding: 4px 10px;
}

@media (min-width: 821px) {
  .dash-column--left > div:nth-child(1) {
    flex: 0 0 auto;
    max-height: 120px;
  }
}


/* =============================================================================
   v26 "DYNAMIC BILL STATUS COLORS" (MASTER_SYSTEM_ARCHITECTURE_v26)
   -----------------------------------------------------------------------------
   The closed Bills & Utilities bar is tinted by state (set in app.js
   renderUtilityBills): pale red while any bill is unpaid, pale green once all
   are paid. Both are lighter than the Cricket card. The label sits in its own
   span with its own colour, so the text colour is applied to it directly.
   ============================================================================= */
.bills-panel.unpaid,
.bills-summary.unpaid,
.bills-closed-card--unpaid {
  background: #fef2f2 !important;
  color: #991b1b !important;
  border: 1px solid #fecaca !important;
}

.bills-panel.paid,
.bills-summary.paid,
.bills-closed-card--paid {
  background: #f0fdf4 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
}

.bills-summary.unpaid .bills-closed-card__text,
.bills-closed-card--unpaid .bills-closed-card__text {
  color: #991b1b !important;
}

.bills-summary.paid .bills-closed-card__text,
.bills-closed-card--paid .bills-closed-card__text {
  color: #166534 !important;
}

/* tap feedback stays inside the same pastel */
.bills-summary.unpaid:hover, .bills-summary.unpaid:active,
.bills-closed-card--unpaid:hover, .bills-closed-card--unpaid:active {
  background: #fee2e2 !important;
}

.bills-summary.paid:hover, .bills-summary.paid:active,
.bills-closed-card--paid:hover, .bills-closed-card--paid:active {
  background: #dcfce7 !important;
}


/* =============================================================================
   v38/v39 — CONTACTS SPACE TRIM + 2-ROW x 3-COLUMN TEXT-ONLY GROUP DOCK
   -----------------------------------------------------------------------------
   Scoped to Column 2 only (.dash-box--contacts, #contacts-column-body,
   #contact-category-dock) — Column 1 and the top header are not touched. The
   spec's .contacts-card / #contacts-container are this build's
   .dash-box--contacts / #contacts-column-body. Avatars (.contact-row__avatar)
   are deliberately left alone.
   ============================================================================= */

/* §1 Reclaim the space under the "Contacts" title: the card's flex gap (6px)
   is dropped and the list's own 4px top padding is the only space left. */
.dash-box--contacts {
  padding-top: 4px !important;
  margin-top: 0 !important;
  gap: 0 !important;
}

#contacts-column-body {
  padding-top: 4px !important;
  margin-top: 0 !important;
  gap: 6px !important;
}

/* Row-to-row spacing: 4px, applied once (the compact list used to get its
   spacing from a per-row margin-bottom instead of a gap).
   v21 (MSA V1 §2): was 6px, which made the 10-row stack 518px tall inside the
   506px box — 12px of scrolling. Now 10 x 46px rows + 9 x 4px gaps + the
   box's 4px top padding = 500px, so the main list never scrolls on iPad. */
#contacts-column-body .contact-row-list--compact {
  gap: 4px !important;
}

#contacts-column-body .contact-row-list--compact .contact-row {
  margin-bottom: 0 !important;
}

/* §2 Group dock: 2 rows x 3 columns of text-only pills. */
.contact-category-dock {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 4px !important;
  margin-top: 6px !important;
  padding-top: 6px !important;
  border-top: 1px solid #e2e8f0 !important;
}

.contact-category-dock:empty {
  display: none !important;
}

.contact-group-pill {
  background: #0d9488 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.3) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0;
  padding: 0 4px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

/* Pressed / selected: deep high-contrast teal. (The pale grey press colour that
   used to be here would have turned the white label unreadable on tap.) */
.contact-group-pill:active,
.contact-group-pill.active {
  background: #0f766e !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(15, 118, 110, 0.5) !important;
}


/* =============================================================================
   v39 — CONTACT GROUP POP-OUT MODAL (#contact-group-modal)
   -----------------------------------------------------------------------------
   Opened by the 6 dock pills. Reuses the .detail-modal shell (fixed overlay,
   backdrop button, panel) and overrides it for a high-contrast look: dark dim
   behind, white panel, large bold title beside a prominent red close button,
   and large contact cards whose avatar / name / pills are all scaled up.
   The panel itself does not scroll — only the card list does — so the header
   and its close button stay on screen however many contacts there are.
   Scoped to .contact-group-modal: nothing here touches Column 1, the header,
   or the compact rows in Column 2.
   ============================================================================= */

.contact-group-modal .detail-modal__backdrop {
  background: rgba(15, 23, 42, 0.7);
}

.contact-group-modal__panel {
  max-width: 900px;
  overflow: hidden;
  gap: 16px;
  border: 3px solid #0f172a;
  background: #ffffff;
}

.contact-group-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-bottom: 14px;
  border-bottom: 3px solid #0f4c81;
}

.contact-group-modal__title {
  font-size: 34px;
  line-height: 1.15;
  font-weight: 900;
  color: #0f172a;
  min-width: 0;
}

.contact-group-modal__close {
  min-height: 60px;
  padding: 0 24px;
  background: #b91c1c;
  color: #ffffff;
  border: 3px solid #7f1d1d;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(127, 29, 29, 0.35);
}

.contact-group-modal__close:hover,
.contact-group-modal__close:active {
  background: #7f1d1d;
}

.contact-group-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 4px 0;
}

.contact-group-modal__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-group-modal__empty {
  font-size: 22px;
  font-weight: 700;
  color: #334155;
  padding: 24px 4px;
}

/* ---- Large contact cards ---- */
.contact-group-modal .contact-row {
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 16px 20px;
  margin: 0;
  min-height: 0;
  background: #ffffff;
  border: 2px solid #334155;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.contact-group-modal .contact-row__avatar {
  width: 76px;
  height: 76px;
  font-size: 28px;
  border: 3px solid #0f172a;
}

.contact-group-modal .contact-row__info {
  flex: 1 1 220px;
}

.contact-group-modal .contact-row__name {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.contact-group-modal .contact-row__clock,
.contact-group-modal .contact-row__clock--awake,
.contact-group-modal .contact-row__clock--sleeping,
.contact-group-modal .contact-row__clock--vacation {
  font-size: 17px;
  color: #334155;
}

.contact-group-modal .contact-row__soft-note {
  font-size: 18px;
  color: #334155;
}

/* ---- Name + clock: stacked, so neither is ever cut off by the pills ---- */
.contact-group-modal .contact-row__line {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.contact-group-modal .contact-row__name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.contact-group-modal .contact-row__clock {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.contact-group-modal .contact-row__clock:not(:empty)::before {
  content: none;
}

/* ---- High-contrast action pills: solid dark fills, white 20px labels ----
   !important is needed here: the v24 "faint button fills" block further up
   forces pastel fills on every .contact-row__connect-btn--* with !important,
   and the pop-out is the one place that is meant to be the opposite. Colour
   meaning is kept (Call blue, WhatsApp teal-green, Botim green); every fill
   is dark enough for white text at 5:1 or better. */
.contact-group-modal .contact-row__actions {
  flex: 1 1 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: none;
  gap: 10px;
}

.contact-group-modal .contact-row__connect-btn {
  min-height: 60px;
  min-width: 132px;
  padding: 0 18px;
  font-size: 20px;
  font-weight: 800;
  gap: 8px;
  color: #ffffff !important;
  border: 2px solid rgba(15, 23, 42, 0.6) !important;
}

.contact-group-modal .contact-row__connect-btn--call { background: #1d4ed8 !important; }
.contact-group-modal .contact-row__connect-btn--whatsapp { background: #0f766e !important; }
.contact-group-modal .contact-row__connect-btn--botim { background: #15803d !important; }
.contact-group-modal .contact-row__connect-btn--email { background: #334155 !important; }

.contact-group-modal .contact-row__connect-btn:hover,
.contact-group-modal .contact-row__connect-btn:active {
  filter: brightness(0.85);
}


/* =============================================================================
   TV ASSISTANT MODAL (#tv-modal) — "Channel Guide & Inspiration" + "TV Doctor"
   ---------------------------------------------------------------------------
   High contrast on purpose: a solid black panel, white type, one yellow accent
   (#FACC15 on black = 14:1), every button >= 72px tall with 24px+ type.
   The panel starts BELOW the dashboard header (app.js sets --tv-modal-top from
   the header's bottom edge) so the header mic and [ Stop Audio ] stay visible
   and tappable — no z-index tricks, no second mic. z-index 200 like the other
   modals (the confirm card at 250 and the listening overlay at 300 still sit
   on top of it). Only one of the three views (menu / guide / help) shows at a
   time; app.js toggles `hidden` on them and sets #tv-modal[data-mode].
   ============================================================================= */

.tv-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--tv-modal-top, 0px);
  z-index: 200;
  display: flex;
  background: #000000;
  color: #FFFFFF;
  border-top: 4px solid #FACC15;
}

.tv-modal__panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 clamp(16px, 3vw, 40px) 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Title / back / close stay pinned while the body scrolls. */
.tv-modal__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0 12px;
  background: #000000;
  border-bottom: 3px solid #FACC15;
}

.tv-modal__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  color: #FACC15;
}

.tv-modal__close,
.tv-modal__back {
  flex: 0 0 auto;
  min-height: 76px; /* the project's --touch-min */
  min-width: 150px;
  padding: 0 24px;
  border: 4px solid #FFFFFF;
  border-radius: 999px;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.tv-modal__close { background: #FFFFFF; color: #000000; }
.tv-modal__back  { background: #FACC15; color: #000000; border-color: #FACC15; }

.tv-modal button:focus-visible {
  outline: 6px solid #38BDF8;
  outline-offset: 4px;
}

.tv-view { display: flex; flex-direction: column; gap: 20px; }

/* ---- MENU: the two primary modes ---- */
.tv-view--menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding-top: 8px;
}
/* 3 Oct: the greeting and its microphone hint sit above the two buttons, across both columns */
.tv-menu-greeting { grid-column: 1 / -1; }
.tv-menu-greeting[hidden] { display: none; }

.tv-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  padding: 24px 20px;
  border: 8px solid #FFFFFF;
  border-radius: 32px;
  text-align: center;
  cursor: pointer;
}

.tv-mode-btn--guide { background: #FACC15; color: #000000; border-color: #FFFFFF; }
.tv-mode-btn--help  { background: #FFFFFF; color: #000000; border-color: #22C55E; }

.tv-mode-btn__icon  { font-size: 76px; line-height: 1; }
.tv-mode-btn__label { font-size: 38px; font-weight: 900; line-height: 1.15; }
.tv-mode-btn__hint  { font-size: 26px; font-weight: 700; }

/* ---- GUIDE: categories -> channel cards ---- */
.tv-sample-note {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: #F59E0B;
  color: #000000;
  font-size: 24px;
  font-weight: 900;
}

.tv-prompt {
  margin: 0 0 4px;
  font-size: 36px;
  font-weight: 800;
  color: #FFFFFF;
}

.tv-category-grid {
  display: grid;
  /* Two wide buttons per row on an iPad: seven categories, and names such as "Entertainment" or
     "Documentaries, Nature & Casual" must fit inside their button at this type size. */
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 18px;
}

.tv-category-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 130px;
  padding: 16px 24px;
  background: #111111;
  color: #FFFFFF;
  border: 5px solid #FACC15;
  border-radius: 26px;
  font-size: 38px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.tv-category-btn__icon { flex: 0 0 auto; font-size: 64px; line-height: 1; }
.tv-category-btn > span:last-child { min-width: 0; overflow-wrap: anywhere; } /* a very long word breaks rather than leaving the button */

.tv-category-btn:hover,
.tv-category-btn:active,
.tv-category-btn[aria-expanded="true"] {
  background: #FACC15;
  color: #000000;
}

.tv-channels__title { margin: 0; font-size: 44px; font-weight: 900; color: #FACC15; }
.tv-channels__blurb { margin: 0 0 6px; font-size: 28px; font-weight: 600; color: #E5E7EB; }

.tv-channel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
}

.tv-channel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 18px 22px;
  background: #111111;
  border: 5px solid #FFFFFF;
  border-radius: 28px;
  text-align: center;
}

.tv-channel-card__number {
  font-size: clamp(100px, 14vw, 156px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #FACC15;
}

.tv-channel-card__name { font-size: 34px; font-weight: 900; line-height: 1.2; color: #FFFFFF; }
.tv-channel-card__note { font-size: 24px; font-weight: 600; color: #E5E7EB; }

.tv-read-btn {
  margin-top: 8px;
  min-height: 80px;
  width: 100%;
  padding: 0 20px;
  background: #1D4ED8;
  color: #FFFFFF;
  border: 4px solid #FFFFFF;
  border-radius: 999px;
  font-size: 30px;
  font-weight: 900;
  cursor: pointer;
}

.tv-read-btn:active { background: #FFFFFF; color: #1D4ED8; }

/* ---- HELP: one short line, big answer buttons, photo cards ---- */
.tv-help-say {
  padding: 22px 24px;
  background: #111111;
  border: 5px solid #FFFFFF;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tv-help-line {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.3;
  color: #FFFFFF;
}

.tv-modal.is-thinking .tv-help-line { color: #FACC15; }

.tv-help-heard {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  font-style: italic;
  color: #FACC15;
}

.tv-help-replies { display: flex; flex-wrap: wrap; gap: 16px; }

.tv-reply-btn {
  flex: 1 1 220px;
  min-height: 96px;
  padding: 10px 20px;
  border: 5px solid #FFFFFF;
  border-radius: 26px;
  color: #FFFFFF;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.15;
  cursor: pointer;
}

.tv-reply-btn--yes      { background: #15803D; }
.tv-reply-btn--no       { background: #B91C1C; }
.tv-reply-btn--maybe    { background: #334155; }
.tv-reply-btn--scenario { background: #1D4ED8; }
/* 3 Oct: the English / Hindi movie quick-tap buttons — black on yellow (about 13:1), bigger than YES / NO */
.tv-reply-btn--choice   { background: #FACC15; color: #000000; border-color: #000000; outline: 5px solid #FFFFFF; outline-offset: 0; min-height: 120px; font-size: 38px; }

.tv-reply-btn:disabled,
.tv-tool-btn:disabled { opacity: 0.5; cursor: progress; }

.tv-help-mic-hint { margin: 0; font-size: 24px; font-weight: 600; color: #E5E7EB; }

.tv-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

.tv-photo-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #000000;
  border: 6px solid #FACC15;
  border-radius: 28px;
  overflow: hidden;
}

.tv-photo-card__title {
  padding: 12px 18px;
  background: #FACC15;
  color: #000000;
  font-size: 30px;
  font-weight: 900;
}

.tv-photo-card__frame {
  position: relative;
  background: #111111;
  min-height: 140px;
  /* 3 Oct: the frame shrink-wraps the picture (centred), so the highlight rings — percentages of the frame — sit on
     the same spot of the picture whatever its shape. A tall photo used to be letterboxed inside a full-width frame,
     which put every ring beside its button. */
  width: fit-content;
  max-width: 100%;
  align-self: center;
}

.tv-photo-card__frame.is-missing { width: 100%; align-self: stretch; }

.tv-photo-card__img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 60vh;
}

.tv-photo-card__highlights {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* A highlight is a ring drawn over the real photo; left/top/width/height are
   percentages of the picture (app.js TV_HELP_PHOTOS). --tv-hl is its colour. */
.tv-highlight {
  --tv-hl: #FACC15;
  position: absolute;
  border: 8px solid var(--tv-hl);
  border-radius: 18px;
  box-shadow: 0 0 0 4px #000000, 0 0 26px 10px var(--tv-hl);
  animation: tv-highlight-pulse 1.4s ease-in-out infinite;
}

.tv-highlight__label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 14px;
  background: var(--tv-hl);
  color: #000000;
  border-radius: 999px;
  font-size: 26px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 0 0 3px #000000;
}

.tv-highlight--label-below .tv-highlight__label { top: calc(100% + 12px); }
.tv-highlight--label-above .tv-highlight__label { bottom: calc(100% + 12px); }

@keyframes tv-highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 4px #000000, 0 0 10px 2px var(--tv-hl); }
  50%      { box-shadow: 0 0 0 4px #000000, 0 0 30px 12px var(--tv-hl); }
}

@media (prefers-reduced-motion: reduce) {
  .tv-highlight { animation: none; }
}

.tv-photo-card__missing {
  display: none;
  margin: 0;
  padding: 28px 22px;
  font-size: 28px;
  font-weight: 800;
  color: #FFFFFF;
}

.tv-photo-card__frame.is-missing .tv-photo-card__img,
.tv-photo-card__frame.is-missing .tv-photo-card__highlights { display: none; }
.tv-photo-card__frame.is-missing .tv-photo-card__missing { display: block; }

.tv-photo-card__caption {
  margin: 0;
  padding: 14px 18px 20px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  color: #FFFFFF;
}

.tv-basics {
  padding: 20px 24px;
  background: #111111;
  border: 5px solid #FFFFFF;
  border-radius: 28px;
  font-size: 30px;
  font-weight: 700;
}

.tv-basics ol { margin: 8px 0 0; padding-left: 40px; display: flex; flex-direction: column; gap: 14px; }

.tv-help-tools { display: flex; flex-wrap: wrap; gap: 14px; }

.tv-tool-btn {
  min-height: 76px;
  padding: 0 24px;
  background: #111111;
  color: #FFFFFF;
  border: 4px solid #FACC15;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}

.tv-tool-btn:active { background: #FACC15; color: #000000; }

/* ---- Narrow screens (phones / small windows) ---- */
@media (max-width: 780px) {
  .tv-view--menu { grid-template-columns: 1fr; }
  .tv-mode-btn { min-height: 190px; }
  .tv-mode-btn__icon { font-size: 60px; }
  .tv-mode-btn__label { font-size: 32px; }
  .tv-modal__title { font-size: 26px; }
  .tv-modal__close, .tv-modal__back { min-width: 0; padding: 0 18px; font-size: 22px; }
  /* BACK and CLOSE share the first row; the title gets a row of its own (it used to be squeezed to a few
     letters and hidden behind CLOSE). */
  .tv-modal__bar { flex-wrap: wrap; row-gap: 6px; }
  .tv-modal__close { margin-left: auto; }
  .tv-modal__title { order: 3; flex: 1 0 100%; }
  .tv-prompt { font-size: 30px; }
  .tv-category-btn { font-size: 30px; min-height: 112px; gap: 12px; padding: 14px 16px; } /* "Entertainment" fits on one line at 390px */
  .tv-category-btn__icon { font-size: 48px; }
  .tv-channel-cards, .tv-photos { grid-template-columns: 1fr; }
  .tv-channel-card__number { font-size: 112px; }
  .tv-help-line { font-size: 34px; }
  .tv-reply-btn { font-size: 30px; flex-basis: 100%; }
  .tv-photo-card__caption { font-size: 28px; }
}

/* =============================================================================
   10 Nov 2026 — CONTACT POP-UP: top breathing room, and an info box for
   message-only contacts (Sabine, Aaliyah).
   -----------------------------------------------------------------------------
   1. The pop-up's scrolling card list (.contact-group-modal__body — the
      pop-up's "modal body") had 2px of top padding, so the first card's
      border and shadow sat hard against the blue divider. 14px gives it room.
   2. A contact with no numbers but a short instruction (contacts.js
      `softNoteLabel`) shows it in the right-hand action area, where buttons
      normally sit, so the card keeps the same shape as the others. It is
      deliberately NOT styled like a button: light fill, dark text, squarer
      corners, no shadow, default cursor — the action pills are solid dark
      fills with white text and fully round ends. Navy #0f4c81 on #EFF6FF is
      well above 4.5:1 contrast.
   ============================================================================= */
.contact-group-modal__body {
  padding-top: 14px;
}

.contact-row--info-pill {
  align-items: center;
}

.contact-row__actions--info {
  justify-content: flex-end;
}

.contact-row__info-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  background: #EFF6FF;
  color: #0f4c81;
  border: 2px solid #93C5FD;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  text-align: left;
  cursor: default;
  box-shadow: none;
  user-select: none;
  -webkit-user-select: none;
}

.contact-group-modal .contact-row__info-pill {
  min-height: 60px;
  padding: 8px 20px;
  font-size: 20px;
  font-weight: 800;
}

/* =============================================================================
   14 Nov 2026 (v47 §5.2) — MESSAGE-ONLY CONTACTS: the label is now a button.
   -----------------------------------------------------------------------------
   Sabine's "ℹ️ Call Sheherzade" and Aaliyah's "ℹ️ Call Alicia / Umair" open
   the Call safety card for Sheherzade / Alicia, so they are drawn as real
   action buttons: the same solid blue, white text, round ends and 60px height
   as the pop-up's [ 📞 Call ] buttons (.contact-row__connect-btn--call). Only
   the width differs — the label is longer, so it is never cut short.
   .contact-row__info-pill above stays as the plain, non-tappable version, used
   only when a label has nobody with a number to call.
   ============================================================================= */
.contact-row__pill-btn {
  flex: 0 1 auto;
  max-width: 100%;
  cursor: pointer;
}

.contact-row__pill-btn .contact-row__btn-label {
  overflow: visible;
  text-overflow: clip;
}

.contact-group-modal .contact-row__pill-btn {
  padding: 0 22px;
}
