/* ===========================================================================
   compass-alarm-ui.css — Compass alarm system, the whole visual layer.
   Builder D, run tg-0928-2245. Plain CSS. No preprocessor, no at-import, no build.
   Re-keyed 09/29/2026: every selector below now matches a class name that
   compass.html, compass-alarm-engine.js, compass-missions.js or
   compass-deadlines.js actually emits. The first draft was written against a
   different set of names and styled almost nothing (126 classes unmatched).

   WHAT LIVES HERE
     1. Deadline verdict styles          .cmp-ontime / .cmp-late / .cmp-missed / .cmp-none
        + the documented .ck* extensions and .cmp-row-* row hooks
     2. Shared guards                    [hidden] stays hidden; no keyframes
     3. The overlay                      .cmp-overlay (#cmpOverlay), fixed, z-index 300
     4. Alarm list                       .cmp-alm-* inside #almList
     5. Button tiers (CONTRACT §11)      .cmp-alm-btn--primary/--secondary/--tertiary
     6. Alarm edit                       .cmp-alm-edit and its sections
     7. Deadline editor                  .cmp-dl-*
     8. Ring and mission screens         .cmp-msn-*
     9. Reduced motion   10. 375x812 guard

   RULES THIS FILE OBEYS
     - Reuses compass.html's :root palette. The ONE new light-theme colour is
       --cmp-ontime, and only because --grn #0f8a4f measures 4.40:1 on white,
       4.03:1 on the AM card and 3.89:1 on the PM card — it fails the 4.5:1
       floor at 11.5px. The dark mission surfaces also get new values, because
       the light palette has no dark-surface token at all.
     - Nothing pulses. Nothing animates on the ring or mission screens. The only
       moving thing there is .cmp-msn-countdown-fill's width, driven by JS.
     - 44x44 CSS px floor on every tappable control.
     - Disabled state is [aria-disabled="true"], never :disabled, and always
       carries rendered reason text.
     - The ONLY existing selectors extended are .ck / .ckbox / .cklbl / .cktime,
       as documented. Everything else is namespaced cmp-.
   =========================================================================== */


/* ---------------------------------------------------------------------------
   0. TOKENS
   --------------------------------------------------------------------------- */
:root{
  /* --- verdict colours (CONTRACT §2 names) ------------------------------- */
  /* Darkened --grn. Same hue family; 6.59:1 on white, 5.83:1 on the PM card.
     Do not swap this back to --grn: --grn fails the 4.5:1 floor. */
  --cmp-ontime:#0b6b3d;
  --cmp-late:var(--red);          /* #b42318 — 6.57 / 6.02 / 5.81 */
  --cmp-missed:var(--red);        /* same red, different affordance */
  --cmp-none:var(--mut);          /* #5a6a85 — 5.48 / 5.01 / 4.84 */

  /* Pale tints, for FILLS ONLY. Never used as a text colour. */
  --cmp-ontime-bg:var(--bg-grn);
  --cmp-late-bg:var(--bg-red);

  /* --- dark surfaces: ring + mission. No existing token covers these. ----- */
  --cmp-msn-bg1:#1b4a9c;          /* gradient top    */
  --cmp-msn-bg2:#16336b;          /* gradient middle */
  --cmp-msn-bg3:#0c1a33;          /* gradient bottom */
  --cmp-msn-ink:#ffffff;
  --cmp-msn-mut:#c9d6ec;          /* readable secondary on the dark wallpaper */
  --cmp-msn-glass:rgba(255,255,255,.14);
  --cmp-msn-glass-line:rgba(255,255,255,.28);

  /* --- geometry ---------------------------------------------------------- */
  --cmp-tap:44px;                 /* the tap-target floor. Never go under it. */
  --cmp-r-card:13px;              /* matches .card */
  --cmp-r-ctl:11px;
  --cmp-r-pill:999px;
  --cmp-safe:env(safe-area-inset-bottom,0px);

  /* --- motion ------------------------------------------------------------ */
  /* Mirrors the shared motion token --mot-context. Used ONLY on the light alarm
     screens. The ring and mission screens are Instant and use none of it. */
  --cmp-t:160ms;
  --cmp-ease:cubic-bezier(.2,0,0,1);
}


/* ===========================================================================
   1. DEADLINE VERDICTS
   The verdict class lands on the .cktime span (CONTRACT A1.5).
   =========================================================================== */

/* Base: .cktime already ships 11.5px / tabular-nums. At that size colour alone
   is a weak signal, so every verdict also bumps weight. */
.cktime.cmp-ontime,
.cktime.cmp-late,
.cktime.cmp-missed,
.cktime.cmp-none{
  font-weight:800;
  letter-spacing:.1px;
  white-space:nowrap;
}

.cktime.cmp-ontime{color:var(--cmp-ontime)}
.cktime.cmp-late  {color:var(--cmp-late)}
.cktime.cmp-missed{color:var(--cmp-missed)}

/* "Not yet due" is deliberately quieter than the other three: the same muted
   grey .cktime already uses, so a neutral row looks untouched. */
.cktime.cmp-none{color:var(--cmp-none);font-weight:700}

/* --- missed has NO timestamp text ---------------------------------------
   An empty span with a colour on it renders nothing at all. Give it a word.
   A word, not a bare icon: "Missed" is announced by screen readers and is
   legible without colour vision. The :empty guard means a real stamp, if one
   ever arrives, wins over the generated marker. */
.cktime.cmp-missed:empty::after{
  content:"Missed";
  font-weight:800;
  letter-spacing:.2px;
}
/* The marker sits in a red-tinted pill so the row reads red from across the
   room. The pill is a FILL; the text on it is full-strength red. */
.cktime.cmp-missed:empty{
  background:var(--cmp-late-bg);
  border-radius:var(--cmp-r-pill);
  padding:3px 9px;
  line-height:1.2;
}

/* Late keeps its stamp and gets the same pill, so late-with-a-time and
   missed-without-one read as the same verdict. */
.cktime.cmp-late:not(:empty){
  background:var(--cmp-late-bg);
  border-radius:var(--cmp-r-pill);
  padding:3px 9px;
  line-height:1.2;
}

/* --- CONSISTENCY FIX: the checkbox must follow the verdict ---------------
   compass.html:118 turns EVERY .ck.done checkbox green. A late item would show
   a green box beside a red time — the row would contradict itself.
   The verdict class sits on a LATER sibling of .ckbox, so :has() is the only
   selector that can reach back to it. A row with no verdict class matches none
   of these rules and keeps the stock green. Nothing is overridden
   unconditionally. */
.ck.done:has(.cktime.cmp-ontime) .ckbox{
  background:var(--cmp-ontime);
  border-color:var(--cmp-ontime);
  color:#fff;
}
.ck.done:has(.cktime.cmp-late) .ckbox{
  background:var(--cmp-late);
  border-color:var(--cmp-late);
  color:#fff;
}
/* Missed: the item was never checked, so the box stays EMPTY (CONTRACT §2,
   "missed = red-outline-empty"). The tick stays transparent — showing it would
   claim the item was done. */
.ck:has(.cktime.cmp-missed) .ckbox{
  border-color:var(--cmp-missed);
  background:var(--cmp-late-bg);
  color:transparent;
}

/* Optional row-level hooks. If the integrator ever finds it easier to stamp the
   verdict on the row than on the span, these give the identical result with no
   :has() dependency. Inert when unused. */
.ck.done.cmp-row-ontime .ckbox{background:var(--cmp-ontime);border-color:var(--cmp-ontime);color:#fff}
.ck.done.cmp-row-late   .ckbox{background:var(--cmp-late);border-color:var(--cmp-late);color:#fff}
.ck.cmp-row-missed      .ckbox{border-color:var(--cmp-missed);background:var(--cmp-late-bg);color:transparent}

/* A missed row is not struck through — it was never done. Guards against the
   done class ever being set alongside a missed verdict. */
.ck:has(.cktime.cmp-missed) .cklbl{text-decoration:none}



/* ===========================================================================
   2. SHARED GUARDS
   =========================================================================== */

/* The JS hides things with the `hidden` attribute (menus, confirm steps, the
   type picker, reason lines, the tap pad). Any rule below that sets `display`
   would otherwise beat the browser's [hidden]{display:none}. This keeps
   `hidden` authoritative everywhere the alarm system renders. */
.cmp-overlay [hidden],
.cmp-alm [hidden],
.cmp-dl [hidden]{display:none !important}

/* Light alarm screens: no keyframe animation anywhere. Short colour/position
   transitions (--cmp-t) are allowed on these screens only. */
.cmp-alm-noanim,
.cmp-alm-noanim *{animation:none !important}


/* ===========================================================================
   3. THE OVERLAY — #cmpOverlay in compass.html
   One fixed, full-screen layer for the edit screen, the deadline editor, the
   ring screen and every mission screen. It sits above everything the page
   owns: the auth gate (100), the "Saved" bar (40) and the toast (200), so no
   page chrome can ever cover a mission button.
   =========================================================================== */
.cmp-overlay{
  position:fixed;
  inset:0;
  bottom:auto;
  height:var(--vvh,100dvh);
  z-index:300;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  background:var(--bg);
  color:var(--ink);
}


/* ===========================================================================
   4. ALARM LIST — renders inside the Alarms card (#almList)
   =========================================================================== */
.cmp-alm{color:var(--ink);font-size:15px;line-height:1.45}

.cmp-alm-list{display:flex;flex-direction:column;gap:10px}
/* The host card already prints the same "Ring in …" line (#almNext) and the
   same keep-your-phone-alarm warning (#almWarn) right above this list, so the
   list's own copies would say everything twice. The edit screen keeps both. */
.cmp-alm-list > .cmp-alm-ringin,
.cmp-alm-list > .cmp-alm-caution{display:none}

.cmp-alm-cards{display:flex;flex-direction:column;gap:10px}

/* Every alarm control starts from this: 44x44 floor, page font, no stray
   margin. Overrides compass.html's global `button` padding/border. */
.cmp-alm-tap{
  min-height:var(--cmp-tap);
  min-width:var(--cmp-tap);
  margin:0;
  font:inherit;
  touch-action:manipulation;
}

/* --- one alarm card ------------------------------------------------------ */
.cmp-alm-card{
  position:relative;
  display:flex;
  align-items:stretch;
  gap:4px;
  background:var(--card);
  border:.5px solid var(--line);
  border-radius:var(--cmp-r-card);
  box-shadow:0 1px 2px rgba(16,32,60,.06);
  padding:4px 4px 4px 0;
}
/* Off: dimmed by COLOUR, never opacity (opacity drags text under 4.5:1). The
   word "Off" (.cmp-alm-offnote) carries the state without colour. */
.cmp-alm-card--off{background:var(--bg-gry)}
.cmp-alm-card--off .cmp-alm-time,
.cmp-alm-card--off .cmp-alm-ampm,
.cmp-alm-card--off .cmp-alm-label,
.cmp-alm-card--off .cmp-alm-day--on{color:var(--mut)}

/* The whole left side is one button: tap anywhere to edit. */
.cmp-alm-card-main{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:3px;
  padding:8px 6px 8px 12px;      /* r367: 2px less, the border below takes it */
  border:2px solid #7b8aa3;      /* r367 10/27/2026: the tap-to-edit area reads as a button */
  border-radius:var(--cmp-r-card);
  background:#e8eefb;   /* r367 round d: own fill, clearly off the #f5f7fa page and the #fff sheet (d>=12) */
  color:var(--ink);
  text-align:left;
  font-weight:400;
  cursor:pointer;
}
.cmp-alm-card-main:hover{border-color:var(--navy);background:#dde6f8}

/* Day strip. Display-only on the card; tappable chips on the edit screen. */
.cmp-alm-days{display:flex;gap:4px}
.cmp-alm-day{
  display:inline-grid;
  place-items:center;
  min-width:13px;
  font-size:11.5px;
  font-weight:800;
  letter-spacing:.3px;
  text-transform:uppercase;
  padding-bottom:2px;
  border-bottom:2px solid transparent;
  color:var(--mut);       /* an OFF day: quiet grey, still 5.48:1 */
  font-weight:600;
}
/* ON day: navy, heavier, and underlined, so the cue is not colour alone. */
.cmp-alm-day--on{color:var(--navy);font-weight:800;border-bottom-color:var(--navy)}

.cmp-alm-timerow{display:flex;align-items:baseline;gap:5px;line-height:1.05}
.cmp-alm-time{
  font-size:34px;
  font-weight:800;
  letter-spacing:-1.2px;
  font-variant-numeric:tabular-nums;
  color:var(--ink);
}
.cmp-alm-ampm{font-size:15px;font-weight:800;color:var(--mut)}

.cmp-alm-missions{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px}
.cmp-alm-mission-ic{
  display:inline-grid;
  place-items:center;
  width:26px;
  height:26px;
  border-radius:7px;
  background:var(--bg-navy);
  font-size:14px;
  line-height:1;
}

.cmp-alm-label{
  display:flex;
  align-items:center;
  gap:7px;
  max-width:100%;
  min-width:0;
  font-size:14.5px;
  font-weight:700;
  color:var(--ink);
}
.cmp-alm-emoji{flex:0 0 auto;font-size:17px;line-height:1}
.cmp-alm-labeltext{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.cmp-alm-offnote{
  display:inline-block;
  margin-top:3px;
  padding:2px 9px;
  border-radius:var(--cmp-r-pill);
  background:var(--card);
  border:.5px solid var(--line);
  font-size:11px;
  font-weight:800;
  letter-spacing:.4px;
  text-transform:uppercase;
  color:var(--mut);
}

/* --- right column: on/off switch over the ⋮ menu ------------------------- */
.cmp-alm-cardside{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  padding:4px 0;
}

/* Switch: a 44-tall button; the track is drawn by ::before, the knob is the
   JS's .cmp-alm-switch-knob span. Knob moves with `left`, not transform, so
   the reduced-motion `transform:none` rule cannot strand it. */
.cmp-alm-switch{
  position:relative;
  width:60px;
  padding:0;
  border:none;
  border-radius:var(--cmp-r-pill);
  background:transparent;
  cursor:pointer;
}
.cmp-alm-switch:hover{border-color:transparent}
.cmp-alm-switch::before{
  content:"";
  position:absolute;
  left:5px;
  top:50%;
  width:50px;
  height:30px;
  margin-top:-15px;
  border-radius:var(--cmp-r-pill);
  background:var(--bg-gry);
  border:1.5px solid var(--gry);      /* 4.76:1 on white: the off track stays visible */
  box-sizing:border-box;
  transition:background-color var(--cmp-t) var(--cmp-ease),border-color var(--cmp-t) var(--cmp-ease);
}
.cmp-alm-switch-knob{
  position:absolute;
  top:50%;
  left:9px;
  width:22px;
  height:22px;
  margin-top:-11px;
  border-radius:50%;
  background:var(--gry);
  transition:left var(--cmp-t) var(--cmp-ease),background-color var(--cmp-t) var(--cmp-ease);
}
.cmp-alm-switch[aria-checked="true"]::before{background:var(--navy);border-color:var(--navy)}
.cmp-alm-switch[aria-checked="true"] .cmp-alm-switch-knob{left:29px;background:#fff}
/* Which switch it is. Same look everywhere; named so each stays addressable. */
.cmp-alm-enable,
.cmp-alm-vibrate,
.cmp-alm-reminder{flex:0 0 auto}

/* --- ⋮ overflow menu ----------------------------------------------------- */
.cmp-alm-menuwrap{position:relative}
.cmp-alm-more{
  padding:0;
  border:none;
  border-radius:var(--cmp-r-ctl);
  background:transparent;
  color:var(--mut);
  font-size:21px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
}
.cmp-alm-more:hover{border-color:transparent;color:var(--ink)}
.cmp-alm-menu{
  position:absolute;
  right:0;
  top:calc(100% + 4px);
  z-index:5;
  width:200px;
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:8px;
  background:var(--card);
  border:.5px solid var(--line);
  border-radius:var(--cmp-r-ctl);
  box-shadow:0 6px 20px rgba(16,32,60,.16);
}
.cmp-alm-menu .cmp-alm-btn--secondary{width:100%}

/* --- delete: tertiary until the confirm step (CONTRACT §11) -------------- */
.cmp-alm-delbox{display:flex;flex-direction:column;align-items:stretch}
.cmp-alm-delconfirm{display:flex;flex-direction:column;align-items:stretch;gap:6px}
.cmp-alm-deltext{margin:2px 0 2px;font-size:14px;font-weight:700;color:var(--ink);text-align:center}
.cmp-alm-del{color:var(--red)}

/* --- add row ------------------------------------------------------------- */
.cmp-alm-addrow{display:flex;justify-content:flex-end;margin-top:2px}
/* Round "+" in the list. Outline, not solid: the Compass page is a long
   scroll with its own actions, so this does not claim the page's primary. */
.cmp-alm-add{
  width:48px;
  height:48px;
  padding:0;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:1.5px solid var(--navy);
  background:var(--card);
  color:var(--navy);
  font-size:26px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
}
.cmp-alm-add:hover{border-color:var(--navy);background:var(--bg-navy)}

.cmp-alm-empty{margin:0;padding:18px 8px;text-align:center;color:var(--mut);font-size:13.5px}


/* ===========================================================================
   5. BUTTON TIERS — light alarm screens (CONTRACT §11)
   Primary: solid, full width, bottom, the only elevated control.
   Secondary: outline. Tertiary: text. Destructive stays tertiary until confirm.
   =========================================================================== */
.cmp-alm-btn--primary,
.cmp-alm-btn--secondary,
.cmp-alm-btn--tertiary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border-radius:var(--cmp-r-ctl);
  font-weight:800;
  line-height:1.2;
  text-align:center;
  cursor:pointer;
  transition:background-color var(--cmp-t) var(--cmp-ease),border-color var(--cmp-t) var(--cmp-ease),color var(--cmp-t) var(--cmp-ease);
}
.cmp-alm-btn--primary{
  width:100%;
  min-height:52px;
  padding:12px 18px;
  background:var(--navy);
  border:1px solid var(--navy);
  color:#fff;
  font-size:16.5px;
  box-shadow:0 2px 10px rgba(16,32,60,.22);
}
.cmp-alm-btn--primary:hover{border-color:var(--navy);filter:brightness(1.08)}
.cmp-alm-btn--secondary{
  padding:10px 16px;
  background:#e8eefb;   /* r367 round d: own fill, clearly off the #f5f7fa page and the #fff sheet (d>=12) */
  border:2px solid var(--navy);   /* r367: 2px edge */
  color:var(--navy);
  font-size:15px;
  box-shadow:none;
}
.cmp-alm-btn--secondary:hover{border-color:var(--navy);background:#dde6f8}
.cmp-alm-btn--tertiary{
  padding:10px 14px;
  background:#e8eefb;   /* r367 round d: own fill, clearly off the #f5f7fa page and the #fff sheet (d>=12) */
  border:2px solid #7b8aa3;   /* r367: a button, never bare text */
  color:var(--mut);
  font-size:14.5px;
  font-weight:700;
  text-decoration:none;
  text-underline-offset:3px;
  box-shadow:none;
}
.cmp-alm-btn--tertiary:hover{color:var(--ink)}
.cmp-alm-btn--tertiary.cmp-alm-del,
.cmp-alm-btn--tertiary.cmp-alm-del:hover{color:var(--red);border-color:var(--red)}

/* Disabled = aria-disabled + a rendered reason line (.cmp-alm-reason). Colour,
   never opacity. */
.cmp-alm-is-off,
.cmp-alm-is-off:hover{
  background:var(--bg-gry);
  border-color:var(--line);
  color:var(--mut);
  box-shadow:none;
  cursor:default;
  filter:none;
}
.cmp-alm-reason{margin:6px 0 0;font-size:13px;font-weight:600;line-height:1.35;color:var(--mut)}


/* ===========================================================================
   6. ALARM EDIT — light, inside the overlay
   =========================================================================== */
.cmp-alm-edit{
  max-width:560px;
  min-height:100%;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:calc(14px + env(safe-area-inset-top,0px)) 12px 0;
}
/* Each block reads as a Compass .card. */
.cmp-alm-edit-head,
.cmp-alm-picker,
.cmp-alm-daysbox,
.cmp-alm-chain,
.cmp-alm-opts{
  background:var(--card);
  border:.5px solid var(--line);
  border-radius:var(--cmp-r-card);
  box-shadow:0 1px 2px rgba(16,32,60,.04);
  padding:12px;
}

.cmp-alm-edit-head{display:flex;flex-direction:column;gap:6px}
.cmp-alm-edit-label{display:flex;align-items:center;gap:8px;min-width:0;font-size:19px;font-weight:800}
.cmp-alm-edit-label .cmp-alm-emoji{font-size:22px}
.cmp-alm-edit-label .cmp-alm-labeltext{flex:1 1 auto}
.cmp-alm-editlabel{flex:0 0 auto}
.cmp-alm-labelform{display:flex;gap:8px}
.cmp-alm-input{
  min-height:var(--cmp-tap);
  padding:8px 11px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font-size:16px;          /* 16px stops iOS zooming on focus */
}
.cmp-alm-labelform .cmp-alm-input{flex:1 1 auto;width:auto;min-width:0}
.cmp-alm-labelform .cmp-alm-input--emoji{flex:0 0 64px;width:64px;text-align:center}
.cmp-alm-edit .cmp-alm-ringin{font-size:14.5px;font-weight:800;color:var(--navy)}
.cmp-alm-caution{margin:0;font-size:12.5px;line-height:1.4;color:var(--mut)}

/* --- 3-row time picker --------------------------------------------------- */
.cmp-alm-picker{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  gap:4px;
}
.cmp-alm-pickcol{display:flex;flex-direction:column;align-items:stretch}
.cmp-alm-pickcol--hour,
.cmp-alm-pickcol--minute{width:78px}
/* No ▲ on top of the AM/PM column: pad it by one row so its selected row lines
   up with the hour and minute selections. */
.cmp-alm-pickcol--ampm{width:66px;padding-top:var(--cmp-tap)}
.cmp-alm-pickstep{
  width:100%;
  padding:0;
  border:none;
  border-radius:10px;
  background:transparent;
  color:var(--navy);
  font-size:15px;
  font-weight:800;
  cursor:pointer;
}
.cmp-alm-pickstep:hover{border-color:transparent;background:var(--bg-navy)}
.cmp-alm-pickrow{
  display:grid;
  place-items:center;
  min-height:var(--cmp-tap);
  font-variant-numeric:tabular-nums;
  font-weight:800;
  user-select:none;
  cursor:pointer;
}
.cmp-alm-pickrow--prev,
.cmp-alm-pickrow--next{font-size:19px;color:var(--mut)}   /* the outer rows, quieter */
.cmp-alm-pickrow--sel{
  min-height:54px;
  font-size:32px;
  letter-spacing:-1px;
  color:var(--ink);
  background:var(--bg-navy);
  border-radius:10px;
  cursor:default;
}
.cmp-alm-pickcol--ampm .cmp-alm-pickrow--sel{font-size:22px;letter-spacing:0}
.cmp-alm-picksep{
  align-self:flex-start;
  margin-top:calc(var(--cmp-tap) * 2);
  line-height:54px;
  font-size:30px;
  font-weight:800;
  color:var(--mut);
}

/* --- days ---------------------------------------------------------------- */
.cmp-alm-daysbox{display:flex;flex-direction:column;gap:6px}
.cmp-alm-daysholder{min-width:0}
.cmp-alm-days--edit{gap:2px;justify-content:space-between}
.cmp-alm-days--edit .cmp-alm-day{
  flex:1 1 0;
  min-width:0;
  height:var(--cmp-tap);
  padding:0;
  border-radius:var(--cmp-r-pill);
  border:2px solid #7b8aa3;   /* r367: visible button edge */
  background:#e8eefb;   /* r367 round d: own fill, clearly off the #f5f7fa page and the #fff sheet (d>=12) */
  color:var(--ink);
  font-size:13px;
  cursor:pointer;
  transition:background-color var(--cmp-t) var(--cmp-ease),color var(--cmp-t) var(--cmp-ease);
}
.cmp-alm-days--edit .cmp-alm-day--on{background:var(--navy);border-color:var(--navy);color:#fff}
.cmp-alm-days--edit .cmp-alm-day:hover{border-color:var(--navy)}
.cmp-alm-daily{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:var(--cmp-tap);
  cursor:pointer;
}
input.cmp-alm-check{
  width:22px;
  height:22px;
  min-width:22px;
  min-height:22px;       /* the whole <label> row is the 44px target */
  margin:0;
  accent-color:var(--navy);
  cursor:pointer;
}
.cmp-alm-dailytext{font-size:14.5px;font-weight:700}

/* --- mission chain ------------------------------------------------------- */
.cmp-alm-chainhead{display:flex;align-items:center;gap:10px}
.cmp-alm-h3{flex:1 1 auto;margin:0;font-size:14.5px;font-weight:800}
.cmp-alm-chaincount{font-size:13px;font-weight:800;color:var(--mut);font-variant-numeric:tabular-nums}
.cmp-alm-addmission{width:var(--cmp-tap);padding:0;font-size:22px;font-weight:700}
.cmp-alm-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.cmp-alm-chips:empty{display:none}
.cmp-alm-chip{
  display:inline-flex;
  align-items:center;
  flex-wrap:wrap;
  gap:2px 6px;
  max-width:100%;
  min-height:var(--cmp-tap);
  padding:0 0 0 12px;
  border-radius:22px;
  border:1px solid #c7d5f2;
  background:var(--bg-navy);
  color:var(--navy);
  font-size:14px;
  font-weight:800;
}
.cmp-alm-chip-ic{font-size:15px;line-height:1}
.cmp-alm-chip-txt{white-space:nowrap}
.cmp-alm-chip-count{font-variant-numeric:tabular-nums}
.cmp-alm-chip-note{font-size:12px;font-weight:700;color:var(--mut)}
.cmp-alm-chip-x{
  width:var(--cmp-tap);
  height:var(--cmp-tap);
  padding:0;
  display:grid;
  place-items:center;
  border:none;
  border-radius:50%;
  background:transparent;
  color:var(--navy);
  font-size:18px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
}
.cmp-alm-chip-x:hover{border-color:transparent;background:rgba(23,64,139,.10)}
.cmp-alm-typepick{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}

/* --- options rows -------------------------------------------------------- */
.cmp-alm-opts{padding-top:2px;padding-bottom:2px}
.cmp-alm-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:52px;
  padding:4px 0;
  border-bottom:.5px solid var(--line);
}
.cmp-alm-row:last-child{border-bottom:none}
.cmp-alm-rowname{flex:1 1 auto;min-width:0;font-size:14.5px;font-weight:700}
.cmp-alm-row .cmp-alm-input{flex:0 1 170px;width:auto;min-width:0}
.cmp-alm-select{
  flex:0 0 auto;
  width:auto;
  min-height:var(--cmp-tap);
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font-size:16px;
}
input.cmp-alm-range{
  flex:1 1 110px;
  min-width:0;
  height:var(--cmp-tap);
  margin:0;
  accent-color:var(--navy);
  cursor:pointer;
}
.cmp-alm-rangeval{
  flex:0 0 44px;
  text-align:right;
  font-size:13.5px;
  font-weight:800;
  color:var(--mut);
  font-variant-numeric:tabular-nums;
}

.cmp-alm-editdel{display:flex;justify-content:center}
.cmp-alm-editdel .cmp-alm-delconfirm{
  width:100%;
  padding:12px;
  background:var(--card);
  border:.5px solid var(--line);
  border-radius:var(--cmp-r-card);
}

/* --- footer: Cancel (secondary) above Save (the one primary) ------------- */
.cmp-alm-foot{
  position:sticky;
  bottom:0;
  z-index:2;
  margin:auto -12px 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:12px 12px calc(12px + var(--cmp-safe));
  background:var(--bg);
  border-top:.5px solid var(--line);
}
.cmp-alm-foot .cmp-alm-btn--secondary{width:72%}
.cmp-alm-foot .cmp-alm-save{width:100%}


/* ===========================================================================
   7. DEADLINE EDITOR — light, inside the overlay (compass-deadlines.js)
   =========================================================================== */
.cmp-dl{
  max-width:560px;
  min-height:100%;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:calc(16px + env(safe-area-inset-top,0px)) 12px calc(16px + var(--cmp-safe));
  color:var(--ink);
}
.cmp-dl-head{padding:0 4px}
.cmp-dl-title{margin:0;font-size:20px;font-weight:800;letter-spacing:-.2px}
.cmp-dl-hint{margin:2px 0 0;font-size:13.5px;color:var(--mut)}
.cmp-dl-block{
  background:var(--card);
  border:.5px solid var(--line);
  border-radius:var(--cmp-r-card);
  box-shadow:0 1px 2px rgba(16,32,60,.04);
  padding:6px 14px;
}
.cmp-dl-block-title{
  margin:8px 0 2px;
  font-size:11.5px;
  font-weight:800;
  letter-spacing:.7px;
  text-transform:uppercase;
  color:var(--mut);
}
.cmp-dl-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:52px;
  border-bottom:.5px solid var(--line);
}
.cmp-dl-row:last-child{border-bottom:none}
.cmp-dl-label{flex:1 1 auto;min-width:0;font-size:14.5px;font-weight:700}
.cmp-dl-input{
  flex:0 0 auto;
  width:132px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#fff;
  color:var(--ink);
  font:inherit;
  font-size:16px;
  font-variant-numeric:tabular-nums;
}
.cmp-dl-status{margin:0;min-height:1.2em;font-size:13.5px;font-weight:700;color:var(--mut);text-align:center}
.cmp-dl-status:empty{display:none}
.cmp-dl-save{
  position:sticky;
  bottom:calc(8px + var(--cmp-safe));
  margin-top:auto;
  min-height:52px;
  padding:12px 18px;
  border-radius:var(--cmp-r-ctl);
  border:1px solid var(--navy);
  background:var(--navy);
  color:#fff;
  font-size:16.5px;
  font-weight:800;
  box-shadow:0 2px 10px rgba(16,32,60,.22);
  cursor:pointer;
}
.cmp-dl-save:hover{border-color:var(--navy);filter:brightness(1.08)}


/* ===========================================================================
   8. RING AND MISSION SCREENS — full screen, dark, Instant
   The ring screen is the overlay itself (.cmp-overlay.cmp-msn-ring); each
   mission renders a .cmp-msn-root into the overlay. No transitions, no
   animation. The only thing that moves is the countdown fill's width, which
   the JS sets directly.
   =========================================================================== */
.cmp-overlay.cmp-msn-ring,
.cmp-overlay:has(> .cmp-msn-root),
.cmp-msn-root{
  background:linear-gradient(168deg,var(--cmp-msn-bg1) 0%,var(--cmp-msn-bg2) 48%,var(--cmp-msn-bg3) 100%);
  background-color:var(--cmp-msn-bg3);
  color:var(--cmp-msn-ink);
}
.cmp-overlay.cmp-msn-ring,
.cmp-overlay.cmp-msn-ring *,
.cmp-msn-root,
.cmp-msn-root *{
  transition:none !important;
  animation:none !important;
}

/* --- ring screen --------------------------------------------------------- */
.cmp-overlay.cmp-msn-ring{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:calc(18px + env(safe-area-inset-top,0px)) 18px calc(18px + var(--cmp-safe));
  text-align:center;
}
/* date + clock + label float in the middle; Start Mission sits at the bottom. */
.cmp-msn-ring-date{margin-top:auto;font-size:15px;font-weight:700;letter-spacing:.2px;color:var(--cmp-msn-mut)}
.cmp-msn-ring-clock{
  font-size:clamp(60px,21vw,92px);
  font-weight:800;
  letter-spacing:-3px;
  line-height:1;
  font-variant-numeric:tabular-nums;
  color:var(--cmp-msn-ink);
}
.cmp-msn-ring-label{
  max-width:100%;
  margin-top:6px;
  padding:11px 18px;
  border-radius:var(--cmp-r-pill);
  background:var(--cmp-msn-glass);
  border:1px solid var(--cmp-msn-glass-line);
  font-size:16px;
  font-weight:800;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.cmp-overlay.cmp-msn-ring > .cmp-msn-btn-primary{margin-top:auto}

/* --- mission shell ------------------------------------------------------- */
.cmp-msn-root{
  min-height:100%;
  display:flex;
  flex-direction:column;
  padding:calc(10px + env(safe-area-inset-top,0px)) 16px 0;
}
/* Which mission is up. Layout is shared; these stay addressable. */
.cmp-msn-phrase,
.cmp-msn-motion{position:relative}
.cmp-msn-motion-squat .cmp-msn-demo-art::before{content:"\01F3CB\FE0F"}
.cmp-msn-motion-step  .cmp-msn-demo-art::before{content:"\01F45F"}

/* Countdown bar, pinned to the top: drains over 20s of no typing. */
.cmp-msn-countdown{
  flex:0 0 auto;
  position:sticky;
  top:0;
  z-index:2;
  height:6px;
  width:100%;
  margin-bottom:6px;
  border-radius:var(--cmp-r-pill);
  background:rgba(255,255,255,.22);
  overflow:hidden;
}
.cmp-msn-countdown-fill{height:100%;border-radius:inherit;background:#fff}

.cmp-msn-head{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:var(--cmp-tap);
}
.cmp-msn-step{font-size:14px;font-weight:800;color:var(--cmp-msn-ink);font-variant-numeric:tabular-nums}
.cmp-msn-mute{
  min-width:var(--cmp-tap);
  min-height:var(--cmp-tap);
  margin:0;
  padding:0 16px;
  border-radius:var(--cmp-r-pill);
  border:2px solid rgba(255,255,255,.7);   /* r367: clearly visible on the dark mission screen (was 1px glass line) */
  background:var(--cmp-msn-glass);
  color:var(--cmp-msn-ink);
  font:inherit;
  font-size:14px;
  font-weight:800;
  cursor:pointer;
}
.cmp-msn-mute:hover{border-color:#fff}
.cmp-msn-mute[aria-pressed="true"]{background:#fff;border-color:#fff;color:var(--cmp-msn-bg3)}

.cmp-msn-body{
  flex:1 0 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:12px;
  padding:10px 0 14px;
  text-align:center;
}
.cmp-msn-hint,
.cmp-msn-note,
.cmp-msn-status{margin:0;font-size:14.5px;font-weight:600;line-height:1.4;color:var(--cmp-msn-mut)}
.cmp-msn-title{margin:0;font-size:21px;font-weight:800;line-height:1.25;color:var(--cmp-msn-ink)}

/* --- phrase: the target sentence as per-word blocks ---------------------- */
.cmp-msn-target{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  row-gap:7px;
  width:100%;
  font-size:18px;
  font-weight:700;
  line-height:1.45;
}
.cmp-msn-word{
  display:inline-block;
  padding:3px 7px;
  border-radius:7px;
  background:var(--cmp-msn-glass);
  color:var(--cmp-msn-ink);
}
.cmp-msn-gap{display:inline-block;padding:3px 0;white-space:pre}
.cmp-msn-char{white-space:pre}
/* Typed right: pale green + a green underline, so the cue is not colour alone
   (4.9:1 on the lightest word chip). Typed wrong: red on a pale red chip
   (5.7:1). Not yet typed: plain white (5.9:1). */
.cmp-msn-char.is-typed{
  color:#bff7d8;
  text-decoration:underline;
  text-decoration-color:#8ee3b5;
  text-decoration-thickness:2px;
  text-underline-offset:4px;
}
.cmp-msn-gap .cmp-msn-char.is-typed{text-decoration:none}
.cmp-msn-char.is-wrong{background:#fdeceb;color:#b42318;border-radius:3px}

/* The typing box is a solid light field with dark text, so it reads the same
   whatever is behind it. */
.cmp-msn-input{
  display:block;
  width:100%;
  min-height:var(--cmp-tap);
  margin:2px 0 0;
  padding:12px 14px;
  border-radius:var(--cmp-r-ctl);
  border:2px solid #fff;
  background:#fff;
  color:var(--ink);
  caret-color:var(--navy);
  font:inherit;
  font-size:16px;          /* 16px stops iOS zooming on focus */
  font-weight:600;
  line-height:1.45;
  resize:none;
}
.cmp-msn-input:focus{outline:3px solid #8ee3b5;outline-offset:2px;border-color:#fff}
.cmp-msn-input[readonly]{background:#dfe6f2}
.cmp-msn-count{
  margin:0;
  font-size:13.5px;
  font-weight:800;
  color:var(--cmp-msn-mut);
  font-variant-numeric:tabular-nums;
}

/* --- squat / step -------------------------------------------------------- */
.cmp-msn-demo{
  width:100%;
  max-width:300px;
  padding:10px 14px;
  border-radius:var(--cmp-r-card);
  background:var(--cmp-msn-glass);
  border:1px solid var(--cmp-msn-glass-line);
}
.cmp-msn-demo-art{font-size:52px;line-height:1.1}
.cmp-msn-howto{
  margin:8px 0 0;
  padding-left:20px;
  text-align:left;
  font-size:14.5px;
  font-weight:600;
  line-height:1.45;
  color:var(--cmp-msn-ink);
}
.cmp-msn-remaining{
  margin:0;
  font-size:clamp(56px,18vw,76px);
  font-weight:800;
  line-height:1;
  font-variant-numeric:tabular-nums;
  color:var(--cmp-msn-ink);
}
.cmp-msn-remaining-unit{margin:-6px 0 0;font-size:14px;font-weight:700;color:var(--cmp-msn-mut)}

.cmp-msn-picker{display:flex;justify-content:center;gap:8px;width:100%}
.cmp-msn-picker-row{
  flex:0 1 92px;
  min-width:var(--cmp-tap);
  min-height:var(--cmp-tap);
  margin:0;
  padding:4px 10px;
  display:inline-flex;
  align-items:baseline;
  justify-content:center;
  gap:4px;
  border-radius:var(--cmp-r-pill);
  border:2px solid rgba(255,255,255,.7);   /* r367: a worded pick-list chip gets the visible 2px edge */
  background:var(--cmp-msn-glass);        /* r367 round d: its own glass fill, never transparent on the dark screen */
  color:var(--cmp-msn-ink);
  font:inherit;
  cursor:pointer;
}
.cmp-msn-picker-row:hover{border-color:#fff}
.cmp-msn-picker-row.is-selected,
.cmp-msn-picker-row[aria-checked="true"]{background:#fff;border-color:#fff;color:var(--cmp-msn-bg3)}
.cmp-msn-picker-num{font-size:18px;font-weight:800;font-variant-numeric:tabular-nums}
.cmp-msn-picker-unit{font-size:12.5px;font-weight:700}

/* Manual counter: a big pad, required when the motion sensor is out. */
.cmp-msn-tap-pad{
  width:100%;
  min-height:120px;
  margin:0;
  padding:14px;
  border-radius:var(--cmp-r-card);
  border:1.5px solid #fff;
  background:var(--cmp-msn-glass);
  color:var(--cmp-msn-ink);
  font:inherit;
  cursor:pointer;
  touch-action:manipulation;
}
.cmp-msn-tap-pad:hover{border-color:#fff}
.cmp-msn-tap-label{font-size:18px;font-weight:800}
.cmp-msn-manual-link{   /* r367: an escape-hatch button, not underlined text - 2px edge, glass fill, ~260px, centered */
  display:block;
  width:100%;
  max-width:260px;
  min-height:var(--cmp-tap);
  margin:0 auto;
  padding:10px 14px;
  border:2px solid rgba(255,255,255,.7);
  border-radius:var(--cmp-r-ctl);
  background:var(--cmp-msn-glass);
  color:var(--cmp-msn-ink);
  font:inherit;
  font-size:14px;
  font-weight:700;
  line-height:1.25;
  text-align:center;
  cursor:pointer;
}
.cmp-msn-manual-link:hover{border-color:#fff}

/* --- bottom action bar: the one primary, pinned in the thumb zone -------- */
.cmp-msn-actions{
  flex:0 0 auto;
  position:sticky;
  bottom:0;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  margin:0 -16px;
  padding:12px 16px calc(14px + var(--cmp-safe));
  background:var(--cmp-msn-bg3);
  border-top:1px solid rgba(255,255,255,.12);
}
.cmp-msn-reason{margin:0;font-size:13.5px;font-weight:600;line-height:1.35;color:var(--cmp-msn-mut);text-align:center}

.cmp-msn-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:var(--cmp-tap);
  min-width:var(--cmp-tap);
  margin:0;
  padding:10px 18px;
  border-radius:var(--cmp-r-ctl);
  font:inherit;
  font-weight:800;
  line-height:1.2;
  cursor:pointer;
  touch-action:manipulation;
}
.cmp-msn-btn-primary{
  width:100%;
  min-height:56px;
  border:2px solid #fff;   /* r367 */
  background:#fff;
  color:var(--cmp-msn-bg3);
  font-size:17px;
  box-shadow:0 2px 12px rgba(0,0,0,.30);   /* the one elevated control here */
}
.cmp-msn-btn-primary:hover{border-color:#fff}
.cmp-msn-btn-primary[aria-disabled="true"]{
  background:var(--cmp-msn-glass);
  border-color:var(--cmp-msn-glass-line);
  color:var(--cmp-msn-ink);
  box-shadow:none;
  cursor:default;
}
.cmp-msn-btn-secondary{
  width:72%;
  border:2px solid rgba(255,255,255,.7);   /* r367: clearly visible on the dark mission screen */
  background:var(--cmp-msn-glass);        /* r367 round d: its own glass fill (Allow motion / Preview), never transparent */
  color:var(--cmp-msn-ink);
  font-size:15px;
  box-shadow:none;
}
.cmp-msn-btn-secondary:hover{border-color:#fff}

.cmp-overlay button:focus-visible,
.cmp-alm button:focus-visible{outline:3px solid var(--navy);outline-offset:2px}
.cmp-overlay.cmp-msn-ring button:focus-visible,
.cmp-msn-root button:focus-visible{outline-color:#8ee3b5}


/* ===========================================================================
   9. REDUCED MOTION — not optional.
   Every duration collapses to 1ms and every transform is dropped. Nothing in
   this file uses a transform for layout, so dropping them is safe.
   =========================================================================== */
@media (prefers-reduced-motion:reduce){
  :root{--cmp-t:1ms}

  [class*="cmp-"],
  [class*="cmp-"]::before,
  [class*="cmp-"]::after,
  .ck .ckbox{
    transition-duration:1ms !important;
    transition-delay:0s !important;
    animation-duration:1ms !important;
    animation-delay:0s !important;
    animation-iteration-count:1 !important;
    transform:none !important;
    scroll-behavior:auto !important;
  }
}


/* ===========================================================================
   10. SMALL-SCREEN GUARD — must read correctly at 375x812
   =========================================================================== */
@media (max-width:389px){
  .cmp-alm-time{font-size:32px}
  .cmp-alm-pickcol--hour,
  .cmp-alm-pickcol--minute{width:72px}
  .cmp-msn-target{font-size:17px}
  .cmp-alm-foot .cmp-alm-btn--secondary,
  .cmp-msn-btn-secondary{width:80%}
}
/* Short viewports: shrink the big numerals so the bottom primary stays in view. */
@media (max-height:700px){
  .cmp-msn-ring-clock{font-size:56px}
  .cmp-msn-remaining{font-size:52px}
  .cmp-msn-demo-art{font-size:40px}
}
