/* @ekm-tags: style, misc */
/* Phone polish (owner 2026-11-06: "it looks cheap"; 2026-11-08: "Live site — do all of it").
   1. Readable text (WCAG AA, 4.5:1) in the Pearl themes, on EVERY screen size: these pages were drawn for the old dark
      theme, so on Pearl (light) their text was pale-on-pale, and two safety banners were dark boxes with dark text
      ("Provider review is required" measured 1.6:1). Colours come from the 2030 kit tokens (css/ekm-kit-2030.css), so
      Pearl Night keeps its own light-on-dark values.
   2. No pill shapes on a phone: buttons, badges, chips and filters with fully round ends get the same small corner as the
      rest of the app (8px; 6px under 30px tall). js/ekm-mobile-shell.js marks them (data-ekm-shape) by measuring, so circles
      (avatars, dots, round icon buttons), switches and the owner-approved Pearl "soft boxes" (--k-r-soft) keep their shape. */

/* ── 1. Readable text in Pearl / Pearl Night ─────────────────────────────────────────────────────────────────── */
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .cds-banner {
  color: var(--k-ink);
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .cds-banner--persistent {
  background: var(--k-glass-strong);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-color: var(--k-rule);
  color: var(--k-ink);
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .cds-banner strong { color: inherit; }
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) :is(.cds-domain--safety .cds-domain-title, .cds-check--safety) {
  color: var(--k-alert);
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .cds-check--safety.is-selected { color: var(--k-ink); }
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .mg-pill { color: var(--k-muted); }
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .mg-pill--class {
  color: var(--k-ok);
  background: color-mix(in srgb, var(--k-ok) 12%, transparent);
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .mg-pill--c2 {
  color: var(--k-warn);
  background: color-mix(in srgb, var(--k-warn) 12%, transparent);
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .mg-pill--c4 {
  color: var(--k-ink);
  background: color-mix(in srgb, #8e7bb8 18%, transparent);
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .da-status-badge--available {
  color: var(--k-ok);
  border-color: color-mix(in srgb, var(--k-ok) 40%, transparent);
  background: transparent; /* a green tint under green text fell just under 4.5:1 */
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .da-status-badge--soon { color: var(--k-muted); }
/* separators and empty counts: faded to 30–45% they disappeared; muted is quieter than the text and still visible */
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) :is(.today-sched-view-sep, .appt-wf-meta-sep, .csh-hero-dot, .msr-day-tab-count--empty) {
  color: var(--k-muted);
  opacity: 1;
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .ir-board-fu-badge:not(.ir-board-pot-entry .ir-board-fu-badge) {
  color: var(--k-alert);
  background: color-mix(in srgb, var(--k-alert) 10%, transparent);
}
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .gm-rail-item.is-active { color: var(--k-ink); }
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .msg-fax-filter-btn > span { opacity: 1 !important; }
:is(html[data-theme="pearl"], html[data-theme="pearl_night"]) .pulse-sum.urgent .pulse-sum-num { color: var(--k-alert); }
/* My Files paints its own light page; its grey text measured 3.2–3.6:1 */
html[data-theme="pearl"] #ekm-my-files-overlay:not([data-mf-theme="dark"]) {
  --muted: #55616e;
  --green-txt: #48604f;
  --blue-txt: #4a6386;
}

/* ── 2. No pill shapes on a phone ────────────────────────────────────────────────────────────────────────────── */
/* :is(#ekm-polish, *) matches any ancestor but counts as an id, so this wins over the themes' !important corner rules */
html.ekm-mobile :is(#ekm-polish, *) [data-ekm-shape="square"] { border-radius: 8px !important; }
html.ekm-mobile :is(#ekm-polish, *) [data-ekm-shape="square-sm"] { border-radius: 6px !important; }
/* the phone shell's own notices and badges, which sit outside the pages the measuring pass covers (Bugbot on #1894): the
   Reconnecting notice, the pull-to-refresh notice and the More list's count badges. The sheet's grab handle, the round chat
   button and the spinner keep their shapes. */
html.ekm-mobile :is(#msg-realtime-conn, .ekm-mobile-ptr) { border-radius: 8px; }
html.ekm-mobile .ekm-mobile-sheet-badge { border-radius: 6px; }
