/* MultiplyOS kit · phone pack 1 · 2026-09-28    1 Oct 2026: merged with face-id-lock; main's floor kept, branch-only blocks carried over.
*/
/* MultiplyOS product design kit — stylesheet. Source: design/RULES-CARD.md v1, 23 Sep 2026.
   Every rule uses var(--mo-…); the only literal hexes in this file are the token definitions below.
   Font: Inter, root 15px. Dark theme is first class (rule 13). */
/* Repair round 3 (30 Sep 2026, S7): this canonical copy had drifted behind the app
   copies of the kit — it was missing the phone pack above (16px phone root, the
   brand lockup line 2, 44px tap targets, .mo-iconbutton/.mo-back/.mo-table/.mo-help)
   entirely, while separately carrying a later floor-bump (.mo-label/.mo-caption/
   .mo-fieldlabel/.mo-why/.mo-status/.mo-tile__delta at 16px) that the app copies had
   not received yet. Merged forward from the newest app copy (Planting's
   public/multiplyos/multiplyos.css, byte-identical to Sermon Prep/Preach It
   Back/HR's) so a future sync in either direction cannot roll either side back.
   .mo-field is 16px (was 15px — iOS zooms the page on any field under 16px,
   RULES-CARD §13). .mo-state/.mo-state--compact are both 16px (the compact variant
   was 16 over the default's 15, the same inversion N2 found in the launcher's own
   copy). Three selectors this canonical file had ALREADY bumped to 16px before the
   phone pack existed — .mo-brand__context, .mo-userchip__avatar, .mo-tabbar__tab —
   would have been rolled back to the app copy's stale 12/13px if merged verbatim;
   reapplied 16px on all three, keeping the app copy's added min-height: 44px on
   .mo-tabbar__tab. Still under the 16px floor and untouched here, because they are
   new to this file and were not part of the opus-reviewed findings for this round:
   .mo-nav__item, .mo-back, .mo-next-pill (15px), .mo-brand__line2 (15px, itself
   commented "never smaller" by a 26 Sep ruling — worth a second look), .mo-table,
   .mo-table th, .mo-help, .mo-table td::before (13–15px). They need their own
   design pass before the next sync. */

:root {
  --mo-kit-version: "2026-09-28";
  --mo-ink: #0B1320;
  --mo-muted: #5B6472;
  --mo-page: #FFFFFF;
  --mo-inset: #F1F3F4;
  --mo-card: #FFFFFF;
  --mo-field: #FFFFFF;
  --mo-line: #D8DCE3;
  --mo-accent: #1D4ED8;
  --mo-accent-tint: #E9EFFF;
  --mo-btn-fill: #0B1320;
  --mo-btn-ink: #FFFFFF;
  --mo-btn-hover: #243044;
  --mo-danger: #C4001A;
  --mo-danger-ink: #FFFFFF;
  /* Lockup line 2 module name (26 Sep 2026 ruling): ink on light, steel on Midnight
     (#D1D5DB, 12.63:1 — light neutral per the 26 Sep final icon brief; steel #B7C4D9 retired) — distinct from --mo-ink, which flips to near-white in dark. */
  --mo-module-ink: #0B1320;
  /* Deep tier of the four brand colours: main-button fills ONLY where RULES-CARD §6a allows (25 Sep 2026) */
  --mo-deep-green: #0D652D;   /* Finance --mo-btn-fill override; hover #0A5224 */
  --mo-deep-red: #A3261A;     /* --mo-danger hover only */
  --mo-deep-orange: #8A4507;  /* reserved, pending his ruling */
  --mo-deep-gold: #E0A800;    /* Notes --mo-btn-fill override = Notes' existing gold, unchanged; MIDNIGHT label; hover #C79500 (his ruling 25 Sep 2026) */
  --mo-deep-gold-ink: #0B1320;

  /* State colour accent (his ruling, 24 Sep 2026): a quiet hue on top of shape + order + words
     (rule §7), never instead of them. Proven in design/explorations/2026-09-24-state-colour/. */
  --mo-st-ok: #189A4E;
  --mo-st-ok-ink: #137B3E;
  --mo-st-watch: #AB8000;
  --mo-st-watch-ink: #876500;
  --mo-st-attn: #CF6B0D;
  --mo-st-attn-ink: #9E520A;
  --mo-st-high: #E0301E;
  --mo-st-high-ink: #D52E1D;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --mo-ink: #F2F5F9;
    --mo-muted: #9BA6B8;
    --mo-page: #0B1320;
    --mo-inset: #0B1320;
    --mo-card: #141C2B;
    --mo-field: #0F1626;
    --mo-line: #2A3547;
    --mo-accent: #7BA4FF;
    --mo-accent-tint: #1B2A4A;
    --mo-btn-fill: #F2F5F9;
    --mo-btn-ink: #0B1320;
    --mo-btn-hover: #D0D7E0;
    --mo-danger: #FF6B7F;
    --mo-danger-ink: #0B1320;
    --mo-module-ink: #D1D5DB;
    --mo-st-ok: #1FC765;
    --mo-st-ok-ink: #38E07E;
    --mo-st-watch: #E6AB00;
    --mo-st-watch-ink: #FFC51A;
    --mo-st-attn: #D8700E;
    --mo-st-attn-ink: #F3963F;
    --mo-st-high: #CA2B1B;
    --mo-st-high-ink: #EA6E62;
  }
}

:root[data-theme="dark"] {
  --mo-ink: #F2F5F9;
  --mo-muted: #9BA6B8;
  --mo-page: #0B1320;
  --mo-inset: #0B1320;
  --mo-card: #141C2B;
  --mo-field: #0F1626;
  --mo-line: #2A3547;
  --mo-accent: #7BA4FF;
  --mo-accent-tint: #1B2A4A;
  --mo-btn-fill: #F2F5F9;
  --mo-btn-ink: #0B1320;
  --mo-btn-hover: #D0D7E0;
  --mo-danger: #FF6B7F;
  --mo-danger-ink: #0B1320;
  --mo-module-ink: #D1D5DB;
  --mo-st-ok: #1FC765;
  --mo-st-ok-ink: #38E07E;
  --mo-st-watch: #E6AB00;
  --mo-st-watch-ink: #FFC51A;
  --mo-st-attn: #D8700E;
  --mo-st-attn-ink: #F3963F;
  --mo-st-high: #CA2B1B;
  --mo-st-high-ink: #EA6E62;
}

/* ---- Base ---- */
html { font-size: 15px; }
/* Phones: a 16px root, so rem sizes come out as designed (h-11 = 44px, text-xs = 12px).
   Desktop keeps 15px. Ashley's ruling, 28 Sep 2026. */
@media (max-width: 768px) { html { font-size: 16px; } }
body {
  margin: 0;
  background: var(--mo-page);
  color: var(--mo-ink);
  font-family: var(--mo-font, Inter), system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 1rem;
  line-height: 1.55;
  font-weight: 400;
}
* { box-sizing: border-box; }

:focus-visible {
  outline: 2px solid var(--mo-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--mo-card);
}

/* ---- Type ---- */
.mo-h1 { font-size: calc(28px * var(--mos-ts-display, 1)); font-weight: 700; line-height: 1.15; margin: 0; color: var(--mo-ink); }
.mo-h2 { font-size: calc(21px * var(--mos-ts, 1)); font-weight: 600; line-height: 1.25; margin: 0; color: var(--mo-ink); }
.mo-h3 { font-size: calc(17px * var(--mos-ts, 1)); font-weight: 600; line-height: 1.35; margin: 0; color: var(--mo-ink); }
.mo-label { font-size: calc(16px * var(--mos-ts, 1)); font-weight: 500; line-height: 1.4; color: var(--mo-muted); }
.mo-caption { font-size: calc(16px * var(--mos-ts, 1)); font-weight: 400; line-height: 1.4; color: var(--mo-muted); }
.mo-num { font-variant-numeric: tabular-nums; }

/* ---- Brand lockup ---- Source: design/mark/SPEC.md §4. .mo-brand sets its own
   gap and font-size (the em basis for .mo-wordmark and .mo-brand__sub) inline,
   per size (side/phone/signin) — see MultiplyBrand in MultiplyMark.tsx. */
.mo-brand { display: inline-flex; align-items: center; }
.mo-wordmark { font-weight: 400; letter-spacing: -0.005em; color: var(--mo-ink); white-space: nowrap; }
.mo-wordmark__lede { font-weight: 800; letter-spacing: -0.015em; }
.mo-brand--signin .mo-wordmark { letter-spacing: -0.015em; }
.mo-brand--signin .mo-wordmark__lede { font-weight: 900; letter-spacing: -0.03em; }
.mo-brand--accent { color: var(--mo-accent); }
.mo-brand__sub {
  display: block;
  font-size: max(12px, 0.30534em); /* 0.42 × cap height (cap = 0.727em) */
  font-weight: 500;
  color: var(--mo-muted);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 4px;
}
.mo-brand__context {
  display: block;
  font-size: calc(16px * var(--mos-ts, 1));
  font-weight: 400;
  color: var(--mo-muted);
  margin-top: 2px;
} /* superseded by .mo-brand__line2 (26 Sep 2026 ruling) for module+tenant callers;
     class kept — a bare, undivided `context` string still renders through it. */
/* Line 2 of the lockup (26 Sep 2026 ruling): the module name, bold, then the tenant,
   muted, both 15px — never smaller. Supersedes the single 12px context line above
   for every caller that has (or is given) a module and a tenant. */
.mo-brand__line2 {
  display: block;
  font-size: calc(16px * var(--mos-ts, 1));
  margin-top: 2px;
  white-space: nowrap;
}
.mo-brand__module {
  font-weight: 800;
  color: var(--mo-module-ink);
}
.mo-brand__tenant {
  font-weight: 400;
  color: var(--mo-muted);
}

/* ---- Sidebar / nav ---- */
.mo-side {
  width: 240px;
  flex: none;
  background: var(--mo-card);
  border-right: 1px solid var(--mo-line);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 16px;
}
.mo-nav { display: flex; flex-direction: column; gap: 2px; }
.mo-nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 12px 0 13px;
  border-radius: 10px;
  font-size: calc(15px * var(--mos-ts, 1));
  font-weight: 500;
  color: var(--mo-ink);
  text-decoration: none;
  border-left: 3px solid transparent;
  background: transparent;
}
.mo-nav__icon { width: 20px; height: 20px; flex: none; color: var(--mo-ink); }
.mo-nav__item.is-active {
  background: var(--mo-accent-tint);
  color: var(--mo-accent);
  border-left: 3px solid var(--mo-accent);
  padding-left: 10px;
}
.mo-nav__item.is-active .mo-nav__icon { color: var(--mo-accent); }

/* ---- Top bar ---- */
.mo-topbar {
  height: 64px;
  background: var(--mo-card);
  border-bottom: 1px solid var(--mo-line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
}
.mo-search {
  height: 44px;
  flex: 1;
  max-width: 420px;
  border: 1px solid var(--mo-line);
  border-radius: 10px;
  background: var(--mo-field);
  color: var(--mo-ink);
  padding: 0 14px;
  font-size: calc(16px * var(--mos-ts, 1)); /* RULES-CARD §13 */
}
.mo-search::placeholder { color: var(--mo-muted); }
.mo-userchip { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mo-userchip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mo-inset);
  color: var(--mo-ink);
  display: grid;
  place-items: center;
  font-size: calc(16px * var(--mos-ts, 1));
  font-weight: 500;
  flex: none;
}

/* ---- Page ---- */
.mo-page { background: var(--mo-page); padding: 24px; min-height: 100vh; min-height: 100dvh; }
.mo-fullheight { min-height: 100vh; min-height: 100dvh; }
.mo-page__inner { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

/* ---- Tile ---- */
.mo-tile {
  background: var(--mo-card);
  border: 1px solid var(--mo-line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mo-tile__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--mo-inset);
  color: var(--mo-ink);
  display: grid;
  place-items: center;
}
.mo-tile__icon svg { width: 18px; height: 18px; }
.mo-tile__value { font-size: calc(28px * var(--mos-ts-display, 1)); font-weight: 700; color: var(--mo-ink); }
.mo-tile__delta { font-size: calc(16px * var(--mos-ts, 1)); color: var(--mo-muted); display: inline-flex; align-items: center; gap: 4px; }

/* ---- Card ---- */
.mo-card {
  background: var(--mo-card);
  border: 1px solid var(--mo-line);
  border-radius: 12px;
  padding: 16px;
}

/* ---- List ---- */
.mo-list { display: flex; flex-direction: column; flex: none; border: 1px solid var(--mo-line); border-radius: 12px; overflow: hidden; background: var(--mo-card); }
/* A list inside a fixed-height scroll box scrolls; it never shrinks its rows into each other. */
.mo-list__row {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--mo-line);
  color: var(--mo-ink);
  text-decoration: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
}
.mo-list__row:last-child { border-bottom: none; }

/* ---- Phone header / tabbar ---- */
.mo-header {
  display: none;
  height: 56px;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--mo-card);
  border-bottom: 1px solid var(--mo-line);
}
.mo-tabbar {
  display: none;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 20;
  /* 56px of tabs PLUS the home-indicator strip: with border-box, a bare 56px would let the
     safe-area padding eat the tabs' own height (found on Comms, 24 Sep 2026). */
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--mo-card);
  border-top: 1px solid var(--mo-line);
}
.mo-tabbar__tab {
  flex: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 56px;
  min-height: 44px;
  font-size: calc(16px * var(--mos-ts, 1));
  white-space: normal;
  line-height: 1.15;
  text-align: center;
  color: var(--mo-muted);
  text-decoration: none;
}
.mo-tabbar__tab.is-active { color: var(--mo-accent); }
.mo-tabbar__tab svg { width: 20px; height: 20px; }

/* ---- Buttons ---- */
.mo-button,
.mo-button--main,
.mo-button--quiet,
.mo-button--danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: calc(16px * var(--mos-ts, 1));
  font-weight: 600;
  border: 1px solid var(--mo-line);
  background: var(--mo-card);
  color: var(--mo-ink);
  cursor: pointer;
}
.mo-button--main {
  background: var(--mo-btn-fill);
  color: var(--mo-btn-ink);
  border: none;
}

.mo-button,
.mo-button--main,
.mo-button--quiet,
.mo-button--danger,
.mo-nav__item,
.mo-tabbar__tab,
.mo-list__row {
  min-height: 44px;
}

.mo-iconbutton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mo-ink);
  cursor: pointer;
}
.mo-iconbutton svg { width: 20px; height: 20px; }

/* ---- Phone back control ---- */
.mo-back {
  display: none;
  align-items: center;
  gap: 6px;
  height: 44px;
  min-height: 44px;
  padding: 0 12px 0 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mo-ink);
  font-size: calc(15px * var(--mos-ts, 1));
  font-weight: 600;
  cursor: pointer;
}
.mo-back svg { width: 20px; height: 20px; flex: none; }
html[data-mo-standalone="true"] .mo-back,
.mo-back--always { display: inline-flex; }

/* ---- Tables ---- */
.mo-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--mo-ink);
  font-size: calc(15px * var(--mos-ts, 1));
  font-variant-numeric: tabular-nums;
}
.mo-table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--mo-line);
  color: var(--mo-muted);
  font-size: calc(13px * var(--mos-ts, 1));
  font-weight: 600;
  text-align: left;
}
.mo-table td {
  padding: 12px;
  border-bottom: 1px solid var(--mo-line);
}
.mo-help {
  display: block;
  margin-top: 4px;
  color: var(--mo-muted);
  font-size: calc(13px * var(--mos-ts, 1));
  font-weight: 400;
  line-height: 1.4;
}

@media (pointer: coarse) {
  .mo-button,
  .mo-button--main,
  .mo-button--quiet,
  .mo-button--danger,
  .mo-nav__item,
  .mo-tabbar__tab,
  .mo-list__row,
  .mo-back {
    min-height: 48px;
  }
  .mo-iconbutton { min-width: 48px; min-height: 48px; }
}
.mo-button--main:hover { background: var(--mo-btn-hover); }
.mo-button--quiet {
  background: transparent;
  border: none;
  color: var(--mo-accent);
  padding: 0 4px;
}
.mo-button--danger {
  background: var(--mo-danger);
  color: var(--mo-danger-ink);
  border: none;
}

/* ---- Fields ---- */
.mo-field {
  height: 44px;
  width: 100%;
  font-size: calc(16px * var(--mos-ts, 1)); /* his ruling 28 Sep 2026: iOS zooms the page on any field under 16px (RULES-CARD §13) */
  color: var(--mo-ink);
  background: var(--mo-field);
  border: 1px solid var(--mo-line);
  border-radius: 10px;
  padding: 0 14px;
}
.mo-field::placeholder { color: var(--mo-muted); }
.mo-fieldlabel { display: block; margin-bottom: 6px; font-size: calc(16px * var(--mos-ts, 1)); font-weight: 500; color: var(--mo-muted); }
.mo-why { display: block; margin-top: 6px; font-size: calc(16px * var(--mos-ts, 1)); color: var(--mo-muted); }

/* ---- Status ---- */
.mo-status { display: inline-flex; align-items: center; gap: 6px; font-size: calc(16px * var(--mos-ts, 1)); }
.mo-status--error { color: var(--mo-danger); }
.mo-status--busy { color: var(--mo-muted); }
.mo-status--done { color: var(--mo-ink); }

/* ---- Next-step signal. Exactly one .mo-next on a screen at a time. ---- */
.mo-next { position: relative; animation: mo-next-pulse 1.8s ease-out infinite; }
@keyframes mo-next-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mo-accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 16px color-mix(in srgb, var(--mo-accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--mo-accent) 0%, transparent); }
}
.mo-next-pill {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: calc(100vw - 32px);
  padding: 0 20px;
  border: 2px solid var(--mo-accent);
  border-radius: 999px;
  background: var(--mo-btn-fill);
  color: var(--mo-btn-ink);
  font: inherit;
  font-size: calc(16px * var(--mos-ts, 1));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
  animation: mo-next-pulse 1.8s ease-out infinite;
}
.mo-next-pill[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .mo-next, .mo-next-pill { animation: none; outline: 3px solid var(--mo-accent); outline-offset: 4px; }
}

/* ---- Empty state ---- */
.mo-empty {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
  border: 2px dashed var(--mo-line);
  border-radius: 12px;
  color: var(--mo-ink);
}

/* ---- States: shape + order + words, never hue (rule §7) ---- */
.mo-state { display: inline-flex; align-items: center; gap: 8px; font-size: calc(16px * var(--mos-ts, 1)); color: var(--mo-ink); }
.mo-state--compact { font-size: calc(16px * var(--mos-ts, 1)); line-height: 1.4; }
.mo-state::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--mo-ink);
  background: conic-gradient(var(--mo-ink) 0%, var(--mo-ink) 0%, transparent 0%, transparent 100%);
}
.mo-state[data-state="engaged"]::before { background: conic-gradient(var(--mo-ink) 0% 100%, transparent 100%); }
.mo-state[data-state="watch"]::before { background: conic-gradient(var(--mo-ink) 0% 75%, transparent 75% 100%); }
.mo-state[data-state="attention"]::before { background: conic-gradient(var(--mo-ink) 0% 50%, transparent 50% 100%); }
.mo-state[data-state="higher"]::before { background: conic-gradient(transparent 0% 100%); }

/* ---- State colour accent (his ruling, 24 Sep 2026): quiet, additive, never the only signal.
   Shape + order + words (above) always stay; this adds a hue on top of them, nowhere else.
   Strength "dot" — people rows and cards: .mo-state gets mo-hue-dot by default (MoState.tsx).
   Strength "edge" — KPI tiles and cards carrying data-state directly. No ring or wash strength
   is shipped in the kit (see RULES-CARD.md §7). ---- */

/* mo-hue-dot: an 8px dot ahead of the words, and the ring glyph itself takes the hue. The ring
   stays ::before (order -2); the dot is ::after, ordered ahead of the text (order -1) so the
   result reads ring → dot → words, never disturbing the DOM MoState.tsx already renders. */
.mo-state.mo-hue-dot::before { order: -2; }
.mo-state.mo-hue-dot::after {
  content: "";
  order: -1;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.mo-state.mo-hue-dot[data-state="engaged"]::after { background: var(--mo-st-ok); }
.mo-state.mo-hue-dot[data-state="engaged"]::before {
  border-color: var(--mo-st-ok);
  background: conic-gradient(var(--mo-st-ok) 0% 100%, transparent 100%);
}
.mo-state.mo-hue-dot[data-state="watch"]::after { background: var(--mo-st-watch); }
.mo-state.mo-hue-dot[data-state="watch"]::before {
  border-color: var(--mo-st-watch);
  background: conic-gradient(var(--mo-st-watch) 0% 75%, transparent 75% 100%);
}
.mo-state.mo-hue-dot[data-state="attention"]::after { background: var(--mo-st-attn); }
.mo-state.mo-hue-dot[data-state="attention"]::before {
  border-color: var(--mo-st-attn);
  background: conic-gradient(var(--mo-st-attn) 0% 50%, transparent 50% 100%);
}
.mo-state.mo-hue-dot[data-state="higher"]::after { background: var(--mo-st-high); }
.mo-state.mo-hue-dot[data-state="higher"]::before {
  border-color: var(--mo-st-high);
  background: conic-gradient(transparent 0% 100%);
}

/* mo-hue-edge: a 3px edge in the state hue — bottom edge on a tile, left edge on a card. Only
   that one edge changes colour; the other three sides stay --mo-line. Words, numbers and icons
   stay --mo-ink; only the thin rule carries the hue. */
.mo-hue-edge.mo-tile[data-state] {
  border-bottom-width: 3px;
  padding-bottom: 13px; /* 16px tile padding minus the 3px edge */
}
.mo-hue-edge.mo-card[data-state] {
  border-left-width: 3px;
  padding-left: 13px; /* 16px card padding minus the 3px edge */
}
.mo-hue-edge.mo-tile[data-state="engaged"] { border-bottom-color: var(--mo-st-ok); }
.mo-hue-edge.mo-card[data-state="engaged"] { border-left-color: var(--mo-st-ok); }
.mo-hue-edge.mo-tile[data-state="watch"] { border-bottom-color: var(--mo-st-watch); }
.mo-hue-edge.mo-card[data-state="watch"] { border-left-color: var(--mo-st-watch); }
.mo-hue-edge.mo-tile[data-state="attention"] { border-bottom-color: var(--mo-st-attn); }
.mo-hue-edge.mo-card[data-state="attention"] { border-left-color: var(--mo-st-attn); }
.mo-hue-edge.mo-tile[data-state="higher"] { border-bottom-color: var(--mo-st-high); }
.mo-hue-edge.mo-card[data-state="higher"] { border-left-color: var(--mo-st-high); }

/* ---- Phone breakpoint (≤768px) ---- */
@media (max-width: 768px) {
  .mo-topbar { display: none; } /* the phone header replaces it */
  .mo-side { display: none; }
  .mo-header { display: flex; }
  .mo-tabbar { display: flex; }
  .mo-button--main { height: 56px; width: 100%; }
  .mo-field { height: 56px; }
  .mo-page { padding: 16px; }
  .mo-tabbar { padding-bottom: env(safe-area-inset-bottom); }
  .mo-table { display: block; }
  .mo-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .mo-table tbody,
  .mo-table tr,
  .mo-table td { display: block; }
  .mo-table tr {
    margin: 0 0 10px;
    padding: 12px 14px;
    border: 1px solid var(--mo-line);
    border-radius: 12px;
    background: var(--mo-card);
  }
  .mo-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 0;
  }
  .mo-table td::before {
    content: attr(data-label);
    flex: 0 1 auto;
    color: var(--mo-muted);
    font-size: calc(13px * var(--mos-ts, 1));
    font-weight: 500;
  }
  .mo-table td > * { margin-left: auto; text-align: right; }
}

/* ---- One action, with its explanation and outcome beside it. ---- */
.mo-action { display: grid; gap: 6px; }

/* ---- One four-step light for things other than people. ---- */
.mo-light { display: inline-flex; align-items: center; gap: 8px; font-size: calc(16px * var(--mos-ts, 1)); color: var(--mo-ink); }
.mo-light--compact { font-size: calc(16px * var(--mos-ts, 1)); line-height: 1.4; }
.mo-light[data-light="green"] { --mo-light-hue: var(--mo-st-ok); --mo-light-fill: 100%; }
.mo-light[data-light="yellow"] { --mo-light-hue: var(--mo-st-watch); --mo-light-fill: 75%; }
.mo-light[data-light="orange"] { --mo-light-hue: var(--mo-st-attn); --mo-light-fill: 50%; }
.mo-light[data-light="red"] { --mo-light-hue: var(--mo-st-high); --mo-light-fill: 0%; }
.mo-light:not([data-light="none"])::before {
  content: "";
  order: -2;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--mo-light-hue);
  background: conic-gradient(var(--mo-light-hue) 0% var(--mo-light-fill), transparent var(--mo-light-fill) 100%);
}
.mo-light.mo-hue-dot:not([data-light="none"])::after {
  content: "";
  order: -1;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mo-light-hue);
}
.mo-light[data-light="none"]::before,
.mo-light[data-light="none"]::after { content: none; }

/* ---- Message screens (B13-06): Make it yours, and the empty composer to the person. ---- */
.mo-compose {
  display: grid;
  gap: 12px;
  max-width: 680px;
}
.mo-compose__banner {
  color: var(--mo-ink);
  background: var(--mo-inset);
  font-size: calc(16px * var(--mos-ts, 1));
  padding: 12px 14px;
  border-radius: 10px;
  margin: 0;
}
.mo-compose__text {
  width: 100%;
  font: inherit;
  font-size: calc(17px * var(--mos-ts, 1));
  line-height: 1.5;
  min-height: calc(6 * 1.5em + 26px);
  padding: 12px 14px;
  color: var(--mo-ink);
  background: var(--mo-field);
  border: 1px solid var(--mo-line);
  border-radius: 10px;
  resize: vertical;
}
.mo-compose__text:focus,
.mo-compose__text:focus-visible { outline-width: 0; box-shadow: none; border-color: var(--mo-ink); }
.mo-compose__hint,
.mo-compose__nudge { margin: 0; font-size: calc(16px * var(--mos-ts, 1)); }
.mo-compose__hint { color: var(--mo-muted); }
.mo-compose__nudge { color: var(--mo-ink); }
.mo-compose__actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; }
.mo-reach { display: flex; flex-wrap: wrap; gap: 8px; }
.mo-reach > a { min-height: 44px; border-radius: 999px; text-decoration: none; }
.mo-reach__hint { margin: 8px 0 0; font-size: calc(16px * var(--mos-ts, 1)); color: var(--mo-muted); }
@media (max-width: 768px) {
  .mo-reach > a.mo-button--main { width: auto; height: 48px; }
  .mo-reach > a { min-height: 48px; }
  .mo-compose__actions > * { width: 100%; }
}

/* ---- Needs you today (B00-10a): MoNeedsYou. ---- */
.mo-needs {
  display: grid;
  gap: 12px;
  max-width: 680px;
}
.mo-needs__title { margin: 0; }
.mo-needs__list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--mo-card);
  border: 1px solid var(--mo-line);
  border-radius: 12px;
  overflow: hidden;
}
.mo-needs__row {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--mo-line);
}
.mo-needs__row:last-child { border-bottom: 0; }
.mo-needs__line,
.mo-needs__question { margin: 0; font-size: calc(17px * var(--mos-ts, 1)); line-height: 1.4; color: var(--mo-ink); }
.mo-needs__line { font-weight: 400; }
.mo-needs__why { margin: 0; font-size: calc(16px * var(--mos-ts, 1)); line-height: 1.4; color: var(--mo-muted); }
.mo-needs__question { font-weight: 600; }
.mo-needs__actions,
.mo-needs__answers { display: flex; flex-wrap: wrap; gap: 8px; }
.mo-needs__actions > .mo-button:not(.mo-button--main) { min-height: 44px; border-radius: 999px; text-decoration: none; }
.mo-needs__answers .mo-button { min-height: 44px; border-radius: 999px; }
.mo-needs__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font: inherit;
  font-size: calc(17px * var(--mos-ts, 1));
  font-weight: 600;
  color: var(--mo-accent);
  background: transparent;
  border: 0;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}
.mo-needs__link:hover,
.mo-needs__link:focus-visible { text-decoration: underline; }
.mo-needs__more { padding: 0 16px; }
.mo-needs__empty {
  margin: 0;
  font-size: calc(17px * var(--mos-ts, 1));
  color: var(--mo-ink);
  padding: 16px;
  background: var(--mo-card);
  border: 1px solid var(--mo-line);
  border-radius: 12px;
}
@media (max-width: 768px) {
  .mo-needs__row .mo-button--main { width: 100%; min-height: 56px; }
  .mo-needs__actions > .mo-button:not(.mo-button--main) { min-height: 48px; }
  .mo-needs__answers .mo-button { min-height: 48px; }
}

/* ---- The Ask box (B13-18). ---- */
.mo-ask { display: grid; gap: 12px; max-width: 680px; }
.mo-ask__form { display: grid; gap: 8px; }
.mo-ask__row { display: flex; align-items: stretch; gap: 8px; }
.mo-ask__field { flex: 1 1 auto; min-width: 0; min-height: 56px; padding: 0 14px; font: inherit; font-size: calc(17px * var(--mos-ts, 1)); color: var(--mo-ink); background: var(--mo-field); border: 1px solid var(--mo-line); border-radius: 12px; }
.mo-ask__field:focus { border-color: var(--mo-accent); outline: 2px solid var(--mo-accent); outline-offset: 2px; box-shadow: 0 0 0 2px var(--mo-card); }
.mo-ask a.mo-button { text-decoration: none; }
.mo-ask__row > .mo-button { flex: 0 0 auto; min-height: 56px; }
.mo-ask__hint, .mo-ask__status, .mo-ask__text, .mo-ask__done, .mo-ask__from, .mo-ask__error { margin: 0; }
.mo-ask__hint, .mo-ask__status { font-size: calc(16px * var(--mos-ts, 1)); color: var(--mo-muted); }
.mo-ask__text { font-size: calc(17px * var(--mos-ts, 1)); line-height: 1.45; color: var(--mo-ink); }
.mo-ask__done { font-size: calc(17px * var(--mos-ts, 1)); color: var(--mo-ink); }
.mo-ask__from { font-size: calc(15px * var(--mos-ts, 1)); color: var(--mo-muted); }
.mo-ask__error { font-size: calc(15px * var(--mos-ts, 1)); color: var(--mo-danger); }
.mo-ask__answer { display: grid; gap: 12px; }
.mo-ask__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mo-ask__act { display: grid; gap: 10px; }
.mo-ask__tablewrap { overflow: auto; max-height: min(60vh, 420px); max-width: 100%; }
.mo-ask__table { min-width: 100%; border-collapse: collapse; font-size: calc(15px * var(--mos-ts, 1)); color: var(--mo-ink); }
.mo-ask__table th, .mo-ask__table td { min-height: 44px; padding: 10px 12px; border-bottom: 1px solid var(--mo-line); text-align: left; }
.mo-ask__table th { font-weight: 600; }
.mo-ask__earlier { display: grid; gap: 8px; }
.mo-ask__earlier-title { margin: 0; font-size: calc(17px * var(--mos-ts, 1)); font-weight: 600; color: var(--mo-ink); }
.mo-ask__earlier .mo-button { min-height: 44px; justify-content: flex-start; width: fit-content; }
@media (max-width: 768px) {
  .mo-ask__row { flex-direction: column; }
  .mo-ask__row > .mo-button { width: 100%; min-height: 56px; }
  .mo-ask__answer .mo-button--main { width: 100%; height: 56px; }
  .mo-ask__pills .mo-button { min-height: 48px; }
}
